This is an automated email from the ASF dual-hosted git repository.
mseidel pushed a commit to branch AOO42X
in repository https://gitbox.apache.org/repos/asf/openoffice.git
The following commit(s) were added to refs/heads/AOO42X by this push:
new 44b6a127d4 Cleanup
44b6a127d4 is described below
commit 44b6a127d48f0c00c3af3e2bc8eb0f8a1af7e0df
Author: mseidel <[email protected]>
AuthorDate: Tue Mar 3 13:29:10 2026 +0100
Cleanup
(cherry picked from commit 527198e9106bdcc46565a309bc94ab031dcdd2a2)
---
main/svx/source/form/fmshell.cxx | 770 +++++++++++++++++------------------
main/vcl/source/control/combobox.cxx | 506 +++++++++++------------
main/vcl/source/control/morebtn.cxx | 5 +-
main/vcl/source/control/slider.cxx | 168 ++++----
main/vcl/source/control/tabctrl.cxx | 11 +-
5 files changed, 727 insertions(+), 733 deletions(-)
diff --git a/main/svx/source/form/fmshell.cxx b/main/svx/source/form/fmshell.cxx
index 460c6f5657..165d764111 100644
--- a/main/svx/source/form/fmshell.cxx
+++ b/main/svx/source/form/fmshell.cxx
@@ -19,8 +19,6 @@
*
*************************************************************/
-
-
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_svx.hxx"
#include "fmvwimp.hxx"
@@ -82,7 +80,6 @@
#include <svx/svdpagv.hxx>
#include <sfx2/objitem.hxx>
#include <sfx2/viewsh.hxx>
-#include <vcl/sound.hxx>
#include "fmexpl.hxx"
#include "formcontrolling.hxx"
#include <svl/numuno.hxx>
@@ -100,22 +97,21 @@
#define HANDLE_SQL_ERRORS( action, successflag, context, message )
\
try
\
{
\
- successflag = sal_False;
\
+ successflag = sal_False;
\
action;
\
- successflag = sal_True;
\
+ successflag = sal_True;
\
}
\
- catch(::com::sun::star::sdbc::SQLException& e)
\
+ catch(::com::sun::star::sdbc::SQLException& e)
\
{
\
- ::com::sun::star::sdb::SQLContext eExtendedInfo =
\
- GetImpl()->prependContextInfo(e, Reference< XInterface > (),
context, ::rtl::OUString()); \
+ ::com::sun::star::sdb::SQLContext eExtendedInfo =
\
+ GetImpl()->prependContextInfo(e, Reference< XInterface > (),
context, ::rtl::OUString()); \
displayException(eExtendedInfo);
\
}
\
- catch(Exception&)
\
+ catch(Exception&)
\
{
\
DBG_ERROR(message);
\
}
\
-
#define DO_SAFE_WITH_ERROR( action, message ) try { action; }
catch(Exception&) { DBG_ERROR(message); }
#define FmFormShell
@@ -128,7 +124,7 @@
#include <comphelper/property.hxx>
#include <com/sun/star/beans/PropertyValue.hpp>
-// wird fuer Invalidate verwendet -> mitpflegen
+// wird für Invalidate verwendet -> mitpflegen
// aufsteigend sortieren !!!!!!
sal_uInt16 ControllerSlotMap[] = // slots des Controllers
{
@@ -231,15 +227,15 @@ SFX_IMPL_INTERFACE(FmFormShell, SfxShell,
SVX_RES(RID_STR_FORMSHELL))
SFX_FEATURED_CHILDWINDOW_REGISTRATION(SID_FM_FILTER_NAVIGATOR,
FM_UI_FEATURE_SHOW_FILTERNAVIGATOR);
SFX_FEATURED_CHILDWINDOW_REGISTRATION(SID_FM_SHOW_DATANAVIGATOR,
FM_UI_FEATURE_SHOW_DATANAVIGATOR);
- SFX_FEATURED_OBJECTBAR_REGISTRATION( SFX_OBJECTBAR_OBJECT |
SFX_VISIBILITY_STANDARD,
+ SFX_FEATURED_OBJECTBAR_REGISTRATION( SFX_OBJECTBAR_OBJECT |
SFX_VISIBILITY_STANDARD,
SVX_RES( RID_SVXTBX_CONTROLS ),
FM_UI_FEATURE_TB_CONTROLS );
- SFX_FEATURED_OBJECTBAR_REGISTRATION( SFX_OBJECTBAR_OBJECT |
SFX_VISIBILITY_STANDARD,
+ SFX_FEATURED_OBJECTBAR_REGISTRATION( SFX_OBJECTBAR_OBJECT |
SFX_VISIBILITY_STANDARD,
SVX_RES( RID_SVXTBX_MORECONTROLS ),
FM_UI_FEATURE_TB_MORECONTROLS );
- SFX_FEATURED_OBJECTBAR_REGISTRATION( SFX_OBJECTBAR_OBJECT |
SFX_VISIBILITY_STANDARD,
+ SFX_FEATURED_OBJECTBAR_REGISTRATION( SFX_OBJECTBAR_OBJECT |
SFX_VISIBILITY_STANDARD,
SVX_RES( RID_SVXTBX_FORMDESIGN ),
FM_UI_FEATURE_TB_FORMDESIGN );
}
@@ -260,7 +256,7 @@ FmFormShell::FmFormShell( SfxViewShell* _pParent,
FmFormView* pView )
{
m_pImpl->acquire();
SetPool( &SFX_APP()->GetPool() );
- SetName( String::CreateFromAscii( "Form" ) );
+ SetName( String::CreateFromAscii( "Form" ) );
SetView(m_pFormView);
}
@@ -269,11 +265,11 @@ FmFormShell::FmFormShell( SfxViewShell* _pParent,
FmFormView* pView )
FmFormShell::~FmFormShell()
{
if ( m_pFormView )
- SetView( NULL );
+ SetView( NULL );
m_pImpl->dispose();
m_pImpl->release();
- m_pImpl = NULL;
+ m_pImpl = NULL;
}
//------------------------------------------------------------------------
@@ -304,38 +300,38 @@ sal_uInt16 FmFormShell::PrepareClose(sal_Bool bUI,
sal_Bool /*bForBrowsing*/)
if(pWindow)
{
- // Zunaechst werden die aktuellen Inhalte der Controls
gespeichert
- // Wenn alles glatt gelaufen ist, werden die
modifizierten Datensaetze gespeichert
- if ( GetImpl()->getActiveController().is() )
- {
- const ::svx::ControllerFeatures& rController =
GetImpl()->getActiveControllerFeatures();
- if ( rController->commitCurrentControl() )
- {
- sal_Bool bModified = rController->isModifiedRow();
-
- if ( bModified && bUI )
- {
- QueryBox aQry(NULL,
SVX_RES(RID_QRY_SAVEMODIFIED));
- switch (aQry.Execute())
- {
- case RET_NO:
- bModified =
sal_False;
-
GetImpl()->didPrepareClose( sal_True );
- break;
-
- case RET_CANCEL:
- return sal_False;
-
- case RET_NEWTASK:
- return RET_NEWTASK;
- }
-
- if ( bModified )
- bResult =
rController->commitCurrentRecord( );
- }
- }
- }
- }
+ // Zunächst werden die aktuellen Inhalte der Controls
gespeichert
+ // Wenn alles glatt gelaufen ist, werden die
modifizierten Datensätze gespeichert
+ if ( GetImpl()->getActiveController().is() )
+ {
+ const ::svx::ControllerFeatures& rController =
GetImpl()->getActiveControllerFeatures();
+ if ( rController->commitCurrentControl() )
+ {
+ sal_Bool bModified =
rController->isModifiedRow();
+
+ if ( bModified && bUI )
+ {
+ QueryBox aQry(NULL,
SVX_RES(RID_QRY_SAVEMODIFIED));
+ switch (aQry.Execute())
+ {
+ case RET_NO:
+ bModified =
sal_False;
+
GetImpl()->didPrepareClose( sal_True );
+ break;
+
+ case RET_CANCEL:
+ return
sal_False;
+
+ case RET_NEWTASK:
+ return
RET_NEWTASK;
+ }
+
+ if ( bModified )
+ bResult =
rController->commitCurrentRecord( );
+ }
+ }
+ }
+ }
}
return bResult;
}
@@ -367,12 +363,12 @@ sal_Bool FmFormShell::HasUIFeature( sal_uInt32 nFeature )
sal_Bool bResult = sal_False;
if ((nFeature & FM_UI_FEATURE_SHOW_DATABASEBAR) ==
FM_UI_FEATURE_SHOW_DATABASEBAR)
{
- // nur wenn auch formulare verfuegbar
+ // nur wenn auch Formulare verfügbar
bResult = !m_bDesignMode && GetImpl()->hasDatabaseBar() &&
!GetImpl()->isInFilterMode();
}
else if ((nFeature & FM_UI_FEATURE_SHOW_FILTERBAR) ==
FM_UI_FEATURE_SHOW_FILTERBAR)
{
- // nur wenn auch formulare verfuegbar
+ // nur wenn auch Formulare verfügbar
bResult = !m_bDesignMode && GetImpl()->hasDatabaseBar() &&
GetImpl()->isInFilterMode();
}
else if ((nFeature & FM_UI_FEATURE_SHOW_FILTERNAVIGATOR) ==
FM_UI_FEATURE_SHOW_FILTERNAVIGATOR)
@@ -391,23 +387,23 @@ sal_Bool FmFormShell::HasUIFeature( sal_uInt32 nFeature )
{
bResult = m_bDesignMode; // OJ #101593# && m_pFormView &&
m_bHasForms;
}
- else if ( ( nFeature & FM_UI_FEATURE_SHOW_TEXT_CONTROL_BAR ) ==
FM_UI_FEATURE_SHOW_TEXT_CONTROL_BAR )
- {
- bResult = !GetImpl()->IsReadonlyDoc() && m_pImpl->IsActiveControl(
true );
- }
+ else if ( ( nFeature & FM_UI_FEATURE_SHOW_TEXT_CONTROL_BAR ) ==
FM_UI_FEATURE_SHOW_TEXT_CONTROL_BAR )
+ {
+ bResult = !GetImpl()->IsReadonlyDoc() &&
m_pImpl->IsActiveControl( true );
+ }
else if ((nFeature & FM_UI_FEATURE_SHOW_DATANAVIGATOR) ==
FM_UI_FEATURE_SHOW_DATANAVIGATOR)
{
- bResult = GetImpl()->isEnhancedForm();
+ bResult = GetImpl()->isEnhancedForm();
+ }
+ else if ( ( ( nFeature & FM_UI_FEATURE_TB_CONTROLS ) ==
FM_UI_FEATURE_TB_CONTROLS )
+ || ( ( nFeature & FM_UI_FEATURE_TB_MORECONTROLS ) ==
FM_UI_FEATURE_TB_MORECONTROLS )
+ || ( ( nFeature & FM_UI_FEATURE_TB_FORMDESIGN ) ==
FM_UI_FEATURE_TB_FORMDESIGN )
+ )
+ {
+ bResult = sal_True;
}
- else if ( ( ( nFeature & FM_UI_FEATURE_TB_CONTROLS ) ==
FM_UI_FEATURE_TB_CONTROLS )
- || ( ( nFeature & FM_UI_FEATURE_TB_MORECONTROLS ) ==
FM_UI_FEATURE_TB_MORECONTROLS )
- || ( ( nFeature & FM_UI_FEATURE_TB_FORMDESIGN ) ==
FM_UI_FEATURE_TB_FORMDESIGN )
- )
- {
- bResult = sal_True;
- }
-
- return bResult;
+
+ return bResult;
}
//------------------------------------------------------------------------
@@ -426,7 +422,7 @@ void FmFormShell::Execute(SfxRequest &rReq)
case SID_FM_GROUPBOX:
case SID_FM_LISTBOX:
case SID_FM_COMBOBOX:
- case SID_FM_NAVIGATIONBAR:
+ case SID_FM_NAVIGATIONBAR:
case SID_FM_EDIT:
case SID_FM_DBGRID:
case SID_FM_IMAGEBUTTON:
@@ -438,8 +434,8 @@ void FmFormShell::Execute(SfxRequest &rReq)
case SID_FM_CURRENCYFIELD:
case SID_FM_PATTERNFIELD:
case SID_FM_FORMATTEDFIELD:
- case SID_FM_SCROLLBAR:
- case SID_FM_SPINBUTTON:
+ case SID_FM_SCROLLBAR:
+ case SID_FM_SPINBUTTON:
m_nLastSlot = nSlot;
GetViewShell()->GetViewFrame()->GetBindings().Invalidate( SID_FM_CONFIG );
break;
@@ -474,9 +470,9 @@ void FmFormShell::Execute(SfxRequest &rReq)
case SID_FM_COMBOBOX:
nIdentifier = OBJ_FM_COMBOBOX;
break;
- case SID_FM_NAVIGATIONBAR:
+ case SID_FM_NAVIGATIONBAR:
nIdentifier = OBJ_FM_NAVIGATIONBAR;
- break;
+ break;
case SID_FM_DBGRID:
nIdentifier = OBJ_FM_GRID;
break;
@@ -524,7 +520,7 @@ void FmFormShell::Execute(SfxRequest &rReq)
case SID_FM_EDIT:
case SID_FM_RADIOBUTTON:
case SID_FM_COMBOBOX:
- case SID_FM_NAVIGATIONBAR:
+ case SID_FM_NAVIGATIONBAR:
case SID_FM_GROUPBOX:
case SID_FM_DBGRID:
case SID_FM_IMAGEBUTTON:
@@ -536,8 +532,8 @@ void FmFormShell::Execute(SfxRequest &rReq)
case SID_FM_CURRENCYFIELD:
case SID_FM_PATTERNFIELD:
case SID_FM_FORMATTEDFIELD:
- case SID_FM_SCROLLBAR:
- case SID_FM_SPINBUTTON:
+ case SID_FM_SCROLLBAR:
+ case SID_FM_SPINBUTTON:
{
SFX_REQUEST_ARG( rReq, pGrabFocusItem, SfxBoolItem,
SID_FM_TOGGLECONTROLFOCUS, sal_False );
if ( pGrabFocusItem && pGrabFocusItem->GetValue() )
@@ -581,36 +577,36 @@ void FmFormShell::Execute(SfxRequest &rReq)
// Individuelle Aktionen
switch( nSlot )
{
- case SID_FM_MORE_CONTROLS:
- case SID_FM_FORM_DESIGN_TOOLS:
- {
- FormToolboxes aToolboxAccess( GetImpl()->getHostFrame() );
- aToolboxAccess.toggleToolbox( nSlot );
- rReq.Done();
- }
- break;
+ case SID_FM_MORE_CONTROLS:
+ case SID_FM_FORM_DESIGN_TOOLS:
+ {
+ FormToolboxes aToolboxAccess( GetImpl()->getHostFrame()
);
+ aToolboxAccess.toggleToolbox( nSlot );
+ rReq.Done();
+ }
+ break;
case SID_FM_TOGGLECONTROLFOCUS:
{
- FmFormView* pFormView = GetFormView();
- if ( !pFormView )
- break;
-
- // if we execute this ourself, then either the application does
not implement an own handling for this,
- // of we're on the top of the dispatcher stack, which means a
control has the focus.
- // In the latter case, we put the focus to the document window,
otherwise, we focus the first control
- const bool bHasControlFocus = GetImpl()->HasControlFocus();
- if ( bHasControlFocus )
- {
- const OutputDevice* pDevice = GetCurrentViewDevice();
- Window* pWindow = dynamic_cast< Window* >( const_cast<
OutputDevice* >( pDevice ) );
- if ( pWindow )
- pWindow->GrabFocus();
- }
- else
- {
- pFormView->GrabFirstControlFocus( );
- }
+ FmFormView* pFormView = GetFormView();
+ if ( !pFormView )
+ break;
+
+ // if we execute this ourself, then either the
application does not implement an own handling for this,
+ // of we're on the top of the dispatcher stack, which
means a control has the focus.
+ // In the latter case, we put the focus to the document
window, otherwise, we focus the first control
+ const bool bHasControlFocus =
GetImpl()->HasControlFocus();
+ if ( bHasControlFocus )
+ {
+ const OutputDevice* pDevice =
GetCurrentViewDevice();
+ Window* pWindow = dynamic_cast< Window* >(
const_cast< OutputDevice* >( pDevice ) );
+ if ( pWindow )
+ pWindow->GrabFocus();
+ }
+ else
+ {
+ pFormView->GrabFirstControlFocus( );
+ }
}
break;
@@ -618,8 +614,8 @@ void FmFormShell::Execute(SfxRequest &rReq)
GetImpl()->CreateExternalView();
break;
case SID_FM_CONVERTTO_EDIT :
- case SID_FM_CONVERTTO_BUTTON :
- case SID_FM_CONVERTTO_FIXEDTEXT :
+ case SID_FM_CONVERTTO_BUTTON :
+ case SID_FM_CONVERTTO_FIXEDTEXT :
case SID_FM_CONVERTTO_LISTBOX :
case SID_FM_CONVERTTO_CHECKBOX :
case SID_FM_CONVERTTO_RADIOBUTTON :
@@ -633,13 +629,13 @@ void FmFormShell::Execute(SfxRequest &rReq)
case SID_FM_CONVERTTO_CURRENCY :
case SID_FM_CONVERTTO_PATTERN :
case SID_FM_CONVERTTO_IMAGECONTROL :
- case SID_FM_CONVERTTO_FORMATTED :
- case SID_FM_CONVERTTO_SCROLLBAR :
- case SID_FM_CONVERTTO_SPINBUTTON :
- case SID_FM_CONVERTTO_NAVIGATIONBAR :
+ case SID_FM_CONVERTTO_FORMATTED :
+ case SID_FM_CONVERTTO_SCROLLBAR :
+ case SID_FM_CONVERTTO_SPINBUTTON :
+ case SID_FM_CONVERTTO_NAVIGATIONBAR :
GetImpl()->executeControlConversionSlot( nSlot );
- // nach dem Konvertieren die Selektion neu bestimmern,
da sich ja das selektierte Objekt
- // geaendert hat
+ // nach dem Konvertieren die Selektion neu bestimmen,
da sich ja das selektierte Objekt
+ // geändert hat
GetImpl()->SetSelection(GetFormView()->GetMarkedObjectList());
break;
case SID_FM_LEAVE_CREATE:
@@ -660,15 +656,15 @@ void FmFormShell::Execute(SfxRequest &rReq)
case SID_FM_PROPERTIES:
{
- // PropertyBrowser anzeigen
+ // show PropertyBrowser
SFX_REQUEST_ARG(rReq, pShowItem, SfxBoolItem, nSlot,
sal_False);
sal_Bool bShow = pShowItem ? pShowItem->GetValue() :
sal_True;
- InterfaceBag aOnlyTheForm;
- aOnlyTheForm.insert( Reference< XInterface >(
GetImpl()->getCurrentForm(), UNO_QUERY ) );
+ InterfaceBag aOnlyTheForm;
+ aOnlyTheForm.insert( Reference< XInterface >(
GetImpl()->getCurrentForm(), UNO_QUERY ) );
GetImpl()->setCurrentSelection( aOnlyTheForm );
- GetImpl()->ShowSelectionProperties( bShow );
+ GetImpl()->ShowSelectionProperties( bShow );
rReq.Done();
} break;
@@ -678,9 +674,9 @@ void FmFormShell::Execute(SfxRequest &rReq)
SFX_REQUEST_ARG(rReq, pShowItem, SfxBoolItem, nSlot,
sal_False);
sal_Bool bShow = pShowItem ? pShowItem->GetValue() :
sal_True;
- OSL_ENSURE( GetImpl()->onlyControlsAreMarked(),
"FmFormShell::Execute: ControlProperties should be disabled!" );
- if ( bShow )
- GetImpl()->selectLastMarkedControls();
+ OSL_ENSURE( GetImpl()->onlyControlsAreMarked(),
"FmFormShell::Execute: ControlProperties should be disabled!" );
+ if ( bShow )
+ GetImpl()->selectLastMarkedControls();
GetImpl()->ShowSelectionProperties( bShow );
rReq.Done();
@@ -690,7 +686,7 @@ void FmFormShell::Execute(SfxRequest &rReq)
case SID_FM_FILTER_NAVIGATOR:
case SID_FM_SHOW_DATANAVIGATOR :
{
- GetViewShell()->GetViewFrame()->ChildWindowExecute( rReq );
+ GetViewShell()->GetViewFrame()->ChildWindowExecute(
rReq );
rReq.Done();
} break;
case SID_FM_SHOW_FMEXPLORER:
@@ -701,27 +697,27 @@ void FmFormShell::Execute(SfxRequest &rReq)
GetViewShell()->GetViewFrame()->ChildWindowExecute(rReq);
rReq.Done();
}
- break;
+ break;
case SID_FM_TAB_DIALOG:
{
- GetImpl()->ExecuteTabOrderDialog( Reference< XTabControllerModel
>( GetImpl()->getCurrentForm(), UNO_QUERY ) );
+ GetImpl()->ExecuteTabOrderDialog( Reference<
XTabControllerModel >( GetImpl()->getCurrentForm(), UNO_QUERY ) );
rReq.Done();
}
- break;
+ break;
- case SID_FM_DESIGN_MODE:
+ case SID_FM_DESIGN_MODE:
{
SFX_REQUEST_ARG(rReq, pDesignItem, SfxBoolItem, nSlot,
sal_False);
- sal_Bool bDesignMode = pDesignItem ? pDesignItem->GetValue() :
!m_bDesignMode;
- SetDesignMode( bDesignMode );
- if ( m_bDesignMode == bDesignMode )
- rReq.Done();
+ sal_Bool bDesignMode = pDesignItem ?
pDesignItem->GetValue() : !m_bDesignMode;
+ SetDesignMode( bDesignMode );
+ if ( m_bDesignMode == bDesignMode )
+ rReq.Done();
- m_nLastSlot = SID_FM_DESIGN_MODE;
- GetViewShell()->GetViewFrame()->GetBindings().Invalidate(
SID_FM_CONFIG );
- }
- break;
+ m_nLastSlot = SID_FM_DESIGN_MODE;
+
GetViewShell()->GetViewFrame()->GetBindings().Invalidate( SID_FM_CONFIG );
+ }
+ break;
case SID_FM_AUTOCONTROLFOCUS:
{
@@ -749,20 +745,20 @@ void FmFormShell::Execute(SfxRequest &rReq)
break;
case SID_FM_SEARCH:
{
- const ::svx::ControllerFeatures& rController =
GetImpl()->getActiveControllerFeatures();
- if ( rController->commitCurrentControl() &&
rController->commitCurrentRecord() )
+ const ::svx::ControllerFeatures& rController =
GetImpl()->getActiveControllerFeatures();
+ if ( rController->commitCurrentControl() &&
rController->commitCurrentRecord() )
GetImpl()->ExecuteSearch();
rReq.Done();
}
- break;
+ break;
case SID_FM_RECORD_FIRST:
case SID_FM_RECORD_PREV:
- case SID_FM_RECORD_NEXT:
+ case SID_FM_RECORD_NEXT:
case SID_FM_RECORD_LAST:
case SID_FM_RECORD_NEW:
- case SID_FM_REFRESH:
- case SID_FM_REFRESH_FORM_CONTROL:
+ case SID_FM_REFRESH:
+ case SID_FM_REFRESH_FORM_CONTROL:
case SID_FM_RECORD_DELETE:
case SID_FM_RECORD_UNDO:
case SID_FM_RECORD_SAVE:
@@ -771,19 +767,19 @@ void FmFormShell::Execute(SfxRequest &rReq)
case SID_FM_SORTUP:
case SID_FM_AUTOFILTER:
case SID_FM_ORDERCRIT:
- case SID_FM_FORM_FILTERED:
+ case SID_FM_FORM_FILTERED:
{
- GetImpl()->ExecuteFormSlot( nSlot );
+ GetImpl()->ExecuteFormSlot( nSlot );
rReq.Done();
- }
- break;
+ }
+ break;
case SID_FM_RECORD_ABSOLUTE:
{
- const ::svx::ControllerFeatures& rController =
GetImpl()->getNavControllerFeatures();
+ const ::svx::ControllerFeatures& rController =
GetImpl()->getNavControllerFeatures();
sal_Int32 nRecord = -1;
- const SfxItemSet* pArgs = rReq.GetArgs();
+ const SfxItemSet* pArgs = rReq.GetArgs();
if ( pArgs )
{
const SfxPoolItem* pItem;
@@ -797,10 +793,10 @@ void FmFormShell::Execute(SfxRequest &rReq)
else
{
SvxAbstractDialogFactory* pFact =
SvxAbstractDialogFactory::Create();
- DBG_ASSERT( pFact, "no dialog factory!" );
+ DBG_ASSERT( pFact, "no dialog factory!" );
if ( pFact )
{
- ::std::auto_ptr< AbstractFmInputRecordNoDialog > dlg(
pFact->CreateFmInputRecordNoDialog( NULL ) );
+ ::std::auto_ptr<
AbstractFmInputRecordNoDialog > dlg( pFact->CreateFmInputRecordNoDialog( NULL )
);
DBG_ASSERT( dlg.get(), "Dialogdiet
fail!" );
dlg->SetValue(
rController->getCursor()->getRow() );
if ( dlg->Execute() == RET_OK )
@@ -811,7 +807,7 @@ void FmFormShell::Execute(SfxRequest &rReq)
}
if ( nRecord != -1 )
- rController->execute( nSlot, ::rtl::OUString::createFromAscii(
"Position" ), makeAny( (sal_Int32)nRecord ) );
+ rController->execute( nSlot,
::rtl::OUString::createFromAscii( "Position" ), makeAny( (sal_Int32)nRecord ) );
rReq.Done();
} break;
@@ -824,7 +820,7 @@ void FmFormShell::Execute(SfxRequest &rReq)
if ( !bCancelled )
{
// if the filter navigator is still open, we
need to close it, so it can possibly
- // commit it's most recent changes
+ // commit its most recent changes
if ( GetViewShell() &&
GetViewShell()->GetViewFrame() )
if (
GetViewShell()->GetViewFrame()->HasChildWindow( SID_FM_FILTER_NAVIGATOR ) )
{
@@ -838,7 +834,7 @@ void FmFormShell::Execute(SfxRequest &rReq)
// closing the window was
denied, for instance because of a invalid criterion
|| ( xController.is()
- &&
!GetImpl()->getActiveControllerFeatures()->commitCurrentControl( )
+ &&
!GetImpl()->getActiveControllerFeatures()->commitCurrentControl( )
)
// committing the controller
was denied
)
@@ -863,10 +859,10 @@ void FmFormShell::Execute(SfxRequest &rReq)
GetImpl()->startFiltering();
rReq.Done();
- // initially open the filter navigator, the whole form based
filter is pretty useless without it
+ // initially open the filter navigator, the whole form
based filter is pretty useless without it
SfxBoolItem aIdentifierItem( SID_FM_FILTER_NAVIGATOR,
sal_True );
GetViewShell()->GetViewFrame()->GetDispatcher()->Execute(
SID_FM_FILTER_NAVIGATOR, SFX_CALLMODE_ASYNCHRON,
- &aIdentifierItem, NULL );
+ &aIdentifierItem, NULL );
} break;
}
}
@@ -880,13 +876,13 @@ void FmFormShell::GetState(SfxItemSet &rSet)
{
switch( nWhich )
{
- case SID_FM_MORE_CONTROLS:
- case SID_FM_FORM_DESIGN_TOOLS:
- {
- FormToolboxes aToolboxAccess( GetImpl()->getHostFrame() );
- rSet.Put( SfxBoolItem( nWhich,
aToolboxAccess.isToolboxVisible( nWhich ) ) );
- }
- break;
+ case SID_FM_MORE_CONTROLS:
+ case SID_FM_FORM_DESIGN_TOOLS:
+ {
+ FormToolboxes aToolboxAccess(
GetImpl()->getHostFrame() );
+ rSet.Put( SfxBoolItem( nWhich,
aToolboxAccess.isToolboxVisible( nWhich ) ) );
+ }
+ break;
case SID_FM_FILTER_EXECUTE:
case SID_FM_FILTER_EXIT:
@@ -895,7 +891,7 @@ void FmFormShell::GetState(SfxItemSet &rSet)
break;
case SID_FM_USE_WIZARDS:
- if ( !SvtModuleOptions().IsModuleInstalled(
SvtModuleOptions::E_SDATABASE ) )
+ if ( !SvtModuleOptions().IsModuleInstalled(
SvtModuleOptions::E_SDATABASE ) )
rSet.Put( SfxVisibilityItem( nWhich,
sal_False ) );
else if (!GetFormModel())
rSet.DisableItem( nWhich );
@@ -915,22 +911,22 @@ void FmFormShell::GetState(SfxItemSet &rSet)
rSet.Put( SfxBoolItem(nWhich,
GetFormModel()->GetOpenInDesignMode() ) );
break;
- case SID_FM_NAVIGATIONBAR:
+ case SID_FM_NAVIGATIONBAR:
case SID_FM_DBGRID:
- if ( !SvtModuleOptions().IsModuleInstalled(
SvtModuleOptions::E_SDATABASE ) )
- {
- rSet.Put( SfxVisibilityItem( nWhich, sal_False ) );
- break;
- }
- // NO break!
-
- case SID_FM_SCROLLBAR:
+ if ( !SvtModuleOptions().IsModuleInstalled(
SvtModuleOptions::E_SDATABASE ) )
+ {
+ rSet.Put( SfxVisibilityItem( nWhich,
sal_False ) );
+ break;
+ }
+ // NO break!
+
+ case SID_FM_SCROLLBAR:
case SID_FM_IMAGECONTROL:
case SID_FM_FILECONTROL:
case SID_FM_CURRENCYFIELD:
case SID_FM_PATTERNFIELD:
case SID_FM_IMAGEBUTTON:
- case SID_FM_RADIOBUTTON:
+ case SID_FM_RADIOBUTTON:
case SID_FM_COMBOBOX:
case SID_FM_GROUPBOX:
case SID_FM_CHECKBOX:
@@ -942,18 +938,18 @@ void FmFormShell::GetState(SfxItemSet &rSet)
case SID_FM_TIMEFIELD:
case SID_FM_NUMERICFIELD:
case SID_FM_FORMATTEDFIELD:
- case SID_FM_SPINBUTTON:
- if (!m_bDesignMode)
+ case SID_FM_SPINBUTTON:
+ if (!m_bDesignMode)
rSet.DisableItem( nWhich );
else
{
sal_Bool bLayerLocked = sal_False;
if (m_pFormView)
{
- // Ist der
::com::sun::star::drawing::Layer gelocked, so m???ssen die Slots disabled
werden. #36897
+ // Ist der
::com::sun::star::drawing::Layer gelocked, so müssen die Slots disabled werden.
#36897
SdrPageView* pPV =
m_pFormView->GetSdrPageView();
- if (pPV != NULL)
- bLayerLocked =
pPV->IsLayerLocked(m_pFormView->GetActiveLayer());
+ if (pPV != NULL)
+ bLayerLocked =
pPV->IsLayerLocked(m_pFormView->GetActiveLayer());
}
if (bLayerLocked)
rSet.DisableItem( nWhich );
@@ -1002,11 +998,11 @@ void FmFormShell::GetState(SfxItemSet &rSet)
{
rSet.Put(SfxBoolItem(GetImpl()->IsPropBrwOpen()));
}
- break;
+ break;
case SID_FM_CTL_PROPERTIES:
{
- // der Impl eventuell die Moeglichjkeit geben,
ihre an der aktuellen MarkList ausgerichteten Objekte
+ // der Impl eventuell die Möglichjkeit geben,
ihre an der aktuellen MarkList ausgerichteten Objekte
// auf den neuesten Stand zu bringen
if (GetImpl()->IsSelectionUpdatePending())
GetImpl()->ForceUpdateSelection(sal_False);
@@ -1016,16 +1012,16 @@ void FmFormShell::GetState(SfxItemSet &rSet)
else
{
sal_Bool bChecked =
GetImpl()->IsPropBrwOpen() && !GetImpl()->isSolelySelected(
GetImpl()->getCurrentForm() );
- // if the property browser is open, and only controls
are marked, and the current selection
- // does not consist of only the current form, then the
current selection is the (composition of)
- // the currently marked controls
+ // if the property browser is
open, and only controls are marked, and the current selection
+ // does not consist of only the
current form, then the current selection is the (composition of)
+ // the currently marked controls
rSet.Put( SfxBoolItem( nWhich, bChecked
) );
}
} break;
case SID_FM_PROPERTIES:
{
- // der Impl eventuell die Moeglichjkeit geben,
ihre an der aktuellen MarkList ausgerichteten Objekte
+ // der Impl eventuell die Möglichkeit geben,
ihre an der aktuellen MarkList ausgerichteten Objekte
// auf den neuesten Stand zu bringen
if (GetImpl()->IsSelectionUpdatePending())
GetImpl()->ForceUpdateSelection(sal_False);
@@ -1039,7 +1035,7 @@ void FmFormShell::GetState(SfxItemSet &rSet)
}
} break;
case SID_FM_TAB_DIALOG:
- // der Impl eventuell die Moeglichjkeit geben,
ihre an der aktuellen MarkList ausgerichteten Objekte
+ // der Impl eventuell die Möglichkeit geben,
ihre an der aktuellen MarkList ausgerichteten Objekte
// auf den neuesten Stand zu bringen
if (GetImpl()->IsSelectionUpdatePending())
GetImpl()->ForceUpdateSelection(sal_False);
@@ -1051,9 +1047,9 @@ void FmFormShell::GetState(SfxItemSet &rSet)
rSet.Put(SfxUInt16Item(nWhich, m_nLastSlot));
break;
case SID_FM_DESIGN_MODE:
- if (!m_pFormView || GetImpl()->IsReadonlyDoc() )
+ if (!m_pFormView || GetImpl()->IsReadonlyDoc() )
rSet.DisableItem( nWhich );
- else
+ else
rSet.Put( SfxBoolItem(nWhich,
m_bDesignMode) );
break;
case SID_FM_SEARCH:
@@ -1075,7 +1071,7 @@ void FmFormShell::GetState(SfxItemSet &rSet)
case SID_FM_FILTER_START:
case SID_FM_AUTOFILTER:
case SID_FM_REFRESH:
- case SID_FM_REFRESH_FORM_CONTROL:
+ case SID_FM_REFRESH_FORM_CONTROL:
case SID_FM_VIEW_AS_GRID:
GetFormState(rSet,nWhich);
break;
@@ -1086,8 +1082,8 @@ void FmFormShell::GetState(SfxItemSet &rSet)
rSet.DisableItem( nWhich );
else
{
- if ( !GetImpl()->canConvertCurrentSelectionToControl(
OBJ_FM_FIXEDTEXT ) )
- // if it cannot be converted to a fixed text, it is no
single control
+ if (
!GetImpl()->canConvertCurrentSelectionToControl( OBJ_FM_FIXEDTEXT ) )
+ // if it cannot be converted to
a fixed text, it is no single control
rSet.DisableItem( nWhich );
}
} break;
@@ -1096,11 +1092,11 @@ void FmFormShell::GetState(SfxItemSet &rSet)
case SID_FM_CONVERTTO_CURRENCY :
case SID_FM_CONVERTTO_PATTERN :
case SID_FM_CONVERTTO_IMAGECONTROL :
- case SID_FM_CONVERTTO_SCROLLBAR :
- case SID_FM_CONVERTTO_NAVIGATIONBAR :
- case SID_FM_CONVERTTO_IMAGEBUTTON :
- case SID_FM_CONVERTTO_EDIT :
- case SID_FM_CONVERTTO_BUTTON :
+ case SID_FM_CONVERTTO_SCROLLBAR :
+ case SID_FM_CONVERTTO_NAVIGATIONBAR :
+ case SID_FM_CONVERTTO_IMAGEBUTTON :
+ case SID_FM_CONVERTTO_EDIT :
+ case SID_FM_CONVERTTO_BUTTON :
case SID_FM_CONVERTTO_FIXEDTEXT :
case SID_FM_CONVERTTO_LISTBOX :
case SID_FM_CONVERTTO_CHECKBOX :
@@ -1111,7 +1107,7 @@ void FmFormShell::GetState(SfxItemSet &rSet)
case SID_FM_CONVERTTO_TIME :
case SID_FM_CONVERTTO_NUMERIC :
case SID_FM_CONVERTTO_FORMATTED :
- case SID_FM_CONVERTTO_SPINBUTTON :
+ case SID_FM_CONVERTTO_SPINBUTTON :
{
if ( !m_pFormView || !m_bDesignMode ||
!GetImpl()->canConvertCurrentSelectionToControl( nWhich ) )
rSet.DisableItem( nWhich );
@@ -1121,7 +1117,7 @@ void FmFormShell::GetState(SfxItemSet &rSet)
// just to have a defined state
(available and not checked)
}
}
- break;
+ break;
}
nWhich = aIter.NextWhich();
}
@@ -1141,18 +1137,18 @@ void FmFormShell::GetFormState(SfxItemSet &rSet,
sal_uInt16 nWhich)
else
{
sal_Bool bEnable = sal_False;
- try
- {
- switch (nWhich)
- {
+ try
+ {
+ switch (nWhich)
+ {
case SID_FM_VIEW_AS_GRID:
if (GetImpl()->getHostFrame().is() &&
GetImpl()->getNavController().is())
{
bEnable = sal_True;
sal_Bool bDisplayingCurrent =
- GetImpl()->getInternalForm(
- Reference< XForm >(
GetImpl()->getNavController()->getModel(), UNO_QUERY )
- ) == GetImpl()->getExternallyDisplayedForm();
+ GetImpl()->getInternalForm(
+ Reference< XForm >(
GetImpl()->getNavController()->getModel(), UNO_QUERY )
+ ) ==
GetImpl()->getExternallyDisplayedForm();
rSet.Put(SfxBoolItem(nWhich,
bDisplayingCurrent));
}
break;
@@ -1163,65 +1159,65 @@ void FmFormShell::GetFormState(SfxItemSet &rSet,
sal_uInt16 nWhich)
sal_Int32 nCount =
::comphelper::getINT32(xNavSet->getPropertyValue(FM_PROP_ROWCOUNT));
bEnable = nCount != 0;
} break;
- case SID_FM_RECORD_ABSOLUTE:
- case SID_FM_RECORD_TOTAL:
- {
- FeatureState aState;
- GetImpl()->getNavControllerFeatures()->getState( nWhich,
aState );
- if ( SID_FM_RECORD_ABSOLUTE == nWhich )
- {
- sal_Int32 nPosition = 0;
- aState.State >>= nPosition;
- rSet.Put( SfxInt32Item( nWhich, nPosition ) );
- }
- else if ( SID_FM_RECORD_TOTAL == nWhich )
- {
- ::rtl::OUString sTotalCount;
- aState.State >>= sTotalCount;
- rSet.Put( SfxStringItem( nWhich, sTotalCount ) );
- }
- bEnable = aState.Enabled;
- }
- break;
-
- // first, prev, next, last, and absolute affect the nav
controller, not the
- // active controller
- case SID_FM_RECORD_FIRST:
- case SID_FM_RECORD_PREV:
- case SID_FM_RECORD_NEXT:
- case SID_FM_RECORD_LAST:
- case SID_FM_RECORD_NEW:
- case SID_FM_RECORD_SAVE:
- case SID_FM_RECORD_UNDO:
- case SID_FM_RECORD_DELETE:
- case SID_FM_REFRESH:
- case SID_FM_REFRESH_FORM_CONTROL:
- case SID_FM_REMOVE_FILTER_SORT:
- case SID_FM_SORTUP:
- case SID_FM_SORTDOWN:
- case SID_FM_AUTOFILTER:
- case SID_FM_ORDERCRIT:
- bEnable = GetImpl()->IsFormSlotEnabled( nWhich );
- break;
-
- case SID_FM_FORM_FILTERED:
- {
- FeatureState aState;
- bEnable = GetImpl()->IsFormSlotEnabled( nWhich, &aState );
-
- rSet.Put( SfxBoolItem( nWhich, ::comphelper::getBOOL(
aState.State ) ) );
- }
- break;
-
- case SID_FM_FILTER_START:
- bEnable =
GetImpl()->getActiveControllerFeatures()->canDoFormFilter();
- break;
- }
- }
- catch( const Exception& )
- {
- DBG_ERROR( "FmFormShell::GetFormState: caught an exception while
determining the state!" );
- }
+ case SID_FM_RECORD_ABSOLUTE:
+ case SID_FM_RECORD_TOTAL:
+ {
+ FeatureState aState;
+
GetImpl()->getNavControllerFeatures()->getState( nWhich, aState );
+ if ( SID_FM_RECORD_ABSOLUTE == nWhich )
+ {
+ sal_Int32 nPosition = 0;
+ aState.State >>= nPosition;
+ rSet.Put( SfxInt32Item( nWhich,
nPosition ) );
+ }
+ else if ( SID_FM_RECORD_TOTAL == nWhich )
+ {
+ ::rtl::OUString sTotalCount;
+ aState.State >>= sTotalCount;
+ rSet.Put( SfxStringItem( nWhich,
sTotalCount ) );
+ }
+ bEnable = aState.Enabled;
+ }
+ break;
+
+ // first, prev, next, last, and absolute affect the nav
controller, not the
+ // active controller
+ case SID_FM_RECORD_FIRST:
+ case SID_FM_RECORD_PREV:
+ case SID_FM_RECORD_NEXT:
+ case SID_FM_RECORD_LAST:
+ case SID_FM_RECORD_NEW:
+ case SID_FM_RECORD_SAVE:
+ case SID_FM_RECORD_UNDO:
+ case SID_FM_RECORD_DELETE:
+ case SID_FM_REFRESH:
+ case SID_FM_REFRESH_FORM_CONTROL:
+ case SID_FM_REMOVE_FILTER_SORT:
+ case SID_FM_SORTUP:
+ case SID_FM_SORTDOWN:
+ case SID_FM_AUTOFILTER:
+ case SID_FM_ORDERCRIT:
+ bEnable = GetImpl()->IsFormSlotEnabled( nWhich
);
+ break;
+
+ case SID_FM_FORM_FILTERED:
+ {
+ FeatureState aState;
+ bEnable = GetImpl()->IsFormSlotEnabled( nWhich,
&aState );
+
+ rSet.Put( SfxBoolItem( nWhich,
::comphelper::getBOOL( aState.State ) ) );
+ }
+ break;
+
+ case SID_FM_FILTER_START:
+ bEnable =
GetImpl()->getActiveControllerFeatures()->canDoFormFilter();
+ break;
+ }
+ }
+ catch( const Exception& )
+ {
+ DBG_ERROR( "FmFormShell::GetFormState: caught an
exception while determining the state!" );
+ }
if (!bEnable)
rSet.DisableItem(nWhich);
}
@@ -1241,16 +1237,16 @@ void FmFormShell::SetView( FmFormView* _pView )
{
if ( m_pFormView )
{
- if ( IsActive() )
- GetImpl()->viewDeactivated( *m_pFormView );
+ if ( IsActive() )
+ GetImpl()->viewDeactivated( *m_pFormView );
m_pFormView->SetFormShell( NULL, FmFormView::FormShellAccess()
);
- m_pFormView = NULL;
+ m_pFormView = NULL;
m_pFormModel = NULL;
}
- if ( !_pView )
- return;
+ if ( !_pView )
+ return;
m_pFormView = _pView;
m_pFormView->SetFormShell( this, FmFormView::FormShellAccess() );
@@ -1296,8 +1292,8 @@ void FmFormShell::Activate(sal_Bool bMDI)
{
SfxShell::Activate(bMDI);
- if ( m_pFormView )
- GetImpl()->viewActivated( *m_pFormView, sal_True );
+ if ( m_pFormView )
+ GetImpl()->viewActivated( *m_pFormView, sal_True );
}
//------------------------------------------------------------------------
@@ -1305,200 +1301,200 @@ void FmFormShell::Deactivate(sal_Bool bMDI)
{
SfxShell::Deactivate(bMDI);
- if ( m_pFormView )
- GetImpl()->viewDeactivated( *m_pFormView, sal_False );
+ if ( m_pFormView )
+ GetImpl()->viewDeactivated( *m_pFormView, sal_False );
}
//------------------------------------------------------------------------
void FmFormShell::ExecuteTextAttribute( SfxRequest& _rReq )
{
- m_pImpl->ExecuteTextAttribute( _rReq );
+ m_pImpl->ExecuteTextAttribute( _rReq );
}
//------------------------------------------------------------------------
void FmFormShell::GetTextAttributeState( SfxItemSet& _rSet )
{
- m_pImpl->GetTextAttributeState( _rSet );
+ m_pImpl->GetTextAttributeState( _rSet );
}
//------------------------------------------------------------------------
bool FmFormShell::IsActiveControl() const
{
- return m_pImpl->IsActiveControl();
+ return m_pImpl->IsActiveControl();
}
//------------------------------------------------------------------------
void FmFormShell::ForgetActiveControl()
{
- m_pImpl->ForgetActiveControl();
+ m_pImpl->ForgetActiveControl();
}
//------------------------------------------------------------------------
void FmFormShell::SetControlActivationHandler( const Link& _rHdl )
{
- m_pImpl->SetControlActivationHandler( _rHdl );
+ m_pImpl->SetControlActivationHandler( _rHdl );
}
//------------------------------------------------------------------------
namespace
{
- SdrUnoObj* lcl_findUnoObject( const SdrObjList& _rObjList, const
Reference< XControlModel >& _rxModel )
- {
- SdrObjListIter aIter( _rObjList );
- while ( aIter.IsMore() )
- {
- SdrObject* pObject = aIter.Next();
- SdrUnoObj* pUnoObject = pObject ? PTR_CAST( SdrUnoObj, pObject ) :
NULL;
- if ( !pUnoObject )
- continue;
-
- Reference< XControlModel > xControlModel =
pUnoObject->GetUnoControlModel();
- if ( !xControlModel.is() )
- continue;
-
- if ( _rxModel == xControlModel )
- return pUnoObject;
- }
- return NULL;
- }
+ SdrUnoObj* lcl_findUnoObject( const SdrObjList& _rObjList, const
Reference< XControlModel >& _rxModel )
+ {
+ SdrObjListIter aIter( _rObjList );
+ while ( aIter.IsMore() )
+ {
+ SdrObject* pObject = aIter.Next();
+ SdrUnoObj* pUnoObject = pObject ? PTR_CAST( SdrUnoObj,
pObject ) : NULL;
+ if ( !pUnoObject )
+ continue;
+
+ Reference< XControlModel > xControlModel =
pUnoObject->GetUnoControlModel();
+ if ( !xControlModel.is() )
+ continue;
+
+ if ( _rxModel == xControlModel )
+ return pUnoObject;
+ }
+ return NULL;
+ }
}
//------------------------------------------------------------------------
void FmFormShell::ToggleControlFocus( const SdrUnoObj& i_rUnoObject, const
SdrView& i_rView, OutputDevice& i_rDevice ) const
{
- try
- {
- // check if the focus currently is in a control
- // Well, okay, do it the other way 'round: Check whether the current
control of the active controller
- // actually has the focus. This should be equivalent.
- const bool bHasControlFocus = GetImpl()->HasControlFocus();
-
- if ( bHasControlFocus )
- {
- Window* pWindow( dynamic_cast< Window* >( &i_rDevice ) );
- OSL_ENSURE( pWindow, "FmFormShell::ToggleControlFocus: I need a
Window, really!" );
- if ( pWindow )
- pWindow->GrabFocus();
- }
- else
- {
- Reference< XControl > xControl;
- GetFormControl( i_rUnoObject.GetUnoControlModel(), i_rView,
i_rDevice, xControl );
- Reference< XWindow > xControlWindow( xControl, UNO_QUERY );
- if ( xControlWindow.is() )
- xControlWindow->setFocus();
- }
- }
- catch( const Exception& )
- {
- DBG_UNHANDLED_EXCEPTION();
- }
+ try
+ {
+ // check if the focus currently is in a control
+ // Well, okay, do it the other way 'round: Check whether the
current control of the active controller
+ // actually has the focus. This should be equivalent.
+ const bool bHasControlFocus = GetImpl()->HasControlFocus();
+
+ if ( bHasControlFocus )
+ {
+ Window* pWindow( dynamic_cast< Window* >( &i_rDevice )
);
+ OSL_ENSURE( pWindow, "FmFormShell::ToggleControlFocus:
I need a Window, really!" );
+ if ( pWindow )
+ pWindow->GrabFocus();
+ }
+ else
+ {
+ Reference< XControl > xControl;
+ GetFormControl( i_rUnoObject.GetUnoControlModel(),
i_rView, i_rDevice, xControl );
+ Reference< XWindow > xControlWindow( xControl,
UNO_QUERY );
+ if ( xControlWindow.is() )
+ xControlWindow->setFocus();
+ }
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
}
//------------------------------------------------------------------------
namespace
{
- class FocusableControlsFilter : public ::svx::ISdrObjectFilter
- {
- public:
- FocusableControlsFilter( const SdrView& i_rView, const OutputDevice&
i_rDevice )
- :m_rView( i_rView )
- ,m_rDevice( i_rDevice )
- {
- }
-
- public:
- virtual bool includeObject( const SdrObject& i_rObject ) const
- {
- const SdrUnoObj* pUnoObj = dynamic_cast< const SdrUnoObj* >(
&i_rObject );
- if ( !pUnoObj )
- return false;
-
- Reference< XControl > xControl = pUnoObj->GetUnoControl( m_rView,
m_rDevice );
- return FmXFormView::isFocusable( xControl );
- }
-
- private:
- const SdrView& m_rView;
- const OutputDevice& m_rDevice;
- };
+ class FocusableControlsFilter : public ::svx::ISdrObjectFilter
+ {
+ public:
+ FocusableControlsFilter( const SdrView& i_rView, const
OutputDevice& i_rDevice )
+ :m_rView( i_rView )
+ ,m_rDevice( i_rDevice )
+ {
+ }
+
+ public:
+ virtual bool includeObject( const SdrObject& i_rObject )
const
+ {
+ const SdrUnoObj* pUnoObj = dynamic_cast< const
SdrUnoObj* >( &i_rObject );
+ if ( !pUnoObj )
+ return false;
+
+ Reference< XControl > xControl =
pUnoObj->GetUnoControl( m_rView, m_rDevice );
+ return FmXFormView::isFocusable( xControl );
+ }
+
+ private:
+ const SdrView& m_rView;
+ const OutputDevice& m_rDevice;
+ };
}
//------------------------------------------------------------------------
::std::auto_ptr< ::svx::ISdrObjectFilter >
FmFormShell::CreateFocusableControlFilter( const SdrView& i_rView, const
OutputDevice& i_rDevice ) const
{
- ::std::auto_ptr< ::svx::ISdrObjectFilter > pFilter;
+ ::std::auto_ptr< ::svx::ISdrObjectFilter > pFilter;
- if ( !i_rView.IsDesignMode() )
- pFilter.reset( new FocusableControlsFilter( i_rView, i_rDevice ) );
+ if ( !i_rView.IsDesignMode() )
+ pFilter.reset( new FocusableControlsFilter( i_rView, i_rDevice
) );
- return pFilter;
+ return pFilter;
}
//------------------------------------------------------------------------
SdrUnoObj* FmFormShell::GetFormControl( const Reference< XControlModel >&
_rxModel, const SdrView& _rView, const OutputDevice& _rDevice, Reference<
XControl >& _out_rxControl ) const
{
- if ( !_rxModel.is() )
- return NULL;
-
- // we can only retrieve controls for SdrObjects which belong to page which
is actually displayed in the given view
- SdrPageView* pPageView = _rView.GetSdrPageView();
- SdrPage* pPage = pPageView ? pPageView->GetPage() : NULL;
- OSL_ENSURE( pPage, "FmFormShell::GetFormControl: no page displayed in the
given view!" );
- if ( !pPage )
- return NULL;
-
- SdrUnoObj* pUnoObject = lcl_findUnoObject( *pPage, _rxModel );
- if ( pUnoObject )
- {
- _out_rxControl = pUnoObject->GetUnoControl( _rView, _rDevice );
- return pUnoObject;
- }
+ if ( !_rxModel.is() )
+ return NULL;
+
+ // we can only retrieve controls for SdrObjects which belong to page
which is actually displayed in the given view
+ SdrPageView* pPageView = _rView.GetSdrPageView();
+ SdrPage* pPage = pPageView ? pPageView->GetPage() : NULL;
+ OSL_ENSURE( pPage, "FmFormShell::GetFormControl: no page displayed in
the given view!" );
+ if ( !pPage )
+ return NULL;
+
+ SdrUnoObj* pUnoObject = lcl_findUnoObject( *pPage, _rxModel );
+ if ( pUnoObject )
+ {
+ _out_rxControl = pUnoObject->GetUnoControl( _rView, _rDevice );
+ return pUnoObject;
+ }
#if OSL_DEBUG_LEVEL > 0
- // perhaps we are fed with a control model which lives on a page other
than the one displayed
- // in the given view. This is worth being reported as error, in
non-product builds.
+ // perhaps we are fed with a control model which lives on a page other
than the one displayed
+ // in the given view. This is worth being reported as error, in
non-product builds.
FmFormModel* pModel = GetFormModel();
- if ( pModel )
- {
- sal_uInt16 pageCount = pModel->GetPageCount();
- for ( sal_uInt16 page = 0; page < pageCount; ++page )
- {
- pPage = pModel->GetPage( page );
- OSL_ENSURE( pPage, "FmFormShell::GetFormControl: NULL page
encountered!" );
- if ( !pPage )
- continue;
-
- pUnoObject = lcl_findUnoObject( *pPage, _rxModel );
- OSL_ENSURE( !pUnoObject, "FmFormShell::GetFormControl: the given
control model belongs to a wrong page (displayed elsewhere)!" );
- }
- }
+ if ( pModel )
+ {
+ sal_uInt16 pageCount = pModel->GetPageCount();
+ for ( sal_uInt16 page = 0; page < pageCount; ++page )
+ {
+ pPage = pModel->GetPage( page );
+ OSL_ENSURE( pPage, "FmFormShell::GetFormControl: NULL
page encountered!" );
+ if ( !pPage )
+ continue;
+
+ pUnoObject = lcl_findUnoObject( *pPage, _rxModel );
+ OSL_ENSURE( !pUnoObject, "FmFormShell::GetFormControl:
the given control model belongs to a wrong page (displayed elsewhere)!" );
+ }
+ }
#endif
- return NULL;
+ return NULL;
}
//------------------------------------------------------------------------
Reference< runtime::XFormController > FmFormShell::GetFormController( const
Reference< XForm >& _rxForm, const SdrView& _rView, const OutputDevice&
_rDevice ) const
{
- const FmFormView* pFormView = dynamic_cast< const FmFormView* >( &_rView );
- if ( !pFormView )
- return NULL;
+ const FmFormView* pFormView = dynamic_cast< const FmFormView* >(
&_rView );
+ if ( !pFormView )
+ return NULL;
- return pFormView->GetFormController( _rxForm, _rDevice );
+ return pFormView->GetFormController( _rxForm, _rDevice );
}
//------------------------------------------------------------------------
void FmFormShell::SetDesignMode( sal_Bool _bDesignMode )
{
- if ( _bDesignMode == m_bDesignMode )
- return;
+ if ( _bDesignMode == m_bDesignMode )
+ return;
FmFormModel* pModel = GetFormModel();
if (pModel)
- // fuer die Zeit des Uebergangs das Undo-Environment ausschalten,
das sichert, dass man dort auch nicht-transiente
- // Properties mal eben aendern kann (sollte allerdings mit
Vorsicht genossen und beim Rueckschalten des Modes
- // auch immer wieder rueckgaegig gemacht werden. Ein Beispiel
ist das Setzen der maximalen Text-Laenge durch das
+ // für die Zeit des Übergangs das Undo-Environment ausschalten,
das sichert, dass man dort auch nicht-transiente
+ // Properties mal eben ändern kann (sollte allerdings mit
Vorsicht genossen und beim Rückschalten des Modes
+ // auch immer wieder rückgängig gemacht werden. Ein Beispiel
ist das Setzen der maximalen Text-Länge durch das
// OEditModel an seinem Control.)
pModel->GetUndoEnv().Lock();
@@ -1506,7 +1502,9 @@ void FmFormShell::SetDesignMode( sal_Bool _bDesignMode )
if ( m_bDesignMode || PrepareClose( sal_True ) )
impl_setDesignMode(!m_bDesignMode );
- // und mein Undo-Environment wieder an
+ // und mein Undo-Environment wieder an
if ( pModel )
pModel->GetUndoEnv().UnLock();
}
+
+/* vim: set noet sw=4 ts=4: */
diff --git a/main/vcl/source/control/combobox.cxx
b/main/vcl/source/control/combobox.cxx
index c3ba043159..d0096d4907 100644
--- a/main/vcl/source/control/combobox.cxx
+++ b/main/vcl/source/control/combobox.cxx
@@ -19,8 +19,6 @@
*
*************************************************************/
-
-
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_vcl.hxx"
@@ -133,20 +131,20 @@ void ComboBox::ImplCalcEditHeight()
if ( !IsDropDownBox() )
mnDDHeight += 4;
- Rectangle aCtrlRegion( Point( 0, 0 ), Size( 10, 10 ) );
- Rectangle aBoundRegion, aContentRegion;
- ImplControlValue aControlValue;
- ControlType aType = IsDropDownBox() ? CTRL_COMBOBOX : CTRL_EDITBOX;
- if( GetNativeControlRegion( aType, PART_ENTIRE_CONTROL,
- aCtrlRegion,
- CTRL_STATE_ENABLED,
- aControlValue, rtl::OUString(),
- aBoundRegion, aContentRegion ) )
- {
- const long nNCHeight = aBoundRegion.GetHeight();
- if( mnDDHeight < nNCHeight )
- mnDDHeight = sal::static_int_cast<sal_uInt16>( nNCHeight );
- }
+ Rectangle aCtrlRegion( Point( 0, 0 ), Size( 10, 10 ) );
+ Rectangle aBoundRegion, aContentRegion;
+ ImplControlValue aControlValue;
+ ControlType aType = IsDropDownBox() ? CTRL_COMBOBOX : CTRL_EDITBOX;
+ if( GetNativeControlRegion( aType, PART_ENTIRE_CONTROL,
+ aCtrlRegion,
+
CTRL_STATE_ENABLED,
+ aControlValue,
rtl::OUString(),
+ aBoundRegion,
aContentRegion ) )
+ {
+ const long nNCHeight = aBoundRegion.GetHeight();
+ if( mnDDHeight < nNCHeight )
+ mnDDHeight = sal::static_int_cast<sal_uInt16>(
nNCHeight );
+ }
}
// -----------------------------------------------------------------------
@@ -277,26 +275,26 @@ sal_Bool ComboBox::IsAutocompleteEnabled() const
void ComboBox::SetMpSubEditAccessibleName(String &aName)
{
if(mpSubEdit!=NULL)
- mpSubEdit->SetAccessibleName(aName);
+ mpSubEdit->SetAccessibleName(aName);
}
// -----------------------------------------------------------------------
IMPL_LINK( ComboBox, ImplClickBtnHdl, void*, EMPTYARG )
{
- ImplCallEventListeners( VCLEVENT_DROPDOWN_PRE_OPEN );
+ ImplCallEventListeners( VCLEVENT_DROPDOWN_PRE_OPEN );
mpSubEdit->GrabFocus();
if ( !mpImplLB->GetEntryList()->GetMRUCount() )
ImplUpdateFloatSelection();
else
mpImplLB->SelectEntry( 0 , sal_True );
mpBtn->SetPressed( sal_True );
- SetSelection( Selection( 0, SELECTION_MAX ) );
+ SetSelection( Selection( 0, SELECTION_MAX ) );
mpFloatWin->StartFloat( sal_True );
- ImplCallEventListeners( VCLEVENT_DROPDOWN_OPEN );
+ ImplCallEventListeners( VCLEVENT_DROPDOWN_OPEN );
- ImplClearLayoutData();
- if( mpImplLB )
- mpImplLB->GetMainWindow()->ImplClearLayoutData();
+ ImplClearLayoutData();
+ if( mpImplLB )
+ mpImplLB->GetMainWindow()->ImplClearLayoutData();
return 0;
}
@@ -305,24 +303,24 @@ IMPL_LINK( ComboBox, ImplClickBtnHdl, void*, EMPTYARG )
IMPL_LINK( ComboBox, ImplPopupModeEndHdl, void*, EMPTYARG )
{
- if( mpFloatWin->IsPopupModeCanceled() )
- {
- if ( !mpImplLB->GetEntryList()->IsEntryPosSelected(
mpFloatWin->GetPopupModeStartSaveSelection() ) )
- {
- mpImplLB->SelectEntry(
mpFloatWin->GetPopupModeStartSaveSelection(), sal_True );
- sal_Bool bTravelSelect = mpImplLB->IsTravelSelect();
- mpImplLB->SetTravelSelect( sal_True );
- Select();
- mpImplLB->SetTravelSelect( bTravelSelect );
- }
- }
-
- ImplClearLayoutData();
- if( mpImplLB )
- mpImplLB->GetMainWindow()->ImplClearLayoutData();
+ if( mpFloatWin->IsPopupModeCanceled() )
+ {
+ if ( !mpImplLB->GetEntryList()->IsEntryPosSelected(
mpFloatWin->GetPopupModeStartSaveSelection() ) )
+ {
+ mpImplLB->SelectEntry(
mpFloatWin->GetPopupModeStartSaveSelection(), sal_True );
+ sal_Bool bTravelSelect = mpImplLB->IsTravelSelect();
+ mpImplLB->SetTravelSelect( sal_True );
+ Select();
+ mpImplLB->SetTravelSelect( bTravelSelect );
+ }
+ }
+
+ ImplClearLayoutData();
+ if( mpImplLB )
+ mpImplLB->GetMainWindow()->ImplClearLayoutData();
mpBtn->SetPressed( sal_False );
- ImplCallEventListeners( VCLEVENT_DROPDOWN_CLOSE );
+ ImplCallEventListeners( VCLEVENT_DROPDOWN_CLOSE );
return 0;
}
@@ -333,9 +331,9 @@ IMPL_LINK( ComboBox, ImplAutocompleteHdl, Edit*, pEdit )
Selection aSel = pEdit->GetSelection();
AutocompleteAction eAction = pEdit->GetAutocompleteAction();
- /* If there is no current selection do not auto complete on
- Tab/Shift-Tab since then we would not cycle to the next field.
- */
+ /* If there is no current selection do not auto complete on
+ Tab/Shift-Tab since then we would not cycle to the next field.
+ */
if ( aSel.Len() ||
((eAction != AUTOCOMPLETE_TABFORWARD) && (eAction !=
AUTOCOMPLETE_TABBACKWARD)) )
{
@@ -355,19 +353,19 @@ IMPL_LINK( ComboBox, ImplAutocompleteHdl, Edit*, pEdit )
nStart = nStart ? nStart - 1 :
mpImplLB->GetEntryList()->GetEntryCount()-1;
}
- sal_uInt16 nPos = LISTBOX_ENTRY_NOTFOUND;
- if( ! mbMatchCase )
- {
+ sal_uInt16 nPos = LISTBOX_ENTRY_NOTFOUND;
+ if( ! mbMatchCase )
+ {
// Try match case insensitive from current position
nPos = mpImplLB->GetEntryList()->FindMatchingEntry(
aStartText, nStart, bForward, sal_True );
- if ( nPos == LISTBOX_ENTRY_NOTFOUND )
- // Try match case insensitive, but from start
- nPos = mpImplLB->GetEntryList()->FindMatchingEntry(
aStartText, bForward ? 0 : (mpImplLB->GetEntryList()->GetEntryCount()-1),
bForward, sal_True );
- }
+ if ( nPos == LISTBOX_ENTRY_NOTFOUND )
+ // Try match case insensitive, but from start
+ nPos =
mpImplLB->GetEntryList()->FindMatchingEntry( aStartText, bForward ? 0 :
(mpImplLB->GetEntryList()->GetEntryCount()-1), bForward, sal_True );
+ }
if ( nPos == LISTBOX_ENTRY_NOTFOUND )
- // Try match full from current position
- nPos = mpImplLB->GetEntryList()->FindMatchingEntry( aStartText,
nStart, bForward, sal_False );
+ // Try match full from current position
+ nPos = mpImplLB->GetEntryList()->FindMatchingEntry(
aStartText, nStart, bForward, sal_False );
if ( nPos == LISTBOX_ENTRY_NOTFOUND )
// Match full, but from start
nPos = mpImplLB->GetEntryList()->FindMatchingEntry(
aStartText, bForward ? 0 : (mpImplLB->GetEntryList()->GetEntryCount()-1),
bForward, sal_False );
@@ -396,7 +394,7 @@ IMPL_LINK( ComboBox, ImplSelectHdl, void*, EMPTYARG )
{
aText = mpSubEdit->GetText();
- // Alle Eintraege entfernen, zu denen es einen Entry
gibt, der aber nicht selektiert ist.
+ // Alle Einträge entfernen, zu denen es einen Entry
gibt, der aber nicht selektiert ist.
xub_StrLen nIndex = 0;
while ( nIndex != STRING_NOTFOUND )
{
@@ -418,7 +416,7 @@ IMPL_LINK( ComboBox, ImplSelectHdl, void*, EMPTYARG )
aText.EraseLeadingAndTrailingChars( ' ' );
}
- // Fehlende Eintraege anhaengen...
+ // Fehlende Einträge anhängen...
Table aSelInText;
lcl_GetSelectedEntries( aSelInText, aText, mcMultiSep,
mpImplLB->GetEntryList() );
sal_uInt16 nSelectedEntries =
mpImplLB->GetEntryList()->GetSelectEntryCount();
@@ -430,7 +428,7 @@ IMPL_LINK( ComboBox, ImplSelectHdl, void*, EMPTYARG )
if ( aText.Len() && (aText.GetChar(
aText.Len()-1 ) != mcMultiSep) )
aText += mcMultiSep;
if ( aText.Len() )
- aText += ' '; // etwas
auflockern
+ aText += ' '; // etwas
auflockern
aText +=
mpImplLB->GetEntryList()->GetEntryText( nP );
aText += mcMultiSep;
}
@@ -475,7 +473,7 @@ IMPL_LINK( ComboBox, ImplSelectHdl, void*, EMPTYARG )
}
IMPL_LINK( ComboBox, ImplListItemSelectHdl, void*, EMPTYARG )
{
- ImplCallEventListeners( VCLEVENT_DROPDOWN_SELECT );
+ ImplCallEventListeners( VCLEVENT_DROPDOWN_SELECT );
return 1;
}
// -----------------------------------------------------------------------
@@ -513,38 +511,38 @@ IMPL_LINK( ComboBox, ImplDoubleClickHdl, void*, EMPTYARG )
void ComboBox::ToggleDropDown()
{
- if( IsDropDownBox() )
- {
- if( mpFloatWin->IsInPopupMode() )
- mpFloatWin->EndPopupMode();
- else
- {
- mpSubEdit->GrabFocus();
- if ( !mpImplLB->GetEntryList()->GetMRUCount() )
- ImplUpdateFloatSelection();
- else
- mpImplLB->SelectEntry( 0 , sal_True );
- ImplCallEventListeners( VCLEVENT_DROPDOWN_PRE_OPEN );
- mpBtn->SetPressed( sal_True );
- SetSelection( Selection( 0, SELECTION_MAX ) );
- mpFloatWin->StartFloat( sal_True );
- ImplCallEventListeners( VCLEVENT_DROPDOWN_OPEN );
- }
- }
+ if( IsDropDownBox() )
+ {
+ if( mpFloatWin->IsInPopupMode() )
+ mpFloatWin->EndPopupMode();
+ else
+ {
+ mpSubEdit->GrabFocus();
+ if ( !mpImplLB->GetEntryList()->GetMRUCount() )
+ ImplUpdateFloatSelection();
+ else
+ mpImplLB->SelectEntry( 0 , sal_True );
+ ImplCallEventListeners( VCLEVENT_DROPDOWN_PRE_OPEN );
+ mpBtn->SetPressed( sal_True );
+ SetSelection( Selection( 0, SELECTION_MAX ) );
+ mpFloatWin->StartFloat( sal_True );
+ ImplCallEventListeners( VCLEVENT_DROPDOWN_OPEN );
+ }
+ }
}
// -----------------------------------------------------------------------
void ComboBox::Select()
{
- ImplCallEventListenersAndHandler( VCLEVENT_COMBOBOX_SELECT, maSelectHdl,
this );
+ ImplCallEventListenersAndHandler( VCLEVENT_COMBOBOX_SELECT,
maSelectHdl, this );
}
// -----------------------------------------------------------------------
void ComboBox::DoubleClick()
{
- ImplCallEventListenersAndHandler( VCLEVENT_COMBOBOX_DOUBLECLICK,
maDoubleClickHdl, this );
+ ImplCallEventListenersAndHandler( VCLEVENT_COMBOBOX_DOUBLECLICK,
maDoubleClickHdl, this );
}
// -----------------------------------------------------------------------
@@ -555,14 +553,14 @@ void ComboBox::EnableAutoSize( sal_Bool bAuto )
if ( mpFloatWin )
{
if ( bAuto && !mpFloatWin->GetDropDownLineCount() )
- {
- // Adapt to GetListBoxMaximumLineCount here; was on fixed number
of five before
- AdaptDropDownLineCountToMaximum();
- }
+ {
+ // Adapt to GetListBoxMaximumLineCount here; was on
fixed number of five before
+ AdaptDropDownLineCountToMaximum();
+ }
else if ( !bAuto )
- {
+ {
mpFloatWin->SetDropDownLineCount( 0 );
- }
+ }
}
}
@@ -570,15 +568,15 @@ void ComboBox::EnableAutoSize( sal_Bool bAuto )
void ComboBox::EnableDDAutoWidth( sal_Bool b )
{
- if ( mpFloatWin )
- mpFloatWin->SetAutoWidth( b );
+ if ( mpFloatWin )
+ mpFloatWin->SetAutoWidth( b );
}
// -----------------------------------------------------------------------
sal_Bool ComboBox::IsDDAutoWidthEnabled() const
{
- return mpFloatWin ? mpFloatWin->IsAutoWidth() : sal_False;
+ return mpFloatWin ? mpFloatWin->IsAutoWidth() : sal_False;
}
@@ -594,8 +592,8 @@ void ComboBox::SetDropDownLineCount( sal_uInt16 nLines )
void ComboBox::AdaptDropDownLineCountToMaximum()
{
- // adapt to maximum allowed number
- SetDropDownLineCount(std::min(GetEntryCount(),
GetSettings().GetStyleSettings().GetListBoxMaximumLineCount()));
+ // adapt to maximum allowed number
+ SetDropDownLineCount(std::min(GetEntryCount(),
GetSettings().GetStyleSettings().GetListBoxMaximumLineCount()));
}
// -----------------------------------------------------------------------
@@ -633,7 +631,7 @@ void ComboBox::SetPosSizePixel( long nX, long nY, long
nWidth, long nHeight,
void ComboBox::Resize()
{
- Control::Resize();
+ Control::Resize();
Size aOutSz = GetOutputSizePixel();
if( IsDropDownBox() )
@@ -642,46 +640,46 @@ void ComboBox::Resize()
long nTop = 0;
long nBottom = aOutSz.Height();
- Window *pBorder = GetWindow( WINDOW_BORDER );
+ Window *pBorder = GetWindow( WINDOW_BORDER );
ImplControlValue aControlValue;
Point aPoint;
Rectangle aContent, aBound;
- // use the full extent of the control
+ // use the full extent of the control
Rectangle aArea( aPoint, pBorder->GetOutputSizePixel() );
if ( GetNativeControlRegion(CTRL_COMBOBOX, PART_BUTTON_DOWN,
aArea, 0, aControlValue, rtl::OUString(),
aBound, aContent) )
{
- // convert back from border space to local coordinates
- aPoint = pBorder->ScreenToOutputPixel( OutputToScreenPixel( aPoint
) );
- aContent.Move(-aPoint.X(), -aPoint.Y());
-
- mpBtn->SetPosSizePixel( aContent.Left(), nTop,
aContent.getWidth(), (nBottom-nTop) );
-
- // adjust the size of the edit field
- if ( GetNativeControlRegion(CTRL_COMBOBOX, PART_SUB_EDIT,
- aArea, 0, aControlValue, rtl::OUString(), aBound,
aContent) )
- {
- // convert back from border space to local coordinates
- aContent.Move(-aPoint.X(), -aPoint.Y());
-
- // use the themes drop down size
- mpSubEdit->SetPosSizePixel( aContent.TopLeft(),
aContent.GetSize() );
- }
- else
- {
- // use the themes drop down size for the button
- aOutSz.Width() -= aContent.getWidth();
- mpSubEdit->SetSizePixel( aOutSz );
- }
+ // convert back from border space to local coordinates
+ aPoint = pBorder->ScreenToOutputPixel(
OutputToScreenPixel( aPoint ) );
+ aContent.Move(-aPoint.X(), -aPoint.Y());
+
+ mpBtn->SetPosSizePixel( aContent.Left(), nTop,
aContent.getWidth(), (nBottom-nTop) );
+
+ // adjust the size of the edit field
+ if ( GetNativeControlRegion(CTRL_COMBOBOX,
PART_SUB_EDIT,
+ aArea, 0, aControlValue,
rtl::OUString(), aBound, aContent) )
+ {
+ // convert back from border space to local
coordinates
+ aContent.Move(-aPoint.X(), -aPoint.Y());
+
+ // use the themes drop down size
+ mpSubEdit->SetPosSizePixel( aContent.TopLeft(),
aContent.GetSize() );
+ }
+ else
+ {
+ // use the themes drop down size for the button
+ aOutSz.Width() -= aContent.getWidth();
+ mpSubEdit->SetSizePixel( aOutSz );
+ }
}
else
- {
- nSBWidth = CalcZoom( nSBWidth );
- mpSubEdit->SetPosSizePixel( Point( 0, 0 ), Size(
aOutSz.Width() - nSBWidth, aOutSz.Height() ) );
- mpBtn->SetPosSizePixel( aOutSz.Width() - nSBWidth, nTop,
nSBWidth, (nBottom-nTop) );
- }
+ {
+ nSBWidth = CalcZoom( nSBWidth );
+ mpSubEdit->SetPosSizePixel( Point( 0, 0 ), Size(
aOutSz.Width() - nSBWidth, aOutSz.Height() ) );
+ mpBtn->SetPosSizePixel( aOutSz.Width() - nSBWidth,
nTop, nSBWidth, (nBottom-nTop) );
+ }
}
else
{
@@ -701,24 +699,24 @@ void ComboBox::Resize()
void ComboBox::FillLayoutData() const
{
- mpControlData->mpLayoutData = new vcl::ControlLayoutData();
- AppendLayoutData( *mpSubEdit );
- mpSubEdit->SetLayoutDataParent( this );
- Control* pMainWindow = mpImplLB->GetMainWindow();
- if( mpFloatWin )
- {
- // dropdown mode
- if( mpFloatWin->IsReallyVisible() )
- {
- AppendLayoutData( *pMainWindow );
- pMainWindow->SetLayoutDataParent( this );
- }
- }
- else
- {
- AppendLayoutData( *pMainWindow );
- pMainWindow->SetLayoutDataParent( this );
- }
+ mpControlData->mpLayoutData = new vcl::ControlLayoutData();
+ AppendLayoutData( *mpSubEdit );
+ mpSubEdit->SetLayoutDataParent( this );
+ Control* pMainWindow = mpImplLB->GetMainWindow();
+ if( mpFloatWin )
+ {
+ // dropdown mode
+ if( mpFloatWin->IsReallyVisible() )
+ {
+ AppendLayoutData( *pMainWindow );
+ pMainWindow->SetLayoutDataParent( this );
+ }
+ }
+ else
+ {
+ AppendLayoutData( *pMainWindow );
+ pMainWindow->SetLayoutDataParent( this );
+ }
}
// -----------------------------------------------------------------------
@@ -774,17 +772,17 @@ void ComboBox::StateChanged( StateChangedType nType )
SetStyle( ImplInitStyle( GetStyle() ) );
mpImplLB->GetMainWindow()->EnableSort( ( GetStyle() & WB_SORT )
? sal_True : sal_False );
}
- else if( nType == STATE_CHANGE_MIRRORING )
- {
- if( mpBtn )
- {
- mpBtn->EnableRTL( IsRTLEnabled() );
- ImplInitDropDownButton( mpBtn );
- }
- mpSubEdit->StateChanged( STATE_CHANGE_MIRRORING );
- mpImplLB->EnableRTL( IsRTLEnabled() );
- Resize();
- }
+ else if( nType == STATE_CHANGE_MIRRORING )
+ {
+ if( mpBtn )
+ {
+ mpBtn->EnableRTL( IsRTLEnabled() );
+ ImplInitDropDownButton( mpBtn );
+ }
+ mpSubEdit->StateChanged( STATE_CHANGE_MIRRORING );
+ mpImplLB->EnableRTL( IsRTLEnabled() );
+ Resize();
+ }
}
// -----------------------------------------------------------------------
@@ -804,8 +802,8 @@ void ComboBox::DataChanged( const DataChangedEvent& rDCEvt )
ImplInitDropDownButton( mpBtn );
}
Resize();
- mpImplLB->Resize(); // Wird nicht durch ComboBox::Resize()
gerufen, wenn sich die ImplLB nicht aendert.
- SetBackground(); // due to a hack in Window::UpdateSettings the
background must be reset
+ mpImplLB->Resize(); // Wird nicht durch ComboBox::Resize()
gerufen, wenn sich die ImplLB nicht ändert.
+ SetBackground(); // due to a hack in Window::UpdateSettings
the background must be reset
// otherwise it will overpaint NWF drawn comboboxes
}
}
@@ -838,13 +836,13 @@ long ComboBox::Notify( NotifyEvent& rNEvt )
ImplUpdateFloatSelection();
if( ( nKeyCode == KEY_DOWN ) && mpFloatWin &&
!mpFloatWin->IsInPopupMode() && aKeyEvt.GetKeyCode().IsMod2() )
{
- ImplCallEventListeners( VCLEVENT_DROPDOWN_PRE_OPEN );
+ ImplCallEventListeners(
VCLEVENT_DROPDOWN_PRE_OPEN );
mpBtn->SetPressed( sal_True );
if (
mpImplLB->GetEntryList()->GetMRUCount() )
mpImplLB->SelectEntry( 0 ,
sal_True );
- SetSelection( Selection( 0, SELECTION_MAX ) );
+ SetSelection( Selection( 0,
SELECTION_MAX ) );
mpFloatWin->StartFloat( sal_False );
- ImplCallEventListeners( VCLEVENT_DROPDOWN_OPEN );
+ ImplCallEventListeners(
VCLEVENT_DROPDOWN_OPEN );
nDone = 1;
}
else if( ( nKeyCode == KEY_UP ) && mpFloatWin
&& mpFloatWin->IsInPopupMode() && aKeyEvt.GetKeyCode().IsMod2() )
@@ -853,9 +851,9 @@ long ComboBox::Notify( NotifyEvent& rNEvt )
nDone = 1;
}
else
- {
+ {
nDone = mpImplLB->ProcessKeyInput(
aKeyEvt );
- }
+ }
}
break;
@@ -881,21 +879,21 @@ long ComboBox::Notify( NotifyEvent& rNEvt )
(rNEvt.GetCommandEvent()->GetCommand() ==
COMMAND_WHEEL) &&
(rNEvt.GetWindow() == mpSubEdit) )
{
- sal_uInt16 nWheelBehavior(
GetSettings().GetMouseSettings().GetWheelBehavior() );
- if ( ( nWheelBehavior == MOUSE_WHEEL_ALWAYS )
- || ( ( nWheelBehavior == MOUSE_WHEEL_FOCUS_ONLY )
- && HasChildPathFocus()
- )
- )
- {
- nDone = mpImplLB->HandleWheelAsCursorTravel(
*rNEvt.GetCommandEvent() );
- }
- else
- {
- nDone = 0; // don't eat this event, let the default handling
happen (i.e. scroll the context)
- }
+ sal_uInt16 nWheelBehavior(
GetSettings().GetMouseSettings().GetWheelBehavior() );
+ if ( ( nWheelBehavior == MOUSE_WHEEL_ALWAYS )
+ || ( ( nWheelBehavior == MOUSE_WHEEL_FOCUS_ONLY )
+ && HasChildPathFocus()
+ )
+ )
+ {
+ nDone = mpImplLB->HandleWheelAsCursorTravel(
*rNEvt.GetCommandEvent() );
+ }
+ else
+ {
+ nDone = 0; // don't eat this event, let the default
handling happen (i.e. scroll the context)
+ }
}
- else if( ( rNEvt.GetType() == EVENT_MOUSEBUTTONDOWN ) && (
rNEvt.GetWindow() == mpImplLB->GetMainWindow() ) )
+ else if( ( rNEvt.GetType() == EVENT_MOUSEBUTTONDOWN ) && (
rNEvt.GetWindow() == mpImplLB->GetMainWindow() ) )
{
mpSubEdit->GrabFocus();
}
@@ -907,7 +905,7 @@ long ComboBox::Notify( NotifyEvent& rNEvt )
void ComboBox::SetText( const XubString& rStr )
{
- ImplCallEventListeners( VCLEVENT_COMBOBOX_SETTEXT );
+ ImplCallEventListeners( VCLEVENT_COMBOBOX_SETTEXT );
Edit::SetText( rStr );
ImplUpdateFloatSelection();
@@ -917,7 +915,7 @@ void ComboBox::SetText( const XubString& rStr )
void ComboBox::SetText( const XubString& rStr, const Selection& rNewSelection )
{
- ImplCallEventListeners( VCLEVENT_COMBOBOX_SETTEXT );
+ ImplCallEventListeners( VCLEVENT_COMBOBOX_SETTEXT );
Edit::SetText( rStr, rNewSelection );
ImplUpdateFloatSelection();
@@ -990,7 +988,7 @@ sal_uInt16 ComboBox::InsertEntry( const XubString& rStr,
sal_uInt16 nPos )
{
sal_uInt16 nRealPos = mpImplLB->InsertEntry( nPos +
mpImplLB->GetEntryList()->GetMRUCount(), rStr );
nRealPos = sal::static_int_cast<sal_uInt16>(nRealPos -
mpImplLB->GetEntryList()->GetMRUCount());
- CallEventListeners( VCLEVENT_COMBOBOX_ITEMADDED, (void*)
sal_IntPtr(nRealPos) );
+ CallEventListeners( VCLEVENT_COMBOBOX_ITEMADDED, (void*)
sal_IntPtr(nRealPos) );
return nRealPos;
}
@@ -1000,7 +998,7 @@ sal_uInt16 ComboBox::InsertEntry( const XubString& rStr,
const Image& rImage, sa
{
sal_uInt16 nRealPos = mpImplLB->InsertEntry( nPos +
mpImplLB->GetEntryList()->GetMRUCount(), rStr, rImage );
nRealPos = sal::static_int_cast<sal_uInt16>(nRealPos -
mpImplLB->GetEntryList()->GetMRUCount());
- CallEventListeners( VCLEVENT_COMBOBOX_ITEMADDED, (void*)
sal_IntPtr(nRealPos) );
+ CallEventListeners( VCLEVENT_COMBOBOX_ITEMADDED, (void*)
sal_IntPtr(nRealPos) );
return nRealPos;
}
@@ -1016,7 +1014,7 @@ void ComboBox::RemoveEntry( const XubString& rStr )
void ComboBox::RemoveEntry( sal_uInt16 nPos )
{
mpImplLB->RemoveEntry( nPos + mpImplLB->GetEntryList()->GetMRUCount() );
- CallEventListeners( VCLEVENT_COMBOBOX_ITEMREMOVED, (void*)
sal_IntPtr(nPos) );
+ CallEventListeners( VCLEVENT_COMBOBOX_ITEMREMOVED, (void*)
sal_IntPtr(nPos) );
}
// -----------------------------------------------------------------------
@@ -1024,15 +1022,15 @@ void ComboBox::RemoveEntry( sal_uInt16 nPos )
void ComboBox::Clear()
{
mpImplLB->Clear();
- CallEventListeners( VCLEVENT_COMBOBOX_ITEMREMOVED, (void*) sal_IntPtr(-1)
);
+ CallEventListeners( VCLEVENT_COMBOBOX_ITEMREMOVED, (void*)
sal_IntPtr(-1) );
}
// -----------------------------------------------------------------------
Image ComboBox::GetEntryImage( sal_uInt16 nPos ) const
{
- if ( mpImplLB->GetEntryList()->HasEntryImage( nPos ) )
- return mpImplLB->GetEntryList()->GetEntryImage( nPos );
- return Image();
+ if ( mpImplLB->GetEntryList()->HasEntryImage( nPos ) )
+ return mpImplLB->GetEntryList()->GetEntryImage( nPos );
+ return Image();
}
// -----------------------------------------------------------------------
@@ -1109,12 +1107,12 @@ long ComboBox::CalcWindowSizePixel( sal_uInt16 nLines )
const
Size ComboBox::GetOptimalSize(WindowSizeType eType) const
{
- switch (eType) {
- case WINDOWSIZE_MINIMUM:
- return CalcMinimumSize();
- default:
- return Edit::GetOptimalSize( eType );
- }
+ switch (eType) {
+ case WINDOWSIZE_MINIMUM:
+ return CalcMinimumSize();
+ default:
+ return Edit::GetOptimalSize( eType );
+ }
}
// -----------------------------------------------------------------------
@@ -1173,7 +1171,7 @@ Size ComboBox::CalcSize( sal_uInt16 nColumns, sal_uInt16
nLines ) const
Size aMinSz = CalcMinimumSize();
Size aSz;
- // Hoehe
+ // Höhe
if ( nLines )
{
if ( !IsDropDownBox() )
@@ -1251,7 +1249,7 @@ void ComboBox::Draw( OutputDevice* pDev, const Point&
rPos, const Size& rSize, s
// aRect.Top() += nEditHeight;
if ( bBorder )
{
- ImplDrawFrame( pDev, aRect );
+ ImplDrawFrame( pDev, aRect );
}
if ( bBackground )
{
@@ -1263,21 +1261,21 @@ void ComboBox::Draw( OutputDevice* pDev, const Point&
rPos, const Size& rSize, s
// Inhalt
if ( !IsDropDownBox() )
{
- long nOnePixel = GetDrawPixel( pDev, 1 );
+ long nOnePixel = GetDrawPixel( pDev, 1 );
long nTextHeight = pDev->GetTextHeight();
long nEditHeight = nTextHeight + 6*nOnePixel;
- sal_uInt16 nTextStyle = TEXT_DRAW_VCENTER;
+ sal_uInt16 nTextStyle = TEXT_DRAW_VCENTER;
// First, draw the edit part
- mpSubEdit->Draw( pDev, aPos, Size( aSize.Width(), nEditHeight ),
nFlags );
+ mpSubEdit->Draw( pDev, aPos, Size( aSize.Width(), nEditHeight
), nFlags );
- // Second, draw the listbox
- if ( GetStyle() & WB_CENTER )
- nTextStyle |= TEXT_DRAW_CENTER;
- else if ( GetStyle() & WB_RIGHT )
- nTextStyle |= TEXT_DRAW_RIGHT;
- else
- nTextStyle |= TEXT_DRAW_LEFT;
+ // Second, draw the listbox
+ if ( GetStyle() & WB_CENTER )
+ nTextStyle |= TEXT_DRAW_CENTER;
+ else if ( GetStyle() & WB_RIGHT )
+ nTextStyle |= TEXT_DRAW_RIGHT;
+ else
+ nTextStyle |= TEXT_DRAW_LEFT;
if ( ( nFlags & WINDOW_DRAW_MONO ) || ( eOutDevType ==
OUTDEV_PRINTER ) )
{
@@ -1303,25 +1301,25 @@ void ComboBox::Draw( OutputDevice* pDev, const Point&
rPos, const Size& rSize, s
nLines = 1;
sal_uInt16 nTEntry = IsReallyVisible() ?
mpImplLB->GetTopEntry() : 0;
- Rectangle aTextRect( aPos, aSize );
+ Rectangle aTextRect( aPos, aSize );
- aTextRect.Left() += 3*nOnePixel;
- aTextRect.Right() -= 3*nOnePixel;
- aTextRect.Top() += nEditHeight + nOnePixel;
- aTextRect.Bottom() = aTextRect.Top() + nTextHeight;
+ aTextRect.Left() += 3*nOnePixel;
+ aTextRect.Right() -= 3*nOnePixel;
+ aTextRect.Top() += nEditHeight + nOnePixel;
+ aTextRect.Bottom() = aTextRect.Top() + nTextHeight;
- // the drawing starts here
- for ( sal_uInt16 n = 0; n < nLines; n++ )
- {
+ // the drawing starts here
+ for ( sal_uInt16 n = 0; n < nLines; n++ )
+ {
pDev->DrawText( aTextRect,
mpImplLB->GetEntryList()->GetEntryText( n+nTEntry ), nTextStyle );
- aTextRect.Top() += nTextHeight;
- aTextRect.Bottom() += nTextHeight;
- }
+ aTextRect.Top() += nTextHeight;
+ aTextRect.Bottom() += nTextHeight;
+ }
}
pDev->Pop();
- // Call Edit::Draw after restoring the MapMode...
+ // Call Edit::Draw after restoring the MapMode...
if ( IsDropDownBox() )
{
mpSubEdit->Draw( pDev, rPos, rSize, nFlags );
@@ -1437,7 +1435,7 @@ sal_uInt16 ComboBox::GetMRUCount() const
sal_uInt16 ComboBox::GetDisplayLineCount() const
{
- return mpImplLB->GetDisplayLineCount();
+ return mpImplLB->GetDisplayLineCount();
}
// -----------------------------------------------------------------------
@@ -1482,44 +1480,44 @@ sal_uInt16 ComboBox::GetTopEntry() const
void ComboBox::SetProminentEntryType( ProminentEntry eType )
{
- mpImplLB->SetProminentEntryType( eType );
+ mpImplLB->SetProminentEntryType( eType );
}
// -----------------------------------------------------------------------
ProminentEntry ComboBox::GetProminentEntryType() const
{
- return mpImplLB->GetProminentEntryType();
+ return mpImplLB->GetProminentEntryType();
}
// -----------------------------------------------------------------------
Rectangle ComboBox::GetDropDownPosSizePixel() const
{
- return mpFloatWin ? mpFloatWin->GetWindowExtentsRelative(
const_cast<ComboBox*>(this) ) : Rectangle();
+ return mpFloatWin ? mpFloatWin->GetWindowExtentsRelative(
const_cast<ComboBox*>(this) ) : Rectangle();
}
// -----------------------------------------------------------------------
Rectangle ComboBox::GetListPosSizePixel() const
{
- return mpFloatWin ? Rectangle() :
mpImplLB->GetMainWindow()->GetWindowExtentsRelative(
const_cast<ComboBox*>(this) );
+ return mpFloatWin ? Rectangle() :
mpImplLB->GetMainWindow()->GetWindowExtentsRelative(
const_cast<ComboBox*>(this) );
}
// -----------------------------------------------------------------------
const Wallpaper& ComboBox::GetDisplayBackground() const
{
- if( ! mpSubEdit->IsBackground() )
- return Control::GetDisplayBackground();
+ if( ! mpSubEdit->IsBackground() )
+ return Control::GetDisplayBackground();
- const Wallpaper& rBack = mpSubEdit->GetBackground();
- if( ! rBack.IsBitmap() &&
- ! rBack.IsGradient() &&
- rBack.GetColor().GetColor() == COL_TRANSPARENT
- )
- return Control::GetDisplayBackground();
- return rBack;
+ const Wallpaper& rBack = mpSubEdit->GetBackground();
+ if( ! rBack.IsBitmap() &&
+ ! rBack.IsGradient() &&
+ rBack.GetColor().GetColor() == COL_TRANSPARENT
+ )
+ return Control::GetDisplayBackground();
+ return rBack;
}
//
-----------------------------------------------------------------------------
sal_uInt16 ComboBox::GetSelectEntryCount() const
@@ -1558,10 +1556,10 @@ void ComboBox::SetNoSelection()
//
-----------------------------------------------------------------------------
Rectangle ComboBox::GetBoundingRectangle( sal_uInt16 nItem ) const
{
- Rectangle aRect = mpImplLB->GetMainWindow()->GetBoundingRectangle( nItem );
- Rectangle aOffset = mpImplLB->GetMainWindow()->GetWindowExtentsRelative(
(Window*)this );
- aRect.Move( aOffset.TopLeft().X(), aOffset.TopLeft().Y() );
- return aRect;
+ Rectangle aRect = mpImplLB->GetMainWindow()->GetBoundingRectangle(
nItem );
+ Rectangle aOffset =
mpImplLB->GetMainWindow()->GetWindowExtentsRelative( (Window*)this );
+ aRect.Move( aOffset.TopLeft().X(), aOffset.TopLeft().Y() );
+ return aRect;
}
//
-----------------------------------------------------------------------------
@@ -1578,34 +1576,36 @@ void ComboBox::SetBorderStyle( sal_uInt16 nBorderStyle )
long ComboBox::GetIndexForPoint( const Point& rPoint, sal_uInt16& rPos ) const
{
- if( !HasLayoutData() )
- FillLayoutData();
-
- // check whether rPoint fits at all
- long nIndex = Control::GetIndexForPoint( rPoint );
- if( nIndex != -1 )
- {
- // point must be either in main list window
- // or in impl window (dropdown case)
- ImplListBoxWindow* pMain = mpImplLB->GetMainWindow();
-
- // convert coordinates to ImplListBoxWindow pixel coordinate space
- Point aConvPoint = LogicToPixel( rPoint );
- aConvPoint = OutputToAbsoluteScreenPixel( aConvPoint );
- aConvPoint = pMain->AbsoluteScreenToOutputPixel( aConvPoint );
- aConvPoint = pMain->PixelToLogic( aConvPoint );
-
- // try to find entry
- sal_uInt16 nEntry = pMain->GetEntryPosForPoint( aConvPoint );
- if( nEntry == LISTBOX_ENTRY_NOTFOUND )
- nIndex = -1;
- else
- rPos = nEntry;
- }
-
- // get line relative index
- if( nIndex != -1 )
- nIndex = ToRelativeLineIndex( nIndex );
-
- return nIndex;
+ if( !HasLayoutData() )
+ FillLayoutData();
+
+ // check whether rPoint fits at all
+ long nIndex = Control::GetIndexForPoint( rPoint );
+ if( nIndex != -1 )
+ {
+ // point must be either in main list window
+ // or in impl window (dropdown case)
+ ImplListBoxWindow* pMain = mpImplLB->GetMainWindow();
+
+ // convert coordinates to ImplListBoxWindow pixel coordinate
space
+ Point aConvPoint = LogicToPixel( rPoint );
+ aConvPoint = OutputToAbsoluteScreenPixel( aConvPoint );
+ aConvPoint = pMain->AbsoluteScreenToOutputPixel( aConvPoint );
+ aConvPoint = pMain->PixelToLogic( aConvPoint );
+
+ // try to find entry
+ sal_uInt16 nEntry = pMain->GetEntryPosForPoint( aConvPoint );
+ if( nEntry == LISTBOX_ENTRY_NOTFOUND )
+ nIndex = -1;
+ else
+ rPos = nEntry;
+ }
+
+ // get line relative index
+ if( nIndex != -1 )
+ nIndex = ToRelativeLineIndex( nIndex );
+
+ return nIndex;
}
+
+/* vim: set noet sw=4 ts=4: */
diff --git a/main/vcl/source/control/morebtn.cxx
b/main/vcl/source/control/morebtn.cxx
index ccb2bbf852..653ad6dae7 100644
--- a/main/vcl/source/control/morebtn.cxx
+++ b/main/vcl/source/control/morebtn.cxx
@@ -27,7 +27,6 @@
#include <tools/rc.h>
#endif
-
// =======================================================================
DECLARE_LIST( ImplMoreWindowList, Window* )
@@ -124,7 +123,7 @@ void MoreButton::ImplLoadRes( const ResId& rResId )
if ( nObjMask & RSC_MOREBUTTON_MAPUNIT )
meUnit = (MapUnit)ReadLongRes();
if ( nObjMask & RSC_MOREBUTTON_DELTA )
- // Groesse fuer Erweitern des Dialogs
+ // Größe für Erweitern des Dialogs
mnDelta = ReadShortRes();
}
@@ -146,7 +145,7 @@ void MoreButton::Click()
Window* pWindow = (mpMBData->mpItemList) ?
mpMBData->mpItemList->First() : NULL;
long nDeltaPixel = LogicToPixel( Size( 0, mnDelta ), meUnit
).Height();
- // Status aendern
+ // Status ändern
mbState = !mbState;
ShowState();
diff --git a/main/vcl/source/control/slider.cxx
b/main/vcl/source/control/slider.cxx
index 5e7dbc6e7d..cb53e34180 100644
--- a/main/vcl/source/control/slider.cxx
+++ b/main/vcl/source/control/slider.cxx
@@ -19,8 +19,6 @@
*
*************************************************************/
-
-
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_vcl.hxx"
@@ -31,8 +29,6 @@
#include <vcl/decoview.hxx>
#include <vcl/slider.hxx>
-
-
// =======================================================================
static long ImplMulDiv( long nNumber, long nNumerator, long nDenominator )
@@ -69,7 +65,7 @@ void Slider::ImplInit( Window* pParent, WinBits nStyle )
{
mnThumbPixOffset = 0;
mnThumbPixRange = 0;
- mnThumbPixPos = 0; // between mnThumbPixOffset and
mnThumbPixOffset+mnThumbPixRange
+ mnThumbPixPos = 0; // between mnThumbPixOffset and
mnThumbPixOffset+mnThumbPixRange
mnChannelPixOffset = 0;
mnChannelPixRange = 0;
mnChannelPixTop = 0;
@@ -193,14 +189,14 @@ void Slider::ImplUpdateRects( sal_Bool bUpdate )
const Rectangle aControlRegion( Rectangle( Point(0,0),
Size( SLIDER_THUMB_SIZE, 10 ) ) );
Rectangle aThumbBounds, aThumbContent;
- if ( GetNativeControlRegion( CTRL_SLIDER, PART_THUMB_HORZ,
- aControlRegion, 0,
ImplControlValue(), rtl::OUString(),
- aThumbBounds, aThumbContent ) )
- {
- maThumbRect.Left() = mnThumbPixPos - aThumbBounds.GetWidth()/2;
- maThumbRect.Right() = maThumbRect.Left() +
aThumbBounds.GetWidth() - 1;
- bInvalidateAll = true;
- }
+ if ( GetNativeControlRegion( CTRL_SLIDER,
PART_THUMB_HORZ,
+
aControlRegion, 0, ImplControlValue(), rtl::OUString(),
+
aThumbBounds, aThumbContent ) )
+ {
+ maThumbRect.Left() = mnThumbPixPos -
aThumbBounds.GetWidth()/2;
+ maThumbRect.Right() = maThumbRect.Left() +
aThumbBounds.GetWidth() - 1;
+ bInvalidateAll = true;
+ }
}
else
{
@@ -227,14 +223,14 @@ void Slider::ImplUpdateRects( sal_Bool bUpdate )
const Rectangle aControlRegion( Rectangle( Point(0,0),
Size( 10, SLIDER_THUMB_SIZE ) ) );
Rectangle aThumbBounds, aThumbContent;
- if ( GetNativeControlRegion( CTRL_SLIDER, PART_THUMB_VERT,
- aControlRegion, 0,
ImplControlValue(), rtl::OUString(),
- aThumbBounds, aThumbContent ) )
- {
- maThumbRect.Top() = mnThumbPixPos - aThumbBounds.GetHeight()/2;
- maThumbRect.Bottom() = maThumbRect.Top() +
aThumbBounds.GetHeight() - 1;
- bInvalidateAll = true;
- }
+ if ( GetNativeControlRegion( CTRL_SLIDER,
PART_THUMB_VERT,
+
aControlRegion, 0, ImplControlValue(), rtl::OUString(),
+
aThumbBounds, aThumbContent ) )
+ {
+ maThumbRect.Top() = mnThumbPixPos -
aThumbBounds.GetHeight()/2;
+ maThumbRect.Bottom() = maThumbRect.Top() +
aThumbBounds.GetHeight() - 1;
+ bInvalidateAll = true;
+ }
}
}
else
@@ -248,22 +244,22 @@ void Slider::ImplUpdateRects( sal_Bool bUpdate )
{
if ( aOldThumbRect != maThumbRect )
{
- if( bInvalidateAll )
- Invalidate();
- else
- {
- Region aInvalidRegion( aOldThumbRect );
- aInvalidRegion.Union( maThumbRect );
-
- if( !IsBackground() && GetParent() )
- {
- const Point aPos( GetPosPixel() );
- aInvalidRegion.Move( aPos.X(), aPos.Y() );
- GetParent()->Invalidate( aInvalidRegion,
INVALIDATE_TRANSPARENT | INVALIDATE_UPDATE );
- }
- else
- Invalidate( aInvalidRegion );
- }
+ if( bInvalidateAll )
+ Invalidate();
+ else
+ {
+ Region aInvalidRegion( aOldThumbRect );
+ aInvalidRegion.Union( maThumbRect );
+
+ if( !IsBackground() && GetParent() )
+ {
+ const Point aPos( GetPosPixel() );
+ aInvalidRegion.Move( aPos.X(), aPos.Y()
);
+ GetParent()->Invalidate(
aInvalidRegion, INVALIDATE_TRANSPARENT | INVALIDATE_UPDATE );
+ }
+ else
+ Invalidate( aInvalidRegion );
+ }
}
}
}
@@ -381,26 +377,26 @@ void Slider::ImplDraw( sal_uInt16 nDrawFlags )
if ( mbCalcSize )
ImplCalc( sal_False );
- ControlPart nPart = (GetStyle() & WB_HORZ) ? PART_TRACK_HORZ_AREA :
PART_TRACK_VERT_AREA;
- ControlState nState = ( IsEnabled() ? CTRL_STATE_ENABLED : 0 ) | (
HasFocus() ? CTRL_STATE_FOCUSED : 0 );
- SliderValue sldValue;
+ ControlPart nPart = (GetStyle() & WB_HORZ) ? PART_TRACK_HORZ_AREA :
PART_TRACK_VERT_AREA;
+ ControlState nState = ( IsEnabled() ? CTRL_STATE_ENABLED : 0 ) | (
HasFocus() ? CTRL_STATE_FOCUSED : 0 );
+ SliderValue sldValue;
- sldValue.mnMin = mnMinRange;
- sldValue.mnMax = mnMaxRange;
- sldValue.mnCur = mnThumbPos;
- sldValue.maThumbRect = maThumbRect;
+ sldValue.mnMin = mnMinRange;
+ sldValue.mnMax = mnMaxRange;
+ sldValue.mnCur = mnThumbPos;
+ sldValue.maThumbRect = maThumbRect;
- if( IsMouseOver() )
- {
- if( maThumbRect.IsInside( GetPointerPosPixel() ) )
- sldValue.mnThumbState |= CTRL_STATE_ROLLOVER;
- }
+ if( IsMouseOver() )
+ {
+ if( maThumbRect.IsInside( GetPointerPosPixel() ) )
+ sldValue.mnThumbState |= CTRL_STATE_ROLLOVER;
+ }
- const Rectangle aCtrlRegion( Point(0,0), GetOutputSizePixel() );
- bool bNativeOK = DrawNativeControl( CTRL_SLIDER, nPart,
- aCtrlRegion, nState, sldValue,
rtl::OUString() );
- if( bNativeOK )
- return;
+ const Rectangle aCtrlRegion( Point(0,0), GetOutputSizePixel() );
+ bool bNativeOK = DrawNativeControl( CTRL_SLIDER, nPart,
+
aCtrlRegion, nState, sldValue, rtl::OUString() );
+ if( bNativeOK )
+ return;
if ( (nDrawFlags & SLIDER_DRAW_CHANNEL1) && !maChannel1Rect.IsEmpty() )
{
@@ -589,10 +585,10 @@ long Slider::ImplDoAction( sal_Bool bCallEndSlide )
break;
case SCROLL_SET:
- nDelta = ImplSlide( ImplCalcThumbPos(
GetPointerPosPixel().X() ), bCallEndSlide );
- break;
- default:
- break;
+ nDelta = ImplSlide( ImplCalcThumbPos(
GetPointerPosPixel().X() ), bCallEndSlide );
+ break;
+ default:
+ break;
}
return nDelta;
@@ -607,9 +603,9 @@ void Slider::ImplDoMouseAction( const Point& rMousePos,
sal_Bool bCallAction )
switch ( meScrollType )
{
- case( SCROLL_SET ):
- {
- const bool bUp = ImplIsPageUp( rMousePos ), bDown = ImplIsPageDown(
rMousePos );
+ case( SCROLL_SET ):
+ {
+ const bool bUp = ImplIsPageUp( rMousePos ), bDown =
ImplIsPageDown( rMousePos );
if ( bUp || bDown )
{
@@ -619,7 +615,7 @@ void Slider::ImplDoMouseAction( const Point& rMousePos,
sal_Bool bCallAction )
else
mnStateFlags &= ~( SLIDER_STATE_CHANNEL1_DOWN |
SLIDER_STATE_CHANNEL2_DOWN );
break;
- }
+ }
case SCROLL_PAGEUP:
if ( ImplIsPageUp( rMousePos ) )
@@ -640,8 +636,8 @@ void Slider::ImplDoMouseAction( const Point& rMousePos,
sal_Bool bCallAction )
else
mnStateFlags &= ~SLIDER_STATE_CHANNEL2_DOWN;
break;
- default:
- break;
+ default:
+ break;
}
if ( bAction )
@@ -712,24 +708,24 @@ void Slider::MouseButtonDown( const MouseEvent& rMEvt )
}
else if ( ImplIsPageUp( rMousePos ) )
{
- if( GetStyle() & WB_SLIDERSET )
- meScrollType = SCROLL_SET;
- else
- {
- nTrackFlags = STARTTRACK_BUTTONREPEAT;
- meScrollType = SCROLL_PAGEUP;
+ if( GetStyle() & WB_SLIDERSET )
+ meScrollType = SCROLL_SET;
+ else
+ {
+ nTrackFlags = STARTTRACK_BUTTONREPEAT;
+ meScrollType = SCROLL_PAGEUP;
}
mnDragDraw = SLIDER_DRAW_CHANNEL;
}
else if ( ImplIsPageDown( rMousePos ) )
{
- if( GetStyle() & WB_SLIDERSET )
- meScrollType = SCROLL_SET;
- else
- {
- nTrackFlags = STARTTRACK_BUTTONREPEAT;
- meScrollType = SCROLL_PAGEDOWN;
+ if( GetStyle() & WB_SLIDERSET )
+ meScrollType = SCROLL_SET;
+ else
+ {
+ nTrackFlags = STARTTRACK_BUTTONREPEAT;
+ meScrollType = SCROLL_PAGEDOWN;
}
mnDragDraw = SLIDER_DRAW_CHANNEL;
@@ -744,7 +740,7 @@ void Slider::MouseButtonDown( const MouseEvent& rMEvt )
Update();
if( meScrollType != SCROLL_SET )
- StartTracking( nTrackFlags );
+ StartTracking( nTrackFlags );
}
}
}
@@ -753,8 +749,8 @@ void Slider::MouseButtonDown( const MouseEvent& rMEvt )
void Slider::MouseButtonUp( const MouseEvent& )
{
- if( SCROLL_SET == meScrollType )
- {
+ if( SCROLL_SET == meScrollType )
+ {
// Button und PageRect-Status wieder herstellen
const sal_uInt16 nOldStateFlags = mnStateFlags;
@@ -764,9 +760,9 @@ void Slider::MouseButtonUp( const MouseEvent& )
ImplDraw( mnDragDraw );
mnDragDraw = 0;
- ImplDoAction( sal_True );
- meScrollType = SCROLL_DONTKNOW;
- }
+ ImplDoAction( sal_True );
+ meScrollType = SCROLL_DONTKNOW;
+ }
}
// -----------------------------------------------------------------------
@@ -825,7 +821,7 @@ void Slider::Tracking( const TrackingEvent& rTEvt )
nMovePix =
rMousePos.X()-(aCenterPos.X()+mnMouseOff);
else
nMovePix =
rMousePos.Y()-(aCenterPos.Y()+mnMouseOff);
- // Nur wenn sich Maus in die Scrollrichtung bewegt,
muessen
+ // Nur wenn sich Maus in die Scrollrichtung bewegt,
müssen
// wir etwas tun
if ( nMovePix )
{
@@ -852,7 +848,7 @@ void Slider::Tracking( const TrackingEvent& rTEvt )
else
ImplDoMouseAction( rMousePos, rTEvt.IsTrackingRepeat()
);
- // Wenn Slider-Werte so umgesetzt wurden, das es nichts
+ // Wenn Slider-Werte so umgesetzt wurden, dass es nichts
// mehr zum Tracking gibt, dann berechen wir hier ab
if ( !IsVisible() )
EndTracking();
@@ -912,7 +908,7 @@ void Slider::Paint( const Rectangle& )
void Slider::Resize()
{
- Control::Resize();
+ Control::Resize();
mbCalcSize = sal_True;
if ( IsReallyVisible() )
ImplCalc( sal_False );
@@ -1076,3 +1072,5 @@ Size Slider::CalcWindowSizePixel()
}
return aSize;
}
+
+/* vim: set noet sw=4 ts=4: */
diff --git a/main/vcl/source/control/tabctrl.cxx
b/main/vcl/source/control/tabctrl.cxx
index 9defbc8be7..e783afc847 100644
--- a/main/vcl/source/control/tabctrl.cxx
+++ b/main/vcl/source/control/tabctrl.cxx
@@ -33,7 +33,6 @@
#include "vcl/tabpage.hxx"
#include "vcl/tabctrl.hxx"
#include "vcl/controllayout.hxx"
-#include "vcl/sound.hxx"
#include "vcl/lstbox.hxx"
#include "controldata.hxx"
@@ -395,7 +394,7 @@ Rectangle TabControl::ImplGetTabRect( sal_uInt16 nItemPos,
long nWidth, long nHe
aLightFont.SetWeight( WEIGHT_LIGHT );
// If Bold and none Bold strings have the same width, we
- // add in the calculation extra space, so that the tabs
+ // add in the calculation extra space, so that the tab
// looks better. This could be the case on systems without
// an bold UI font and without synthetic bold support
XubString aTestStr( RTL_CONSTASCII_USTRINGPARAM( "Abc." ) );
@@ -434,7 +433,7 @@ Rectangle TabControl::ImplGetTabRect( sal_uInt16 nItemPos,
long nWidth, long nHe
if ( nLines == 99 )
break;
- nX = nOffsetX;
+ nX = nOffsetX;
nY += aSize.Height();
nLines++;
nLineWidthAry[nLines] = 0;
@@ -1708,7 +1707,7 @@ void TabControl::RemovePage( sal_uInt16 nPageId )
// does the item exist?
if ( nPos != TAB_PAGE_NOTFOUND )
{
- //remove page item
+ // remove page item
std::vector< ImplTabItem >::iterator it =
mpTabCtrlData->maItemList.begin() + nPos;
bool bIsCurrentPage = (it->mnId == mnCurPageId);
mpTabCtrlData->maItemList.erase( it );
@@ -1718,7 +1717,7 @@ void TabControl::RemovePage( sal_uInt16 nPageId )
mpTabCtrlData->mpListBox->SetDropDownLineCount(
mpTabCtrlData->mpListBox->GetEntryCount() );
}
- // If current page is removed, than first page gets the current
page
+ // If current page is removed, then first page gets the current
page
if ( bIsCurrentPage )
{
mnCurPageId = 0;
@@ -1892,7 +1891,7 @@ void TabControl::SelectTabPage( sal_uInt16 nPageId )
{
mnActPageId = nPageId;
ActivatePage();
- // Page könnte im Activate-Handler umgeschaltet wurden
sein
+ // Page könnte im Activate-Handler umgeschaltet worden
sein
nPageId = mnActPageId;
mnActPageId = 0;
SetCurPageId( nPageId );