This is an automated email from the ASF dual-hosted git repository.
mseidel pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/openoffice.git
The following commit(s) were added to refs/heads/trunk by this push:
new 013b951efd Cleanup
013b951efd is described below
commit 013b951efd287fdc278c680b1adeb3413cf91cae
Author: mseidel <[email protected]>
AuthorDate: Tue May 27 14:07:39 2025 +0200
Cleanup
---
main/sc/source/ui/view/scextopt.cxx | 90 +--
main/sw/source/ui/uiview/view2.cxx | 116 +--
main/toolkit/source/controls/unocontrol.cxx | 1116 +++++++++++++-------------
main/toolkit/source/layout/vcl/wrapper.cxx | 133 ++-
main/unotools/source/config/startoptions.cxx | 112 +--
5 files changed, 782 insertions(+), 785 deletions(-)
diff --git a/main/sc/source/ui/view/scextopt.cxx
b/main/sc/source/ui/view/scextopt.cxx
index ec1a5c3030..b9d604479f 100644
--- a/main/sc/source/ui/view/scextopt.cxx
+++ b/main/sc/source/ui/view/scextopt.cxx
@@ -1,5 +1,5 @@
/**************************************************************
- *
+ *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
@@ -7,20 +7,18 @@
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
- *
+ *
*************************************************************/
-
-
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sc.hxx"
#include "scextopt.hxx"
@@ -80,7 +78,7 @@ private:
/** Makes a deep copy of all objects in the passed map. */
void CopyFromMap( const ScExtTabSettingsMap& rMap );
- ScExtTabSettingsMap maMap;
+ ScExtTabSettingsMap maMap;
};
// ----------------------------------------------------------------------------
@@ -91,34 +89,34 @@ ScExtTabSettingsCont::ScExtTabSettingsCont()
ScExtTabSettingsCont::ScExtTabSettingsCont( const ScExtTabSettingsCont& rSrc )
{
- CopyFromMap( rSrc.maMap );
+ CopyFromMap( rSrc.maMap );
}
ScExtTabSettingsCont& ScExtTabSettingsCont::operator=( const
ScExtTabSettingsCont& rSrc )
{
- CopyFromMap( rSrc.maMap );
- return *this;
+ CopyFromMap( rSrc.maMap );
+ return *this;
}
const ScExtTabSettings* ScExtTabSettingsCont::GetTabSettings( SCTAB nTab )
const
{
- ScExtTabSettingsMap::const_iterator aIt = maMap.find( nTab );
- return (aIt == maMap.end()) ? 0 : aIt->second.get();
+ ScExtTabSettingsMap::const_iterator aIt = maMap.find( nTab );
+ return (aIt == maMap.end()) ? 0 : aIt->second.get();
}
ScExtTabSettings& ScExtTabSettingsCont::GetOrCreateTabSettings( SCTAB nTab )
{
- ScExtTabSettingsRef& rxTabSett = maMap[ nTab ];
- if( !rxTabSett )
- rxTabSett.reset( new ScExtTabSettings );
- return *rxTabSett;
+ ScExtTabSettingsRef& rxTabSett = maMap[ nTab ];
+ if( !rxTabSett )
+ rxTabSett.reset( new ScExtTabSettings );
+ return *rxTabSett;
}
void ScExtTabSettingsCont::CopyFromMap( const ScExtTabSettingsMap& rMap )
{
- maMap.clear();
- for( ScExtTabSettingsMap::const_iterator aIt = rMap.begin(), aEnd =
rMap.end(); aIt != aEnd; ++aIt )
- maMap[ aIt->first ].reset( new ScExtTabSettings( *aIt->second ) );
+ maMap.clear();
+ for( ScExtTabSettingsMap::const_iterator aIt = rMap.begin(), aEnd =
rMap.end(); aIt != aEnd; ++aIt )
+ maMap[ aIt->first ].reset( new ScExtTabSettings( *aIt->second )
);
}
// ============================================================================
@@ -128,28 +126,28 @@ struct ScExtDocOptionsImpl
{
typedef ::std::vector< String > StringVec;
- ScExtDocSettings maDocSett; /// Global document settings.
- ScExtTabSettingsCont maTabSett; /// Settings for all sheets.
- StringVec maCodeNames; /// Codenames for all sheets (VBA
module names).
- bool mbChanged; /// Use only if something has been
changed.
+ ScExtDocSettings maDocSett; // Global document settings.
+ ScExtTabSettingsCont maTabSett; // Settings for all sheets.
+ StringVec maCodeNames; // Codenames for all sheets (VBA
module names).
+ bool mbChanged; // Use only if something has been
changed.
explicit ScExtDocOptionsImpl();
};
ScExtDocOptionsImpl::ScExtDocOptionsImpl() :
- mbChanged( false )
+ mbChanged( false )
{
}
// ----------------------------------------------------------------------------
ScExtDocOptions::ScExtDocOptions() :
- mxImpl( new ScExtDocOptionsImpl )
+ mxImpl( new ScExtDocOptionsImpl )
{
}
ScExtDocOptions::ScExtDocOptions( const ScExtDocOptions& rSrc ) :
- mxImpl( new ScExtDocOptionsImpl( *rSrc.mxImpl ) )
+ mxImpl( new ScExtDocOptionsImpl( *rSrc.mxImpl ) )
{
}
@@ -159,61 +157,61 @@ ScExtDocOptions::~ScExtDocOptions()
ScExtDocOptions& ScExtDocOptions::operator=( const ScExtDocOptions& rSrc )
{
- *mxImpl = *rSrc.mxImpl;
- return *this;
+ *mxImpl = *rSrc.mxImpl;
+ return *this;
}
bool ScExtDocOptions::IsChanged() const
{
- return mxImpl->mbChanged;
+ return mxImpl->mbChanged;
}
void ScExtDocOptions::SetChanged( bool bChanged )
{
- mxImpl->mbChanged = bChanged;
+ mxImpl->mbChanged = bChanged;
}
const ScExtDocSettings& ScExtDocOptions::GetDocSettings() const
{
- return mxImpl->maDocSett;
+ return mxImpl->maDocSett;
}
ScExtDocSettings& ScExtDocOptions::GetDocSettings()
{
- return mxImpl->maDocSett;
+ return mxImpl->maDocSett;
}
const ScExtTabSettings* ScExtDocOptions::GetTabSettings( SCTAB nTab ) const
{
- return mxImpl->maTabSett.GetTabSettings( nTab );
+ return mxImpl->maTabSett.GetTabSettings( nTab );
}
ScExtTabSettings& ScExtDocOptions::GetOrCreateTabSettings( SCTAB nTab )
{
- return mxImpl->maTabSett.GetOrCreateTabSettings( nTab );
+ return mxImpl->maTabSett.GetOrCreateTabSettings( nTab );
}
SCTAB ScExtDocOptions::GetCodeNameCount() const
{
- return static_cast< SCTAB >( mxImpl->maCodeNames.size() );
+ return static_cast< SCTAB >( mxImpl->maCodeNames.size() );
}
const String& ScExtDocOptions::GetCodeName( SCTAB nTab ) const
{
- DBG_ASSERT( (0 <= nTab) && (nTab < GetCodeNameCount()),
"ScExtDocOptions::GetCodeName - invalid sheet index" );
- return ((0 <= nTab) && (nTab < GetCodeNameCount())) ? mxImpl->maCodeNames[
static_cast< size_t >( nTab ) ] : EMPTY_STRING;
+ DBG_ASSERT( (0 <= nTab) && (nTab < GetCodeNameCount()),
"ScExtDocOptions::GetCodeName - invalid sheet index" );
+ return ((0 <= nTab) && (nTab < GetCodeNameCount())) ?
mxImpl->maCodeNames[ static_cast< size_t >( nTab ) ] : EMPTY_STRING;
}
void ScExtDocOptions::SetCodeName( SCTAB nTab, const String& rCodeName )
{
- DBG_ASSERT( nTab >= 0, "ScExtDocOptions::SetCodeName - invalid sheet
index" );
- if( nTab >= 0 )
- {
- size_t nIndex = static_cast< size_t >( nTab );
- if( nIndex >= mxImpl->maCodeNames.size() )
- mxImpl->maCodeNames.resize( nIndex + 1 );
- mxImpl->maCodeNames[ nIndex ] = rCodeName;
- }
+ DBG_ASSERT( nTab >= 0, "ScExtDocOptions::SetCodeName - invalid sheet
index" );
+ if( nTab >= 0 )
+ {
+ size_t nIndex = static_cast< size_t >( nTab );
+ if( nIndex >= mxImpl->maCodeNames.size() )
+ mxImpl->maCodeNames.resize( nIndex + 1 );
+ mxImpl->maCodeNames[ nIndex ] = rCodeName;
+ }
}
-// ============================================================================
+/* vim: set noet sw=4 ts=4: */
diff --git a/main/sw/source/ui/uiview/view2.cxx
b/main/sw/source/ui/uiview/view2.cxx
index 6999d1a350..48227a142c 100644
--- a/main/sw/source/ui/uiview/view2.cxx
+++ b/main/sw/source/ui/uiview/view2.cxx
@@ -383,8 +383,8 @@ sal_Bool SwView::InsertGraphicDlg( SfxRequest& rReq )
rReq.AppendItem( SfxBoolItem( FN_PARAM_1, bAsLink ) );
}
- SFX_REQUEST_ARG( rReq, pAsLink, SfxBoolItem, FN_PARAM_1 , sal_False );
- SFX_REQUEST_ARG( rReq, pStyle, SfxStringItem, FN_PARAM_2 , sal_False );
+ SFX_REQUEST_ARG( rReq, pAsLink, SfxBoolItem, FN_PARAM_1 ,
sal_False );
+ SFX_REQUEST_ARG( rReq, pStyle, SfxStringItem, FN_PARAM_2 ,
sal_False );
sal_Bool bAsLink = sal_False;
if( nHtmlMode & HTMLMODE_ON )
@@ -415,31 +415,31 @@ sal_Bool SwView::InsertGraphicDlg( SfxRequest& rReq )
}
}
- SwWrtShell& rSh = GetWrtShell();
- rSh.LockPaint();
- rSh.StartAction();
+ SwWrtShell& rSh = GetWrtShell();
+ rSh.LockPaint();
+ rSh.StartAction();
- /// #111827#
- SwRewriter aRewriter;
- aRewriter.AddRule(UNDO_ARG1, String(SW_RES(STR_GRAPHIC_DEFNAME)));
+ // #111827#
+ SwRewriter aRewriter;
+ aRewriter.AddRule(UNDO_ARG1,
String(SW_RES(STR_GRAPHIC_DEFNAME)));
- // #123922# determine if we really want to insert or replace the
graphic at a selected object
- const bool bReplaceMode(rSh.HasSelection() && nsSelectionType::SEL_FRM
== rSh.GetSelectionType());
+ // #123922# determine if we really want to insert or replace
the graphic at a selected object
+ const bool bReplaceMode(rSh.HasSelection() &&
nsSelectionType::SEL_FRM == rSh.GetSelectionType());
- rSh.StartUndo(UNDO_INSERT, &aRewriter);
+ rSh.StartUndo(UNDO_INSERT, &aRewriter);
- int nError = InsertGraphic( aFileName, aFilterName, bAsLink,
GraphicFilter::GetGraphicFilter() );
+ int nError = InsertGraphic( aFileName, aFilterName, bAsLink,
GraphicFilter::GetGraphicFilter() );
- // Format ist ungleich Current Filter, jetzt mit auto. detection
- if( nError == GRFILTER_FORMATERROR )
- nError = InsertGraphic( aFileName, aEmptyStr, bAsLink,
GraphicFilter::GetGraphicFilter() );
+ // Format ist ungleich Current Filter, jetzt mit auto. detection
+ if( nError == GRFILTER_FORMATERROR )
+ nError = InsertGraphic( aFileName, aEmptyStr, bAsLink,
GraphicFilter::GetGraphicFilter() );
- // #123922# no new FrameFormat for replace mode, only when new object
was created,
- // else this would reset the current setting for the frame holding the
graphic
- if ( !bReplaceMode && rSh.IsFrmSelected() )
- {
- SwFrmFmt* pFmt = pDoc->FindFrmFmtByName( sGraphicFormat );
- if(!pFmt)
+ // #123922# no new FrameFormat for replace mode, only when new
object was created,
+ // else this would reset the current setting for the frame
holding the graphic
+ if ( !bReplaceMode && rSh.IsFrmSelected() )
+ {
+ SwFrmFmt* pFmt = pDoc->FindFrmFmtByName( sGraphicFormat
);
+ if(!pFmt)
pFmt = pDoc->MakeFrmFmt(sGraphicFormat,
pDocShell->GetDoc()->GetDfltFrmFmt(),
sal_True, sal_False);
@@ -486,14 +486,14 @@ sal_Bool SwView::InsertGraphicDlg( SfxRequest& rReq )
bReturn = sal_True;
AutoCaption( GRAPHIC_CAP );
rReq.Done();
- }
+ }
- rSh.EndUndo(); // due to possible change of Shell
- }
+ rSh.EndUndo(); // due to possible change of Shell
+ }
- delete pFileDlg;
+ delete pFileDlg;
- return bReturn;
+ return bReturn;
}
@@ -502,21 +502,21 @@ void __EXPORT SwView::Execute(SfxRequest &rReq)
sal_uInt16 nSlot = rReq.GetSlot();
const SfxItemSet* pArgs = rReq.GetArgs();
const SfxPoolItem* pItem;
- sal_Bool bIgnore = sal_False;
+ sal_Bool bIgnore = sal_False;
switch( nSlot )
{
case SID_CREATE_SW_DRAWVIEW:
- // --> OD 2005-08-08 #i52858# - method name changed
- pWrtShell->getIDocumentDrawModelAccess()->GetOrCreateDrawModel();
- // <--
+ // --> OD 2005-08-08 #i52858# - method name changed
+
pWrtShell->getIDocumentDrawModelAccess()->GetOrCreateDrawModel();
+ // <--
break;
case FN_LINE_NUMBERING_DLG:
{
SwAbstractDialogFactory* pFact =
SwAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "Dialogdiet fail!");
- VclAbstractDialog* pDlg = pFact->CreateVclSwViewDialog(
DLG_LINE_NUMBERING, *this);
- DBG_ASSERT(pDlg, "Dialogdiet fail!");
+ DBG_ASSERT(pFact, "Dialogdiet fail!");
+ VclAbstractDialog* pDlg = pFact->CreateVclSwViewDialog(
DLG_LINE_NUMBERING, *this);
+ DBG_ASSERT(pDlg, "Dialogdiet fail!");
pDlg->Execute();
delete pDlg;
break;
@@ -533,25 +533,25 @@ void __EXPORT SwView::Execute(SfxRequest &rReq)
case FN_PAGEDOWN_SEL:
{
Rectangle aVis( GetVisArea() );
- SwEditWin& rTmpWin = GetEditWin();
- if ( FN_PAGEUP == nSlot || FN_PAGEUP_SEL == nSlot )
- PageUpCrsr(FN_PAGEUP_SEL == nSlot);
- else
- PageDownCrsr(FN_PAGEDOWN_SEL == nSlot);
+ SwEditWin& rTmpWin = GetEditWin();
+ if ( FN_PAGEUP == nSlot || FN_PAGEUP_SEL == nSlot )
+ PageUpCrsr(FN_PAGEUP_SEL == nSlot);
+ else
+ PageDownCrsr(FN_PAGEDOWN_SEL == nSlot);
rReq.SetReturnValue(SfxBoolItem(nSlot,
aVis != GetVisArea()));
- //#i42732# - notify the edit window that from now on we do not use
the input language
- rTmpWin.SetUseInputLanguage( sal_False );
- }
+ //#i42732# - notify the edit window that from now on we
do not use the input language
+ rTmpWin.SetUseInputLanguage( sal_False );
+ }
break;
case FN_REDLINE_ON:
{
if( pArgs &&
SFX_ITEM_SET == pArgs->GetItemState(nSlot,
sal_False, &pItem ))
{
- IDocumentRedlineAccess* pIDRA =
pWrtShell->getIDocumentRedlineAccess();
- Sequence <sal_Int8> aPasswd = pIDRA->GetRedlinePassword();
+ IDocumentRedlineAccess* pIDRA =
pWrtShell->getIDocumentRedlineAccess();
+ Sequence <sal_Int8> aPasswd =
pIDRA->GetRedlinePassword();
if( aPasswd.getLength() )
{
DBG_ASSERT( !((const
SfxBoolItem*)pItem)->GetValue(), "SwView::Execute(): password set an redlining
off doesn't match!" );
@@ -665,15 +665,15 @@ void __EXPORT SwView::Execute(SfxRequest &rReq)
}
}
}
- }
- break;
+ }
+ break;
case SID_DOCUMENT_COMPARE:
case SID_DOCUMENT_MERGE:
{
String sFileName, sFilterName;
sal_Int16 nVersion = 0;
- bool bHasFileName = false;
- pViewImpl->SetParam( 0 );
+ bool bHasFileName = false;
+ pViewImpl->SetParam( 0 );
if( pArgs )
{
@@ -716,10 +716,10 @@ void __EXPORT SwView::Execute(SfxRequest &rReq)
}
break;
case FN_SYNC_LABELS:
- case FN_MAILMERGE_CHILDWINDOW:
- GetViewFrame()->ShowChildWindow(nSlot, sal_True);
- break;
- case FN_ESCAPE:
+ case FN_MAILMERGE_CHILDWINDOW:
+ GetViewFrame()->ShowChildWindow(nSlot, sal_True);
+ break;
+ case FN_ESCAPE:
{
if ( pWrtShell->HasDrawView() &&
pWrtShell->GetDrawView()->IsDragObj() )
{
@@ -2226,7 +2226,7 @@ extern int lcl_FindDocShell( SfxObjectShellRef& xDocSh,
SfxObjectShellLock& xLoc
xDocSh->DoClose();
}
- delete pMedium;
+ delete pMedium;
return nFound;
}
/* -----------------05.02.2003 12:06-----------------
@@ -2234,10 +2234,10 @@ extern int lcl_FindDocShell( SfxObjectShellRef& xDocSh,
SfxObjectShellLock& xLoc
* --------------------------------------------------*/
void SwView::EnableMailMerge(sal_Bool bEnable )
{
- bInMailMerge = bEnable;
- SfxBindings& rBind = GetViewFrame()->GetBindings();
- rBind.Invalidate(FN_INSERT_FIELD_DATA_ONLY);
- rBind.Update(FN_INSERT_FIELD_DATA_ONLY);
+ bInMailMerge = bEnable;
+ SfxBindings& rBind = GetViewFrame()->GetBindings();
+ rBind.Invalidate(FN_INSERT_FIELD_DATA_ONLY);
+ rBind.Update(FN_INSERT_FIELD_DATA_ONLY);
}
/*
*/
@@ -2310,8 +2310,8 @@ class SwMergeSourceWarningBox_Impl : public ModalDialog
void SwView::GenerateFormLetter(sal_Bool bUseCurrentDocument)
{
- if(bUseCurrentDocument)
- {
+ if(bUseCurrentDocument)
+ {
if(!GetWrtShell().IsAnyDatabaseFieldInDoc())
{
// check availability of data sources (except biblio source)
diff --git a/main/toolkit/source/controls/unocontrol.cxx
b/main/toolkit/source/controls/unocontrol.cxx
index 85c9fe2eab..1245370fba 100644
--- a/main/toolkit/source/controls/unocontrol.cxx
+++ b/main/toolkit/source/controls/unocontrol.cxx
@@ -1,5 +1,5 @@
/**************************************************************
- *
+ *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
@@ -7,20 +7,18 @@
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
- *
+ *
*************************************************************/
-
-
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_toolkit.hxx"
#include <com/sun/star/awt/XControlContainer.hpp>
@@ -73,19 +71,19 @@ using ::com::sun::star::accessibility::XAccessible;
struct LanguageDependentProp
{
- const char* pPropName;
- sal_Int32 nPropNameLength;
+ const char* pPropName;
+ sal_Int32 nPropNameLength;
};
static const LanguageDependentProp aLanguageDependentProp[] =
{
- { "Text", 4 },
- { "Label", 5 },
- { "Title", 5 },
- { "HelpText", 8 },
- { "CurrencySymbol", 14 },
- { "StringItemList", 14 },
- { 0, 0 }
+ { "Text", 4 },
+ { "Label", 5 },
+ { "Title", 5 },
+ { "HelpText", 8 },
+ { "CurrencySymbol", 14 },
+ { "StringItemList", 14 },
+ { 0, 0 }
};
static Sequence< ::rtl::OUString> lcl_ImplGetPropertyNames( const Reference<
XMultiPropertySet > & rxModel )
@@ -93,8 +91,8 @@ static Sequence< ::rtl::OUString> lcl_ImplGetPropertyNames(
const Reference< XMu
Sequence< ::rtl::OUString> aNames;
Reference< XPropertySetInfo > xPSInf = rxModel->getPropertySetInfo();
DBG_ASSERT( xPSInf.is(), "UpdateFromModel: No PropertySetInfo!" );
- if ( xPSInf.is() )
- {
+ if ( xPSInf.is() )
+ {
Sequence< Property> aProps = xPSInf->getProperties();
sal_Int32 nLen = aProps.getLength();
aNames = Sequence< ::rtl::OUString>( nLen );
@@ -110,39 +108,39 @@ static Sequence< ::rtl::OUString>
lcl_ImplGetPropertyNames( const Reference< XMu
class VclListenerLock
{
private:
- VCLXWindow* m_pLockWindow;
+ VCLXWindow* m_pLockWindow;
public:
- inline VclListenerLock( VCLXWindow* _pLockWindow )
- :m_pLockWindow( _pLockWindow )
- {
+ inline VclListenerLock( VCLXWindow* _pLockWindow )
+ :m_pLockWindow( _pLockWindow )
+ {
if ( m_pLockWindow )
m_pLockWindow->suspendVclEventListening( );
- }
- inline ~VclListenerLock( )
- {
+ }
+ inline ~VclListenerLock( )
+ {
if ( m_pLockWindow )
m_pLockWindow->resumeVclEventListening( );
- }
+ }
private:
- VclListenerLock(); // never
implemented
- VclListenerLock( const VclListenerLock& ); // never
implemented
- VclListenerLock& operator=( const VclListenerLock& ); // never
implemented
+ VclListenerLock(); // never
implemented
+ VclListenerLock( const VclListenerLock& ); // never
implemented
+ VclListenerLock& operator=( const VclListenerLock& ); // never
implemented
};
typedef ::std::map< ::rtl::OUString, sal_Int32 > MapString2Int;
struct UnoControl_Data
{
- MapString2Int aSuspendedPropertyNotifications;
- /// true if and only if our model has a property ResourceResolver
- bool bLocalizationSupport;
+ MapString2Int aSuspendedPropertyNotifications;
+ // true if and only if our model has a property ResourceResolver
+ bool bLocalizationSupport;
- UnoControl_Data()
- :aSuspendedPropertyNotifications()
- ,bLocalizationSupport( false )
- {
- }
+ UnoControl_Data()
+ :aSuspendedPropertyNotifications()
+ ,bLocalizationSupport( false )
+ {
+ }
};
// ----------------------------------------------------
@@ -150,8 +148,8 @@ struct UnoControl_Data
// ----------------------------------------------------
DBG_NAME( UnoControl )
UnoControl::UnoControl()
- :maContext( ::comphelper::getProcessServiceFactory() )
- ,maDisposeListeners( *this )
+ :maContext( ::comphelper::getProcessServiceFactory() )
+ ,maDisposeListeners( *this )
,maWindowListeners( *this )
,maFocusListeners( *this )
,maKeyListeners( *this )
@@ -159,17 +157,17 @@ UnoControl::UnoControl()
,maMouseMotionListeners( *this )
,maPaintListeners( *this )
,maModeChangeListeners( GetMutex() )
- ,mpData( new UnoControl_Data )
+ ,mpData( new UnoControl_Data )
{
- DBG_CTOR( UnoControl, NULL );
- OSL_ENSURE( false, "UnoControl::UnoControl: not implemented. Well, not
really." );
- // just implemented to let the various FooImplInheritanceHelper compile,
you should use the
- // version taking a service factory
+ DBG_CTOR( UnoControl, NULL );
+ OSL_ENSURE( false, "UnoControl::UnoControl: not implemented. Well, not
really." );
+ // just implemented to let the various FooImplInheritanceHelper
compile, you should use the
+ // version taking a service factory
}
UnoControl::UnoControl( const Reference< XMultiServiceFactory >& i_factory )
: maContext( i_factory )
- , maDisposeListeners( *this )
+ , maDisposeListeners( *this )
, maWindowListeners( *this )
, maFocusListeners( *this )
, maKeyListeners( *this )
@@ -177,9 +175,9 @@ UnoControl::UnoControl( const Reference<
XMultiServiceFactory >& i_factory )
, maMouseMotionListeners( *this )
, maPaintListeners( *this )
, maModeChangeListeners( GetMutex() )
- , mpData( new UnoControl_Data )
+ , mpData( new UnoControl_Data )
{
- DBG_CTOR( UnoControl, NULL );
+ DBG_CTOR( UnoControl, NULL );
mbDisposePeer = sal_True;
mbRefeshingPeer = sal_False;
mbCreatingPeer = sal_False;
@@ -189,8 +187,8 @@ UnoControl::UnoControl( const Reference<
XMultiServiceFactory >& i_factory )
UnoControl::~UnoControl()
{
- DELETEZ( mpData );
- DBG_DTOR( UnoControl, NULL );
+ DELETEZ( mpData );
+ DBG_DTOR( UnoControl, NULL );
}
::rtl::OUString UnoControl::GetComponentServiceName()
@@ -225,28 +223,28 @@ Reference< XWindowPeer >
UnoControl::ImplGetCompatiblePeer( sal_Bool bAcceptExis
Window* pParentWindow( NULL );
{
- osl::Guard< vos::IMutex > aGuard(
Application::GetSolarMutex() );
- pParentWindow = dynamic_cast< Window* >(
Application::GetDefaultDevice() );
- ENSURE_OR_THROW( pParentWindow != NULL, "could obtain a default
parent window!" );
+ osl::Guard< vos::IMutex > aGuard(
Application::GetSolarMutex() );
+ pParentWindow = dynamic_cast< Window* >(
Application::GetDefaultDevice() );
+ ENSURE_OR_THROW( pParentWindow != NULL, "could obtain a
default parent window!" );
+ }
+ try
+ {
+ xMe->createPeer( NULL,
pParentWindow->GetComponentInterface( sal_True ) );
+ }
+ catch( const Exception& )
+ {
+ mbCreatingCompatiblePeer = sal_False;
+ throw;
}
- try
- {
- xMe->createPeer( NULL,
pParentWindow->GetComponentInterface( sal_True ) );
- }
- catch( const Exception& )
- {
- mbCreatingCompatiblePeer = sal_False;
- throw;
- }
xCompatiblePeer = getPeer();
setPeer( xCurrentPeer );
- if ( xCompatiblePeer.is() && mxGraphics.is() )
- {
- Reference< XView > xPeerView( xCompatiblePeer, UNO_QUERY );
- if ( xPeerView.is() )
- xPeerView->setGraphics( mxGraphics );
- }
+ if ( xCompatiblePeer.is() && mxGraphics.is() )
+ {
+ Reference< XView > xPeerView( xCompatiblePeer,
UNO_QUERY );
+ if ( xPeerView.is() )
+ xPeerView->setGraphics( mxGraphics );
+ }
if( bVis )
maComponentInfos.bVisible = sal_True;
@@ -259,75 +257,75 @@ Reference< XWindowPeer >
UnoControl::ImplGetCompatiblePeer( sal_Bool bAcceptExis
bool UnoControl::ImplCheckLocalize( ::rtl::OUString& _rPossiblyLocalizable )
{
- if ( !mpData->bLocalizationSupport
- || ( _rPossiblyLocalizable.getLength() == 0 )
- || ( _rPossiblyLocalizable[0] != '&' )
- // TODO: make this reasonable. At the moment, everything which by
accident starts with a & is considered
- // localizable, which is probably wrong.
- )
- return false;
-
- try
- {
- Reference< XPropertySet > xPropSet( mxModel, UNO_QUERY_THROW );
- Reference< resource::XStringResourceResolver > xStringResourceResolver(
- xPropSet->getPropertyValue( ::rtl::OUString(
RTL_CONSTASCII_USTRINGPARAM( "ResourceResolver" ) ) ),
- UNO_QUERY
- );
- if ( xStringResourceResolver.is() )
- {
- ::rtl::OUString aLocalizationKey( _rPossiblyLocalizable.copy( 1 )
);
- _rPossiblyLocalizable = xStringResourceResolver->resolveString(
aLocalizationKey );
- return true;
- }
- }
- catch( const Exception& )
- {
- DBG_UNHANDLED_EXCEPTION();
- }
- return false;
+ if ( !mpData->bLocalizationSupport
+ || ( _rPossiblyLocalizable.getLength() == 0 )
+ || ( _rPossiblyLocalizable[0] != '&' )
+ // TODO: make this reasonable. At the moment,
everything which by accident starts with a & is considered
+ // localizable, which is probably wrong.
+ )
+ return false;
+
+ try
+ {
+ Reference< XPropertySet > xPropSet( mxModel, UNO_QUERY_THROW );
+ Reference< resource::XStringResourceResolver >
xStringResourceResolver(
+ xPropSet->getPropertyValue( ::rtl::OUString(
RTL_CONSTASCII_USTRINGPARAM( "ResourceResolver" ) ) ),
+ UNO_QUERY
+ );
+ if ( xStringResourceResolver.is() )
+ {
+ ::rtl::OUString aLocalizationKey(
_rPossiblyLocalizable.copy( 1 ) );
+ _rPossiblyLocalizable =
xStringResourceResolver->resolveString( aLocalizationKey );
+ return true;
+ }
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+ return false;
}
void UnoControl::ImplSetPeerProperty( const ::rtl::OUString& rPropName, const
Any& rVal )
{
- // since a change made in propertiesChange, we can't be sure that this is
called with an valid getPeer(),
+ // since a change made in propertiesChange, we can't be sure that this
is called with an valid getPeer(),
// this assumption may be false in some (seldom) multi-threading
scenarios (cause propertiesChange
// releases our mutex before calling here in)
// That's why this additional check
-
- if ( mxVclWindowPeer.is() )
- {
+
+ if ( mxVclWindowPeer.is() )
+ {
Any aConvertedValue( rVal );
- if ( mpData->bLocalizationSupport )
- {
- // We now support a mapping for language dependent properties.
This is the
- // central method to implement it.
- if (( rPropName.equalsAsciiL( "Text", 4 )) ||
- ( rPropName.equalsAsciiL( "Label", 5 )) ||
- ( rPropName.equalsAsciiL( "Title", 5 )) ||
- ( rPropName.equalsAsciiL( "HelpText", 8 )) ||
- ( rPropName.equalsAsciiL( "CurrencySymbol", 14 )) ||
- ( rPropName.equalsAsciiL( "StringItemList", 14 )) )
- {
- ::rtl::OUString aValue;
- uno::Sequence< rtl::OUString > aSeqValue;
- if ( aConvertedValue >>= aValue )
- {
- if ( ImplCheckLocalize( aValue ) )
- aConvertedValue <<= aValue;
- }
- else if ( aConvertedValue >>= aSeqValue )
- {
- for ( sal_Int32 i = 0; i < aSeqValue.getLength(); i++ )
- ImplCheckLocalize( aSeqValue[i] );
- aConvertedValue <<= aSeqValue;
- }
- }
- }
-
+ if ( mpData->bLocalizationSupport )
+ {
+ // We now support a mapping for language dependent
properties. This is the
+ // central method to implement it.
+ if (( rPropName.equalsAsciiL( "Text", 4 )) ||
+ ( rPropName.equalsAsciiL( "Label", 5
)) ||
+ ( rPropName.equalsAsciiL( "Title", 5
)) ||
+ ( rPropName.equalsAsciiL( "HelpText", 8
)) ||
+ ( rPropName.equalsAsciiL( "CurrencySymbol", 14
)) ||
+ ( rPropName.equalsAsciiL( "StringItemList", 14
)) )
+ {
+ ::rtl::OUString aValue;
+ uno::Sequence< rtl::OUString > aSeqValue;
+ if ( aConvertedValue >>= aValue )
+ {
+ if ( ImplCheckLocalize( aValue ) )
+ aConvertedValue <<= aValue;
+ }
+ else if ( aConvertedValue >>= aSeqValue )
+ {
+ for ( sal_Int32 i = 0; i <
aSeqValue.getLength(); i++ )
+ ImplCheckLocalize( aSeqValue[i]
);
+ aConvertedValue <<= aSeqValue;
+ }
+ }
+ }
+
mxVclWindowPeer->setProperty( rPropName, aConvertedValue );
- }
+ }
}
void UnoControl::PrepareWindowDescriptor( WindowDescriptor& )
@@ -352,15 +350,15 @@ Reference< XWindow > UnoControl::getParentPeer()
const
void UnoControl::updateFromModel()
{
- // Alle standard Properties werden ausgelesen und in das Peer
uebertragen
+ // Alle standard Properties werden ausgelesen und in das Peer übertragen
if( getPeer().is() )
{
Reference< XMultiPropertySet > xPropSet( mxModel, UNO_QUERY );
- if( xPropSet.is() )
- {
- Sequence< ::rtl::OUString> aNames = lcl_ImplGetPropertyNames(
xPropSet );
- xPropSet->firePropertiesChangeEvent( aNames, this );
- }
+ if( xPropSet.is() )
+ {
+ Sequence< ::rtl::OUString> aNames =
lcl_ImplGetPropertyNames( xPropSet );
+ xPropSet->firePropertiesChangeEvent( aNames, this );
+ }
}
}
@@ -388,19 +386,19 @@ void UnoControl::disposeAccessibleContext()
void UnoControl::dispose( ) throw(RuntimeException)
{
- Reference< XWindowPeer > xPeer;
- {
- ::osl::MutexGuard aGuard( GetMutex() );
- if( mbDisposePeer )
- {
- xPeer = mxPeer;
- }
- setPeer( NULL );
- }
- if( xPeer.is() )
- {
- xPeer->dispose();
- }
+ Reference< XWindowPeer > xPeer;
+ {
+ ::osl::MutexGuard aGuard( GetMutex() );
+ if( mbDisposePeer )
+ {
+ xPeer = mxPeer;
+ }
+ setPeer( NULL );
+ }
+ if( xPeer.is() )
+ {
+ xPeer->dispose();
+ }
// dispose and release our AccessibleContext
disposeAccessibleContext();
@@ -416,7 +414,7 @@ void UnoControl::dispose( ) throw(RuntimeException)
maMouseMotionListeners.disposeAndClear( aDisposeEvent );
maPaintListeners.disposeAndClear( aDisposeEvent );
maModeChangeListeners.disposeAndClear( aDisposeEvent );
-
+
// Model wieder freigeben
setModel( Reference< XControlModel > () );
setContext( Reference< XInterface > () );
@@ -425,104 +423,104 @@ void UnoControl::dispose( ) throw(RuntimeException)
void UnoControl::addEventListener( const Reference< XEventListener >&
rxListener ) throw(RuntimeException)
{
::osl::MutexGuard aGuard( GetMutex() );
-
+
maDisposeListeners.addInterface( rxListener );
}
void UnoControl::removeEventListener( const Reference< XEventListener >&
rxListener ) throw(RuntimeException)
{
::osl::MutexGuard aGuard( GetMutex() );
-
+
maDisposeListeners.removeInterface( rxListener );
}
sal_Bool UnoControl::requiresNewPeer( const ::rtl::OUString& /* _rPropertyName
*/ ) const
{
- return sal_False;
+ return sal_False;
}
// XPropertiesChangeListener
void UnoControl::propertiesChange( const Sequence< PropertyChangeEvent >&
rEvents ) throw(RuntimeException)
{
- Sequence< PropertyChangeEvent > aEvents( rEvents );
- {
- ::osl::MutexGuard aGuard( GetMutex() );
-
- if ( !mpData->aSuspendedPropertyNotifications.empty() )
- {
- // strip the property which we are currently updating (somewhere
up the stack)
- PropertyChangeEvent* pEvents = aEvents.getArray();
- PropertyChangeEvent* pEventsEnd = pEvents + aEvents.getLength();
- for ( ; pEvents < pEventsEnd; )
- if ( mpData->aSuspendedPropertyNotifications.find(
pEvents->PropertyName ) != mpData->aSuspendedPropertyNotifications.end() )
- {
- if ( pEvents != pEventsEnd )
- ::std::copy( pEvents + 1, pEventsEnd, pEvents );
- --pEventsEnd;
- }
- else
- ++pEvents;
- aEvents.realloc( pEventsEnd - aEvents.getConstArray() );
-
- if ( !aEvents.getLength() )
- return;
- }
- }
-
- ImplModelPropertiesChanged( aEvents );
-}
-
+ Sequence< PropertyChangeEvent > aEvents( rEvents );
+ {
+ ::osl::MutexGuard aGuard( GetMutex() );
+
+ if ( !mpData->aSuspendedPropertyNotifications.empty() )
+ {
+ // strip the property which we are currently updating
(somewhere up the stack)
+ PropertyChangeEvent* pEvents = aEvents.getArray();
+ PropertyChangeEvent* pEventsEnd = pEvents +
aEvents.getLength();
+ for ( ; pEvents < pEventsEnd; )
+ if (
mpData->aSuspendedPropertyNotifications.find( pEvents->PropertyName ) !=
mpData->aSuspendedPropertyNotifications.end() )
+ {
+ if ( pEvents != pEventsEnd )
+ ::std::copy( pEvents + 1,
pEventsEnd, pEvents );
+ --pEventsEnd;
+ }
+ else
+ ++pEvents;
+ aEvents.realloc( pEventsEnd - aEvents.getConstArray() );
+
+ if ( !aEvents.getLength() )
+ return;
+ }
+ }
+
+ ImplModelPropertiesChanged( aEvents );
+}
+
void UnoControl::ImplLockPropertyChangeNotification( const ::rtl::OUString&
rPropertyName, bool bLock )
{
- MapString2Int::iterator pos =
mpData->aSuspendedPropertyNotifications.find( rPropertyName );
- if ( bLock )
- {
- if ( pos == mpData->aSuspendedPropertyNotifications.end() )
- pos = mpData->aSuspendedPropertyNotifications.insert(
MapString2Int::value_type( rPropertyName, 0 ) ).first;
- ++pos->second;
- }
- else
- {
- OSL_ENSURE( pos != mpData->aSuspendedPropertyNotifications.end(),
"UnoControl::ImplLockPropertyChangeNotification: property not locked!" );
- if ( pos != mpData->aSuspendedPropertyNotifications.end() )
- {
- OSL_ENSURE( pos->second > 0,
"UnoControl::ImplLockPropertyChangeNotification: invalid suspension counter!" );
- if ( 0 == --pos->second )
- mpData->aSuspendedPropertyNotifications.erase( pos );
- }
- }
+ MapString2Int::iterator pos =
mpData->aSuspendedPropertyNotifications.find( rPropertyName );
+ if ( bLock )
+ {
+ if ( pos == mpData->aSuspendedPropertyNotifications.end() )
+ pos = mpData->aSuspendedPropertyNotifications.insert(
MapString2Int::value_type( rPropertyName, 0 ) ).first;
+ ++pos->second;
+ }
+ else
+ {
+ OSL_ENSURE( pos !=
mpData->aSuspendedPropertyNotifications.end(),
"UnoControl::ImplLockPropertyChangeNotification: property not locked!" );
+ if ( pos != mpData->aSuspendedPropertyNotifications.end() )
+ {
+ OSL_ENSURE( pos->second > 0,
"UnoControl::ImplLockPropertyChangeNotification: invalid suspension counter!" );
+ if ( 0 == --pos->second )
+ mpData->aSuspendedPropertyNotifications.erase(
pos );
+ }
+ }
}
void UnoControl::ImplLockPropertyChangeNotifications( const Sequence<
::rtl::OUString >& rPropertyNames, bool bLock )
{
- for ( const ::rtl::OUString* pPropertyName =
rPropertyNames.getConstArray();
- pPropertyName != rPropertyNames.getConstArray() +
rPropertyNames.getLength();
- ++pPropertyName
- )
- ImplLockPropertyChangeNotification( *pPropertyName, bLock );
+ for ( const ::rtl::OUString* pPropertyName =
rPropertyNames.getConstArray();
+ pPropertyName != rPropertyNames.getConstArray() +
rPropertyNames.getLength();
+ ++pPropertyName
+ )
+ ImplLockPropertyChangeNotification( *pPropertyName, bLock );
}
void UnoControl::ImplModelPropertiesChanged( const Sequence<
PropertyChangeEvent >& rEvents )
{
::osl::ClearableGuard< ::osl::Mutex > aGuard( GetMutex() );
- if( getPeer().is() )
+ if( getPeer().is() )
{
DECLARE_STL_VECTOR( PropertyValue, PropertyValueVector);
PropertyValueVector aPeerPropertiesToSet;
sal_Int32 nIndependentPos = 0;
- bool bResourceResolverSet( false );
+ bool bResourceResolverSet( false );
// position where to insert the independent properties
into aPeerPropertiesToSet,
- // dependent ones are inserted at the end of the vector
+ // dependent ones are inserted at the end of the vector
sal_Bool bNeedNewPeer = sal_False;
// some properties require a re-creation of the peer,
'cause they can't be changed on the fly
Reference< XControlModel > xOwnModel( getModel(), UNO_QUERY );
// our own model for comparison
- Reference< XPropertySet > xPS( xOwnModel, UNO_QUERY );
- Reference< XPropertySetInfo > xPSI( xPS->getPropertySetInfo(),
UNO_QUERY );
- OSL_ENSURE( xPSI.is(), "UnoControl::ImplModelPropertiesChanged: should
have property set meta data!" );
+ Reference< XPropertySet > xPS( xOwnModel, UNO_QUERY );
+ Reference< XPropertySetInfo > xPSI( xPS->getPropertySetInfo(),
UNO_QUERY );
+ OSL_ENSURE( xPSI.is(), "UnoControl::ImplModelPropertiesChanged:
should have property set meta data!" );
const PropertyChangeEvent* pEvents = rEvents.getConstArray();
@@ -534,82 +532,82 @@ void UnoControl::ImplModelPropertiesChanged( const
Sequence< PropertyChangeEvent
Reference< XControlModel > xModel( pEvents->Source,
UNO_QUERY );
sal_Bool bOwnModel = xModel.get() == xOwnModel.get();
if ( !bOwnModel )
- continue;
-
- // Detect changes on our resource resolver which invalidates
- // automatically some language dependent properties.
- if ( pEvents->PropertyName.equalsAsciiL( "ResourceResolver", 16 ))
- {
- Reference< resource::XStringResourceResolver > xStrResolver;
- if ( pEvents->NewValue >>= xStrResolver )
- bResourceResolverSet = xStrResolver.is();
- }
-
- sal_uInt16 nPType = GetPropertyId( pEvents->PropertyName );
- if ( mbDesignMode && mbDisposePeer && !mbRefeshingPeer
&& !mbCreatingPeer )
- {
- // if we're in design mode, then some properties can change
which
- // require creating a *new* peer (since these properties cannot
- // be switched at existing peers)
- if ( nPType )
- bNeedNewPeer = ( nPType == BASEPROPERTY_BORDER )
- || ( nPType == BASEPROPERTY_MULTILINE )
- || ( nPType ==
BASEPROPERTY_DROPDOWN )
- || ( nPType ==
BASEPROPERTY_HSCROLL )
- || ( nPType ==
BASEPROPERTY_VSCROLL )
- || ( nPType ==
BASEPROPERTY_AUTOHSCROLL )
- || ( nPType ==
BASEPROPERTY_AUTOVSCROLL )
- || ( nPType ==
BASEPROPERTY_ORIENTATION )
- || ( nPType ==
BASEPROPERTY_SPIN )
- || ( nPType ==
BASEPROPERTY_ALIGN )
- || ( nPType ==
BASEPROPERTY_PAINTTRANSPARENT );
- else
- bNeedNewPeer = requiresNewPeer( pEvents->PropertyName );
-
- if ( bNeedNewPeer )
+ continue;
+
+ // Detect changes on our resource resolver which
invalidates
+ // automatically some language dependent properties.
+ if ( pEvents->PropertyName.equalsAsciiL(
"ResourceResolver", 16 ))
+ {
+ Reference< resource::XStringResourceResolver >
xStrResolver;
+ if ( pEvents->NewValue >>= xStrResolver )
+ bResourceResolverSet =
xStrResolver.is();
+ }
+
+ sal_uInt16 nPType = GetPropertyId(
pEvents->PropertyName );
+ if ( mbDesignMode && mbDisposePeer && !mbRefeshingPeer
&& !mbCreatingPeer )
+ {
+ // if we're in design mode, then some
properties can change which
+ // require creating a *new* peer (since these
properties cannot
+ // be switched at existing peers)
+ if ( nPType )
+ bNeedNewPeer = ( nPType ==
BASEPROPERTY_BORDER )
+ || ( nPType ==
BASEPROPERTY_MULTILINE )
+ || ( nPType ==
BASEPROPERTY_DROPDOWN )
+ || ( nPType ==
BASEPROPERTY_HSCROLL )
+ || ( nPType ==
BASEPROPERTY_VSCROLL )
+ || ( nPType ==
BASEPROPERTY_AUTOHSCROLL )
+ || ( nPType ==
BASEPROPERTY_AUTOVSCROLL )
+ || ( nPType ==
BASEPROPERTY_ORIENTATION )
+ || ( nPType ==
BASEPROPERTY_SPIN )
+ || ( nPType ==
BASEPROPERTY_ALIGN )
+ || ( nPType ==
BASEPROPERTY_PAINTTRANSPARENT );
+ else
+ bNeedNewPeer = requiresNewPeer(
pEvents->PropertyName );
+
+ if ( bNeedNewPeer )
break;
}
if ( nPType && ( nLen > 1 ) && DoesDependOnOthers(
nPType ) )
{
- // Properties die von anderen abhaengen erst
hinterher einstellen,
- // weil sie von anderen Properties abhaengig
sind, die aber erst spaeter
+ // Properties die von anderen abhängen erst
hinterher einstellen,
+ // weil sie von anderen Properties abhängig
sind, die aber erst später
// eingestellt werden, z.B. VALUE nach
VALUEMIN/MAX.
aPeerPropertiesToSet.push_back(PropertyValue(pEvents->PropertyName, 0,
pEvents->NewValue, PropertyState_DIRECT_VALUE));
}
else
{
- if ( bResourceResolverSet )
- {
+ if ( bResourceResolverSet )
+ {
// The resource resolver property
change should be one of the first ones.
- // All language dependent properties are dependent on this
property.
- // As BASEPROPERTY_NATIVE_WIDGET_LOOK is not dependent on
resource
- // resolver. We don't need to handle a special order for
these two props.
- aPeerPropertiesToSet.insert(
- aPeerPropertiesToSet.begin(),
+ // All language dependent properties
are dependent on this property.
+ // As BASEPROPERTY_NATIVE_WIDGET_LOOK
is not dependent on resource
+ // resolver. We don't need to handle a
special order for these two props.
+ aPeerPropertiesToSet.insert(
+ aPeerPropertiesToSet.begin(),
PropertyValue(
pEvents->PropertyName, 0, pEvents->NewValue, PropertyState_DIRECT_VALUE ) );
- ++nIndependentPos;
- }
- else if ( nPType == BASEPROPERTY_NATIVE_WIDGET_LOOK )
- {
- // since *a lot* of other properties might be overruled by
this one, we need
- // a special handling:
- // NativeWidgetLook needs to be set first: If it is set to
ON, all other
- // properties describing the look (e.g. BackgroundColor)
are ignored, anyway.
- // If it is switched OFF, then we need to do it first
because else it will
- // overrule other look-related properties, and
re-initialize them from system
- // defaults.
- aPeerPropertiesToSet.insert(
- aPeerPropertiesToSet.begin(),
+ ++nIndependentPos;
+ }
+ else if ( nPType ==
BASEPROPERTY_NATIVE_WIDGET_LOOK )
+ {
+ // since *a lot* of other properties
might be overruled by this one, we need
+ // a special handling:
+ // NativeWidgetLook needs to be set
first: If it is set to ON, all other
+ // properties describing the look (e.g.
BackgroundColor) are ignored, anyway.
+ // If it is switched OFF, then we need
to do it first because else it will
+ // overrule other look-related
properties, and re-initialize them from system
+ // defaults.
+ aPeerPropertiesToSet.insert(
+ aPeerPropertiesToSet.begin(),
PropertyValue(
pEvents->PropertyName, 0, pEvents->NewValue, PropertyState_DIRECT_VALUE ) );
- ++nIndependentPos;
- }
- else
- {
+ ++nIndependentPos;
+ }
+ else
+ {
aPeerPropertiesToSet.insert(aPeerPropertiesToSet.begin() + nIndependentPos,
PropertyValue(pEvents->PropertyName, 0, pEvents->NewValue,
PropertyState_DIRECT_VALUE));
++nIndependentPos;
- }
+ }
}
}
@@ -619,50 +617,50 @@ void UnoControl::ImplModelPropertiesChanged( const
Sequence< PropertyChangeEvent
DBG_ASSERT( !bNeedNewPeer || xParent.is(), "Need new peer, but
don't have a parent!" );
- // Check if we have to update language dependent properties
- if ( !bNeedNewPeer && bResourceResolverSet )
- {
- // Add language dependent properties into the peer property set.
- // Our resource resolver has been changed and we must be sure
- // that language dependent props use the new resolver.
- const LanguageDependentProp* pLangDepProp = aLanguageDependentProp;
- while ( pLangDepProp->pPropName != 0 )
- {
- bool bMustBeInserted( true );
- for ( sal_uInt32 i = 0; i < aPeerPropertiesToSet.size(); i++ )
- {
- if ( aPeerPropertiesToSet[i].Name.equalsAsciiL(
- pLangDepProp->pPropName,
pLangDepProp->nPropNameLength ))
- {
- bMustBeInserted = false;
- break;
- }
- }
-
- if ( bMustBeInserted )
- {
- // Add language dependent props at the end
- ::rtl::OUString aPropName(
::rtl::OUString::createFromAscii( pLangDepProp->pPropName ));
- if ( xPSI.is() && xPSI->hasPropertyByName( aPropName ) )
- {
- aPeerPropertiesToSet.push_back(
- PropertyValue( aPropName, 0,
xPS->getPropertyValue( aPropName ), PropertyState_DIRECT_VALUE ) );
- }
- }
-
- ++pLangDepProp;
- }
- }
- aGuard.clear();
-
- // clear the guard before creating a new peer - as usual, our peer
implementations use the SolarMutex
+ // Check if we have to update language dependent properties
+ if ( !bNeedNewPeer && bResourceResolverSet )
+ {
+ // Add language dependent properties into the peer
property set.
+ // Our resource resolver has been changed and we must
be sure
+ // that language dependent props use the new resolver.
+ const LanguageDependentProp* pLangDepProp =
aLanguageDependentProp;
+ while ( pLangDepProp->pPropName != 0 )
+ {
+ bool bMustBeInserted( true );
+ for ( sal_uInt32 i = 0; i <
aPeerPropertiesToSet.size(); i++ )
+ {
+ if (
aPeerPropertiesToSet[i].Name.equalsAsciiL(
+
pLangDepProp->pPropName, pLangDepProp->nPropNameLength ))
+ {
+ bMustBeInserted = false;
+ break;
+ }
+ }
+
+ if ( bMustBeInserted )
+ {
+ // Add language dependent props at the
end
+ ::rtl::OUString aPropName(
::rtl::OUString::createFromAscii( pLangDepProp->pPropName ));
+ if ( xPSI.is() &&
xPSI->hasPropertyByName( aPropName ) )
+ {
+ aPeerPropertiesToSet.push_back(
+ PropertyValue(
aPropName, 0, xPS->getPropertyValue( aPropName ), PropertyState_DIRECT_VALUE )
);
+ }
+ }
+
+ ++pLangDepProp;
+ }
+ }
+ aGuard.clear();
+
+ // clear the guard before creating a new peer - as usual, our
peer implementations use the SolarMutex
// #82300# - 2000-12-21 - [email protected]
if (bNeedNewPeer && xParent.is())
{
vos::OGuard aVclGuard( Application::GetSolarMutex() );
// and now this is the final withdrawal:
// With 83561, I have no other idea than
locking the SolarMutex here ....
- // I really hate the fact that VCL is not
theadsafe ....
+ // I really hate the fact that VCL is not
threadsafe ....
// #83561# - 2001-03-01 - [email protected]
// Funktioniert beim Container nicht!
@@ -676,17 +674,17 @@ void UnoControl::ImplModelPropertiesChanged( const
Sequence< PropertyChangeEvent
aPeerPropertiesToSet.clear();
}
- // lock the multiplexing of VCL events to our UNO listeners
- // this is for compatibility reasons: in OOo 1.0.x, changes which were
done at the
- // model did not cause the listeners of the controls/peers to be called
- // Since the implementations for the listeners changed a lot towards
1.1, this
- // would not be the case anymore, if we would not do this
listener-lock below
- // #i14703# - 2003-05-23 - [email protected]
- Window* pVclPeer = VCLUnoHelper::GetWindow( getPeer() );
- VCLXWindow* pPeer = pVclPeer ? pVclPeer->GetWindowPeer() : NULL;
- VclListenerLock aNoVclEventMultiplexing( pPeer );
-
- // setting peer properties may result in an attempt to acquire the
solar mutex, 'cause the peers
+ // lock the multiplexing of VCL events to our UNO listeners
+ // this is for compatibility reasons: in OOo 1.0.x, changes
which were done at the
+ // model did not cause the listeners of the controls/peers to
be called
+ // Since the implementations for the listeners changed a lot
towards 1.1, this
+ // would not be the case anymore, if we would not do this
listener-lock below
+ // #i14703# - 2003-05-23 - [email protected]
+ Window* pVclPeer = VCLUnoHelper::GetWindow( getPeer() );
+ VCLXWindow* pPeer = pVclPeer ? pVclPeer->GetWindowPeer() : NULL;
+ VclListenerLock aNoVclEventMultiplexing( pPeer );
+
+ // setting peer properties may result in an attempt to acquire
the solar mutex, 'cause the peers
// usually don't have an own mutex but use the SolarMutex
instead.
// To prevent deadlocks resulting from this, we do this without
our own mutex locked
// 2000-11-03 - [email protected]
@@ -706,18 +704,18 @@ void UnoControl::disposing( const EventObject& rEvt )
throw(RuntimeException)
::osl::ClearableMutexGuard aGuard( GetMutex() );
// bei "Multible Inheritance" nicht unterschiedliche Typen vergleichen.
- if ( maAccessibleContext.get() == rEvt.Source )
- {
+ if ( maAccessibleContext.get() == rEvt.Source )
+ {
// just in case the context is disposed, but not released -
ensure that we do not re-use it in the future
maAccessibleContext = NULL;
- }
+ }
else if( mxModel.get() == Reference< XControlModel
>(rEvt.Source,UNO_QUERY).get() )
{
// #62337# if the model dies, it does not make sense for us to
live ...
Reference< XControl > xThis = this;
- aGuard.clear();
- xThis->dispose();
+ aGuard.clear();
+ xThis->dispose();
DBG_ASSERT( !mxModel.is(), "UnoControl::disposing: invalid
dispose behaviour!" );
mxModel.clear();
@@ -733,48 +731,48 @@ void SAL_CALL UnoControl::setOutputSize( const awt::Size&
aSize ) throw (Runtime
xPeerWindow = xPeerWindow.query( getPeer() );
}
- if ( xPeerWindow.is() )
+ if ( xPeerWindow.is() )
xPeerWindow->setOutputSize( aSize );
}
namespace
{
- template < typename RETVALTYPE >
- RETVALTYPE lcl_askPeer( const uno::Reference< awt::XWindowPeer >& _rxPeer,
RETVALTYPE (SAL_CALL XWindow2::*_pMethod)(), RETVALTYPE _aDefault )
- {
- RETVALTYPE aReturn( _aDefault );
+ template < typename RETVALTYPE >
+ RETVALTYPE lcl_askPeer( const uno::Reference< awt::XWindowPeer >&
_rxPeer, RETVALTYPE (SAL_CALL XWindow2::*_pMethod)(), RETVALTYPE _aDefault )
+ {
+ RETVALTYPE aReturn( _aDefault );
- Reference< XWindow2 > xPeerWindow( _rxPeer, UNO_QUERY );
- if ( xPeerWindow.is() )
- aReturn = (xPeerWindow.get()->*_pMethod)();
+ Reference< XWindow2 > xPeerWindow( _rxPeer, UNO_QUERY );
+ if ( xPeerWindow.is() )
+ aReturn = (xPeerWindow.get()->*_pMethod)();
- return aReturn;
- }
+ return aReturn;
+ }
}
awt::Size SAL_CALL UnoControl::getOutputSize( ) throw (RuntimeException)
{
- return lcl_askPeer( getPeer(), &XWindow2::getOutputSize, awt::Size() );
+ return lcl_askPeer( getPeer(), &XWindow2::getOutputSize, awt::Size() );
}
::sal_Bool SAL_CALL UnoControl::isVisible( ) throw (RuntimeException)
{
- return lcl_askPeer( getPeer(), &XWindow2::isVisible,
maComponentInfos.bVisible );
+ return lcl_askPeer( getPeer(), &XWindow2::isVisible,
maComponentInfos.bVisible );
}
::sal_Bool SAL_CALL UnoControl::isActive( ) throw (RuntimeException)
{
- return lcl_askPeer( getPeer(), &XWindow2::isActive, sal_False );
+ return lcl_askPeer( getPeer(), &XWindow2::isActive, sal_False );
}
::sal_Bool SAL_CALL UnoControl::isEnabled( ) throw (RuntimeException)
{
- return lcl_askPeer( getPeer(), &XWindow2::isEnabled,
maComponentInfos.bEnable );
+ return lcl_askPeer( getPeer(), &XWindow2::isEnabled,
maComponentInfos.bEnable );
}
::sal_Bool SAL_CALL UnoControl::hasFocus( ) throw (RuntimeException)
{
- return lcl_askPeer( getPeer(), &XWindow2::hasFocus, sal_False );
+ return lcl_askPeer( getPeer(), &XWindow2::hasFocus, sal_False );
}
// XWindow
@@ -783,37 +781,37 @@ void UnoControl::setPosSize( sal_Int32 X, sal_Int32 Y,
sal_Int32 Width, sal_Int3
Reference< XWindow > xWindow;
{
::osl::MutexGuard aGuard( GetMutex() );
-
- if ( Flags & awt::PosSize::X )
- maComponentInfos.nX = X;
- if ( Flags & awt::PosSize::Y )
- maComponentInfos.nY = Y;
- if ( Flags & awt::PosSize::WIDTH )
- maComponentInfos.nWidth = Width;
- if ( Flags & awt::PosSize::HEIGHT )
- maComponentInfos.nHeight = Height;
+
+ if ( Flags & awt::PosSize::X )
+ maComponentInfos.nX = X;
+ if ( Flags & awt::PosSize::Y )
+ maComponentInfos.nY = Y;
+ if ( Flags & awt::PosSize::WIDTH )
+ maComponentInfos.nWidth = Width;
+ if ( Flags & awt::PosSize::HEIGHT )
+ maComponentInfos.nHeight = Height;
maComponentInfos.nFlags |= Flags;
-
+
xWindow = xWindow.query( getPeer() );
}
- if( xWindow.is() )
+ if( xWindow.is() )
xWindow->setPosSize( X, Y, Width, Height, Flags );
}
awt::Rectangle UnoControl::getPosSize( ) throw(RuntimeException)
{
- awt::Rectangle aRect( maComponentInfos.nX, maComponentInfos.nY,
maComponentInfos.nWidth, maComponentInfos.nHeight);
- Reference< XWindow > xWindow;
+ awt::Rectangle aRect( maComponentInfos.nX, maComponentInfos.nY,
maComponentInfos.nWidth, maComponentInfos.nHeight);
+ Reference< XWindow > xWindow;
- {
- ::osl::MutexGuard aGuard( GetMutex() );
- xWindow = xWindow.query( getPeer() );
- }
+ {
+ ::osl::MutexGuard aGuard( GetMutex() );
+ xWindow = xWindow.query( getPeer() );
+ }
- if( xWindow.is() )
- aRect = xWindow->getPosSize();
- return aRect;
+ if( xWindow.is() )
+ aRect = xWindow->getPosSize();
+ return aRect;
}
void UnoControl::setVisible( sal_Bool bVisible ) throw(RuntimeException)
@@ -821,7 +819,7 @@ void UnoControl::setVisible( sal_Bool bVisible )
throw(RuntimeException)
Reference< XWindow > xWindow;
{
::osl::MutexGuard aGuard( GetMutex() );
-
+
// Visible status ist Sache der View
maComponentInfos.bVisible = bVisible;
xWindow = xWindow.query( getPeer() );
@@ -835,7 +833,7 @@ void UnoControl::setEnable( sal_Bool bEnable )
throw(RuntimeException)
Reference< XWindow > xWindow;
{
::osl::MutexGuard aGuard( GetMutex() );
-
+
// Enable status ist Sache der View
maComponentInfos.bEnable = bEnable;
xWindow = xWindow.query( getPeer() );
@@ -857,158 +855,158 @@ void UnoControl::setFocus( )
throw(RuntimeException)
void UnoControl::addWindowListener( const Reference< XWindowListener >&
rxListener ) throw(RuntimeException)
{
- Reference< XWindow > xPeerWindow;
- {
- ::osl::MutexGuard aGuard( GetMutex() );
- maWindowListeners.addInterface( rxListener );
- if ( maWindowListeners.getLength() == 1 )
- xPeerWindow = xPeerWindow.query( getPeer() );
- }
- if ( xPeerWindow.is() )
- xPeerWindow->addWindowListener( &maWindowListeners );
+ Reference< XWindow > xPeerWindow;
+ {
+ ::osl::MutexGuard aGuard( GetMutex() );
+ maWindowListeners.addInterface( rxListener );
+ if ( maWindowListeners.getLength() == 1 )
+ xPeerWindow = xPeerWindow.query( getPeer() );
+ }
+ if ( xPeerWindow.is() )
+ xPeerWindow->addWindowListener( &maWindowListeners );
}
void UnoControl::removeWindowListener( const Reference< XWindowListener >&
rxListener ) throw(RuntimeException)
{
- Reference< XWindow > xPeerWindow;
- {
- ::osl::MutexGuard aGuard( GetMutex() );
- if ( maWindowListeners.getLength() == 1 )
- xPeerWindow = xPeerWindow.query( getPeer() );
- maWindowListeners.removeInterface( rxListener );
- }
- if ( xPeerWindow.is() )
- xPeerWindow->removeWindowListener( &maWindowListeners );
+ Reference< XWindow > xPeerWindow;
+ {
+ ::osl::MutexGuard aGuard( GetMutex() );
+ if ( maWindowListeners.getLength() == 1 )
+ xPeerWindow = xPeerWindow.query( getPeer() );
+ maWindowListeners.removeInterface( rxListener );
+ }
+ if ( xPeerWindow.is() )
+ xPeerWindow->removeWindowListener( &maWindowListeners );
}
void UnoControl::addFocusListener( const Reference< XFocusListener >&
rxListener ) throw(RuntimeException)
{
- Reference< XWindow > xPeerWindow;
- {
- ::osl::MutexGuard aGuard( GetMutex() );
- maFocusListeners.addInterface( rxListener );
- if ( maFocusListeners.getLength() == 1 )
- xPeerWindow = xPeerWindow.query( getPeer() );
- }
- if ( xPeerWindow.is() )
- xPeerWindow->addFocusListener( &maFocusListeners );
+ Reference< XWindow > xPeerWindow;
+ {
+ ::osl::MutexGuard aGuard( GetMutex() );
+ maFocusListeners.addInterface( rxListener );
+ if ( maFocusListeners.getLength() == 1 )
+ xPeerWindow = xPeerWindow.query( getPeer() );
+ }
+ if ( xPeerWindow.is() )
+ xPeerWindow->addFocusListener( &maFocusListeners );
}
void UnoControl::removeFocusListener( const Reference< XFocusListener >&
rxListener ) throw(RuntimeException)
{
- Reference< XWindow > xPeerWindow;
- {
- ::osl::MutexGuard aGuard( GetMutex() );
- if ( maFocusListeners.getLength() == 1 )
- xPeerWindow = xPeerWindow.query( getPeer() );
- maFocusListeners.removeInterface( rxListener );
- }
- if ( xPeerWindow.is() )
- xPeerWindow->removeFocusListener( &maFocusListeners );
+ Reference< XWindow > xPeerWindow;
+ {
+ ::osl::MutexGuard aGuard( GetMutex() );
+ if ( maFocusListeners.getLength() == 1 )
+ xPeerWindow = xPeerWindow.query( getPeer() );
+ maFocusListeners.removeInterface( rxListener );
+ }
+ if ( xPeerWindow.is() )
+ xPeerWindow->removeFocusListener( &maFocusListeners );
}
void UnoControl::addKeyListener( const Reference< XKeyListener >& rxListener )
throw(RuntimeException)
{
- Reference< XWindow > xPeerWindow;
- {
- ::osl::MutexGuard aGuard( GetMutex() );
- maKeyListeners.addInterface( rxListener );
- if ( maKeyListeners.getLength() == 1 )
- xPeerWindow = xPeerWindow.query( getPeer() );
- }
- if ( xPeerWindow.is() )
- xPeerWindow->addKeyListener( &maKeyListeners);
+ Reference< XWindow > xPeerWindow;
+ {
+ ::osl::MutexGuard aGuard( GetMutex() );
+ maKeyListeners.addInterface( rxListener );
+ if ( maKeyListeners.getLength() == 1 )
+ xPeerWindow = xPeerWindow.query( getPeer() );
+ }
+ if ( xPeerWindow.is() )
+ xPeerWindow->addKeyListener( &maKeyListeners);
}
void UnoControl::removeKeyListener( const Reference< XKeyListener >&
rxListener ) throw(RuntimeException)
{
- Reference< XWindow > xPeerWindow;
- {
- ::osl::MutexGuard aGuard( GetMutex() );
- if ( maKeyListeners.getLength() == 1 )
- xPeerWindow = xPeerWindow.query( getPeer() );
- maKeyListeners.removeInterface( rxListener );
- }
- if ( xPeerWindow.is() )
+ Reference< XWindow > xPeerWindow;
+ {
+ ::osl::MutexGuard aGuard( GetMutex() );
+ if ( maKeyListeners.getLength() == 1 )
+ xPeerWindow = xPeerWindow.query( getPeer() );
+ maKeyListeners.removeInterface( rxListener );
+ }
+ if ( xPeerWindow.is() )
xPeerWindow->removeKeyListener( &maKeyListeners);
}
void UnoControl::addMouseListener( const Reference< XMouseListener >&
rxListener ) throw(RuntimeException)
{
- Reference< XWindow > xPeerWindow;
- {
- ::osl::MutexGuard aGuard( GetMutex() );
- maMouseListeners.addInterface( rxListener );
- if ( maMouseListeners.getLength() == 1 )
- xPeerWindow = xPeerWindow.query( getPeer() );
- }
- if ( xPeerWindow.is() )
- xPeerWindow->addMouseListener( &maMouseListeners);
+ Reference< XWindow > xPeerWindow;
+ {
+ ::osl::MutexGuard aGuard( GetMutex() );
+ maMouseListeners.addInterface( rxListener );
+ if ( maMouseListeners.getLength() == 1 )
+ xPeerWindow = xPeerWindow.query( getPeer() );
+ }
+ if ( xPeerWindow.is() )
+ xPeerWindow->addMouseListener( &maMouseListeners);
}
void UnoControl::removeMouseListener( const Reference< XMouseListener >&
rxListener ) throw(RuntimeException)
{
- Reference< XWindow > xPeerWindow;
- {
- ::osl::MutexGuard aGuard( GetMutex() );
- if ( maMouseListeners.getLength() == 1 )
- xPeerWindow = xPeerWindow.query( getPeer() );
- maMouseListeners.removeInterface( rxListener );
- }
- if ( xPeerWindow.is() )
- xPeerWindow->removeMouseListener( &maMouseListeners );
+ Reference< XWindow > xPeerWindow;
+ {
+ ::osl::MutexGuard aGuard( GetMutex() );
+ if ( maMouseListeners.getLength() == 1 )
+ xPeerWindow = xPeerWindow.query( getPeer() );
+ maMouseListeners.removeInterface( rxListener );
+ }
+ if ( xPeerWindow.is() )
+ xPeerWindow->removeMouseListener( &maMouseListeners );
}
void UnoControl::addMouseMotionListener( const Reference< XMouseMotionListener
>& rxListener ) throw(RuntimeException)
{
- Reference< XWindow > xPeerWindow;
- {
- ::osl::MutexGuard aGuard( GetMutex() );
- maMouseMotionListeners.addInterface( rxListener );
- if ( maMouseMotionListeners.getLength() == 1 )
- xPeerWindow = xPeerWindow.query( getPeer() );
- }
- if ( xPeerWindow.is() )
- xPeerWindow->addMouseMotionListener( &maMouseMotionListeners);
+ Reference< XWindow > xPeerWindow;
+ {
+ ::osl::MutexGuard aGuard( GetMutex() );
+ maMouseMotionListeners.addInterface( rxListener );
+ if ( maMouseMotionListeners.getLength() == 1 )
+ xPeerWindow = xPeerWindow.query( getPeer() );
+ }
+ if ( xPeerWindow.is() )
+ xPeerWindow->addMouseMotionListener( &maMouseMotionListeners);
}
void UnoControl::removeMouseMotionListener( const Reference<
XMouseMotionListener >& rxListener ) throw(RuntimeException)
{
- Reference< XWindow > xPeerWindow;
- {
- ::osl::MutexGuard aGuard( GetMutex() );
- if ( maMouseMotionListeners.getLength() == 1 )
- xPeerWindow = xPeerWindow.query( getPeer() );
- maMouseMotionListeners.removeInterface( rxListener );
- }
- if ( xPeerWindow.is() )
- xPeerWindow->removeMouseMotionListener( &maMouseMotionListeners );
+ Reference< XWindow > xPeerWindow;
+ {
+ ::osl::MutexGuard aGuard( GetMutex() );
+ if ( maMouseMotionListeners.getLength() == 1 )
+ xPeerWindow = xPeerWindow.query( getPeer() );
+ maMouseMotionListeners.removeInterface( rxListener );
+ }
+ if ( xPeerWindow.is() )
+ xPeerWindow->removeMouseMotionListener( &maMouseMotionListeners
);
}
void UnoControl::addPaintListener( const Reference< XPaintListener >&
rxListener ) throw(RuntimeException)
{
- Reference< XWindow > xPeerWindow;
- {
- ::osl::MutexGuard aGuard( GetMutex() );
- maPaintListeners.addInterface( rxListener );
- if ( maPaintListeners.getLength() == 1 )
- xPeerWindow = xPeerWindow.query( getPeer() );
- }
- if ( xPeerWindow.is() )
- xPeerWindow->addPaintListener( &maPaintListeners);
+ Reference< XWindow > xPeerWindow;
+ {
+ ::osl::MutexGuard aGuard( GetMutex() );
+ maPaintListeners.addInterface( rxListener );
+ if ( maPaintListeners.getLength() == 1 )
+ xPeerWindow = xPeerWindow.query( getPeer() );
+ }
+ if ( xPeerWindow.is() )
+ xPeerWindow->addPaintListener( &maPaintListeners);
}
void UnoControl::removePaintListener( const Reference< XPaintListener >&
rxListener ) throw(RuntimeException)
{
- Reference< XWindow > xPeerWindow;
- {
- ::osl::MutexGuard aGuard( GetMutex() );
- if ( maPaintListeners.getLength() == 1 )
- xPeerWindow = xPeerWindow.query( getPeer() );
- maPaintListeners.removeInterface( rxListener );
- }
- if ( xPeerWindow.is() )
- xPeerWindow->removePaintListener( &maPaintListeners );
+ Reference< XWindow > xPeerWindow;
+ {
+ ::osl::MutexGuard aGuard( GetMutex() );
+ if ( maPaintListeners.getLength() == 1 )
+ xPeerWindow = xPeerWindow.query( getPeer() );
+ maPaintListeners.removeInterface( rxListener );
+ }
+ if ( xPeerWindow.is() )
+ xPeerWindow->removePaintListener( &maPaintListeners );
}
// XView
@@ -1017,7 +1015,7 @@ sal_Bool UnoControl::setGraphics( const Reference<
XGraphics >& rDevice ) throw(
Reference< XView > xView;
{
::osl::MutexGuard aGuard( GetMutex() );
-
+
mxGraphics = rDevice;
xView = xView.query( getPeer() );
}
@@ -1037,31 +1035,31 @@ awt::Size UnoControl::getSize( )
throw(RuntimeException)
void UnoControl::draw( sal_Int32 x, sal_Int32 y ) throw(RuntimeException)
{
- Reference< XWindowPeer > xDrawPeer;
- Reference< XView > xDrawPeerView;
+ Reference< XWindowPeer > xDrawPeer;
+ Reference< XView > xDrawPeerView;
- bool bDisposeDrawPeer( false );
- {
- ::osl::MutexGuard aGuard( GetMutex() );
+ bool bDisposeDrawPeer( false );
+ {
+ ::osl::MutexGuard aGuard( GetMutex() );
- xDrawPeer = ImplGetCompatiblePeer( sal_True );
- bDisposeDrawPeer = xDrawPeer.is() && ( xDrawPeer != getPeer() );
+ xDrawPeer = ImplGetCompatiblePeer( sal_True );
+ bDisposeDrawPeer = xDrawPeer.is() && ( xDrawPeer != getPeer() );
- xDrawPeerView.set( xDrawPeer, UNO_QUERY );
- DBG_ASSERT( xDrawPeerView.is(), "UnoControl::draw: no peer!" );
- }
+ xDrawPeerView.set( xDrawPeer, UNO_QUERY );
+ DBG_ASSERT( xDrawPeerView.is(), "UnoControl::draw: no peer!" );
+ }
- if ( xDrawPeerView.is() )
- {
- Reference< XVclWindowPeer > xWindowPeer;
- xWindowPeer.set( xDrawPeer, UNO_QUERY );
- if ( xWindowPeer.is() )
- xWindowPeer->setDesignMode( mbDesignMode );
- xDrawPeerView->draw( x, y );
- }
+ if ( xDrawPeerView.is() )
+ {
+ Reference< XVclWindowPeer > xWindowPeer;
+ xWindowPeer.set( xDrawPeer, UNO_QUERY );
+ if ( xWindowPeer.is() )
+ xWindowPeer->setDesignMode( mbDesignMode );
+ xDrawPeerView->draw( x, y );
+ }
- if ( bDisposeDrawPeer )
- xDrawPeer->dispose();
+ if ( bDisposeDrawPeer )
+ xDrawPeer->dispose();
}
void UnoControl::setZoom( float fZoomX, float fZoomY ) throw(RuntimeException)
@@ -1069,7 +1067,7 @@ void UnoControl::setZoom( float fZoomX, float fZoomY )
throw(RuntimeException)
Reference< XView > xView;
{
::osl::MutexGuard aGuard( GetMutex() );
-
+
maComponentInfos.nZoomX = fZoomX;
maComponentInfos.nZoomY = fZoomY;
@@ -1083,40 +1081,40 @@ void UnoControl::setZoom( float fZoomX, float fZoomY )
throw(RuntimeException)
void UnoControl::setContext( const Reference< XInterface >& rxContext )
throw(RuntimeException)
{
::osl::MutexGuard aGuard( GetMutex() );
-
+
mxContext = rxContext;
}
Reference< XInterface > UnoControl::getContext( ) throw(RuntimeException)
{
::osl::MutexGuard aGuard( GetMutex() );
-
+
return mxContext;
}
void UnoControl::peerCreated()
{
- Reference< XWindow > xWindow( getPeer(), UNO_QUERY );
- if ( !xWindow.is() )
- return;
+ Reference< XWindow > xWindow( getPeer(), UNO_QUERY );
+ if ( !xWindow.is() )
+ return;
- if ( maWindowListeners.getLength() )
- xWindow->addWindowListener( &maWindowListeners );
+ if ( maWindowListeners.getLength() )
+ xWindow->addWindowListener( &maWindowListeners );
- if ( maFocusListeners.getLength() )
- xWindow->addFocusListener( &maFocusListeners );
+ if ( maFocusListeners.getLength() )
+ xWindow->addFocusListener( &maFocusListeners );
- if ( maKeyListeners.getLength() )
- xWindow->addKeyListener( &maKeyListeners );
+ if ( maKeyListeners.getLength() )
+ xWindow->addKeyListener( &maKeyListeners );
- if ( maMouseListeners.getLength() )
- xWindow->addMouseListener( &maMouseListeners );
+ if ( maMouseListeners.getLength() )
+ xWindow->addMouseListener( &maMouseListeners );
- if ( maMouseMotionListeners.getLength() )
- xWindow->addMouseMotionListener( &maMouseMotionListeners );
+ if ( maMouseMotionListeners.getLength() )
+ xWindow->addMouseMotionListener( &maMouseMotionListeners );
- if ( maPaintListeners.getLength() )
- xWindow->addPaintListener( &maPaintListeners );
+ if ( maPaintListeners.getLength() )
+ xWindow->addPaintListener( &maPaintListeners );
}
void UnoControl::createPeer( const Reference< XToolkit >& rxToolkit, const
Reference< XWindowPeer >& rParentPeer ) throw(RuntimeException)
@@ -1130,7 +1128,7 @@ void UnoControl::createPeer( const Reference< XToolkit >&
rxToolkit, const Refer
aException.Context =
(XAggregation*)(::cppu::OWeakAggObject*)this;
throw( aException );
}
-
+
if( !getPeer().is() )
{
mbCreatingPeer = sal_True;
@@ -1140,7 +1138,7 @@ void UnoControl::createPeer( const Reference< XToolkit >&
rxToolkit, const Refer
if( rParentPeer.is() && mxContext.is() )
{
// kein TopWindow
- if ( !xToolkit.is() )
+ if ( !xToolkit.is() )
xToolkit = rParentPeer->getToolkit();
Any aAny = OWeakAggObject::queryInterface(
::getCppuType((const Reference< XControlContainer>*)0) );
Reference< XControlContainer > xC;
@@ -1155,13 +1153,13 @@ void UnoControl::createPeer( const Reference< XToolkit
>& rxToolkit, const Refer
{ // Nur richtig, wenn es sich um ein Top Window handelt
if( rParentPeer.is() )
{
- if ( !xToolkit.is() )
+ if ( !xToolkit.is() )
xToolkit = rParentPeer->getToolkit();
eType = WindowClass_CONTAINER;
}
else
{
- if ( !xToolkit.is() )
+ if ( !xToolkit.is() )
xToolkit =
VCLUnoHelper::CreateToolkit();
eType = WindowClass_TOP;
}
@@ -1173,10 +1171,10 @@ void UnoControl::createPeer( const Reference< XToolkit
>& rxToolkit, const Refer
aDescr.Bounds = getPosSize();
aDescr.WindowAttributes = 0;
- // Border
+ // Border
Reference< XPropertySet > xPSet( mxModel, UNO_QUERY );
Reference< XPropertySetInfo > xInfo =
xPSet->getPropertySetInfo();
-
+
Any aVal;
::rtl::OUString aPropName = GetPropertyName(
BASEPROPERTY_BORDER );
if ( xInfo->hasPropertyByName( aPropName ) )
@@ -1193,17 +1191,17 @@ void UnoControl::createPeer( const Reference< XToolkit
>& rxToolkit, const Refer
}
// DESKTOP_AS_PARENT
- if ( aDescr.Type == WindowClass_TOP )
- {
- aPropName = GetPropertyName( BASEPROPERTY_DESKTOP_AS_PARENT );
- if ( xInfo->hasPropertyByName( aPropName ) )
- {
- aVal = xPSet->getPropertyValue( aPropName );
- sal_Bool b = sal_Bool();
- if ( ( aVal >>= b ) && b)
- aDescr.ParentIndex = -1;
- }
- }
+ if ( aDescr.Type == WindowClass_TOP )
+ {
+ aPropName = GetPropertyName(
BASEPROPERTY_DESKTOP_AS_PARENT );
+ if ( xInfo->hasPropertyByName( aPropName ) )
+ {
+ aVal = xPSet->getPropertyValue( aPropName );
+ sal_Bool b = sal_Bool();
+ if ( ( aVal >>= b ) && b)
+ aDescr.ParentIndex = -1;
+ }
+ }
// Moveable
aPropName = GetPropertyName( BASEPROPERTY_MOVEABLE );
if ( xInfo->hasPropertyByName( aPropName ) )
@@ -1233,7 +1231,7 @@ void UnoControl::createPeer( const Reference< XToolkit >&
rxToolkit, const Refer
if ( ( aVal >>= b ) && b)
aDescr.WindowAttributes |=
VclWindowPeerAttribute::DROPDOWN;
}
-
+
// Spin
aPropName = GetPropertyName( BASEPROPERTY_SPIN );
if ( xInfo->hasPropertyByName( aPropName ) )
@@ -1284,8 +1282,8 @@ void UnoControl::createPeer( const Reference< XToolkit >&
rxToolkit, const Refer
aDescr.WindowAttributes |=
VclWindowPeerAttribute::AUTOVSCROLL;
}
- //added for issue79712
- //NoLabel
+ // added for issue79712
+ // NoLabel
aPropName = GetPropertyName( BASEPROPERTY_NOLABEL );
if ( xInfo->hasPropertyByName( aPropName ) )
{
@@ -1295,7 +1293,7 @@ void UnoControl::createPeer( const Reference< XToolkit >&
rxToolkit, const Refer
aDescr.WindowAttributes |=
VclWindowPeerAttribute::NOLABEL;
}
//issue79712 ends
-
+
// Align
aPropName = GetPropertyName( BASEPROPERTY_ALIGN );
if ( xInfo->hasPropertyByName( aPropName ) )
@@ -1313,7 +1311,7 @@ void UnoControl::createPeer( const Reference< XToolkit >&
rxToolkit, const Refer
}
}
- // Ableitungen die Moeglichkeit geben die Attribute zu manipulieren
+ // Ableitungen die Möglichkeit geben die Attribute zu
manipulieren
PrepareWindowDescriptor(aDescr);
// create the peer
@@ -1331,7 +1329,7 @@ void UnoControl::createPeer( const Reference< XToolkit >&
rxToolkit, const Refer
UnoControlComponentInfos aComponentInfos(maComponentInfos);
sal_Bool bDesignMode(mbDesignMode);
- Reference< XGraphics > xGraphics( mxGraphics );
+ Reference< XGraphics > xGraphics( mxGraphics );
Reference< XView > xView ( getPeer(), UNO_QUERY );
Reference< XWindow > xWindow ( getPeer(), UNO_QUERY );
@@ -1345,7 +1343,7 @@ void UnoControl::createPeer( const Reference< XToolkit >&
rxToolkit, const Refer
xView->setZoom( aComponentInfos.nZoomX, aComponentInfos.nZoomY
);
- setPosSize( aComponentInfos.nX, aComponentInfos.nY,
aComponentInfos.nWidth, aComponentInfos.nHeight, aComponentInfos.nFlags );
+ setPosSize( aComponentInfos.nX, aComponentInfos.nY,
aComponentInfos.nWidth, aComponentInfos.nHeight, aComponentInfos.nFlags );
if( aComponentInfos.bVisible && !bDesignMode )
// Erst nach dem setzen der Daten anzeigen
@@ -1356,7 +1354,7 @@ void UnoControl::createPeer( const Reference< XToolkit >&
rxToolkit, const Refer
xView->setGraphics( xGraphics );
- peerCreated();
+ peerCreated();
mbCreatingPeer = sal_False;
}
@@ -1371,36 +1369,36 @@ Reference< XWindowPeer > UnoControl::getPeer()
throw(RuntimeException)
sal_Bool UnoControl::setModel( const Reference< XControlModel >& rxModel )
throw(RuntimeException)
{
::osl::MutexGuard aGuard( GetMutex() );
-
+
Reference< XMultiPropertySet > xPropSet( mxModel, UNO_QUERY );
- // query for the XPropertiesChangeListener - our delegator is allowed to
overwrite this interface
- Reference< XPropertiesChangeListener > xListener;
- queryInterface( ::getCppuType( &xListener ) ) >>= xListener;
+ // query for the XPropertiesChangeListener - our delegator is allowed
to overwrite this interface
+ Reference< XPropertiesChangeListener > xListener;
+ queryInterface( ::getCppuType( &xListener ) ) >>= xListener;
if( xPropSet.is() )
xPropSet->removePropertiesChangeListener( xListener );
- mpData->bLocalizationSupport = false;
+ mpData->bLocalizationSupport = false;
mxModel = rxModel;
- if( mxModel.is() )
+ if( mxModel.is() )
{
- try
- {
- xPropSet.set( mxModel, UNO_QUERY_THROW );
- Reference< XPropertySetInfo > xPSI(
xPropSet->getPropertySetInfo(), UNO_SET_THROW );
-
- Sequence< ::rtl::OUString> aNames = lcl_ImplGetPropertyNames(
xPropSet );
- xPropSet->addPropertiesChangeListener( aNames, xListener );
-
- mpData->bLocalizationSupport = xPSI->hasPropertyByName(
::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ResourceResolver" ) ) );
- }
- catch( const Exception& )
- {
- DBG_UNHANDLED_EXCEPTION();
- mxModel.clear();
- }
+ try
+ {
+ xPropSet.set( mxModel, UNO_QUERY_THROW );
+ Reference< XPropertySetInfo > xPSI(
xPropSet->getPropertySetInfo(), UNO_SET_THROW );
+
+ Sequence< ::rtl::OUString> aNames =
lcl_ImplGetPropertyNames( xPropSet );
+ xPropSet->addPropertiesChangeListener( aNames,
xListener );
+
+ mpData->bLocalizationSupport = xPSI->hasPropertyByName(
::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ResourceResolver" ) ) );
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ mxModel.clear();
+ }
}
return mxModel.is();
@@ -1438,12 +1436,12 @@ void UnoControl::setDesignMode( sal_Bool bOn )
throw(RuntimeException)
aModeChangeEvent.NewMode = ::rtl::OUString::createFromAscii(
mbDesignMode ? "design" : "alive" );
}
- // ajust the visibility of our window
+ // adjust the visibility of our window
if ( xWindow.is() )
xWindow->setVisible( !bOn );
// and notify our mode listeners
- maModeChangeListeners.notifyEach( &XModeChangeListener::modeChanged,
aModeChangeEvent );
+ maModeChangeListeners.notifyEach( &XModeChangeListener::modeChanged,
aModeChangeEvent );
}
sal_Bool UnoControl::isDesignMode( ) throw(RuntimeException)
@@ -1466,7 +1464,7 @@ sal_Bool UnoControl::isTransparent( )
throw(RuntimeException)
sal_Bool UnoControl::supportsService( const ::rtl::OUString& rServiceName )
throw(RuntimeException)
{
::osl::MutexGuard aGuard( GetMutex() );
-
+
Sequence< ::rtl::OUString > aSNL = getSupportedServiceNames();
const ::rtl::OUString* pArray = aSNL.getConstArray();
const ::rtl::OUString* pArrayEnd = aSNL.getConstArray() +
aSNL.getLength();
@@ -1486,8 +1484,8 @@ Sequence< ::rtl::OUString >
UnoControl::getSupportedServiceNames( ) throw(Runti
// ------------------------------------------------------------------------
Reference< XAccessibleContext > SAL_CALL UnoControl::getAccessibleContext( )
throw (RuntimeException)
{
- // creation of the context will certainly require the SolarMutex ...
- ::vos::OGuard aSolarGuard( Application::GetSolarMutex() );
+ // creation of the context will certainly require the SolarMutex ...
+ ::vos::OGuard aSolarGuard( Application::GetSolarMutex() );
::osl::MutexGuard aGuard( GetMutex() );
Reference< XAccessibleContext > xCurrentContext(
maAccessibleContext.get(), UNO_QUERY );
@@ -1551,7 +1549,7 @@ awt::Point SAL_CALL UnoControl::convertPointToLogic(
const awt::Point& i_Point,
}
if ( xPeerConversion.is() )
return xPeerConversion->convertPointToLogic( i_Point,
i_TargetUnit );
- return awt::Point( );
+ return awt::Point( );
}
//----------------------------------------------------------------------------------------------------------------------
@@ -1564,7 +1562,7 @@ awt::Point SAL_CALL UnoControl::convertPointToPixel(
const awt::Point& i_Point,
}
if ( xPeerConversion.is() )
return xPeerConversion->convertPointToPixel( i_Point,
i_SourceUnit );
- return awt::Point( );
+ return awt::Point( );
}
//----------------------------------------------------------------------------------------------------------------------
@@ -1577,7 +1575,7 @@ awt::Size SAL_CALL UnoControl::convertSizeToLogic( const
awt::Size& i_Size, ::sa
}
if ( xPeerConversion.is() )
return xPeerConversion->convertSizeToLogic( i_Size,
i_TargetUnit );
- return awt::Size( );
+ return awt::Size( );
}
//----------------------------------------------------------------------------------------------------------------------
@@ -1590,18 +1588,20 @@ awt::Size SAL_CALL UnoControl::convertSizeToPixel(
const awt::Size& i_Size, ::sa
}
if ( xPeerConversion.is() )
return xPeerConversion->convertSizeToPixel( i_Size,
i_SourceUnit );
- return awt::Size( );
+ return awt::Size( );
}
//----------------------------------------------------------------------------------------------------------------------
uno::Reference< awt::XStyleSettings > SAL_CALL UnoControl::getStyleSettings()
throw (RuntimeException)
{
- Reference< awt::XStyleSettingsSupplier > xPeerSupplier;
+ Reference< awt::XStyleSettingsSupplier > xPeerSupplier;
{
::osl::MutexGuard aGuard( GetMutex() );
xPeerSupplier = xPeerSupplier.query( getPeer() );
}
if ( xPeerSupplier.is() )
return xPeerSupplier->getStyleSettings();
- return NULL;
+ return NULL;
}
+
+/* vim: set noet sw=4 ts=4: */
diff --git a/main/toolkit/source/layout/vcl/wrapper.cxx
b/main/toolkit/source/layout/vcl/wrapper.cxx
index d2994523e9..0a2d811564 100644
--- a/main/toolkit/source/layout/vcl/wrapper.cxx
+++ b/main/toolkit/source/layout/vcl/wrapper.cxx
@@ -1,5 +1,5 @@
/**************************************************************
- *
+ *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
@@ -7,20 +7,18 @@
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
- *
+ *
*************************************************************/
-
-
#include <tools/rc.h>
//#define RESOURCE_PUBLISH_PROTECTED 1
#if RESOURCE_PUBLISH_PROTECTED
@@ -30,7 +28,6 @@
#include <tools/rc.hxx>
#undef protected
-
#include "wrapper.hxx"
#include <awt/vclxplugin.hxx>
@@ -64,39 +61,39 @@ namespace layout
// Context bits ...
class ContextImpl
{
- uno::Reference< awt::XLayoutRoot > mxRoot;
- uno::Reference< container::XNameAccess > mxNameAccess;
- PeerHandle mxTopLevel;
+ uno::Reference< awt::XLayoutRoot > mxRoot;
+ uno::Reference< container::XNameAccess > mxNameAccess;
+ PeerHandle mxTopLevel;
public:
- ContextImpl( char const *pPath )
- {
- uno::Sequence< uno::Any > aParams( 1 );
- aParams[0] <<= OUString( pPath, strlen( pPath ), RTL_TEXTENCODING_UTF8
);
+ ContextImpl( char const *pPath )
+ {
+ uno::Sequence< uno::Any > aParams( 1 );
+ aParams[0] <<= OUString( pPath, strlen( pPath ),
RTL_TEXTENCODING_UTF8 );
- uno::Reference< lang::XSingleServiceFactory > xFactory(
+ uno::Reference< lang::XSingleServiceFactory > xFactory(
comphelper::createProcessComponent(
OUString::createFromAscii( "com.sun.star.awt.Layout" ) ),
uno::UNO_QUERY );
- if ( !xFactory.is() )
- {
+ if ( !xFactory.is() )
+ {
throw uno::RuntimeException(
OUString( RTL_CONSTASCII_USTRINGPARAM( "Layout engine not
installed" ) ),
uno::Reference< uno::XInterface >() );
- }
- mxRoot = uno::Reference< awt::XLayoutRoot >(
- xFactory->createInstanceWithArguments( aParams ),
- uno::UNO_QUERY );
+ }
+ mxRoot = uno::Reference< awt::XLayoutRoot >(
+ xFactory->createInstanceWithArguments( aParams ),
+ uno::UNO_QUERY );
- mxNameAccess = uno::Reference< container::XNameAccess >( mxRoot,
uno::UNO_QUERY );
- }
+ mxNameAccess = uno::Reference< container::XNameAccess >(
mxRoot, uno::UNO_QUERY );
+ }
- ~ContextImpl()
- {
- }
+ ~ContextImpl()
+ {
+ }
- PeerHandle getByName( const OUString &rName )
- {
+ PeerHandle getByName( const OUString &rName )
+ {
uno::Any val = mxNameAccess->getByName( rName );
PeerHandle xRet;
val >>= xRet;
@@ -117,13 +114,13 @@ public:
};
Context::Context( const char *pPath )
- : pImpl( new ContextImpl( pPath ) )
+ : pImpl( new ContextImpl( pPath ) )
{
}
Context::~Context()
{
- delete pImpl;
- pImpl = NULL;
+ delete pImpl;
+ pImpl = NULL;
}
void Context::setToplevel( PeerHandle xToplevel )
@@ -398,7 +395,7 @@ void Window::SetPosPixel (Point const&)
Point Window::GetPosPixel () const
{
- return Point ();
+ return Point ();
}
void Window::SetSizePixel (Size const&)
@@ -411,69 +408,69 @@ void Window::SetPosSizePixel (Point const&, Size const&)
Size Window::GetSizePixel () const
{
- return Size ();
+ return Size ();
}
// void Window::Enable (bool enable, bool child);
// {
-// GetWindow ()->Enable (enable, child);
+// GetWindow ()->Enable (enable, child);
// }
// void Window::Disable (bool child)
// {
-// GetWindow ()->Disable (child);
+// GetWindow ()->Disable (child);
// }
bool Window::IsEnabled () const
{
- return GetWindow ()->IsEnabled ();
-// if (getImpl().mxWindow.is ())
-// return getImpl ().mxWindow->isEnabled ();
-// return false;
+ return GetWindow ()->IsEnabled ();
+// if (getImpl().mxWindow.is ())
+// return getImpl ().mxWindow->isEnabled ();
+// return false;
}
void Window::EnableInput (bool enable, bool child)
{
- GetWindow ()->EnableInput (enable, child);
+ GetWindow ()->EnableInput (enable, child);
}
bool Window::IsInputEnabled () const
{
- return GetWindow ()->IsInputEnabled ();
+ return GetWindow ()->IsInputEnabled ();
}
bool Window::HasFocus () const
{
- return GetWindow ()->HasFocus ();
+ return GetWindow ()->HasFocus ();
}
Font& Window::GetFont () const
{
- return const_cast <Font&> (GetWindow ()->GetFont ());
+ return const_cast <Font&> (GetWindow ()->GetFont ());
}
void Window::SetFont (Font const& font)
{
- GetWindow ()->SetFont (font);
+ GetWindow ()->SetFont (font);
}
void Window::Invalidate (sal_uInt8 flags)
{
- GetWindow ()->Invalidate (flags);
+ GetWindow ()->Invalidate (flags);
}
struct ToolkitVclPropsMap
{
- WinBits vclStyle;
- long initAttr;
- const char *propName;
+ WinBits vclStyle;
+ long initAttr;
+ const char *propName;
- // the value to give the prop to enable/disable it -- not the most
brilliant
- // type declaration and storage, but does the work... properties are
- // either a boolean or a short since they are either a directly wrappers
for
- // a WinBit, or aggregates related (like Align for WB_LEFT, _RIGHT and
_CENTER).
- bool isBoolean;
- short enableProp, disableProp;
+ // the value to give the prop to enable/disable it -- not the most
brilliant
+ // type declaration and storage, but does the work... properties are
+ // either a boolean or a short since they are either a directly
wrappers for
+ // a WinBit, or aggregates related (like Align for WB_LEFT, _RIGHT and
_CENTER).
+ bool isBoolean;
+ short enableProp, disableProp;
};
#define TYPE_BOOL true
@@ -481,11 +478,11 @@ struct ToolkitVclPropsMap
#define NOTYPE 0
static const ToolkitVclPropsMap toolkitVclPropsMap[] =
{
- { WB_BORDER, awt::WindowAttribute::BORDER, "Border", TYPE_SHORT, 1,
0 },
- { WB_NOBORDER, awt::VclWindowPeerAttribute::NOBORDER, "Border",
TYPE_SHORT, 0, 1 },
- { WB_SIZEABLE, awt::WindowAttribute::SIZEABLE, NULL, NOTYPE, 0, 0 },
- { WB_MOVEABLE, awt::WindowAttribute::MOVEABLE, NULL, NOTYPE, 0, 0 },
- { WB_CLOSEABLE, awt::WindowAttribute::CLOSEABLE, NULL, NOTYPE, 0, 0
},
+ { WB_BORDER, awt::WindowAttribute::BORDER, "Border", TYPE_SHORT,
1, 0 },
+ { WB_NOBORDER, awt::VclWindowPeerAttribute::NOBORDER, "Border",
TYPE_SHORT, 0, 1 },
+ { WB_SIZEABLE, awt::WindowAttribute::SIZEABLE, NULL, NOTYPE, 0, 0
},
+ { WB_MOVEABLE, awt::WindowAttribute::MOVEABLE, NULL, NOTYPE, 0, 0
},
+ { WB_CLOSEABLE, awt::WindowAttribute::CLOSEABLE, NULL, NOTYPE, 0,
0 },
{ WB_HSCROLL, awt::VclWindowPeerAttribute::HSCROLL, NULL, NOTYPE, 0,
0 },
{ WB_VSCROLL, awt::VclWindowPeerAttribute::VSCROLL, NULL, NOTYPE, 0,
0 },
@@ -525,7 +522,7 @@ static const ToolkitVclPropsMap toolkitVclPropsMap[] =
#undef NOTYPE
static const int toolkitVclPropsMapLen =
- sizeof( toolkitVclPropsMap ) / sizeof( ToolkitVclPropsMap );
+ sizeof( toolkitVclPropsMap ) / sizeof( ToolkitVclPropsMap );
void Window::SetStyle( WinBits nStyle )
{
@@ -720,9 +717,9 @@ void ControlImpl::UpdateListening (Link const& link)
}
void SAL_CALL ControlImpl::disposing (lang::EventObject const&)
- throw (uno::RuntimeException)
+ throw (uno::RuntimeException)
{
-/// mxWindow.clear ();
+// mxWindow.clear ();
}
void SAL_CALL ControlImpl::focusGained (awt::FocusEvent const&)
@@ -1111,8 +1108,8 @@ void TabControl::InsertPage (sal_uInt16 id, OUString
const& title, sal_uInt16 po
#endif
#if 0
- /// This so seems the right solution, but it makes the buttons of the
- /// tabdialog move up
+ // This so seems the right solution, but it makes the buttons of the
+ // tabdialog move up
::TabPage *page = GetTabPage (id);
if (Window *w = dynamic_cast <Window*> (page))
@@ -1160,8 +1157,8 @@ void TabControl::SetTabPage (sal_uInt16 id, ::TabPage*
page)
GetTabControl ()->SetTabPage (id, page);
#if 0
- /// This so seems the right solution, but it makes the buttons of the
- /// tabdialog move up
+ // This so seems the right solution, but it makes the buttons of the
+ // tabdialog move up
if (Window *w = dynamic_cast <Window*> (page))
{
w->SetParent (this);
@@ -1603,8 +1600,10 @@ void InPlug::ParentSet (Window *window)
{
window->SetParent (dynamic_cast< ::Window* > (this));
- /// FIXME: for standalone run of layout::SfxTabDialog
+ // FIXME: for standalone run of layout::SfxTabDialog
SetParent (window->GetParent ());
}
} // namespace layout
+
+/* vim: set noet sw=4 ts=4: */
diff --git a/main/unotools/source/config/startoptions.cxx
b/main/unotools/source/config/startoptions.cxx
index fe5185db8a..0c223060e6 100644
--- a/main/unotools/source/config/startoptions.cxx
+++ b/main/unotools/source/config/startoptions.cxx
@@ -1,5 +1,5 @@
/**************************************************************
- *
+ *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
@@ -7,20 +7,18 @@
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
- *
+ *
*************************************************************/
-
-
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_unotools.hxx"
#ifndef GCC
@@ -55,7 +53,7 @@ using namespace ::com::sun::star::uno ;
#define DEFAULT_SHOWINTRO sal_True
#define DEFAULT_CONNECTIONURL OUString()
-#define ROOTNODE_START
OUString(RTL_CONSTASCII_USTRINGPARAM("Setup/Office" ))
+#define ROOTNODE_START
OUString(RTL_CONSTASCII_USTRINGPARAM("Setup/Office" ))
#define PROPERTYNAME_SHOWINTRO
OUString(RTL_CONSTASCII_USTRINGPARAM("ooSetupShowIntro" ))
#define PROPERTYNAME_CONNECTIONURL
OUString(RTL_CONSTASCII_USTRINGPARAM("ooSetupConnectionURL" ))
@@ -90,7 +88,7 @@ class SvtStartOptions_Impl : public ConfigItem
/*-****************************************************************************************************//**
@short called for notify of configmanager
@descr These method is called from the
ConfigManager before application ends or from the
- PropertyChangeListener if the
sub tree broadcasts changes. You must update your
+ PropertyChangeListener if the
sub tree broadcasts changes. You must update your
internal values.
@ATTENTION We don't implement these method -
because we support readonly values at runtime only!
@@ -103,7 +101,7 @@ class SvtStartOptions_Impl : public ConfigItem
@onerror -
*//*-*****************************************************************************************************/
- virtual void Notify( const Sequence< OUString >& seqPropertyNames );
+ virtual void Notify( const Sequence< OUString >&
seqPropertyNames );
/*-****************************************************************************************************//**
@short write changes to configuration
@@ -120,7 +118,7 @@ class SvtStartOptions_Impl : public ConfigItem
@onerror -
*//*-*****************************************************************************************************/
- virtual void Commit();
+ virtual void Commit();
//---------------------------------------------------------------------------------------------------------
// public interface
@@ -172,8 +170,8 @@ class SvtStartOptions_Impl : public ConfigItem
private:
- sal_Bool m_bShowIntro ; /// cache
"ShowIntro" of Start section
- OUString m_sConnectionURL ; /// cache
"Connection" of Start section
+ sal_Bool m_bShowIntro ; // cache
"ShowIntro" of Start section
+ OUString m_sConnectionURL ; // cache
"Connection" of Start section
};
//_________________________________________________________________________________________________________________
@@ -185,7 +183,7 @@ class SvtStartOptions_Impl : public ConfigItem
//*****************************************************************************************************************
SvtStartOptions_Impl::SvtStartOptions_Impl()
// Init baseclasses first
- : ConfigItem ( ROOTNODE_START )
+ : ConfigItem ( ROOTNODE_START )
// Init member then.
, m_bShowIntro ( DEFAULT_SHOWINTRO )
{
@@ -206,20 +204,20 @@ SvtStartOptions_Impl::SvtStartOptions_Impl()
// Safe impossible cases.
// Check any for valid value.
DBG_ASSERT( !(seqValues[nProperty].hasValue()==sal_False),
"SvtStartOptions_Impl::SvtStartOptions_Impl()\nInvalid property value for
property detected!\n" );
- switch( nProperty )
- {
- case PROPERTYHANDLE_SHOWINTRO : {
-
DBG_ASSERT(!(seqValues[nProperty].getValueTypeClass()!=TypeClass_BOOLEAN),
"SvtStartOptions_Impl::SvtStartOptions_Impl()\nWho has changed the value type
of \"Office.Common\\Start\\ShowIntro\"?" );
+ switch( nProperty )
+ {
+ case PROPERTYHANDLE_SHOWINTRO : {
+
DBG_ASSERT(!(seqValues[nProperty].getValueTypeClass()!=TypeClass_BOOLEAN),
"SvtStartOptions_Impl::SvtStartOptions_Impl()\nWho has changed the value type
of \"Office.Common\\Start\\ShowIntro\"?" );
seqValues[nProperty] >>= m_bShowIntro;
}
break;
- case PROPERTYHANDLE_CONNECTIONURL : {
-
DBG_ASSERT(!(seqValues[nProperty].getValueTypeClass()!=TypeClass_STRING),
"SvtStartOptions_Impl::SvtStartOptions_Impl()\nWho has changed the value type
of \"Office.Common\\Start\\Connection\"?" );
+ case PROPERTYHANDLE_CONNECTIONURL : {
+
DBG_ASSERT(!(seqValues[nProperty].getValueTypeClass()!=TypeClass_STRING),
"SvtStartOptions_Impl::SvtStartOptions_Impl()\nWho has changed the value type
of \"Office.Common\\Start\\Connection\"?" );
seqValues[nProperty] >>= m_sConnectionURL;
}
break;
- }
+ }
}
// Don't enable notification mechanism of our baseclass!
@@ -263,7 +261,7 @@ void SvtStartOptions_Impl::Notify( const Sequence< OUString
>& seqPropertyNames
DBG_ASSERT(!(seqValues[nProperty].getValueTypeClass()!=TypeClass_STRING),
"SvtStartOptions_Impl::Notify()\nWho has changed the value type of
\"Office.Common\\Start\\Connection\"?" );
seqValues[nProperty] >>= m_sConnectionURL;
}
- #if OSL_DEBUG_LEVEL > 1
+ #if OSL_DEBUG_LEVEL > 1
else DBG_ASSERT( sal_False,
"SvtStartOptions_Impl::Notify()\nUnkown property detected ... I can't handle
these!\n" );
#endif
}
@@ -280,17 +278,17 @@ void SvtStartOptions_Impl::Commit()
Sequence< Any > seqValues ( nCount );
for( sal_Int32 nProperty=0; nProperty<nCount; ++nProperty )
{
- switch( nProperty )
- {
- case PROPERTYHANDLE_SHOWINTRO : {
-
seqValues[nProperty] <<= m_bShowIntro;
-
}
-
break;
- case PROPERTYHANDLE_CONNECTIONURL : {
-
seqValues[nProperty] <<= m_sConnectionURL;
-
}
-
break;
- }
+ switch( nProperty )
+ {
+ case PROPERTYHANDLE_SHOWINTRO : {
+
seqValues[nProperty] <<= m_bShowIntro;
+
}
+
break;
+ case PROPERTYHANDLE_CONNECTIONURL : {
+
seqValues[nProperty] <<= m_sConnectionURL;
+
}
+
break;
+ }
}
// Set properties in configuration.
PutProperties( seqNames, seqValues );
@@ -360,17 +358,17 @@ sal_Int32
SvtStartOptions::m_nRefCount = 0 ;
//*****************************************************************************************************************
SvtStartOptions::SvtStartOptions()
{
- // Global access, must be guarded (multithreading!).
- MutexGuard aGuard( GetOwnStaticMutex() );
+ // Global access, must be guarded (multithreading!).
+ MutexGuard aGuard( GetOwnStaticMutex() );
// Increase our refcount ...
++m_nRefCount;
// ... and initialize our data container only if it not already!
- if( m_pDataContainer == NULL )
+ if( m_pDataContainer == NULL )
{
- RTL_LOGFILE_CONTEXT(aLog, "unotools ( ??? )
::SvtStartOptions_Impl::ctor()");
- m_pDataContainer = new SvtStartOptions_Impl();
+ RTL_LOGFILE_CONTEXT(aLog, "unotools ( ??? )
::SvtStartOptions_Impl::ctor()");
+ m_pDataContainer = new SvtStartOptions_Impl();
- ItemHolder1::holdConfigItem(E_STARTOPTIONS);
+ ItemHolder1::holdConfigItem(E_STARTOPTIONS);
}
}
@@ -379,13 +377,13 @@ SvtStartOptions::SvtStartOptions()
//*****************************************************************************************************************
SvtStartOptions::~SvtStartOptions()
{
- // Global access, must be guarded (multithreading!)
- MutexGuard aGuard( GetOwnStaticMutex() );
+ // Global access, must be guarded (multithreading!)
+ MutexGuard aGuard( GetOwnStaticMutex() );
// Decrease our refcount.
--m_nRefCount;
// If last instance was deleted ...
// we must destroy our static data container!
- if( m_nRefCount <= 0 )
+ if( m_nRefCount <= 0 )
{
delete m_pDataContainer;
m_pDataContainer = NULL;
@@ -397,7 +395,7 @@ SvtStartOptions::~SvtStartOptions()
//*****************************************************************************************************************
sal_Bool SvtStartOptions::IsIntroEnabled() const
{
- MutexGuard aGuard( GetOwnStaticMutex() );
+ MutexGuard aGuard( GetOwnStaticMutex() );
return m_pDataContainer->IsIntroEnabled();
}
@@ -406,7 +404,7 @@ sal_Bool SvtStartOptions::IsIntroEnabled() const
//*****************************************************************************************************************
void SvtStartOptions::EnableIntro( sal_Bool bState )
{
- MutexGuard aGuard( GetOwnStaticMutex() );
+ MutexGuard aGuard( GetOwnStaticMutex() );
m_pDataContainer->EnableIntro( bState );
}
@@ -415,7 +413,7 @@ void SvtStartOptions::EnableIntro( sal_Bool bState )
//*****************************************************************************************************************
OUString SvtStartOptions::GetConnectionURL() const
{
- MutexGuard aGuard( GetOwnStaticMutex() );
+ MutexGuard aGuard( GetOwnStaticMutex() );
return m_pDataContainer->GetConnectionURL();
}
@@ -424,7 +422,7 @@ OUString SvtStartOptions::GetConnectionURL() const
//*****************************************************************************************************************
void SvtStartOptions::SetConnectionURL( const OUString& sURL )
{
- MutexGuard aGuard( GetOwnStaticMutex() );
+ MutexGuard aGuard( GetOwnStaticMutex() );
m_pDataContainer->SetConnectionURL( sURL );
}
@@ -434,21 +432,23 @@ void SvtStartOptions::SetConnectionURL( const OUString&
sURL )
Mutex& SvtStartOptions::GetOwnStaticMutex()
{
// Initialize static mutex only for one time!
- static Mutex* pMutex = NULL;
+ static Mutex* pMutex = NULL;
// If these method first called (Mutex not already exist!) ...
- if( pMutex == NULL )
- {
+ if( pMutex == NULL )
+ {
// ... we must create a new one. Protect follow code with the
global mutex -
// It must be - we create a static variable!
- MutexGuard aGuard( Mutex::getGlobalMutex() );
+ MutexGuard aGuard( Mutex::getGlobalMutex() );
// We must check our pointer again - because it can be that
another instance of our class will be faster than these!
- if( pMutex == NULL )
- {
+ if( pMutex == NULL )
+ {
// Create the new mutex and set it for return on static
variable.
- static Mutex aMutex;
- pMutex = &aMutex;
- }
- }
+ static Mutex aMutex;
+ pMutex = &aMutex;
+ }
+ }
// Return new created or already existing mutex object.
- return *pMutex;
+ return *pMutex;
}
+
+/* vim: set noet sw=4 ts=4: */