diff options
49 files changed, 1326 insertions, 2739 deletions
diff --git a/svl/inc/svl/zforlist.hxx b/svl/inc/svl/zforlist.hxx index 25e06a9237e2..783fce26bec9 100644 --- a/svl/inc/svl/zforlist.hxx +++ b/svl/inc/svl/zforlist.hxx @@ -425,7 +425,7 @@ public: /** Same as <method>PutEntry</method> but the format code string is considered to be of language/country eLnge and is converted to language/country eNewLnge */ - sal_Bool PutandConvertEntry( String& rString, xub_StrLen& nCheckPos, + bool PutandConvertEntry( String& rString, xub_StrLen& nCheckPos, short& nType, sal_uInt32& nKey, LanguageType eLnge, LanguageType eNewLnge ); @@ -433,7 +433,7 @@ public: is considered to be of the System language/country eLnge and is converted to another System language/country eNewLnge. In this case the automatic currency is converted too. */ - sal_Bool PutandConvertEntrySystem( String& rString, xub_StrLen& nCheckPos, + bool PutandConvertEntrySystem( String& rString, xub_StrLen& nCheckPos, short& nType, sal_uInt32& nKey, LanguageType eLnge, LanguageType eNewLnge ); diff --git a/svl/prj/build.lst b/svl/prj/build.lst index c47d11227077..1b88fab32810 100644 --- a/svl/prj/build.lst +++ b/svl/prj/build.lst @@ -1,3 +1,3 @@ sl svl : L10N:l10n rsc offuh ucbhelper unotools cppu cppuhelper comphelper sal sot LIBXSLT:libxslt NULL sl svl\prj nmake - all svl_prj NULL -sl svl\qa\unit nmake - all svl_qa_cppunit svl_util NULL +# sl svl\qa\unit nmake - all svl_qa_cppunit svl_util NULL diff --git a/svl/source/memtools/svarray.cxx b/svl/source/memtools/svarray.cxx index e94d00242de2..53b47c7e872a 100644 --- a/svl/source/memtools/svarray.cxx +++ b/svl/source/memtools/svarray.cxx @@ -67,6 +67,7 @@ sal_uInt16 SvPtrarr::GetPos( const VoidPtr& aElement ) const } SV_IMPL_VARARR( SvULongs, sal_uLong ) +SV_IMPL_VARARR( SvUShorts, sal_uInt16 ) SV_IMPL_VARARR( SvLongs, long) SV_IMPL_VARARR_SORT( SvULongsSort, sal_uLong ) diff --git a/svl/source/numbers/zforlist.cxx b/svl/source/numbers/zforlist.cxx index ec6f2c399f5c..f3a2f18c7630 100644 --- a/svl/source/numbers/zforlist.cxx +++ b/svl/source/numbers/zforlist.cxx @@ -573,7 +573,7 @@ bool SvNumberFormatter::PutandConvertEntry(String& rString, } -sal_Bool SvNumberFormatter::PutandConvertEntrySystem(String& rString, +bool SvNumberFormatter::PutandConvertEntrySystem(String& rString, xub_StrLen& nCheckPos, short& nType, sal_uInt32& nKey, @@ -2755,7 +2755,7 @@ void SvNumberFormatter::GenerateFormat(String& sString, const String& rThSep = GetNumThousandSep(); SvNumberformat* pFormat = (SvNumberformat*) aFTable.Get(nIndex); - BOOL insertBrackets = pFormat->IsNegativeInBracket(); + sal_Bool insertBrackets = pFormat->IsNegativeInBracket(); if (nAnzLeading == 0) { diff --git a/svl/source/numbers/zformat.cxx b/svl/source/numbers/zformat.cxx index f4db791770b7..579c494424b8 100644 --- a/svl/source/numbers/zformat.cxx +++ b/svl/source/numbers/zformat.cxx @@ -2052,9 +2052,9 @@ void lcl_GetOutputStringScientific( fNumber, rtl_math_StringFormat_E, nPrec, rFormatter.GetNumDecimalSep().GetChar(0)); } -sal_Int32 lcl_GetForcedDenominator(ImpSvNumberformatInfo &rInfo, USHORT nAnz) +sal_Int32 lcl_GetForcedDenominator(ImpSvNumberformatInfo &rInfo, sal_uInt16 nAnz) { - USHORT i; + sal_uInt16 i; rtl::OUString aDiv; for( i = 0; i < nAnz; i++ ) { @@ -2065,11 +2065,11 @@ sal_Int32 lcl_GetForcedDenominator(ImpSvNumberformatInfo &rInfo, USHORT nAnz) } // TODO: More optimizations? -void lcl_ForcedDenominator(ULONG &nFrac, ULONG &nDiv, ULONG nForcedDiv) +void lcl_ForcedDenominator(sal_uLong &nFrac, sal_uLong &nDiv, sal_uLong nForcedDiv) { double fFrac = (double)nFrac / (double)nDiv; double fMultiplier = (double)nForcedDiv / (double)nDiv; - nFrac = (ULONG)( (double)nFrac * fMultiplier ); + nFrac = (sal_uLong)( (double)nFrac * fMultiplier ); double fFracNew = (double)nFrac / (double)nForcedDiv; double fFracNew1 = (double)(nFrac + 1) / (double)nForcedDiv; @@ -4114,19 +4114,19 @@ sal_Bool SvNumberformat::IsNegativeWithoutSign() const return sal_False; } -BOOL SvNumberformat::IsNegativeInBracket() const +sal_Bool SvNumberformat::IsNegativeInBracket() const { - USHORT nAnz = NumFor[1].GetCount(); + sal_uInt16 nAnz = NumFor[1].GetCount(); if (!nAnz) - return FALSE; + return sal_False; String *tmpStr = NumFor[1].Info().sStrArray; return (tmpStr[0] == '(' && tmpStr[nAnz-1] == ')' ); } -BOOL SvNumberformat::HasPositiveBracketPlaceholder() const +sal_Bool SvNumberformat::HasPositiveBracketPlaceholder() const { - USHORT nAnz = NumFor[0].GetCount(); + sal_uInt16 nAnz = NumFor[0].GetCount(); String *tmpStr = NumFor[0].Info().sStrArray; return (tmpStr[nAnz-1].EqualsAscii( "_)" )); } diff --git a/svtools/Library_svt.mk b/svtools/Library_svt.mk index ebcdb7ac663d..5a3e3d250f3f 100644 --- a/svtools/Library_svt.mk +++ b/svtools/Library_svt.mk @@ -60,6 +60,7 @@ $(eval $(call gb_Library_add_linked_libs,svt,\ i18nutil \ icuuc \ jvmfwk \ + salhelper \ sal \ sot \ svl \ @@ -225,6 +226,7 @@ $(eval $(call gb_Library_add_exception_objects,svt,\ svtools/source/misc/imap3 \ svtools/source/misc/itemdel \ svtools/source/misc/langtab \ + svtools/source/misc/langhelp \ svtools/source/misc/stringtransfer \ svtools/source/misc/svtaccessiblefactory \ svtools/source/misc/svtdata \ diff --git a/svtools/inc/svtools/accessibletableprovider.hxx b/svtools/inc/svtools/accessibletableprovider.hxx index 91ef71a16d4d..3f16370a4bad 100644 --- a/svtools/inc/svtools/accessibletableprovider.hxx +++ b/svtools/inc/svtools/accessibletableprovider.hxx @@ -88,7 +88,7 @@ public: virtual sal_Bool HasRowHeader() const = 0; //GetColumnId /** @return <TRUE/>, if the object can focus a cell. */ virtual sal_Bool IsCellFocusable() const = 0; - virtual BOOL GoToCell( sal_Int32 _nRow, sal_uInt16 _nColumnPos ) = 0; + virtual sal_Bool GoToCell( sal_Int32 _nRow, sal_uInt16 _nColumnPos ) = 0; virtual void SetNoSelection() = 0; virtual void SelectAll() = 0; diff --git a/svtools/inc/svtools/borderhelper.hxx b/svtools/inc/svtools/borderhelper.hxx new file mode 100644 index 000000000000..18bad8929f0c --- /dev/null +++ b/svtools/inc/svtools/borderhelper.hxx @@ -0,0 +1,49 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _BORDERHELPER_HXX +#define _BORDERHELPER_HXX + +#include "svtools/svtdllapi.h" + +#include <basegfx/polygon/b2dpolypolygon.hxx> +#include <basegfx/polygon/b2dpolygon.hxx> +#include <vcl/outdev.hxx> + +namespace svtools +{ + SVT_DLLPUBLIC basegfx::B2DPolyPolygon ApplyLineDashing( const basegfx::B2DPolygon& rPolygon, + sal_uInt16 nDashing, MapUnit eUnit ); + + SVT_DLLPUBLIC void DrawLine( OutputDevice& rDev, const Point& rBeg, + const Point& rEnd, sal_uInt32 nWidth, sal_uInt16 nDashing ); +} + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svtools/inc/svtools/ctrlbox.hxx b/svtools/inc/svtools/ctrlbox.hxx index 50a83f8a2218..981a89885e60 100644 --- a/svtools/inc/svtools/ctrlbox.hxx +++ b/svtools/inc/svtools/ctrlbox.hxx @@ -47,9 +47,9 @@ typedef ::std::vector< ImplColorListData* > ImpColorList; typedef ::std::vector< ImpLineListData* > ImpLineList; typedef ::std::vector< ImplFontNameListData* > ImplFontList; -#define STYLE_SOLID ( ( USHORT ) 0 ) -#define STYLE_DOTTED ( ( USHORT ) 1 ) -#define STYLE_DASHED ( ( USHORT ) 2 ) +#define STYLE_SOLID ( ( sal_uInt16 ) 0 ) +#define STYLE_DOTTED ( ( sal_uInt16 ) 1 ) +#define STYLE_DASHED ( ( sal_uInt16 ) 2 ) /************************************************************************* @@ -253,7 +253,7 @@ class SVT_DLLPUBLIC LineListBox : public ListBox FieldUnit eSourceUnit; SVT_DLLPRIVATE void ImpGetLine( long nLine1, long nLine2, long nDistance, - USHORT nStyle, Bitmap& rBmp, XubString& rStr ); + sal_uInt16 nStyle, Bitmap& rBmp, XubString& rStr ); using Window::ImplInit; SVT_DLLPRIVATE void ImplInit(); void UpdateLineColors( void ); @@ -277,9 +277,10 @@ public: using ListBox::GetEntryPos; sal_uInt16 GetEntryPos( long nLine1, long nLine2 = 0, long nDistance = 0, sal_uInt16 nStyle = STYLE_SOLID ) const; + long GetEntryLine1( sal_uInt16 nPos ) const; long GetEntryLine2( sal_uInt16 nPos ) const; long GetEntryDistance( sal_uInt16 nPos ) const; - USHORT GetEntryStyle( USHORT nPos ) const; + sal_uInt16 GetEntryStyle( sal_uInt16 nPos ) const; inline void SelectEntry( const XubString& rStr, sal_Bool bSelect = sal_True ) { ListBox::SelectEntry( rStr, bSelect ); } void SelectEntry( long nLine1, long nLine2 = 0, long nDistance = 0, diff --git a/svtools/prj/build.lst b/svtools/prj/build.lst index ff9aa6a9875c..33ac3d4a506d 100644 --- a/svtools/prj/build.lst +++ b/svtools/prj/build.lst @@ -1,2 +1,2 @@ -st svtools : L10N:l10n svl offuh toolkit ucbhelper unotools JPEG:jpeg cppu cppuhelper comphelper sal sot jvmfwk LIBXSLT:libxslt NULL +st svtools : L10N:l10n svl offuh toolkit ucbhelper unotools JPEG:jpeg cppu cppuhelper comphelper sal salhelper sot jvmfwk LIBXSLT:libxslt NULL st svtools\prj nmake - all st_prj NULL diff --git a/svtools/source/contnr/ivctrl.cxx b/svtools/source/contnr/ivctrl.cxx index 479ae4a5df6b..f26de38cc1ab 100644 --- a/svtools/source/contnr/ivctrl.cxx +++ b/svtools/source/contnr/ivctrl.cxx @@ -156,7 +156,7 @@ SvxIconChoiceCtrlEntry* SvtIconChoiceCtrl::InsertEntry( const String& rText, con sal_Bool SvtIconChoiceCtrl::EditedEntry( SvxIconChoiceCtrlEntry*, const XubString&, sal_Bool ) { - return TRUE; + return sal_True; } sal_Bool SvtIconChoiceCtrl::EditingEntry( SvxIconChoiceCtrlEntry* ) diff --git a/svtools/source/contnr/svtabbx.cxx b/svtools/source/contnr/svtabbx.cxx index ee707829444e..90d0cb9e096a 100644 --- a/svtools/source/contnr/svtabbx.cxx +++ b/svtools/source/contnr/svtabbx.cxx @@ -838,7 +838,7 @@ sal_Bool SvHeaderTabListBox::IsCellFocusable() const return IsCellFocusEnabled(); } // ----------------------------------------------------------------------- -BOOL SvHeaderTabListBox::GoToCell( sal_Int32 _nRow, sal_uInt16 _nColumn ) +sal_Bool SvHeaderTabListBox::GoToCell( sal_Int32 _nRow, sal_uInt16 _nColumn ) { sal_Bool bRet = ( IsCellFocusEnabled() == sal_True ); if ( bRet ) diff --git a/svtools/source/contnr/svtreebx.cxx b/svtools/source/contnr/svtreebx.cxx index 91d36548ad88..12ac258dd31c 100644 --- a/svtools/source/contnr/svtreebx.cxx +++ b/svtools/source/contnr/svtreebx.cxx @@ -397,7 +397,7 @@ IMPL_LINK_INLINE_END( SvTreeListBox, CheckButtonClick, SvLBoxButtonData *, pData SvLBoxEntry* SvTreeListBox::InsertEntry( const XubString& aText, SvLBoxEntry* pParent, - BOOL bChildsOnDemand, ULONG nPos, + sal_Bool bChildsOnDemand, sal_uLong nPos, void* pUser, SvLBoxButtonKind eButtonKind ) diff --git a/svtools/source/control/ctrlbox.cxx b/svtools/source/control/ctrlbox.cxx index ceefa0391753..67705c48a84a 100644 --- a/svtools/source/control/ctrlbox.cxx +++ b/svtools/source/control/ctrlbox.cxx @@ -41,7 +41,7 @@ #include <svtools/svtools.hrc> #include <svtools/ctrlbox.hxx> #include <svtools/ctrltool.hxx> -#include <borderhelper.hxx> +#include <svtools/borderhelper.hxx> #include <vcl/i18nhelp.hxx> #include <vcl/fontcapabilities.hxx> @@ -288,7 +288,7 @@ struct ImpLineListData long nLine1; long nLine2; long nDistance; - USHORT nStyle; + sal_uInt16 nStyle; }; // ----------------------------------------------------------------------- @@ -301,9 +301,9 @@ inline const Color& LineListBox::GetPaintColor( void ) const // ----------------------------------------------------------------------- -inline void lclDrawPolygon( OutputDevice& rDev, const basegfx::B2DPolygon& rPolygon, long nWidth, USHORT nDashing ) +inline void lclDrawPolygon( OutputDevice& rDev, const basegfx::B2DPolygon& rPolygon, long nWidth, sal_uInt16 nDashing ) { - USHORT nOldAA = rDev.GetAntialiasing(); + sal_uInt16 nOldAA = rDev.GetAntialiasing(); rDev.SetAntialiasing( nOldAA & !ANTIALIASING_ENABLE_B2DDRAW ); Color aOldColor = rDev.GetFillColor( ); @@ -337,7 +337,7 @@ inline void lclDrawPolygon( OutputDevice& rDev, const basegfx::B2DPolygon& rPoly namespace svtools { - basegfx::B2DPolyPolygon ApplyLineDashing( const basegfx::B2DPolygon& rPolygon, USHORT nDashing, MapUnit eUnit ) + basegfx::B2DPolyPolygon ApplyLineDashing( const basegfx::B2DPolygon& rPolygon, sal_uInt16 nDashing, MapUnit eUnit ) { ::std::vector < double >aPattern; switch ( nDashing ) @@ -390,7 +390,7 @@ namespace svtools } void DrawLine( OutputDevice& rDev, const Point& rP1, const Point& rP2, - sal_uInt32 nWidth, USHORT nDashing ) + sal_uInt32 nWidth, sal_uInt16 nDashing ) { basegfx::B2DPolygon aPolygon; aPolygon.append( basegfx::B2DPoint( rP1.X(), rP1.Y() ) ); @@ -400,7 +400,7 @@ namespace svtools } void LineListBox::ImpGetLine( long nLine1, long nLine2, long nDistance, - USHORT nStyle, Bitmap& rBmp, XubString& rStr ) + sal_uInt16 nStyle, Bitmap& rBmp, XubString& rStr ) { Size aSize = GetOutputSizePixel(); aSize.Width() -= 20; @@ -613,7 +613,7 @@ void LineListBox::Clear() // ----------------------------------------------------------------------- sal_uInt16 LineListBox::GetEntryPos( long nLine1, long nLine2, - long nDistance, USHORT nStyle ) const + long nDistance, sal_uInt16 nStyle ) const { for ( size_t i = 0, n = pLineList->size(); i < n; ++i ) { ImpLineListData* pData = (*pLineList)[ i ]; @@ -624,7 +624,7 @@ sal_uInt16 LineListBox::GetEntryPos( long nLine1, long nLine2, && (pData->nDistance == nDistance) && (pData->nStyle == nStyle) ) { - return (USHORT)i; + return (sal_uInt16)i; } } } @@ -649,7 +649,7 @@ long LineListBox::GetEntryLine2( sal_uInt16 nPos ) const // ----------------------------------------------------------------------- -long LineListBox::GetEntryDistance( USHORT nPos ) const +long LineListBox::GetEntryDistance( sal_uInt16 nPos ) const { ImpLineListData* pData = (nPos < pLineList->size()) ? (*pLineList)[ nPos ] : NULL; return ( pData ) ? pData->nDistance : 0; @@ -657,7 +657,7 @@ long LineListBox::GetEntryDistance( USHORT nPos ) const // ----------------------------------------------------------------------- -USHORT LineListBox::GetEntryStyle( USHORT nPos ) const +sal_uInt16 LineListBox::GetEntryStyle( sal_uInt16 nPos ) const { ImpLineListData* pData = (nPos < pLineList->size()) ? (*pLineList)[ nPos ] : NULL; return ( pData ) ? pData->nStyle : STYLE_SOLID; @@ -679,7 +679,7 @@ void LineListBox::UpdateLineColors( void ) // exchange entries which containing lines SetUpdateMode( sal_False ); - USHORT nSelEntry = GetSelectEntryPos(); + sal_uInt16 nSelEntry = GetSelectEntryPos(); for( size_t n = 0 ; n < nCount ; ++n ) { ImpLineListData* pData = (*pLineList)[ n ]; diff --git a/svtools/source/control/ruler.cxx b/svtools/source/control/ruler.cxx index 96a824d362f0..01587623fc77 100755 --- a/svtools/source/control/ruler.cxx +++ b/svtools/source/control/ruler.cxx @@ -3235,7 +3235,7 @@ const RulerIndent* Ruler::GetIndents() const { return mpData->pIndents; } * ---------------------------------------------------*/ void Ruler::DrawTicks() { - mbFormat = TRUE; + mbFormat = sal_True; ImplDraw(); } diff --git a/svtools/source/control/tabbar.cxx b/svtools/source/control/tabbar.cxx index b969483d25af..9b61f88562da 100644 --- a/svtools/source/control/tabbar.cxx +++ b/svtools/source/control/tabbar.cxx @@ -38,9 +38,11 @@ #include <vcl/decoview.hxx> #include <vcl/button.hxx> #include <vcl/edit.hxx> +#include <vcl/image.hxx> #include "svtaccessiblefactory.hxx" #include <filectrl.hrc> #include <svtools/svtdata.hxx> +#include <svtools/svtools.hrc> #include <limits> // ======================================================================= @@ -371,7 +373,7 @@ struct TabBar_Impl const sal_uInt16 TabBar::APPEND = ::std::numeric_limits<sal_uInt16>::max(); const sal_uInt16 TabBar::PAGE_NOT_FOUND = ::std::numeric_limits<sal_uInt16>::max(); -const sal_uInt16 TabBar::INSERT_TAB_POS = ::std::numeric_limits<USHORT>::max() - 1; +const sal_uInt16 TabBar::INSERT_TAB_POS = ::std::numeric_limits<sal_uInt16>::max() - 1; void TabBar::ImplInit( WinBits nWinStyle ) { @@ -1249,7 +1251,8 @@ public: void drawPlusImage() { - Image aPlusImg( SvtResId(BMP_LIST_ADD) ); + SvtResId id( BMP_LIST_ADD ); + Image aPlusImg( id ); // Center the image within the bounding rectangle. Size aSize = aPlusImg.GetSizePixel(); Point pt = maRect.TopLeft(); @@ -1330,7 +1333,7 @@ private: void TabBar::Paint( const Rectangle& ) { // Items berechnen und ausgeben - USHORT nItemCount = (USHORT)mpItemList->size(); + sal_uInt16 nItemCount = (sal_uInt16)mpItemList->size(); if (!nItemCount) return; @@ -1700,7 +1703,7 @@ long TabBar::ImplDeactivatePage() void TabBar::ImplPrePaint() { - USHORT nItemCount = (USHORT)mpItemList->size(); + sal_uInt16 nItemCount = (sal_uInt16)mpItemList->size(); if (!nItemCount) return; @@ -1713,7 +1716,7 @@ void TabBar::ImplPrePaint() // sichtbar wird if ( mbFirstFormat ) { - mbFirstFormat = FALSE; + mbFirstFormat = sal_False; if ( mnCurPageId && (mnFirstPos == 0) && !mbDropPos ) { @@ -1722,9 +1725,9 @@ void TabBar::ImplPrePaint() { // mbDropPos setzen (bzw. misbrauchen) um Invalidate() // zu unterbinden - mbDropPos = TRUE; + mbDropPos = sal_True; SetFirstPageId( mnCurPageId ); - mbDropPos = FALSE; + mbDropPos = sal_False; if ( mnFirstPos != 0 ) ImplFormat(); } @@ -1732,10 +1735,10 @@ void TabBar::ImplPrePaint() } } -ImplTabBarItem* TabBar::ImplGetLastTabBarItem( USHORT nItemCount ) +ImplTabBarItem* TabBar::ImplGetLastTabBarItem( sal_uInt16 nItemCount ) { // letzten sichtbaren Eintrag suchen - USHORT n = mnFirstPos+1; + sal_uInt16 n = mnFirstPos+1; if ( n >= nItemCount ) n = nItemCount-1; ImplTabBarItem* pItem = seek( n ); @@ -2060,7 +2063,7 @@ sal_uInt16 TabBar::GetPagePos( sal_uInt16 nPageId ) const { for ( size_t i = 0, n = mpItemList->size(); i < n; ++i ) { if ( (*mpItemList)[ i ]->mnId == nPageId ) { - return USHORT( i ); + return sal_uInt16( i ); } } return PAGE_NOT_FOUND; diff --git a/svtools/source/control/valueacc.cxx b/svtools/source/control/valueacc.cxx index b0751780862a..e558a72ae33a 100644 --- a/svtools/source/control/valueacc.cxx +++ b/svtools/source/control/valueacc.cxx @@ -455,7 +455,7 @@ uno::Reference< accessibility::XAccessible > SAL_CALL ValueSetAcc::getAccessible const sal_uInt16 nItemId = mpParent->GetItemId( Point( aPoint.X, aPoint.Y ) ); uno::Reference< accessibility::XAccessible > xRet; - if( ((USHORT)-1) != nItemId ) + if( ((sal_uInt16)-1) != nItemId ) { const size_t nItemPos = mpParent->GetItemPos( nItemId ); diff --git a/svtools/source/dialogs/filedlg2.cxx b/svtools/source/dialogs/filedlg2.cxx index 9525ea132598..a6ccff12a506 100644 --- a/svtools/source/dialogs/filedlg2.cxx +++ b/svtools/source/dialogs/filedlg2.cxx @@ -1216,7 +1216,7 @@ void ImpFileDialog::SetCurFilter( const UniString& rFilter ) for ( size_t i = 0, n = aFilterList.size(); i < n; ++i ) { if ( aFilterList[ i ]->aName == rFilter ) { - pTypeList->SelectEntryPos( USHORT( i ) ); + pTypeList->SelectEntryPos( sal_uInt16( i ) ); return; } } diff --git a/svtools/source/edit/texteng.cxx b/svtools/source/edit/texteng.cxx index 539c34538c44..15412276e587 100644 --- a/svtools/source/edit/texteng.cxx +++ b/svtools/source/edit/texteng.cxx @@ -2098,7 +2098,7 @@ void TextEngine::ImpPaint( OutputDevice* pOutDev, const Point& rStartPos, Rectan // Ueber die Zeilen des Absatzes... // -------------------------------------------------- sal_uInt16 nLines = pPortion->GetLines().Count(); - USHORT nIndex = 0; + sal_uInt16 nIndex = 0; for ( sal_uInt16 nLine = 0; nLine < nLines; nLine++ ) { TextLine* pLine = pPortion->GetLines().GetObject(nLine); diff --git a/svtools/source/filter.vcl/filter/sgfbram.cxx b/svtools/source/filter.vcl/filter/sgfbram.cxx index f17b6c2f675a..8559cbee30eb 100644 --- a/svtools/source/filter.vcl/filter/sgfbram.cxx +++ b/svtools/source/filter.vcl/filter/sgfbram.cxx @@ -308,7 +308,7 @@ sal_Bool SgfFilterBMap(SvStream& rInp, SvStream& rOut, SgfHeader& rHead, SgfEntr rOut.Write((char*)pBuf,nWdtOut); } } else if (nColors==16) { - BYTE pl2= 0; // Masken fuer die Planes + sal_uInt8 pl2= 0; // Masken fuer die Planes rOut<<RGBQuad(0x00,0x00,0x00); // Schwarz rOut<<RGBQuad(0x24,0x24,0x24); // Grau 80% diff --git a/svtools/source/filter.vcl/wmf/enhwmf.cxx b/svtools/source/filter.vcl/wmf/enhwmf.cxx index f54eca6f6075..91cabcf430a3 100644 --- a/svtools/source/filter.vcl/wmf/enhwmf.cxx +++ b/svtools/source/filter.vcl/wmf/enhwmf.cxx @@ -272,8 +272,8 @@ void EnhWMFReader::ReadEMFPlusComment(sal_uInt32 length, sal_Bool& bHaveDC) length -= 4; while (length > 0) { - UINT16 type, flags; - UINT32 size, dataSize; + sal_uInt16 type, flags; + sal_uInt32 size, dataSize; sal_uInt32 next; *pWMF >> type >> flags >> size >> dataSize; @@ -384,7 +384,7 @@ sal_Bool EnhWMFReader::ReadEnhWMF() EMFP_DEBUG(printf ("\tGDI comment\n\t\tlength: %d\n", length)); if( length >= 4 ) { - UINT32 id; + sal_uInt32 id; *pWMF >> id; @@ -1337,14 +1337,14 @@ sal_Bool EnhWMFReader::ReadEnhWMF() case EMR_CREATEDIBPATTERNBRUSHPT : { - UINT32 nStart = pWMF->Tell() - 8; + sal_uInt32 nStart = pWMF->Tell() - 8; Bitmap aBitmap; *pWMF >> nIndex; if ( ( nIndex & ENHMETA_STOCK_OBJECT ) == 0 ) { - UINT32 usage, offBmi, cbBmi, offBits, cbBits; + sal_uInt32 usage, offBmi, cbBmi, offBits, cbBits; *pWMF >> usage; *pWMF >> offBmi; @@ -1353,28 +1353,28 @@ sal_Bool EnhWMFReader::ReadEnhWMF() *pWMF >> cbBits; if ( (cbBits > (SAL_MAX_UINT32 - 14)) || ((SAL_MAX_UINT32 - 14) - cbBits < cbBmi) ) - bStatus = FALSE; + bStatus = sal_False; else if ( offBmi ) { - UINT32 nSize = cbBmi + cbBits + 14; + sal_uInt32 nSize = cbBmi + cbBits + 14; if ( nSize <= ( nEndPos - nStartPos ) ) { char* pBuf = new char[ nSize ]; SvMemoryStream aTmp( pBuf, nSize, STREAM_READ | STREAM_WRITE ); - aTmp.ObjectOwnsMemory( TRUE ); - aTmp << (BYTE)'B' - << (BYTE)'M' - << (UINT32)cbBits - << (UINT16)0 - << (UINT16)0 - << (UINT32)cbBmi + 14; + aTmp.ObjectOwnsMemory( sal_True ); + aTmp << (sal_uInt8)'B' + << (sal_uInt8)'M' + << (sal_uInt32)cbBits + << (sal_uInt16)0 + << (sal_uInt16)0 + << (sal_uInt32)cbBmi + 14; pWMF->Seek( nStart + offBmi ); pWMF->Read( pBuf + 14, cbBmi ); pWMF->Seek( nStart + offBits ); pWMF->Read( pBuf + 14 + cbBmi, cbBits ); aTmp.Seek( 0 ); - aBitmap.Read( aTmp, TRUE ); + aBitmap.Read( aTmp, sal_True ); } } } @@ -1457,13 +1457,13 @@ sal_Bool EnhWMFReader::ReadEnhWMF() sal_Bool EnhWMFReader::ReadHeader() { - sal_uInt32 nUINT32, nHeaderSize, nPalEntries; + sal_uInt32 nsal_uInt32, nHeaderSize, nPalEntries; sal_Int32 nLeft, nTop, nRight, nBottom; // METAFILEHEADER SPARE ICH MIR HIER // Einlesen des METAHEADER - *pWMF >> nUINT32 >> nHeaderSize; - if ( nUINT32 != 1 ) // Typ + *pWMF >> nsal_uInt32 >> nHeaderSize; + if ( nsal_uInt32 != 1 ) // Typ return sal_False; // bound size @@ -1482,12 +1482,12 @@ sal_Bool EnhWMFReader::ReadHeader() rclFrame.Right() = nRight; rclFrame.Bottom() = nBottom; - *pWMF >> nUINT32; // signature + *pWMF >> nsal_uInt32; // signature - if ( nUINT32 != 0x464d4520 ) + if ( nsal_uInt32 != 0x464d4520 ) return sal_False; - *pWMF >> nUINT32; // nVersion + *pWMF >> nsal_uInt32; // nVersion *pWMF >> nEndPos; // size of metafile nEndPos += nStartPos; diff --git a/svtools/source/filter.vcl/wmf/winmtf.cxx b/svtools/source/filter.vcl/wmf/winmtf.cxx index 6335ee12ade9..b0625567d5d6 100644 --- a/svtools/source/filter.vcl/wmf/winmtf.cxx +++ b/svtools/source/filter.vcl/wmf/winmtf.cxx @@ -1352,7 +1352,7 @@ void WinMtfOutput::DrawPolygon( Polygon& rPolygon, sal_Bool bRecordPath ) aMemStm << aFill; mpGDIMetaFile->AddAction( new MetaCommentAction( "XPATHFILL_SEQ_BEGIN", 0, - static_cast<const BYTE*>(aMemStm.GetData()), + static_cast<const sal_uInt8*>(aMemStm.GetData()), aMemStm.Seek( STREAM_SEEK_TO_END ) ) ); mpGDIMetaFile->AddAction( new MetaCommentAction( "XPATHFILL_SEQ_END" ) ); } @@ -2216,14 +2216,14 @@ void WinMtfOutput::PassEMFPlusHeaderInfo() // rotate and scale operations mem << one << zero << zero << one << zero << zero; - mpGDIMetaFile->AddAction( new MetaCommentAction( "EMF_PLUS_HEADER_INFO", 0, (const BYTE*) mem.GetData(), mem.GetEndOfData() ) ); - mpGDIMetaFile->UseCanvas( TRUE ); + mpGDIMetaFile->AddAction( new MetaCommentAction( "EMF_PLUS_HEADER_INFO", 0, (const sal_uInt8*) mem.GetData(), mem.GetEndOfData() ) ); + mpGDIMetaFile->UseCanvas( sal_True ); } -void WinMtfOutput::PassEMFPlus( void* pBuffer, UINT32 nLength ) +void WinMtfOutput::PassEMFPlus( void* pBuffer, sal_uInt32 nLength ) { EMFP_DEBUG(printf ("\t\t\tadd EMF_PLUS comment length %d\n", nLength)); - mpGDIMetaFile->AddAction( new MetaCommentAction( "EMF_PLUS", 0, static_cast<const BYTE*>(pBuffer), nLength ) ); + mpGDIMetaFile->AddAction( new MetaCommentAction( "EMF_PLUS", 0, static_cast<const sal_uInt8*>(pBuffer), nLength ) ); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svtools/source/filter.vcl/wmf/winmtf.hxx b/svtools/source/filter.vcl/wmf/winmtf.hxx index d6db4b6fcdd6..bd2293fe108b 100644 --- a/svtools/source/filter.vcl/wmf/winmtf.hxx +++ b/svtools/source/filter.vcl/wmf/winmtf.hxx @@ -682,7 +682,7 @@ class WinMtfOutput void UpdateClipRegion(); void AddFromGDIMetaFile( GDIMetaFile& rGDIMetaFile ); - void PassEMFPlus( void* pBuffer, UINT32 nLength ); + void PassEMFPlus( void* pBuffer, sal_uInt32 nLength ); void PassEMFPlusHeaderInfo(); WinMtfOutput( GDIMetaFile& rGDIMetaFile ); @@ -723,7 +723,7 @@ class EnhWMFReader : public WinMtf { sal_Bool bRecordPath; sal_Int32 nRecordCount; - BOOL bEMFPlus; + sal_Bool bEMFPlus; sal_Bool ReadHeader(); @@ -732,7 +732,7 @@ class EnhWMFReader : public WinMtf public: EnhWMFReader( SvStream& rStreamWMF, GDIMetaFile& rGDIMetaFile, FilterConfigItem* pConfigItem = NULL ) - : WinMtf( new WinMtfOutput( rGDIMetaFile ), rStreamWMF, pConfigItem ), bRecordPath( sal_False ), bEMFPlus (FALSE) {}; + : WinMtf( new WinMtfOutput( rGDIMetaFile ), rStreamWMF, pConfigItem ), bRecordPath( sal_False ), bEMFPlus( sal_False ) {}; ~EnhWMFReader(); sal_Bool ReadEnhWMF(); diff --git a/svtools/source/hatchwindow/hatchwindow.cxx b/svtools/source/hatchwindow/hatchwindow.cxx index c3c26071646c..c32e3a6c0b60 100644 --- a/svtools/source/hatchwindow/hatchwindow.cxx +++ b/svtools/source/hatchwindow/hatchwindow.cxx @@ -34,7 +34,7 @@ #include "ipwin.hxx" #include <toolkit/helper/convert.hxx> -#include <vos/mutex.hxx> +#include <osl/mutex.hxx> #include <vcl/svapp.hxx> using namespace ::com::sun::star; @@ -53,7 +53,7 @@ void VCLXHatchWindow::initializeWindow( const uno::Reference< awt::XWindowPeer > const awt::Rectangle& aBounds, const awt::Size& aSize ) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; Window* pParent = NULL; VCLXWindow* pParentComponent = VCLXWindow::GetImplementation( xParent ); diff --git a/svtools/source/hatchwindow/hatchwindowfactory.cxx b/svtools/source/hatchwindow/hatchwindowfactory.cxx index 3c7dc2dbc2c0..a0ff0d4daf17 100644 --- a/svtools/source/hatchwindow/hatchwindowfactory.cxx +++ b/svtools/source/hatchwindow/hatchwindowfactory.cxx @@ -71,7 +71,7 @@ uno::Reference< embed::XHatchWindow > SAL_CALL OHatchWindowFactory::createHatchW if ( !xParent.is() ) throw lang::IllegalArgumentException(); // TODO - ::vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; VCLXHatchWindow* pResult = new VCLXHatchWindow(); pResult->initializeWindow( xParent, aBounds, aHandlerSize ); return uno::Reference< embed::XHatchWindow >( static_cast< embed::XHatchWindow* >( pResult ) ); diff --git a/svtools/source/misc/imagemgr.cxx b/svtools/source/misc/imagemgr.cxx index 0ee5a722df35..92fd64bde9cc 100644 --- a/svtools/source/misc/imagemgr.cxx +++ b/svtools/source/misc/imagemgr.cxx @@ -529,77 +529,6 @@ static sal_uInt16 GetFolderDescriptionId_Impl( const String& rURL ) return nRet; } -/* -static ResMgr* GetIsoResMgr_Impl() -{ - static ResMgr* pIsoResMgr = NULL; - - if ( !pIsoResMgr ) - { - ByteString aResMgrName( "iso" ); - pIsoResMgr = ResMgr::CreateResMgr( - aResMgrName.GetBuffer(), Application::GetSettings().GetUILocale() ); - if ( !pIsoResMgr ) - { - // no "iso" resource -> search for "ooo" resource - aResMgrName = ByteString( "ooo" ); - pIsoResMgr = ResMgr::CreateResMgr( - aResMgrName.GetBuffer(), Application::GetSettings().GetUILocale() ); - } - } - - return pIsoResMgr; -} - -static ImageList* CreateImageList_Impl( sal_uInt16 nResId ) -{ - ImageList* pList = NULL; - ResMgr* pResMgr = GetIsoResMgr_Impl(); - DBG_ASSERT( pResMgr, "SvFileInformationManager::CreateImageList_Impl(): no resmgr" ); - ResId aResId( nResId, *pResMgr ); - aResId.SetRT( RSC_IMAGELIST ); - if ( pResMgr->IsAvailable( aResId ) ) - pList = new ImageList( aResId ); - else - pList = new ImageList(); - return pList; -} - -static Image GetOfficeImageFromList_Impl( sal_uInt16 nImageId, sal_Bool bBig ) -{ - ImageList* pList = NULL; - - static ImageList* _pSmallOfficeImgList = NULL; - static ImageList* _pBigOfficeImgList = NULL; - static sal_uLong nStyle = Application::GetSettings().GetStyleSettings().GetSymbolsStyle(); - - // If the style has been changed, throw away our cache of the older images - if ( nStyle != Application::GetSettings().GetStyleSettings().GetSymbolsStyle() ) - { - delete _pSmallOfficeImgList, _pSmallOfficeImgList = NULL; - delete _pBigOfficeImgList, _pBigOfficeImgList = NULL; - nStyle = Application::GetSettings().GetStyleSettings().GetSymbolsStyle(); - } - - if ( bBig ) - { - if ( !_pBigOfficeImgList ) - _pBigOfficeImgList = CreateImageList_Impl( RID_SVTOOLS_IMAGELIST_BIG ); - pList = _pBigOfficeImgList; - } - else - { - if ( !_pSmallOfficeImgList ) - _pSmallOfficeImgList = CreateImageList_Impl( RID_SVTOOLS_IMAGELIST_SMALL ); - pList = _pSmallOfficeImgList; - } - - Image aImage = pList->GetImage( nImageId ); - - return aImage; -} -*/ - static Image GetImageFromList_Impl( sal_uInt16 nImageId, sal_Bool bBig ) { if ( !bBig && IMG_FOLDER == nImageId ) @@ -636,7 +565,8 @@ static Image GetImageFromList_Impl( sal_uInt16 nImageId, sal_Bool bBig ) if ( pList->HasImageAtPos( nImageId ) ) return pList->GetImage( nImageId ); else - return GetOfficeImageFromList_Impl( nImageId, bBig ); + return Image(); +// return GetOfficeImageFromList_Impl( nImageId, bBig ); } String SvFileInformationManager::GetDescription_Impl( const INetURLObject& rObject, sal_Bool bDetectFolder ) diff --git a/svtools/source/table/tablecontrol.cxx b/svtools/source/table/tablecontrol.cxx index 1aec8d4b27a4..eda54726c717 100644 --- a/svtools/source/table/tablecontrol.cxx +++ b/svtools/source/table/tablecontrol.cxx @@ -594,7 +594,6 @@ namespace svt { namespace table { ImplCallEventListenersAndHandler( VCLEVENT_TABLEROW_SELECT, m_pImpl->getSelectHandler(), this ); } -}} // namespace svt::table //........................................................................ //------------------------------------------------------------------------------------------------------------------ @@ -608,6 +607,7 @@ namespace svt { namespace table { return m_pImpl->getSelectHandler(); } +}} // namespace svt::table //...................................................................................................................... /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svtools/source/uno/svtxgridcontrol.cxx b/svtools/source/uno/svtxgridcontrol.cxx index 1f48b904aec3..778925a60c44 100644 --- a/svtools/source/uno/svtxgridcontrol.cxx +++ b/svtools/source/uno/svtxgridcontrol.cxx @@ -83,7 +83,7 @@ void SVTXGridControl::SetWindow( Window* pWindow ) // --------------------------------------------------------------------------------------------------------------------- sal_Int32 SAL_CALL SVTXGridControl::getRowAtPoint(::sal_Int32 x, ::sal_Int32 y) throw (::com::sun::star::uno::RuntimeException) { - ::vos::OGuard aGuard( GetMutex() ); + SolarMutexGuard aGuard; TableControl* pTable = dynamic_cast< TableControl* >( GetWindow() ); ENSURE_OR_RETURN( pTable != NULL, "SVTXGridControl::getRowAtPoint: no control (anymore)!", -1 ); @@ -95,7 +95,7 @@ sal_Int32 SAL_CALL SVTXGridControl::getRowAtPoint(::sal_Int32 x, ::sal_Int32 y) // --------------------------------------------------------------------------------------------------------------------- sal_Int32 SAL_CALL SVTXGridControl::getColumnAtPoint(::sal_Int32 x, ::sal_Int32 y) throw (::com::sun::star::uno::RuntimeException) { - ::vos::OGuard aGuard( GetMutex() ); + SolarMutexGuard aGuard; TableControl* pTable = dynamic_cast< TableControl* >( GetWindow() ); ENSURE_OR_RETURN( pTable != NULL, "SVTXGridControl::getColumnAtPoint: no control (anymore)!", -1 ); @@ -107,7 +107,7 @@ sal_Int32 SAL_CALL SVTXGridControl::getColumnAtPoint(::sal_Int32 x, ::sal_Int32 // --------------------------------------------------------------------------------------------------------------------- sal_Int32 SAL_CALL SVTXGridControl::getCurrentColumn( ) throw (RuntimeException) { - ::vos::OGuard aGuard( GetMutex() ); + SolarMutexGuard aGuard; TableControl* pTable = dynamic_cast< TableControl* >( GetWindow() ); ENSURE_OR_RETURN( pTable != NULL, "SVTXGridControl::getCurrentColumn: no control (anymore)!", -1 ); @@ -119,7 +119,7 @@ sal_Int32 SAL_CALL SVTXGridControl::getCurrentColumn( ) throw (RuntimeException // --------------------------------------------------------------------------------------------------------------------- sal_Int32 SAL_CALL SVTXGridControl::getCurrentRow( ) throw (RuntimeException) { - ::vos::OGuard aGuard( GetMutex() ); + SolarMutexGuard aGuard; TableControl* pTable = dynamic_cast< TableControl* >( GetWindow() ); ENSURE_OR_RETURN( pTable != NULL, "SVTXGridControl::getCurrentRow: no control (anymore)!", -1 ); @@ -531,7 +531,7 @@ void SAL_CALL//----------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------- void SAL_CALL SVTXGridControl::dataChanged( const GridDataEvent& i_event ) throw (RuntimeException) { - ::vos::OGuard aGuard( GetMutex() ); + SolarMutexGuard aGuard; m_pTableModel->notifyDataChanged( i_event ); @@ -596,7 +596,7 @@ void SAL_CALL SVTXGridControl::disposing( const ::com::sun::star::lang::EventObj //---------------------------------------------------------------------------------------------------------------------- void SAL_CALL SVTXGridControl::selectRow( ::sal_Int32 i_rowIndex ) throw (::com::sun::star::uno::RuntimeException) { - ::vos::OGuard aGuard( GetMutex() ); + SolarMutexGuard aGuard; TableControl* pTable = dynamic_cast< TableControl* >( GetWindow() ); ENSURE_OR_RETURN_VOID( pTable, "SVTXGridControl::selectRow: no control (anymore)!" ); @@ -607,7 +607,7 @@ void SAL_CALL SVTXGridControl::selectRow( ::sal_Int32 i_rowIndex ) throw (::com: //---------------------------------------------------------------------------------------------------------------------- void SAL_CALL SVTXGridControl::selectAllRows() throw (::com::sun::star::uno::RuntimeException) { - ::vos::OGuard aGuard( GetMutex() ); + SolarMutexGuard aGuard; TableControl* pTable = dynamic_cast< TableControl* >( GetWindow() ); ENSURE_OR_RETURN_VOID( pTable, "SVTXGridControl::selectAllRows: no control (anymore)!" ); @@ -618,7 +618,7 @@ void SAL_CALL SVTXGridControl::selectAllRows() throw (::com::sun::star::uno::Run //---------------------------------------------------------------------------------------------------------------------- void SAL_CALL SVTXGridControl::deselectRow( ::sal_Int32 i_rowIndex ) throw (::com::sun::star::uno::RuntimeException) { - ::vos::OGuard aGuard( GetMutex() ); + SolarMutexGuard aGuard; TableControl* pTable = dynamic_cast< TableControl* >( GetWindow() ); ENSURE_OR_RETURN_VOID( pTable, "SVTXGridControl::deselectRow: no control (anymore)!" ); @@ -629,7 +629,7 @@ void SAL_CALL SVTXGridControl::deselectRow( ::sal_Int32 i_rowIndex ) throw (::co //---------------------------------------------------------------------------------------------------------------------- void SAL_CALL SVTXGridControl::deselectAllRows() throw (::com::sun::star::uno::RuntimeException) { - ::vos::OGuard aGuard( GetMutex() ); + SolarMutexGuard aGuard; TableControl* pTable = dynamic_cast< TableControl* >( GetWindow() ); ENSURE_OR_RETURN_VOID( pTable, "SVTXGridControl::deselectAllRows: no control (anymore)!" ); @@ -640,7 +640,7 @@ void SAL_CALL SVTXGridControl::deselectAllRows() throw (::com::sun::star::uno::R //---------------------------------------------------------------------------------------------------------------------- ::com::sun::star::uno::Sequence< ::sal_Int32 > SAL_CALL SVTXGridControl::getSelection() throw (::com::sun::star::uno::RuntimeException) { - ::vos::OGuard aGuard( GetMutex() ); + SolarMutexGuard aGuard; TableControl* pTable = dynamic_cast< TableControl* >( GetWindow() ); ENSURE_OR_RETURN( pTable, "SVTXGridControl::getSelection: no control (anymore)!", Sequence< sal_Int32 >() ); @@ -655,7 +655,7 @@ void SAL_CALL SVTXGridControl::deselectAllRows() throw (::com::sun::star::uno::R //---------------------------------------------------------------------------------------------------------------------- ::sal_Bool SAL_CALL SVTXGridControl::isSelectionEmpty() throw (::com::sun::star::uno::RuntimeException) { - ::vos::OGuard aGuard( GetMutex() ); + SolarMutexGuard aGuard; TableControl* pTable = dynamic_cast< TableControl* >( GetWindow() ); ENSURE_OR_RETURN( pTable, "SVTXGridControl::getSelection: no control (anymore)!", sal_True ); @@ -666,7 +666,7 @@ void SAL_CALL SVTXGridControl::deselectAllRows() throw (::com::sun::star::uno::R //---------------------------------------------------------------------------------------------------------------------- ::sal_Bool SAL_CALL SVTXGridControl::isSelectedIndex( ::sal_Int32 index ) throw (::com::sun::star::uno::RuntimeException) { - ::vos::OGuard aGuard( GetMutex() ); + SolarMutexGuard aGuard; TableControl* pTable = dynamic_cast< TableControl* >( GetWindow() ); ENSURE_OR_RETURN( pTable, "SVTXGridControl::isSelectedIndex: no control (anymore)!", sal_False ); @@ -686,7 +686,7 @@ void SVTXGridControl::dispose() throw(::com::sun::star::uno::RuntimeException) //---------------------------------------------------------------------------------------------------------------------- void SVTXGridControl::ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent ) { - ::vos::OGuard aGuard( GetMutex() ); + SolarMutexGuard aGuard; ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow > xKeepAlive( this ); switch ( rVclWindowEvent.GetId() ) @@ -781,4 +781,4 @@ void SVTXGridControl::impl_updateColumnsFromModel_nothrow() } } -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
\ No newline at end of file +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svtools/source/uno/unocontroltablemodel.cxx b/svtools/source/uno/unocontroltablemodel.cxx index 9aff5f1df8e5..73085561e542 100644 --- a/svtools/source/uno/unocontroltablemodel.cxx +++ b/svtools/source/uno/unocontroltablemodel.cxx @@ -47,7 +47,7 @@ #include <tools/debug.hxx> #include <tools/diagnose_ex.h> #include <vcl/svapp.hxx> -#include <vos/mutex.hxx> +#include <osl/mutex.hxx> // ..................................................................................................................... namespace svt { namespace table @@ -892,4 +892,4 @@ namespace svt { namespace table // ..................................................................................................................... } } // svt::table // ..................................................................................................................... -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
\ No newline at end of file +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svtools/source/uno/unogridcolumnfacade.cxx b/svtools/source/uno/unogridcolumnfacade.cxx index d2f5e7b565fd..46c9273ba153 100755 --- a/svtools/source/uno/unogridcolumnfacade.cxx +++ b/svtools/source/uno/unogridcolumnfacade.cxx @@ -44,7 +44,7 @@ #include <tools/debug.hxx> #include <tools/diagnose_ex.h> #include <vcl/svapp.hxx> -#include <vos/mutex.hxx> +#include <osl/mutex.hxx> // ..................................................................................................................... namespace svt { namespace table @@ -150,7 +150,7 @@ namespace svt { namespace table { if ( i_event.AttributeName.equalsAscii( "DataColumnIndex" ) ) { - ::vos::OGuard aSolarGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; if ( m_pColumnImplementation != NULL ) m_pColumnImplementation->dataColumnIndexChanged(); return; @@ -173,7 +173,7 @@ namespace svt { namespace table OSL_ENSURE( nChangedAttributes != COL_ATTRS_NONE, "ColumnChangeMultiplexer::columnChanged: unknown column attributed changed!" ); - ::vos::OGuard aSolarGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; if ( m_pColumnImplementation != NULL ) m_pColumnImplementation->columnChanged( nChangedAttributes ); } diff --git a/toolkit/inc/toolkit/controls/controlmodelcontainerbase.hxx b/toolkit/inc/toolkit/controls/controlmodelcontainerbase.hxx index 3090eba68749..f6859690ce24 100644 --- a/toolkit/inc/toolkit/controls/controlmodelcontainerbase.hxx +++ b/toolkit/inc/toolkit/controls/controlmodelcontainerbase.hxx @@ -72,6 +72,7 @@ public: private: typedef ::std::list< UnoControlModelHolder > UnoControlModelHolderList; +public: // for grouping control models (XTabControllerModel::getGroupXXX) typedef ::std::vector< ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel > > ModelGroup; diff --git a/toolkit/inc/toolkit/controls/dialogcontrol.hxx b/toolkit/inc/toolkit/controls/dialogcontrol.hxx index aa223d8c65df..17b958aeace9 100644 --- a/toolkit/inc/toolkit/controls/dialogcontrol.hxx +++ b/toolkit/inc/toolkit/controls/dialogcontrol.hxx @@ -1,4 +1,3 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -32,18 +31,12 @@ #include <toolkit/controls/controlmodelcontainerbase.hxx> #include <com/sun/star/awt/XTopWindow.hpp> #include <com/sun/star/awt/XDialog.hpp> -#include <com/sun/star/awt/XTabListener.hpp> -#include <com/sun/star/awt/XSimpleTabController.hpp> #include <com/sun/star/resource/XStringResourceResolver.hpp> -#include <com/sun/star/graphic/XGraphicObject.hpp> -#include <cppuhelper/implbase2.hxx> #include "toolkit/helper/servicenames.hxx" #include "toolkit/helper/macros.hxx" #include <toolkit/controls/unocontrolcontainer.hxx> #include <cppuhelper/basemutex.hxx> #include <list> -#include <map> -#include <com/sun/star/graphic/XGraphicObject.hpp> // ---------------------------------------------------- // class UnoControlDialogModel @@ -51,45 +44,24 @@ class UnoControlDialogModel : public ControlModelContainerBase { - enum ChildOperation { Insert = 0, Remove }; protected: - void updateUserFormChildren( const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >& xAllChildren, const rtl::OUString& aName, ChildOperation Operation, const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel >& xTarget ) throw(::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::container::ElementExistException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); - ::com::sun::star::uno::Reference< ::com::sun::star::graphic::XGraphicObject > mxGrfObj; - bool mbAdjustingGraphic; - ::com::sun::star::uno::Any ImplGetDefaultValue( sal_uInt16 nPropId ) const; ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper(); public: UnoControlDialogModel( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory ); - UnoControlDialogModel( bool bRegProps = true ); UnoControlDialogModel( const UnoControlDialogModel& rModel ); ~UnoControlDialogModel(); UnoControlModel* Clone() const; - - // ::com::sun::star::beans::XMultiPropertySet ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException); - // ::com::sun::star::io::XPersistObject ::rtl::OUString SAL_CALL getServiceName() throw(::com::sun::star::uno::RuntimeException); // XServiceInfo DECLIMPL_SERVICEINFO_DERIVED( UnoControlDialogModel, ControlModelContainerBase, szServiceName2_UnoControlDialogModel ) - // ::cppu::OPropertySetHelper - void SAL_CALL setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, const ::com::sun::star::uno::Any& rValue ) throw (::com::sun::star::uno::Exception); -private: - void AddRadioButtonToGroup ( - const ::com::sun::star::uno::Reference< XControlModel >& rControlModel, - const ::rtl::OUString& rPropertyName, - ::std::map< ::rtl::OUString, ModelGroup >& pNamedGroups, - ModelGroup*& rpCurrentGroup ); - void AddRadioButtonGroup ( - ::std::map< ::rtl::OUString, ModelGroup >& pNamedGroups ); - - }; class UnoDialogControl :public ControlContainerBase, @@ -102,7 +74,6 @@ private: TopWindowListenerMultiplexer maTopWindowListeners; bool mbWindowListener; - public: UnoDialogControl( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory ); @@ -131,7 +102,6 @@ public: virtual void SAL_CALL windowShown( const ::com::sun::star::lang::EventObject& e ) throw (::com::sun::star::uno::RuntimeException); virtual void SAL_CALL windowHidden( const ::com::sun::star::lang::EventObject& e ) throw (::com::sun::star::uno::RuntimeException); - // ::com::sun::star::awt::XDialog void SAL_CALL setTitle( const ::rtl::OUString& Title ) throw(::com::sun::star::uno::RuntimeException); ::rtl::OUString SAL_CALL getTitle() throw(::com::sun::star::uno::RuntimeException); @@ -154,203 +124,8 @@ public: protected: // virtual void ImplModelPropertiesChanged( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyChangeEvent >& rEvents ) throw(::com::sun::star::uno::RuntimeException); virtual void PrepareWindowDescriptor( ::com::sun::star::awt::WindowDescriptor& rDesc ); -protected: - virtual void removingControl( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl >& _rxControl ); - virtual void addingControl( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl >& _rxControl ); -}; - - -typedef ::cppu::ImplHelper2< ::com::sun::star::container::XContainerListener, - ::com::sun::star::util::XChangesListener > - UnoParentControl_IBase; - -class UnoParentControl : public UnoControlContainer, public UnoParentControl_IBase -{ -protected: - bool mbSizeModified; - bool mbPosModified; - ::com::sun::star::uno::Reference< ::com::sun::star::awt::XTabController > mxTabController; - void ImplInsertControl( ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel >& rxModel, const ::rtl::OUString& rName ); - void ImplRemoveControl( ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel >& rxModel ); - virtual void ImplSetPosSize( ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl >& rxCtrl ); - -public: - UnoParentControl(); - ~UnoParentControl(); - - DECLIMPL_SERVICEINFO_DERIVED( UnoParentControl, UnoControlBase, "com.sun.star.awt.UnoParentControl" ) - ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException) { return UnoControlContainer::queryInterface(rType); } - ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException); - void SAL_CALL acquire() throw() { OWeakAggObject::acquire(); } - void SAL_CALL release() throw() { OWeakAggObject::release(); } - - void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw(::com::sun::star::uno::RuntimeException); - void SAL_CALL dispose() throw(::com::sun::star::uno::RuntimeException); - - void SAL_CALL createPeer( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XToolkit >& Toolkit, const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer >& Parent ) throw(::com::sun::star::uno::RuntimeException); - - // ::com::sun::star::container::XContainerListener - void SAL_CALL elementInserted( const ::com::sun::star::container::ContainerEvent& Event ) throw(::com::sun::star::uno::RuntimeException); - void SAL_CALL elementRemoved( const ::com::sun::star::container::ContainerEvent& Event ) throw(::com::sun::star::uno::RuntimeException); - void SAL_CALL elementReplaced( const ::com::sun::star::container::ContainerEvent& Event ) throw(::com::sun::star::uno::RuntimeException); - - // ::com::sun::star::lang::XTypeProvider - ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw(::com::sun::star::uno::RuntimeException); - ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw(::com::sun::star::uno::RuntimeException); - - // XChangesListener - virtual void SAL_CALL changesOccurred( const ::com::sun::star::util::ChangesEvent& Event ) throw (::com::sun::star::uno::RuntimeException); - - // ::com::sun::star::awt::XControl - sal_Bool SAL_CALL setModel( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel >& Model ) throw(::com::sun::star::uno::RuntimeException); - void SAL_CALL setDesignMode( sal_Bool bOn ) throw(::com::sun::star::uno::RuntimeException); -protected: virtual void ImplModelPropertiesChanged( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyChangeEvent >& rEvents ) throw(::com::sun::star::uno::RuntimeException); - virtual void removingControl( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl >& _rxControl ); - virtual void addingControl( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl >& _rxControl ); -}; - -class UnoMultiPageModel : public UnoControlDialogModel -{ -public: - UnoMultiPageModel(); - ~UnoMultiPageModel(); - UnoMultiPageModel( const UnoMultiPageModel& rModel ); - - UnoControlModel* Clone() const; - - DECLIMPL_SERVICEINFO_DERIVED( UnoMultiPageModel, UnoControlDialogModel, szServiceName_UnoMultiPageModel ) - - virtual ::rtl::OUString SAL_CALL getServiceName() throw(::com::sun::star::uno::RuntimeException); - virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw( ::com::sun::star::uno::RuntimeException); - // XNamedContainer - void SAL_CALL insertByName( const ::rtl::OUString& aName, const ::com::sun::star::uno::Any& aElement ) throw(::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::container::ElementExistException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); - - // Override the method of parent Class - virtual sal_Bool SAL_CALL getGroupControl( ) throw (::com::sun::star::uno::RuntimeException); -protected: - virtual ::com::sun::star::uno::Any ImplGetDefaultValue( sal_uInt16 nPropId ) const; - ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper(); - -}; - -class UnoMultiPageControl : public UnoParentControl - ,public ::com::sun::star::awt::XSimpleTabController - ,public ::com::sun::star::awt::XTabListener -{ - TabListenerMultiplexer maTabListeners; - void bindPage( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl >& _rxControl ); -public: - UnoMultiPageControl(); - ~UnoMultiPageControl(); - ::rtl::OUString GetComponentServiceName(); - - // ::com::sun::star::lang::XServiceInfo - DECLIMPL_SERVICEINFO_DERIVED( UnoMultiPageControl, UnoParentControl, szServiceName_UnoMultiPageControl ) - ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException) { return UnoParentControl::queryInterface(rType); } - ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException); - void SAL_CALL acquire() throw() { OWeakAggObject::acquire(); } - void SAL_CALL release() throw() { OWeakAggObject::release(); } - // ::com::sun::star::lang::XTypeProvider - ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw(::com::sun::star::uno::RuntimeException); - ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw(::com::sun::star::uno::RuntimeException); - void SAL_CALL createPeer( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XToolkit >& Toolkit, const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer >& Parent ) throw(::com::sun::star::uno::RuntimeException); - // com::sun::star::awt::XSimpleTabController - virtual ::sal_Int32 SAL_CALL insertTab() throw (::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL removeTab( ::sal_Int32 ID ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); - - virtual void SAL_CALL setTabProps( ::sal_Int32 ID, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue >& Properties ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); - virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue > SAL_CALL getTabProps( ::sal_Int32 ID ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); - - virtual void SAL_CALL activateTab( ::sal_Int32 ID ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); - virtual ::sal_Int32 SAL_CALL getActiveTabID() throw (::com::sun::star::uno::RuntimeException); - - virtual void SAL_CALL addTabListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XTabListener >& Listener ) throw (::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL removeTabListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XTabListener >& Listener ) throw (::com::sun::star::uno::RuntimeException); - // XTabListener - virtual void SAL_CALL inserted( ::sal_Int32 ID ) throw (::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL removed( ::sal_Int32 ID ) throw (::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL changed( ::sal_Int32 ID, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue >& Properties ) throw (::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL activated( ::sal_Int32 ID ) throw (::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL deactivated( ::sal_Int32 ID ) throw (::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& evt ) throw (::com::sun::star::uno::RuntimeException); - // XComponent - void SAL_CALL dispose( ) throw(::com::sun::star::uno::RuntimeException); - -protected: - virtual void impl_createControlPeerIfNecessary( - const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl >& _rxControl - ); - -}; - - -class UnoPageModel : public UnoControlDialogModel -{ -public: - UnoPageModel(); - ~UnoPageModel(); - UnoPageModel( const UnoPageModel& rModel ); - - UnoControlModel* Clone() const; - - DECLIMPL_SERVICEINFO_DERIVED( UnoPageModel, UnoControlDialogModel, szServiceName_UnoPageModel ) - - virtual ::rtl::OUString SAL_CALL getServiceName() throw(::com::sun::star::uno::RuntimeException); - virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw( ::com::sun::star::uno::RuntimeException); - - // Override the method of parent Class - virtual sal_Bool SAL_CALL getGroupControl( ) throw (::com::sun::star::uno::RuntimeException); -protected: - virtual ::com::sun::star::uno::Any ImplGetDefaultValue( sal_uInt16 nPropId ) const; - ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper(); - -}; - -class UnoPageControl : public UnoParentControl -{ -public: - UnoPageControl(); - ~UnoPageControl(); - ::rtl::OUString GetComponentServiceName(); - - - // ::com::sun::star::lang::XServiceInfo - DECLIMPL_SERVICEINFO_DERIVED( UnoPageControl, UnoParentControl, szServiceName_UnoPageControl ) -}; - -class UnoFrameModel : public UnoControlDialogModel -{ -public: - UnoFrameModel(); - ~UnoFrameModel(); - UnoFrameModel( const UnoFrameModel& rModel ); - - UnoControlModel* Clone() const; - - DECLIMPL_SERVICEINFO_DERIVED( UnoFrameModel, UnoControlDialogModel, szServiceName_UnoFrameModel ) - - virtual ::rtl::OUString SAL_CALL getServiceName() throw(::com::sun::star::uno::RuntimeException); - virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw( ::com::sun::star::uno::RuntimeException); - protected: - virtual ::com::sun::star::uno::Any ImplGetDefaultValue( sal_uInt16 nPropId ) const; - ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper(); -}; - -class UnoFrameControl : public UnoParentControl -{ -protected: - virtual void ImplSetPosSize( ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl >& rxCtrl ); -public: - UnoFrameControl(); - ~UnoFrameControl(); - ::rtl::OUString GetComponentServiceName(); - -// ::com::sun::star::lang::XServiceInfo -DECLIMPL_SERVICEINFO_DERIVED( UnoFrameControl, UnoParentControl, szServiceName_UnoPageControl ) }; #endif // TOOLKIT_DIALOG_CONTROL_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/toolkit/inc/toolkit/controls/unocontrols.hxx b/toolkit/inc/toolkit/controls/unocontrols.hxx index 7c928ded5485..201858da0a12 100644 --- a/toolkit/inc/toolkit/controls/unocontrols.hxx +++ b/toolkit/inc/toolkit/controls/unocontrols.hxx @@ -72,17 +72,6 @@ #define UNO_NAME_GRAPHOBJ_URLPREFIX "vnd.sun.star.GraphicObject:" #define UNO_NAME_GRAPHOBJ_URLPKGPREFIX "vnd.sun.star.Package:" -class ImageHelper -{ -public: - // The routine will always attempt to return a valid XGraphic for the passed _rURL - // additionallly xOutGraphicObject will container the associated XGraphicObject ( if url - // is valid for that ) - // and is set appropriately ( e.g. NULL if non GraphicObject scheme ) or valid object - // if the rURL points to a valid object - static ::com::sun::star::uno::Reference< ::com::sun::star::graphic::XGraphic > getGraphicAndGraphicObjectFromURL_nothrow( ::com::sun::star::uno::Reference< ::com::sun::star::graphic::XGraphicObject >& xOutGraphicObject, const ::rtl::OUString& _rURL ); -}; - // ---------------------------------------------------- // class UnoControlEditModel // ---------------------------------------------------- @@ -234,6 +223,7 @@ private: bool mbAdjustingGraphic; ::com::sun::star::uno::Reference< ::com::sun::star::graphic::XGraphicObject > mxGrfObj; + ::com::sun::star::uno::Reference< ::com::sun::star::graphic::XGraphic > getGraphicFromURL_nothrow( const ::rtl::OUString& _rURL ); protected: GraphicControlModel( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory ) diff --git a/toolkit/source/awt/animatedimagespeer.cxx b/toolkit/source/awt/animatedimagespeer.cxx index 69c08ee51520..45d60f0d88aa 100755 --- a/toolkit/source/awt/animatedimagespeer.cxx +++ b/toolkit/source/awt/animatedimagespeer.cxx @@ -45,6 +45,7 @@ #include <tools/diagnose_ex.h> #include <tools/urlobj.hxx> #include <vcl/throbber.hxx> +#include <vcl/svapp.hxx> #include <limits> @@ -318,7 +319,7 @@ namespace toolkit //------------------------------------------------------------------------------------------------------------------ void SAL_CALL AnimatedImagesPeer::startAnimation( ) throw (RuntimeException) { - ::osl::MutexGuard aGuard( GetMutex() ); + SolarMutexGuard aGuard; Throbber* pThrobber( dynamic_cast< Throbber* >( GetWindow() ) ); if ( pThrobber != NULL) pThrobber->start(); @@ -327,7 +328,7 @@ namespace toolkit //------------------------------------------------------------------------------------------------------------------ void SAL_CALL AnimatedImagesPeer::stopAnimation( ) throw (RuntimeException) { - ::osl::MutexGuard aGuard( GetMutex() ); + SolarMutexGuard aGuard; Throbber* pThrobber( dynamic_cast< Throbber* >( GetWindow() ) ); if ( pThrobber != NULL) pThrobber->stop(); @@ -336,7 +337,7 @@ namespace toolkit //------------------------------------------------------------------------------------------------------------------ ::sal_Bool SAL_CALL AnimatedImagesPeer::isAnimationRunning( ) throw (RuntimeException) { - ::osl::MutexGuard aGuard( GetMutex() ); + SolarMutexGuard aGuard; Throbber* pThrobber( dynamic_cast< Throbber* >( GetWindow() ) ); if ( pThrobber != NULL) return pThrobber->isRunning(); @@ -346,7 +347,7 @@ namespace toolkit //------------------------------------------------------------------------------------------------------------------ void SAL_CALL AnimatedImagesPeer::setProperty( const ::rtl::OUString& i_propertyName, const Any& i_value ) throw(RuntimeException) { - ::osl::MutexGuard aGuard( GetMutex() ); + SolarMutexGuard aGuard; Throbber* pThrobber( dynamic_cast< Throbber* >( GetWindow() ) ); if ( pThrobber == NULL ) @@ -393,7 +394,7 @@ namespace toolkit //------------------------------------------------------------------------------------------------------------------ Any SAL_CALL AnimatedImagesPeer::getProperty( const ::rtl::OUString& i_propertyName ) throw(RuntimeException) { - ::osl::MutexGuard aGuard( GetMutex() ); + SolarMutexGuard aGuard; Any aReturn; @@ -443,7 +444,7 @@ namespace toolkit //------------------------------------------------------------------------------------------------------------------ void AnimatedImagesPeer::impl_updateImages_nolck( const Reference< XInterface >& i_animatedImages ) { - ::osl::MutexGuard aGuard( GetMutex() ); + SolarMutexGuard aGuard; lcl_updateImageList_nothrow( *m_pData, Reference< XAnimatedImages >( i_animatedImages, UNO_QUERY_THROW ) ); } @@ -451,7 +452,7 @@ namespace toolkit //------------------------------------------------------------------------------------------------------------------ void SAL_CALL AnimatedImagesPeer::elementInserted( const ContainerEvent& i_event ) throw (RuntimeException) { - ::osl::MutexGuard aGuard( GetMutex() ); + SolarMutexGuard aGuard; Reference< XAnimatedImages > xAnimatedImages( i_event.Source, UNO_QUERY_THROW ); sal_Int32 nPosition(0); @@ -474,7 +475,7 @@ namespace toolkit //------------------------------------------------------------------------------------------------------------------ void SAL_CALL AnimatedImagesPeer::elementRemoved( const ContainerEvent& i_event ) throw (RuntimeException) { - ::osl::MutexGuard aGuard( GetMutex() ); + SolarMutexGuard aGuard; Reference< XAnimatedImages > xAnimatedImages( i_event.Source, UNO_QUERY_THROW ); sal_Int32 nPosition(0); @@ -493,7 +494,7 @@ namespace toolkit //------------------------------------------------------------------------------------------------------------------ void SAL_CALL AnimatedImagesPeer::elementReplaced( const ContainerEvent& i_event ) throw (RuntimeException) { - ::osl::MutexGuard aGuard( GetMutex() ); + SolarMutexGuard aGuard; Reference< XAnimatedImages > xAnimatedImages( i_event.Source, UNO_QUERY_THROW ); sal_Int32 nPosition(0); @@ -529,7 +530,7 @@ namespace toolkit void SAL_CALL AnimatedImagesPeer::dispose( ) throw(RuntimeException) { AnimatedImagesPeer_Base::dispose(); - ::osl::MutexGuard aGuard( GetMutex() ); + SolarMutexGuard aGuard; m_pData->aCachedImageSets.resize(0); } diff --git a/toolkit/source/awt/vclxtabpagecontainer.cxx b/toolkit/source/awt/vclxtabpagecontainer.cxx index 01f6fddd10d8..9eecb16286ca 100644 --- a/toolkit/source/awt/vclxtabpagecontainer.cxx +++ b/toolkit/source/awt/vclxtabpagecontainer.cxx @@ -31,6 +31,7 @@ #include <com/sun/star/awt/XControl.hpp> #include <vcl/tabpage.hxx> #include <vcl/tabctrl.hxx> +#include <vcl/svapp.hxx> #include <toolkit/helper/property.hxx> #include <toolkit/helper/vclunohelper.hxx> #include <toolkit/helper/tkresmgr.hxx> @@ -65,7 +66,7 @@ VCLXTabPageContainer::~VCLXTabPageContainer() void SAL_CALL VCLXTabPageContainer::draw( sal_Int32 nX, sal_Int32 nY ) throw(RuntimeException) { - ::osl::MutexGuard aGuard( GetMutex() ); + SolarMutexGuard aGuard; TabControl* pTabControl = (TabControl*)GetWindow(); if ( pTabControl ) { @@ -107,7 +108,7 @@ void SAL_CALL VCLXTabPageContainer::draw( sal_Int32 nX, sal_Int32 nY ) throw(Run void SAL_CALL VCLXTabPageContainer::setProperty(const ::rtl::OUString& PropertyName, const Any& Value ) throw(RuntimeException) { - ::osl::MutexGuard aGuard( GetMutex() ); + SolarMutexGuard aGuard; TabControl* pTabPage = (TabControl*)GetWindow(); if ( pTabPage ) @@ -141,7 +142,7 @@ Reference< ::com::sun::star::awt::tab::XTabPage > SAL_CALL VCLXTabPageContainer: } Reference< ::com::sun::star::awt::tab::XTabPage > SAL_CALL VCLXTabPageContainer::getTabPageByID( ::sal_Int16 tabPageID ) throw (RuntimeException) { - ::osl::ClearableMutexGuard aGuard( GetMutex() ); + SolarMutexGuard aGuard; Reference< ::com::sun::star::awt::tab::XTabPage > xTabPage; ::std::vector< Reference< ::com::sun::star::awt::tab::XTabPage > >::iterator aIter = m_aTabPages.begin(); ::std::vector< Reference< ::com::sun::star::awt::tab::XTabPage > >::iterator aEnd = m_aTabPages.end(); @@ -168,7 +169,7 @@ void SAL_CALL VCLXTabPageContainer::removeTabPageListener( const Reference< ::co void VCLXTabPageContainer::ProcessWindowEvent( const VclWindowEvent& _rVclWindowEvent ) { - ::osl::ClearableMutexGuard aGuard( GetMutex() ); + SolarMutexClearableGuard aGuard; TabControl* pTabControl = static_cast< TabControl* >( GetWindow() ); if ( pTabControl ) { @@ -194,7 +195,7 @@ void SAL_CALL VCLXTabPageContainer::disposing( const ::com::sun::star::lang::Eve } void SAL_CALL VCLXTabPageContainer::elementInserted( const ::com::sun::star::container::ContainerEvent& Event ) throw (::com::sun::star::uno::RuntimeException) { - ::osl::MutexGuard aGuard( GetMutex() ); + SolarMutexGuard aGuard; TabControl* pTabCtrl = (TabControl*)GetWindow(); Reference< ::com::sun::star::awt::tab::XTabPage > xTabPage(Event.Element,uno::UNO_QUERY); if ( pTabCtrl && xTabPage.is() ) @@ -217,7 +218,7 @@ void SAL_CALL VCLXTabPageContainer::elementInserted( const ::com::sun::star::con } void SAL_CALL VCLXTabPageContainer::elementRemoved( const ::com::sun::star::container::ContainerEvent& Event ) throw (::com::sun::star::uno::RuntimeException) { - ::osl::MutexGuard aGuard( GetMutex() ); + SolarMutexGuard aGuard; TabControl* pTabCtrl = (TabControl*)GetWindow(); Reference< ::com::sun::star::awt::tab::XTabPage > xTabPage(Event.Element,uno::UNO_QUERY); if ( pTabCtrl && xTabPage.is() ) diff --git a/toolkit/source/awt/xsimpleanimation.cxx b/toolkit/source/awt/xsimpleanimation.cxx index b67768ddfebf..f59016fd77a2 100644 --- a/toolkit/source/awt/xsimpleanimation.cxx +++ b/toolkit/source/awt/xsimpleanimation.cxx @@ -61,7 +61,7 @@ namespace toolkit //-------------------------------------------------------------------- void SAL_CALL XSimpleAnimation::start() throw ( uno::RuntimeException ) { - ::osl::MutexGuard aGuard( GetMutex() ); + SolarMutexGuard aGuard; Throbber* pThrobber( dynamic_cast< Throbber* >( GetWindow() ) ); if ( pThrobber != NULL) pThrobber->start(); @@ -70,7 +70,7 @@ namespace toolkit //-------------------------------------------------------------------- void SAL_CALL XSimpleAnimation::stop() throw ( uno::RuntimeException ) { - ::osl::MutexGuard aGuard( GetMutex() ); + SolarMutexGuard aGuard; Throbber* pThrobber( dynamic_cast< Throbber* >( GetWindow() ) ); if ( pThrobber != NULL) pThrobber->stop(); @@ -80,7 +80,7 @@ namespace toolkit void SAL_CALL XSimpleAnimation::setImageList( const uno::Sequence< uno::Reference< graphic::XGraphic > >& rImageList ) throw ( uno::RuntimeException ) { - ::osl::MutexGuard aGuard( GetMutex() ); + SolarMutexGuard aGuard; Throbber* pThrobber( dynamic_cast< Throbber* >( GetWindow() ) ); if ( pThrobber != NULL) pThrobber->setImageList( rImageList ); diff --git a/toolkit/source/awt/xthrobber.cxx b/toolkit/source/awt/xthrobber.cxx index bc96712eb0ef..95c6b5b3d197 100644 --- a/toolkit/source/awt/xthrobber.cxx +++ b/toolkit/source/awt/xthrobber.cxx @@ -66,7 +66,7 @@ namespace toolkit //-------------------------------------------------------------------- void SAL_CALL XThrobber::start() throw ( uno::RuntimeException ) { - ::osl::MutexGuard aGuard( GetMutex() ); + SolarMutexGuard aGuard; Throbber* pThrobber( dynamic_cast< Throbber* >( GetWindow() ) ); if ( pThrobber != NULL) pThrobber->start(); @@ -92,7 +92,7 @@ namespace toolkit void SAL_CALL XThrobber::InitImageList() throw( uno::RuntimeException ) { - ::osl::MutexGuard aGuard( GetMutex() ); + SolarMutexGuard aGuard; Throbber* pThrobber( dynamic_cast< Throbber* >( GetWindow() ) ); if ( pThrobber == NULL) diff --git a/toolkit/source/controls/controlmodelcontainerbase.cxx b/toolkit/source/controls/controlmodelcontainerbase.cxx index a630a274adfe..b74537a0c082 100644 --- a/toolkit/source/controls/controlmodelcontainerbase.cxx +++ b/toolkit/source/controls/controlmodelcontainerbase.cxx @@ -32,13 +32,16 @@ #include <vcl/svapp.hxx> #include <vcl/window.hxx> #include <vcl/wall.hxx> +#include <osl/mutex.hxx> #include <toolkit/helper/property.hxx> #include <toolkit/helper/unopropertyarrayhelper.hxx> #include <toolkit/controls/geometrycontrolmodel.hxx> #include <toolkit/controls/unocontrols.hxx> #include "toolkit/controls/formattedcontrol.hxx" #include "toolkit/controls/roadmapcontrol.hxx" +#ifndef TOOLKIT_INC_TOOLKIT_CONTROLS_TKSCROLLBAR_HXX #include "toolkit/controls/tkscrollbar.hxx" +#endif #include <toolkit/controls/stdtabcontroller.hxx> #include <com/sun/star/awt/PosSize.hpp> #include <com/sun/star/awt/WindowAttribute.hpp> @@ -64,14 +67,14 @@ #include "grid/gridcontrol.hxx" #include <toolkit/controls/tabpagecontainer.hxx> +#include <boost/bind.hpp> + #include <map> #include <algorithm> #include <functional> #include "tools/urlobj.hxx" #include "osl/file.hxx" -#include <boost/bind.hpp> - using namespace ::com::sun::star; using namespace ::com::sun::star::uno; using namespace ::com::sun::star::awt; @@ -335,7 +338,7 @@ ControlModelContainerBase::UnoControlModelHolderList::iterator ControlModelConta // ::XMultiServiceFactory Reference< XInterface > ControlModelContainerBase::createInstance( const ::rtl::OUString& aServiceSpecifier ) throw(Exception, RuntimeException) { - SolarMutexGuard aSolarGuard; + SolarMutexGuard aGuard; OGeometryControlModel_Base* pNewModel = NULL; @@ -482,7 +485,7 @@ sal_Bool ControlModelContainerBase::hasElements() throw(RuntimeException) // XNameContainer, XNameReplace, XNameAccess void ControlModelContainerBase::replaceByName( const ::rtl::OUString& aName, const Any& aElement ) throw(IllegalArgumentException, NoSuchElementException, WrappedTargetException, RuntimeException) { - SolarMutexGuard aSolarGuard; + SolarMutexGuard aGuard; Reference< XControlModel > xNewModel; aElement >>= xNewModel; @@ -542,7 +545,7 @@ sal_Bool ControlModelContainerBase::hasByName( const ::rtl::OUString& aName ) th void ControlModelContainerBase::insertByName( const ::rtl::OUString& aName, const Any& aElement ) throw(IllegalArgumentException, ElementExistException, WrappedTargetException, RuntimeException) { - SolarMutexGuard aSolarGuard; + SolarMutexGuard aGuard; Reference< XControlModel > xM; aElement >>= xM; @@ -595,7 +598,7 @@ void ControlModelContainerBase::insertByName( const ::rtl::OUString& aName, cons void ControlModelContainerBase::removeByName( const ::rtl::OUString& aName ) throw(NoSuchElementException, WrappedTargetException, RuntimeException) { - SolarMutexGuard aSolarGuard; + SolarMutexGuard aGuard; UnoControlModelHolderList::iterator aElementPos = ImplFindElement( aName ); if ( maModels.end() == aElementPos ) @@ -638,7 +641,7 @@ void SAL_CALL ControlModelContainerBase::setGroupControl( sal_Bool ) throw (Runt // ---------------------------------------------------------------------------- void SAL_CALL ControlModelContainerBase::setControlModels( const Sequence< Reference< XControlModel > >& _rControls ) throw (RuntimeException) { - SolarMutexGuard aSolarGuard; + SolarMutexGuard aGuard; // set the tab indexes according to the order of models in the sequence const Reference< XControlModel >* pControls = _rControls.getConstArray( ); @@ -675,7 +678,7 @@ typedef ::std::multimap< sal_Int32, Reference< XControlModel >, ::std::less< sal // ---------------------------------------------------------------------------- Sequence< Reference< XControlModel > > SAL_CALL ControlModelContainerBase::getControlModels( ) throw (RuntimeException) { - SolarMutexGuard aSolarGuard; + SolarMutexGuard aGuard; MapIndexToModel aSortedModels; // will be the sorted container of all models which have a tab index property @@ -757,7 +760,7 @@ void SAL_CALL ControlModelContainerBase::setEnabled( ::sal_Bool _enabled ) throw } ::rtl::OUString SAL_CALL ControlModelContainerBase::getTitle() throw (::com::sun::star::uno::RuntimeException) { - SolarMutexGuard aSolarGuard; + SolarMutexGuard aGuard; Reference<XPropertySet> xThis(*this,UNO_QUERY); ::rtl::OUString sTitle; xThis->getPropertyValue(GetPropertyName(BASEPROPERTY_TITLE)) >>= sTitle; @@ -766,7 +769,7 @@ void SAL_CALL ControlModelContainerBase::setEnabled( ::sal_Bool _enabled ) throw } void SAL_CALL ControlModelContainerBase::setTitle( const ::rtl::OUString& _title ) throw (::com::sun::star::uno::RuntimeException) { - SolarMutexGuard aSolarGuard; + SolarMutexGuard aGuard; Reference<XPropertySet> xThis(*this,UNO_QUERY); xThis->setPropertyValue(GetPropertyName(BASEPROPERTY_TITLE),makeAny(_title)); } @@ -816,7 +819,7 @@ namespace // ---------------------------------------------------------------------------- sal_Int32 SAL_CALL ControlModelContainerBase::getGroupCount( ) throw (RuntimeException) { - SolarMutexGuard aSolarGuard; + SolarMutexGuard aGuard; implUpdateGroupStructure(); @@ -826,7 +829,7 @@ sal_Int32 SAL_CALL ControlModelContainerBase::getGroupCount( ) throw (RuntimeEx // ---------------------------------------------------------------------------- void SAL_CALL ControlModelContainerBase::getGroup( sal_Int32 _nGroup, Sequence< Reference< XControlModel > >& _rGroup, ::rtl::OUString& _rName ) throw (RuntimeException) { - SolarMutexGuard aSolarGuard; + SolarMutexGuard aGuard; implUpdateGroupStructure(); @@ -850,7 +853,7 @@ void SAL_CALL ControlModelContainerBase::getGroup( sal_Int32 _nGroup, Sequence< // ---------------------------------------------------------------------------- void SAL_CALL ControlModelContainerBase::getGroupByName( const ::rtl::OUString& _rName, Sequence< Reference< XControlModel > >& _rGroup ) throw (RuntimeException) { - SolarMutexGuard aSolarGuard; + SolarMutexGuard aGuard; ::rtl::OUString sDummyName; getGroup( _rName.toInt32( ), _rGroup, sDummyName ); @@ -1030,7 +1033,7 @@ void ControlModelContainerBase::implUpdateGroupStructure() // ---------------------------------------------------------------------------- void SAL_CALL ControlModelContainerBase::propertyChange( const PropertyChangeEvent& _rEvent ) throw (RuntimeException) { - SolarMutexGuard aSolarGuard; + SolarMutexGuard aGuard; DBG_ASSERT( 0 == _rEvent.PropertyName.compareToAscii( "TabIndex" ), "UnoControlDialogModel::propertyChange: not listening for this property!" ); @@ -1061,7 +1064,7 @@ void SAL_CALL ControlModelContainerBase::disposing( const EventObject& /*rEvent* // ---------------------------------------------------------------------------- void ControlModelContainerBase::startControlListening( const Reference< XControlModel >& _rxChildModel ) { - SolarMutexGuard aSolarGuard; + SolarMutexGuard aGuard; Reference< XPropertySet > xModelProps( _rxChildModel, UNO_QUERY ); Reference< XPropertySetInfo > xPSI; @@ -1075,7 +1078,7 @@ void ControlModelContainerBase::startControlListening( const Reference< XControl // ---------------------------------------------------------------------------- void ControlModelContainerBase::stopControlListening( const Reference< XControlModel >& _rxChildModel ) { - SolarMutexGuard aSolarGuard; + SolarMutexGuard aGuard; Reference< XPropertySet > xModelProps( _rxChildModel, UNO_QUERY ); Reference< XPropertySetInfo > xPSI; @@ -1330,7 +1333,7 @@ ControlContainerBase::~ControlContainerBase() void ControlContainerBase::createPeer( const Reference< XToolkit > & rxToolkit, const Reference< XWindowPeer > & rParentPeer ) throw(RuntimeException) { - SolarMutexGuard aSolarGuard; + SolarMutexGuard aGuard; UnoControlContainer::createPeer( rxToolkit, rParentPeer ); } @@ -1435,13 +1438,12 @@ void ControlContainerBase::ImplSetPosSize( Reference< XControl >& rxCtrl ) void ControlContainerBase::dispose() throw(RuntimeException) { - SolarMutexGuard aSolarGuard; - EventObject aEvt; aEvt.Source = static_cast< ::cppu::OWeakObject* >( this ); // Notify our listener helper about dispose // --- SAFE --- - ::osl::ResettableGuard< ::osl::Mutex > aGuard( GetMutex() ); + + SolarMutexClearableGuard aGuard; Reference< XEventListener > xListener( mxListener, UNO_QUERY ); mxListener.clear(); aGuard.clear(); @@ -1461,7 +1463,7 @@ throw(RuntimeException) sal_Bool ControlContainerBase::setModel( const Reference< XControlModel >& rxModel ) throw(RuntimeException) { - SolarMutexGuard aSolarGuard; + SolarMutexGuard aGuard; // destroy the old tab controller, if existent if ( mxTabController.is() ) @@ -1534,8 +1536,7 @@ sal_Bool ControlContainerBase::setModel( const Reference< XControlModel >& rxMod } void ControlContainerBase::setDesignMode( sal_Bool bOn ) throw(RuntimeException) { - SolarMutexGuard aSolarGuard; - ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() ); + SolarMutexGuard aGuard; UnoControl::setDesignMode( bOn ); @@ -1554,7 +1555,7 @@ void ControlContainerBase::setDesignMode( sal_Bool bOn ) throw(RuntimeException) void ControlContainerBase::elementInserted( const ContainerEvent& Event ) throw(RuntimeException) { - SolarMutexGuard aSolarGuard; + SolarMutexGuard aGuard; Reference< XControlModel > xModel; ::rtl::OUString aName; @@ -1575,7 +1576,7 @@ void ControlContainerBase::elementInserted( const ContainerEvent& Event ) throw( void ControlContainerBase::elementRemoved( const ContainerEvent& Event ) throw(RuntimeException) { - SolarMutexGuard aSolarGuard; + SolarMutexGuard aGuard; Reference< XControlModel > xModel; Event.Element >>= xModel; @@ -1593,7 +1594,7 @@ void ControlContainerBase::elementRemoved( const ContainerEvent& Event ) throw(R void ControlContainerBase::elementReplaced( const ContainerEvent& Event ) throw(RuntimeException) { - SolarMutexGuard aSolarGuard; + SolarMutexGuard aGuard; Reference< XControlModel > xModel; Event.ReplacedElement >>= xModel; @@ -1670,7 +1671,7 @@ void ControlContainerBase::ImplModelPropertiesChanged( const Sequence< PropertyC void ControlContainerBase::addingControl( const Reference< XControl >& _rxControl ) { - SolarMutexGuard aSolarGuard; + SolarMutexGuard aGuard; UnoControlContainer::addingControl( _rxControl ); if ( _rxControl.is() ) @@ -1692,7 +1693,7 @@ void ControlContainerBase::addingControl( const Reference< XControl >& _rxContro void ControlContainerBase::removingControl( const Reference< XControl >& _rxControl ) { - SolarMutexGuard aSolarGuard; + SolarMutexGuard aGuard; UnoControlContainer::removingControl( _rxControl ); if ( _rxControl.is() ) @@ -1706,7 +1707,7 @@ void ControlContainerBase::removingControl( const Reference< XControl >& _rxCont void SAL_CALL ControlContainerBase::changesOccurred( const ChangesEvent& ) throw (RuntimeException) { - SolarMutexGuard aSolarGuard; + SolarMutexGuard aGuard; // a tab controller model may have changed // #109067# in design mode don't notify the tab controller diff --git a/toolkit/source/controls/dialogcontrol.cxx b/toolkit/source/controls/dialogcontrol.cxx index 22c35f77bd61..85bcf95062eb 100644 --- a/toolkit/source/controls/dialogcontrol.cxx +++ b/toolkit/source/controls/dialogcontrol.cxx @@ -1,4 +1,3 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -41,6 +40,7 @@ #include <com/sun/star/awt/WindowAttribute.hpp> #include <com/sun/star/resource/XStringResourceResolver.hpp> #include <com/sun/star/graphic/XGraphicProvider.hpp> +#include <tools/list.hxx> #include <cppuhelper/typeprovider.hxx> #include <tools/debug.hxx> #include <tools/diagnose_ex.h> @@ -53,16 +53,10 @@ #include <vcl/graph.hxx> #include <vcl/image.hxx> #include <map> -#include <boost/unordered_map.hpp> #include <algorithm> -#include <o3tl/compat_functional.hxx> +#include <functional> #include "tools/urlobj.hxx" #include "osl/file.hxx" -#include <com/sun/star/awt/XSimpleTabController.hpp> -#include <vcl/tabctrl.hxx> -#include <vcl/tabpage.hxx> -#include <vcl/button.hxx> -#include <toolkit/awt/vclxwindows.hxx> using namespace ::com::sun::star; using namespace ::com::sun::star::uno; @@ -71,7 +65,6 @@ using namespace ::com::sun::star::lang; using namespace ::com::sun::star::container; using namespace ::com::sun::star::beans; using namespace ::com::sun::star::util; -using namespace ::com::sun::star::script; #define PROPERTY_DIALOGSOURCEURL ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DialogSourceURL" )) #define PROPERTY_IMAGEURL ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ImageURL" )) @@ -80,95 +73,12 @@ using namespace ::com::sun::star::script; ////HELPER ::rtl::OUString getPhysicalLocation( const ::com::sun::star::uno::Any& rbase, const ::com::sun::star::uno::Any& rUrl ); -uno::Reference< graphic::XGraphic > getGraphicFromURL_nothrow( uno::Reference< graphic::XGraphicObject >& rxGrfObj, const ::rtl::OUString& _rURL ); - -// we probably will need both a hash of control models and hash of controls -// => use some template magic - -typedef ::cppu::WeakImplHelper1< container::XNameContainer > SimpleNameContainer_BASE; - -template< typename T > -class SimpleNamedThingContainer : public SimpleNameContainer_BASE -{ - typedef boost::unordered_map< rtl::OUString, Reference< T >, ::rtl::OUStringHash, - ::std::equal_to< ::rtl::OUString > > NamedThingsHash; - NamedThingsHash things; - ::osl::Mutex m_aMutex; -public: - // ::com::sun::star::container::XNameContainer, XNameReplace, XNameAccess - virtual void SAL_CALL replaceByName( const ::rtl::OUString& aName, const Any& aElement ) throw(IllegalArgumentException, NoSuchElementException, WrappedTargetException, RuntimeException) - { - ::osl::MutexGuard aGuard( m_aMutex ); - if ( !hasByName( aName ) ) - throw NoSuchElementException(); - Reference< T > xElement; - if ( ! ( aElement >>= xElement ) ) - throw IllegalArgumentException(); - things[ aName ] = xElement; - } - virtual Any SAL_CALL getByName( const ::rtl::OUString& aName ) throw(NoSuchElementException, WrappedTargetException, RuntimeException) - { - ::osl::MutexGuard aGuard( m_aMutex ); - if ( !hasByName( aName ) ) - throw NoSuchElementException(); - return uno::makeAny( things[ aName ] ); - } - virtual Sequence< ::rtl::OUString > SAL_CALL getElementNames( ) throw(RuntimeException) - { - ::osl::MutexGuard aGuard( m_aMutex ); - Sequence< ::rtl::OUString > aResult( things.size() ); - typename NamedThingsHash::iterator it = things.begin(); - typename NamedThingsHash::iterator it_end = things.end(); - rtl::OUString* pName = aResult.getArray(); - for (; it != it_end; ++it, ++pName ) - *pName = it->first; - return aResult; - } - virtual sal_Bool SAL_CALL hasByName( const ::rtl::OUString& aName ) throw(RuntimeException) - { - ::osl::MutexGuard aGuard( m_aMutex ); - return ( things.find( aName ) != things.end() ); - } - virtual void SAL_CALL insertByName( const ::rtl::OUString& aName, const Any& aElement ) throw(IllegalArgumentException, ElementExistException, WrappedTargetException, RuntimeException) - { - ::osl::MutexGuard aGuard( m_aMutex ); - if ( hasByName( aName ) ) - throw ElementExistException(); - Reference< T > xElement; - if ( ! ( aElement >>= xElement ) ) - throw IllegalArgumentException(); - things[ aName ] = xElement; - } - virtual void SAL_CALL removeByName( const ::rtl::OUString& aName ) throw(NoSuchElementException, WrappedTargetException, RuntimeException) - { - ::osl::MutexGuard aGuard( m_aMutex ); - if ( !hasByName( aName ) ) - throw NoSuchElementException(); - things.erase( things.find( aName ) ); - } - virtual Type SAL_CALL getElementType( ) throw (RuntimeException) - { - return T::static_type( NULL ); - } - virtual ::sal_Bool SAL_CALL hasElements( ) throw (RuntimeException) - { - ::osl::MutexGuard aGuard( m_aMutex ); - return ( things.size() > 0 ); - } -}; - - // ---------------------------------------------------- // class UnoControlDialogModel // ---------------------------------------------------- -UnoControlDialogModel::UnoControlDialogModel( bool regProps ) - :maContainerListeners( *this ) - ,maChangeListeners ( GetMutex() ) - ,mbGroupsUpToDate( sal_False ), mbAdjustingGraphic( false ) +UnoControlDialogModel::UnoControlDialogModel( const Reference< XMultiServiceFactory >& i_factory ) + :ControlModelContainerBase( i_factory ) { - if ( !regProps ) // Register properties elsewhere ( probably in class derived from this ) - return; - ImplRegisterProperty( BASEPROPERTY_BACKGROUNDCOLOR ); // ImplRegisterProperty( BASEPROPERTY_BORDER ); ImplRegisterProperty( BASEPROPERTY_DEFAULTCONTROL ); @@ -189,24 +99,15 @@ UnoControlDialogModel::UnoControlDialogModel( bool regProps ) aBool <<= (sal_Bool) sal_True; ImplRegisterProperty( BASEPROPERTY_MOVEABLE, aBool ); ImplRegisterProperty( BASEPROPERTY_CLOSEABLE, aBool ); - // #TODO separate class for 'UserForm' ( instead of re-using Dialog ? ) - uno::Reference< XNameContainer > xNameCont = new SimpleNamedThingContainer< XControlModel >(); - ImplRegisterProperty( BASEPROPERTY_USERFORMCONTAINEES, uno::makeAny( xNameCont ) ); } UnoControlDialogModel::UnoControlDialogModel( const UnoControlDialogModel& rModel ) - : UnoControlDialogModel_IBase( rModel ) - , UnoControlDialogModel_Base( rModel ) - , maContainerListeners( *this ) - , maChangeListeners ( GetMutex() ) - , mbGroupsUpToDate( sal_False ), mbAdjustingGraphic( false ) + : ControlModelContainerBase( rModel ) { } UnoControlDialogModel::~UnoControlDialogModel() { - maModels.clear(); - mbGroupsUpToDate = sal_False; } UnoControlModel* UnoControlDialogModel::Clone() const @@ -219,45 +120,12 @@ UnoControlModel* UnoControlDialogModel::Clone() const return pClone; } + ::rtl::OUString UnoControlDialogModel::getServiceName( ) throw(RuntimeException) { return ::rtl::OUString::createFromAscii( szServiceName_UnoControlDialogModel ); } -void SAL_CALL UnoControlDialogModel::setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, const ::com::sun::star::uno::Any& rValue ) throw (::com::sun::star::uno::Exception) -{ - UnoControlModel::setFastPropertyValue_NoBroadcast( nHandle, rValue ); - try - { - switch ( nHandle ) - { - case BASEPROPERTY_IMAGEURL: - if ( !mbAdjustingGraphic && ImplHasProperty( BASEPROPERTY_GRAPHIC ) ) - { - mbAdjustingGraphic = true; - ::rtl::OUString sImageURL; - OSL_VERIFY( rValue >>= sImageURL ); - setPropertyValue( GetPropertyName( BASEPROPERTY_GRAPHIC ), uno::makeAny( ImageHelper::getGraphicAndGraphicObjectFromURL_nothrow( mxGrfObj, sImageURL ) ) ); - mbAdjustingGraphic = false; - } - break; - - case BASEPROPERTY_GRAPHIC: - if ( !mbAdjustingGraphic && ImplHasProperty( BASEPROPERTY_IMAGEURL ) ) - { - mbAdjustingGraphic = true; - setPropertyValue( GetPropertyName( BASEPROPERTY_IMAGEURL ), uno::makeAny( ::rtl::OUString() ) ); - mbAdjustingGraphic = false; - } - break; - } - } - catch( const ::com::sun::star::uno::Exception& ) - { - OSL_ENSURE( sal_False, "UnoControlDialogModel::setFastPropertyValue_NoBroadcast: caught an exception while setting Graphic/ImageURL properties!" ); - } -} - Any UnoControlDialogModel::ImplGetDefaultValue( sal_uInt16 nPropId ) const { Any aAny; @@ -292,903 +160,21 @@ Reference< XPropertySetInfo > UnoControlDialogModel::getPropertySetInfo( ) thro return xInfo; } -void UnoControlDialogModel::updateUserFormChildren( const Reference< XNameContainer >& xAllChildren, const rtl::OUString& aName, ChildOperation Operation, const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel >& xTarget ) throw(IllegalArgumentException, ElementExistException, WrappedTargetException, RuntimeException) -{ - if ( Operation < Insert || Operation > Remove ) - throw IllegalArgumentException(); - - if ( xAllChildren.is() ) - { - if ( Operation == Remove ) - { - Reference< XControlModel > xOldModel( xAllChildren->getByName( aName ), UNO_QUERY ); - xAllChildren->removeByName( aName ); - - Reference< XNameContainer > xChildContainer( xOldModel, UNO_QUERY ); - if ( xChildContainer.is() ) - { - Reference< XPropertySet > xProps( xChildContainer, UNO_QUERY ); - // container control is being removed from this container, reset the - // global list of containees - if ( xProps.is() ) - xProps->setPropertyValue( GetPropertyName( BASEPROPERTY_USERFORMCONTAINEES ), uno::makeAny( uno::Reference< XNameContainer >() ) ); - Sequence< rtl::OUString > aChildNames = xChildContainer->getElementNames(); - for ( sal_Int32 index=0; index< aChildNames.getLength(); ++index ) - updateUserFormChildren( xAllChildren, aChildNames[ index ], Operation, Reference< XControlModel > () ); - } - } - else if ( Operation == Insert ) - { - xAllChildren->insertByName( aName, uno::makeAny( xTarget ) ); - Reference< XNameContainer > xChildContainer( xTarget, UNO_QUERY ); - if ( xChildContainer.is() ) - { - // container control is being added from this container, reset the - // global list of containees to point to the correct global list - Reference< XPropertySet > xProps( xChildContainer, UNO_QUERY ); - if ( xProps.is() ) - xProps->setPropertyValue( GetPropertyName( BASEPROPERTY_USERFORMCONTAINEES ), uno::makeAny( xAllChildren ) ); - Sequence< rtl::OUString > aChildNames = xChildContainer->getElementNames(); - for ( sal_Int32 index=0; index< aChildNames.getLength(); ++index ) - { - Reference< XControlModel > xChildTarget( xChildContainer->getByName( aChildNames[ index ] ), UNO_QUERY ); - updateUserFormChildren( xAllChildren, aChildNames[ index ], Operation, xChildTarget ); - } - } - } - } - else - throw IllegalArgumentException(); -} - -sal_Bool UnoControlDialogModel::hasElements() throw(RuntimeException) -{ - return !maModels.empty(); -} - -// XNameContainer, XNameReplace, XNameAccess -void UnoControlDialogModel::replaceByName( const ::rtl::OUString& aName, const Any& aElement ) throw(IllegalArgumentException, NoSuchElementException, WrappedTargetException, RuntimeException) -{ - SolarMutexGuard aSolarGuard; - - Reference< XControlModel > xNewModel; - aElement >>= xNewModel; - if ( !xNewModel.is() ) - lcl_throwIllegalArgumentException(); - - UnoControlModelHolderList::iterator aElementPos = ImplFindElement( aName ); - if ( maModels.end() == aElementPos ) - lcl_throwNoSuchElementException(); - // Dialog behaviour is to have all containee names unique ( MSO Userform is the same ) - // With container controls you could have constructed an existing hierachy and are now - // add this to an existing container, in this case a name nested in the containment - // hierachy of the added control could contain a name clash, if we have access to the - // list of global names then recursively check for previously existing names ( we need - // to do this obviously before the 'this' objects container is updated - Reference< XNameContainer > xAllChildren( getPropertyValue( GetPropertyName( BASEPROPERTY_USERFORMCONTAINEES ) ), UNO_QUERY ); - if ( xAllChildren.is() ) - { - // remove old control ( and children ) from global list of containees - updateUserFormChildren( xAllChildren, aName, Remove, uno::Reference< XControlModel >() ); - // Add new control ( and containees if they exist ) - updateUserFormChildren( xAllChildren, aName, Insert, xNewModel ); - } - // stop listening at the old model - stopControlListening( aElementPos->first ); - Reference< XControlModel > xReplaced( aElementPos->first ); - // remember the new model, and start listening - aElementPos->first = xNewModel; - startControlListening( xNewModel ); - - ContainerEvent aEvent; - aEvent.Source = *this; - aEvent.Element = aElement; - aEvent.ReplacedElement <<= xReplaced; - aEvent.Accessor <<= aName; - - // notify the container listener - maContainerListeners.elementReplaced( aEvent ); - - // our "tab controller model" has potentially changed -> notify this - implNotifyTabModelChange( aName ); -} - -Any UnoControlDialogModel::getByName( const ::rtl::OUString& aName ) throw(NoSuchElementException, WrappedTargetException, RuntimeException) -{ - UnoControlModelHolderList::iterator aElementPos = ImplFindElement( aName ); - if ( maModels.end() == aElementPos ) - lcl_throwNoSuchElementException(); - - return makeAny( aElementPos->first ); -} - -Sequence< ::rtl::OUString > UnoControlDialogModel::getElementNames() throw(RuntimeException) -{ - Sequence< ::rtl::OUString > aNames( maModels.size() ); - - ::std::transform( - maModels.begin(), maModels.end(), // source range - aNames.getArray(), // target range - ::o3tl::select2nd< UnoControlModelHolder >() // operator to apply: select the second element (the name) - ); - - return aNames; -} - -sal_Bool UnoControlDialogModel::hasByName( const ::rtl::OUString& aName ) throw(RuntimeException) -{ - return maModels.end() != ImplFindElement( aName ); -} - -void UnoControlDialogModel::insertByName( const ::rtl::OUString& aName, const Any& aElement ) throw(IllegalArgumentException, ElementExistException, WrappedTargetException, RuntimeException) -{ - SolarMutexGuard aSolarGuard; - - Reference< XControlModel > xM; - aElement >>= xM; - - if ( xM.is() ) - { - Reference< beans::XPropertySet > xProps( xM, UNO_QUERY ); - if ( xProps.is() ) - { - - Reference< beans::XPropertySetInfo > xPropInfo = xProps.get()->getPropertySetInfo(); - - ::rtl::OUString sImageSourceProperty = GetPropertyName( BASEPROPERTY_IMAGEURL ); - if ( xPropInfo.get()->hasPropertyByName( sImageSourceProperty )) - { - Any aUrl = xProps.get()->getPropertyValue( sImageSourceProperty ); - - ::rtl::OUString absoluteUrl; - aUrl >>= absoluteUrl; - if ( absoluteUrl.compareToAscii( UNO_NAME_GRAPHOBJ_URLPREFIX, RTL_CONSTASCII_LENGTH( UNO_NAME_GRAPHOBJ_URLPREFIX ) ) == 0 ) - xProps.get()->setPropertyValue( sImageSourceProperty , aUrl ); - // Now we inherit from this class, no all containers have - // DialogSourceURL - else if ( getPropertySetInfo()->hasPropertyByName( GetPropertyName( BASEPROPERTY_DIALOGSOURCEURL ) ) ) - getPhysicalLocation( getPropertyValue( GetPropertyName( BASEPROPERTY_DIALOGSOURCEURL ) ), aUrl ); - - aUrl <<= absoluteUrl; - - xProps.get()->setPropertyValue( sImageSourceProperty , aUrl ); - } - } - } - - - - if ( !aName.getLength() || !xM.is() ) - lcl_throwIllegalArgumentException(); - - UnoControlModelHolderList::iterator aElementPos = ImplFindElement( aName ); - if ( maModels.end() != aElementPos ) - lcl_throwElementExistException(); - - // Dialog behaviour is to have all containee names unique ( MSO Userform is the same ) - // With container controls you could have constructed an existing hierachy and are now - // add this to an existing container, in this case a name nested in the containment - // hierachy of the added control could contain a name clash, if we have access to the - // list of global names then we need to recursively check for previously existing - // names ( we need to do this obviously before the 'this' objects container is updated - // remove old control ( and children ) from global list of containees - Reference< XNameContainer > xAllChildren( getPropertyValue( GetPropertyName( BASEPROPERTY_USERFORMCONTAINEES ) ), UNO_QUERY ); - - if ( xAllChildren.is() ) - updateUserFormChildren( xAllChildren, aName, Insert, xM ); - maModels.push_back( UnoControlModelHolder( xM, aName ) ); - - mbGroupsUpToDate = sal_False; - startControlListening( xM ); - - ContainerEvent aEvent; - aEvent.Source = *this; - aEvent.Element <<= aElement; - aEvent.Accessor <<= aName; - maContainerListeners.elementInserted( aEvent ); - - // our "tab controller model" has potentially changed -> notify this - implNotifyTabModelChange( aName ); -} - -void UnoControlDialogModel::removeByName( const ::rtl::OUString& aName ) throw(NoSuchElementException, WrappedTargetException, RuntimeException) -{ - SolarMutexGuard aSolarGuard; - - UnoControlModelHolderList::iterator aElementPos = ImplFindElement( aName ); - if ( maModels.end() == aElementPos ) - lcl_throwNoSuchElementException(); - - // Dialog behaviour is to have all containee names unique ( MSO Userform is the same ) - // With container controls you could have constructed an existing hierachy and are now - // removing this control from an existing container, in this case all nested names in - // the containment hierachy of the control to be removed need to be removed from the global - // names cache ( we need to do this obviously before the 'this' objects container is updated ) - Reference< XNameContainer > xAllChildren( getPropertyValue( GetPropertyName( BASEPROPERTY_USERFORMCONTAINEES ) ), UNO_QUERY ); - if ( xAllChildren.is() ) - updateUserFormChildren( xAllChildren, aName, Remove, uno::Reference< XControlModel >() ); - - ContainerEvent aEvent; - aEvent.Source = *this; - aEvent.Element <<= aElementPos->first; - aEvent.Accessor <<= aName; - maContainerListeners.elementRemoved( aEvent ); - - stopControlListening( aElementPos->first ); - Reference< XPropertySet > xPS( aElementPos->first, UNO_QUERY ); - maModels.erase( aElementPos ); - mbGroupsUpToDate = sal_False; - - if ( xPS.is() ) - try - { - xPS->setPropertyValue( PROPERTY_RESOURCERESOLVER, makeAny( Reference< resource::XStringResourceResolver >() ) ); - } - catch( const Exception& ) { DBG_UNHANDLED_EXCEPTION(); } - - // our "tab controller model" has potentially changed -> notify this - implNotifyTabModelChange( aName ); -} - -// ---------------------------------------------------------------------------- -sal_Bool SAL_CALL UnoControlDialogModel::getGroupControl( ) throw (RuntimeException) -{ - return sal_True; -} - -// ---------------------------------------------------------------------------- -void SAL_CALL UnoControlDialogModel::setGroupControl( sal_Bool ) throw (RuntimeException) -{ - OSL_FAIL( "UnoControlDialogModel::setGroupControl: explicit grouping not supported" ); -} - -// ---------------------------------------------------------------------------- -void SAL_CALL UnoControlDialogModel::setControlModels( const Sequence< Reference< XControlModel > >& _rControls ) throw (RuntimeException) -{ - SolarMutexGuard aSolarGuard; - - // set the tab indexes according to the order of models in the sequence - const Reference< XControlModel >* pControls = _rControls.getConstArray( ); - const Reference< XControlModel >* pControlsEnd = _rControls.getConstArray( ) + _rControls.getLength(); - - sal_Int16 nTabIndex = 1; - - for ( ; pControls != pControlsEnd; ++pControls ) - { - // look up the control in our own structure. This is to prevent invalid arguments - UnoControlModelHolderList::const_iterator aPos = - ::std::find_if( - maModels.begin(), maModels.end(), - CompareControlModel( *pControls ) - ); - if ( maModels.end() != aPos ) - { - // okay, this is an existent model - // now set the TabIndex property (if applicable) - Reference< XPropertySet > xProps( aPos->first, UNO_QUERY ); - Reference< XPropertySetInfo > xPSI; - if ( xProps.is() ) - xPSI = xProps->getPropertySetInfo(); - if ( xPSI.is() && xPSI->hasPropertyByName( getTabIndexPropertyName() ) ) - xProps->setPropertyValue( getTabIndexPropertyName(), makeAny( nTabIndex++ ) ); - } - mbGroupsUpToDate = sal_False; - } -} - - -typedef ::std::multimap< sal_Int32, Reference< XControlModel >, ::std::less< sal_Int32 > > MapIndexToModel; - -// ---------------------------------------------------------------------------- -Sequence< Reference< XControlModel > > SAL_CALL UnoControlDialogModel::getControlModels( ) throw (RuntimeException) -{ - SolarMutexGuard aSolarGuard; - - MapIndexToModel aSortedModels; - // will be the sorted container of all models which have a tab index property - ::std::vector< Reference< XControlModel > > aUnindexedModels; - // will be the container of all models which do not have a tab index property - - UnoControlModelHolderList::const_iterator aLoop = maModels.begin(); - for ( ; aLoop != maModels.end(); ++aLoop ) - { - Reference< XControlModel > xModel( aLoop->first ); - - // see if the model has a TabIndex property - Reference< XPropertySet > xControlProps( xModel, UNO_QUERY ); - Reference< XPropertySetInfo > xPSI; - if ( xControlProps.is() ) - xPSI = xControlProps->getPropertySetInfo( ); - DBG_ASSERT( xPSI.is(), "UnoControlDialogModel::getControlModels: invalid child model!" ); - - // has it? - if ( xPSI.is() && xPSI->hasPropertyByName( getTabIndexPropertyName() ) ) - { // yes - sal_Int32 nTabIndex = -1; - xControlProps->getPropertyValue( getTabIndexPropertyName() ) >>= nTabIndex; - - aSortedModels.insert( MapIndexToModel::value_type( nTabIndex, xModel ) ); - } - else if ( xModel.is() ) - // no, it hasn't, but we have to include it, anyway - aUnindexedModels.push_back( xModel ); - } - - // okay, here we have a container of all our models, sorted by tab index, - // plus a container of "unindexed" models - // -> merge them - Sequence< Reference< XControlModel > > aReturn( aUnindexedModels.size() + aSortedModels.size() ); - ::std::transform( - aSortedModels.begin(), aSortedModels.end(), - ::std::copy( aUnindexedModels.begin(), aUnindexedModels.end(), aReturn.getArray() ), - ::o3tl::select2nd< MapIndexToModel::value_type >( ) - ); - - return aReturn; -} - -// ---------------------------------------------------------------------------- -void SAL_CALL UnoControlDialogModel::setGroup( const Sequence< Reference< XControlModel > >&, const ::rtl::OUString& ) throw (RuntimeException) -{ - // not supported. We have only implicit grouping: - // We only have a sequence of control models, and we _know_ (yes, that's a HACK relying on - // implementation details) that VCL does grouping according to the order of controls automatically - // At least VCL does this for all we're interested in: Radio buttons. - OSL_FAIL( "UnoControlDialogModel::setGroup: grouping not supported" ); -} - -// ---------------------------------------------------------------------------- -namespace -{ - enum GroupingMachineState - { - eLookingForGroup, - eExpandingGroup - }; - - // ........................................................................ - static sal_Int32 lcl_getDialogStep( const Reference< XControlModel >& _rxModel ) - { - sal_Int32 nStep = 0; - try - { - Reference< XPropertySet > xModelProps( _rxModel, UNO_QUERY ); - xModelProps->getPropertyValue( getStepPropertyName() ) >>= nStep; - } - catch( const Exception& ) - { - OSL_FAIL( "lcl_getDialogStep: caught an exception while determining the dialog page!" ); - } - return nStep; - } -} - -// ---------------------------------------------------------------------------- -sal_Int32 SAL_CALL UnoControlDialogModel::getGroupCount( ) throw (RuntimeException) -{ - SolarMutexGuard aSolarGuard; - - implUpdateGroupStructure(); - - return maGroups.size(); -} - -// ---------------------------------------------------------------------------- -void SAL_CALL UnoControlDialogModel::getGroup( sal_Int32 _nGroup, Sequence< Reference< XControlModel > >& _rGroup, ::rtl::OUString& _rName ) throw (RuntimeException) -{ - SolarMutexGuard aSolarGuard; - - implUpdateGroupStructure(); - - if ( ( _nGroup < 0 ) || ( _nGroup >= (sal_Int32)maGroups.size() ) ) - { - OSL_FAIL( "UnoControlDialogModel::getGroup: invalid argument and I am not allowed to throw an exception!" ); - _rGroup.realloc( 0 ); - _rName = ::rtl::OUString(); - } - else - { - AllGroups::const_iterator aGroupPos = maGroups.begin() + _nGroup; - _rGroup.realloc( aGroupPos->size() ); - // copy the models - ::std::copy( aGroupPos->begin(), aGroupPos->end(), _rGroup.getArray() ); - // give the group a name - _rName = ::rtl::OUString::valueOf( _nGroup ); - } -} - -// ---------------------------------------------------------------------------- -void SAL_CALL UnoControlDialogModel::getGroupByName( const ::rtl::OUString& _rName, Sequence< Reference< XControlModel > >& _rGroup ) throw (RuntimeException) -{ - SolarMutexGuard aSolarGuard; - - ::rtl::OUString sDummyName; - getGroup( _rName.toInt32( ), _rGroup, sDummyName ); -} - -// ---------------------------------------------------------------------------- -void SAL_CALL UnoControlDialogModel::addChangesListener( const Reference< XChangesListener >& _rxListener ) throw (RuntimeException) -{ - maChangeListeners.addInterface( _rxListener ); -} - -// ---------------------------------------------------------------------------- -void SAL_CALL UnoControlDialogModel::removeChangesListener( const Reference< XChangesListener >& _rxListener ) throw (RuntimeException) -{ - maChangeListeners.removeInterface( _rxListener ); -} - -// ---------------------------------------------------------------------------- -void UnoControlDialogModel::implNotifyTabModelChange( const ::rtl::OUString& _rAccessor ) -{ - // multiplex to our change listeners: - // the changes event - ChangesEvent aEvent; - aEvent.Source = *this; - aEvent.Base <<= aEvent.Source; // the "base of the changes root" is also ourself - aEvent.Changes.realloc( 1 ); // exactly one change - aEvent.Changes[ 0 ].Accessor <<= _rAccessor; - - - Sequence< Reference< XInterface > > aChangeListeners( maChangeListeners.getElements() ); - const Reference< XInterface >* pListener = aChangeListeners.getConstArray(); - const Reference< XInterface >* pListenerEnd = aChangeListeners.getConstArray() + aChangeListeners.getLength(); - for ( ; pListener != pListenerEnd; ++pListener ) - { - if ( pListener->is() ) - static_cast< XChangesListener* >( pListener->get() )->changesOccurred( aEvent ); - } -} - -// ---------------------------------------------------------------------------- -void UnoControlDialogModel::AddRadioButtonGroup ( - ::std::map< ::rtl::OUString, ModelGroup >& rNamedGroups ) -{ - if ( rNamedGroups.size() == 0 ) - return; - - size_t nGroups = maGroups.size(); - maGroups.reserve( nGroups + rNamedGroups.size() ); - ::std::map< ::rtl::OUString, ModelGroup >::const_iterator i = rNamedGroups.begin(), e = rNamedGroups.end(); - for( ; i != e; ++i) - { - maGroups.push_back( i->second ); - } - - rNamedGroups.clear(); -} - -void UnoControlDialogModel::AddRadioButtonToGroup ( - const Reference< XControlModel >& rControlModel, - const ::rtl::OUString& rPropertyName, - ::std::map< ::rtl::OUString, ModelGroup >& rNamedGroups, - ModelGroup*& rpCurrentGroup ) -{ - Reference< XPropertySet > xCurProps( rControlModel, UNO_QUERY ); - ::rtl::OUString sGroup = lcl_GetStringProperty( rPropertyName, xCurProps ); - const sal_Int32 nControlModelStep = lcl_getDialogStep( rControlModel ); - - if ( sGroup.getLength() == 0 ) - { - // Create a new group if: - if ( maGroups.size() == 0 || // no groups - rpCurrentGroup == NULL || // previous group was closed - (nControlModelStep != 0 && // control step matches current group - maGroups.back().size() > 0 && // (group 0 == display everywhere) - nControlModelStep != lcl_getDialogStep( maGroups.back().back() ) ) ) - { - size_t nGroups = maGroups.size(); - maGroups.resize( nGroups + 1 ); - } - rpCurrentGroup = &maGroups.back(); - } - else - { - // Different steps get different sets of named groups - if ( rNamedGroups.size() > 0 && - rNamedGroups.begin()->second.size() > 0 ) - { - const sal_Int32 nPrevStep = lcl_getDialogStep( rNamedGroups.begin()->second.front() ); - if ( nControlModelStep != nPrevStep ) - AddRadioButtonGroup( rNamedGroups ); - } - - rpCurrentGroup = &rNamedGroups[ sGroup ]; - } - rpCurrentGroup->push_back( rControlModel ); -} - -// ---------------------------------------------------------------------------- -void UnoControlDialogModel::implUpdateGroupStructure() -{ - if ( mbGroupsUpToDate ) - // nothing to do - return; - - // conditions for a group: - // * all elements of the group are radio buttons - // * all elements of the group are on the same dialog page - // * in the overall control order (determined by the tab index), all elements are subsequent - - maGroups.clear(); - - Sequence< Reference< XControlModel > > aControlModels = getControlModels(); - const Reference< XControlModel >* pControlModels = aControlModels.getConstArray(); - const Reference< XControlModel >* pControlModelsEnd = pControlModels + aControlModels.getLength(); - - // in extreme we have as much groups as controls - maGroups.reserve( aControlModels.getLength() ); - - GroupingMachineState eState = eLookingForGroup; // the current state of our machine - Reference< XServiceInfo > xModelSI; // for checking for a radion button - ModelGroup* aCurrentGroup = NULL; // the group which we're currently building - sal_Bool bIsRadioButton; // is it a radio button? - - const ::rtl::OUString GROUP_NAME( RTL_CONSTASCII_USTRINGPARAM( "GroupName" ) ); - - ::std::map< ::rtl::OUString, ModelGroup > aNamedGroups; - -#if OSL_DEBUG_LEVEL > 1 - ::std::vector< ::rtl::OUString > aCurrentGroupLabels; -#endif - - for ( ; pControlModels != pControlModelsEnd; ++pControlModels ) - { - // we'll need this in every state - xModelSI = xModelSI.query( *pControlModels ); - bIsRadioButton = xModelSI.is() && xModelSI->supportsService( ::rtl::OUString::createFromAscii( szServiceName2_UnoControlRadioButtonModel ) ); - - switch ( eState ) - { - case eLookingForGroup: - { - if ( !bIsRadioButton ) - // this is no radio button -> still looking for the beginning of a group - continue; - // the current model is a radio button - // -> we found the beginning of a new group - // create the place for this group - AddRadioButtonToGroup( *pControlModels, GROUP_NAME, aNamedGroups, aCurrentGroup ); - - // new state: looking for further members - eState = eExpandingGroup; - -#if OSL_DEBUG_LEVEL > 1 - Reference< XPropertySet > xModelProps( *pControlModels, UNO_QUERY ); - ::rtl::OUString sLabel; - if ( xModelProps.is() && xModelProps->getPropertySetInfo().is() && xModelProps->getPropertySetInfo()->hasPropertyByName( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Label")) ) ) - xModelProps->getPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Label")) ) >>= sLabel; - aCurrentGroupLabels.push_back( sLabel ); -#endif - } - break; - - case eExpandingGroup: - { - if ( !bIsRadioButton ) - { // no radio button -> the group is done - aCurrentGroup = NULL; - eState = eLookingForGroup; -#if OSL_DEBUG_LEVEL > 1 - aCurrentGroupLabels.clear(); -#endif - continue; - } - - AddRadioButtonToGroup( *pControlModels, GROUP_NAME, aNamedGroups, aCurrentGroup ); - -#if OSL_DEBUG_LEVEL > 1 - Reference< XPropertySet > xModelProps( *pControlModels, UNO_QUERY ); - ::rtl::OUString sLabel; - if ( xModelProps.is() && xModelProps->getPropertySetInfo().is() && xModelProps->getPropertySetInfo()->hasPropertyByName( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Label")) ) ) - xModelProps->getPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Label")) ) >>= sLabel; - aCurrentGroupLabels.push_back( sLabel ); -#endif - } - break; - } - } - - AddRadioButtonGroup( aNamedGroups ); - mbGroupsUpToDate = sal_True; -} - -// ---------------------------------------------------------------------------- -void SAL_CALL UnoControlDialogModel::propertyChange( const PropertyChangeEvent& _rEvent ) throw (RuntimeException) -{ - SolarMutexGuard aSolarGuard; - - DBG_ASSERT( 0 == _rEvent.PropertyName.compareToAscii( "TabIndex" ), - "UnoControlDialogModel::propertyChange: not listening for this property!" ); - - // the accessor for the changed element - ::rtl::OUString sAccessor; - UnoControlModelHolderList::const_iterator aPos = - ::std::find_if( - maModels.begin(), maModels.end(), - CompareControlModel( Reference< XControlModel >( _rEvent.Source, UNO_QUERY ) ) - ); - OSL_ENSURE( maModels.end() != aPos, "UnoControlDialogModel::propertyChange: don't know this model!" ); - if ( maModels.end() != aPos ) - sAccessor = aPos->second; - - // our groups are not up-to-date - mbGroupsUpToDate = sal_False; - - // notify - implNotifyTabModelChange( sAccessor ); -} - -// ---------------------------------------------------------------------------- -void SAL_CALL UnoControlDialogModel::disposing( const EventObject& /*rEvent*/ ) throw (RuntimeException) -{ -} - -// ---------------------------------------------------------------------------- -void UnoControlDialogModel::startControlListening( const Reference< XControlModel >& _rxChildModel ) -{ - SolarMutexGuard aSolarGuard; - - Reference< XPropertySet > xModelProps( _rxChildModel, UNO_QUERY ); - Reference< XPropertySetInfo > xPSI; - if ( xModelProps.is() ) - xPSI = xModelProps->getPropertySetInfo(); - - if ( xPSI.is() && xPSI->hasPropertyByName( getTabIndexPropertyName() ) ) - xModelProps->addPropertyChangeListener( getTabIndexPropertyName(), this ); -} - -// ---------------------------------------------------------------------------- -void UnoControlDialogModel::stopControlListening( const Reference< XControlModel >& _rxChildModel ) -{ - SolarMutexGuard aSolarGuard; - - Reference< XPropertySet > xModelProps( _rxChildModel, UNO_QUERY ); - Reference< XPropertySetInfo > xPSI; - if ( xModelProps.is() ) - xPSI = xModelProps->getPropertySetInfo(); - - if ( xPSI.is() && xPSI->hasPropertyByName( getTabIndexPropertyName() ) ) - xModelProps->removePropertyChangeListener( getTabIndexPropertyName(), this ); -} - -// ============================================================================ -// = class ResourceListener -// ============================================================================ - -ResourceListener::ResourceListener( - const Reference< util::XModifyListener >& rListener ) : - OWeakObject(), - m_xListener( rListener ), - m_bListening( false ) -{ -} - -ResourceListener::~ResourceListener() -{ -} - -// XInterface -Any SAL_CALL ResourceListener::queryInterface( const Type& rType ) -throw ( RuntimeException ) -{ - Any a = ::cppu::queryInterface( - rType , - static_cast< XModifyListener* >( this ), - static_cast< XEventListener* >( this )); - - if ( a.hasValue() ) - return a; - - return OWeakObject::queryInterface( rType ); -} - -void SAL_CALL ResourceListener::acquire() throw () -{ - OWeakObject::acquire(); -} - -void SAL_CALL ResourceListener::release() throw () -{ - OWeakObject::release(); -} - -void ResourceListener::startListening( - const Reference< resource::XStringResourceResolver >& rResource ) -{ - Reference< util::XModifyBroadcaster > xModifyBroadcaster( rResource, UNO_QUERY ); - - { - // --- SAFE --- - ::osl::ResettableGuard < ::osl::Mutex > aGuard( m_aMutex ); - bool bListening( m_bListening ); - bool bResourceSet( m_xResource.is() ); - aGuard.clear(); - // --- SAFE --- - - if ( bListening && bResourceSet ) - stopListening(); - - // --- SAFE --- - aGuard.reset(); - m_xResource = rResource; - aGuard.clear(); - // --- SAFE --- - } - - Reference< util::XModifyListener > xThis( static_cast<OWeakObject*>( this ), UNO_QUERY ); - if ( xModifyBroadcaster.is() ) - { - try - { - xModifyBroadcaster->addModifyListener( xThis ); - - // --- SAFE --- - ::osl::ResettableGuard < ::osl::Mutex > aGuard( m_aMutex ); - m_bListening = true; - // --- SAFE --- - } - catch ( RuntimeException& ) - { - throw; - } - catch ( Exception& ) - { - } - } -} - -void ResourceListener::stopListening() -{ - Reference< util::XModifyBroadcaster > xModifyBroadcaster; - - // --- SAFE --- - ::osl::ResettableGuard < ::osl::Mutex > aGuard( m_aMutex ); - if ( m_bListening && m_xResource.is() ) - xModifyBroadcaster = Reference< util::XModifyBroadcaster >( m_xResource, UNO_QUERY ); - aGuard.clear(); - // --- SAFE --- - - Reference< util::XModifyListener > xThis( static_cast< OWeakObject* >( this ), UNO_QUERY ); - if ( xModifyBroadcaster.is() ) - { - try - { - // --- SAFE --- - aGuard.reset(); - m_bListening = false; - m_xResource.clear(); - aGuard.clear(); - // --- SAFE --- - - xModifyBroadcaster->removeModifyListener( xThis ); - } - catch ( RuntimeException& ) - { - throw; - } - catch ( Exception& ) - { - } - } -} - -// XModifyListener -void SAL_CALL ResourceListener::modified( - const lang::EventObject& aEvent ) -throw ( RuntimeException ) -{ - Reference< util::XModifyListener > xListener; - - // --- SAFE --- - ::osl::ResettableGuard < ::osl::Mutex > aGuard( m_aMutex ); - xListener = m_xListener; - aGuard.clear(); - // --- SAFE --- - - if ( xListener.is() ) - { - try - { - xListener->modified( aEvent ); - } - catch ( RuntimeException& ) - { - throw; - } - catch ( Exception& ) - { - } - } -} - -// XEventListener -void SAL_CALL ResourceListener::disposing( - const EventObject& Source ) -throw ( RuntimeException ) -{ - Reference< lang::XEventListener > xListener; - Reference< resource::XStringResourceResolver > xResource; - - // --- SAFE --- - ::osl::ResettableGuard < ::osl::Mutex > aGuard( m_aMutex ); - Reference< XInterface > xIfacRes( m_xResource, UNO_QUERY ); - Reference< XInterface > xIfacList( m_xListener, UNO_QUERY ); - aGuard.clear(); - // --- SAFE --- - - if ( Source.Source == xIfacRes ) - { - // --- SAFE --- - aGuard.reset(); - m_bListening = false; - xResource = m_xResource; - xListener = Reference< lang::XEventListener >( m_xListener, UNO_QUERY ); - m_xResource.clear(); - aGuard.clear(); - // --- SAFE --- - - if ( xListener.is() ) - { - try - { - xListener->disposing( Source ); - } - catch ( RuntimeException& ) - { - throw; - } - catch ( Exception& ) - { - } - } - } - else if ( Source.Source == xIfacList ) - { - // --- SAFE --- - aGuard.reset(); - m_bListening = false; - xListener = Reference< lang::XEventListener >( m_xListener, UNO_QUERY ); - xResource = m_xResource; - m_xResource.clear(); - m_xListener.clear(); - aGuard.clear(); - // --- SAFE --- - - // Remove ourself as listener from resource resolver - Reference< util::XModifyBroadcaster > xModifyBroadcaster( xResource, UNO_QUERY ); - Reference< util::XModifyListener > xThis( static_cast< OWeakObject* >( this ), UNO_QUERY ); - if ( xModifyBroadcaster.is() ) - { - try - { - xModifyBroadcaster->removeModifyListener( xThis ); - } - catch ( RuntimeException& ) - { - throw; - } - catch ( Exception& ) - { - } - } - } -} - // ============================================================================ // = class UnoDialogControl // ============================================================================ -UnoDialogControl::UnoDialogControl() : - maTopWindowListeners( *this ), - mbWindowListener(false), - mbSizeModified(false), - mbPosModified(false) +UnoDialogControl::UnoDialogControl( const uno::Reference< lang::XMultiServiceFactory >& i_factory ) + :ControlContainerBase( i_factory ) + ,maTopWindowListeners( *this ) + ,mbWindowListener(false) { maComponentInfos.nWidth = 300; maComponentInfos.nHeight = 450; - mxListener = new ResourceListener( Reference< util::XModifyListener >( - static_cast< OWeakObject* >( this ), UNO_QUERY )); + } + +UnoDialogControl::~UnoDialogControl() +{ } ::rtl::OUString UnoDialogControl::GetComponentServiceName() @@ -1197,9 +183,9 @@ UnoDialogControl::UnoDialogControl() : sal_Bool bDecoration( sal_True ); ImplGetPropertyValue( GetPropertyName( BASEPROPERTY_DECORATION )) >>= bDecoration; if ( bDecoration ) - return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Dialog")); + return ::rtl::OUString::createFromAscii( "Dialog" ); else - return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("TabPage")); + return ::rtl::OUString::createFromAscii( "TabPage" ); } // XInterface @@ -1223,7 +209,7 @@ IMPL_XTYPEPROVIDER_END void UnoDialogControl::dispose() throw(RuntimeException) { - SolarMutexGuard aSolarGuard; + SolarMutexGuard aGuard; EventObject aEvt; aEvt.Source = static_cast< ::cppu::OWeakObject* >( this ); @@ -1240,35 +226,16 @@ throw(RuntimeException) sal_Bool UnoDialogControl::setModel( const Reference< XControlModel >& rxModel ) throw(RuntimeException) { - SolarMutexGuard aSolarGuard; + // #Can we move all the Resource stuff to the ControlContainerBase ? + SolarMutexGuard aGuard; sal_Bool bRet = ControlContainerBase::setModel( rxModel ); ImplStartListingForResourceEvents(); return bRet; } -void UnoDialogControl::setDesignMode( sal_Bool bOn ) throw(RuntimeException) -{ - SolarMutexGuard aSolarGuard; - ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() ); - - UnoControl::setDesignMode( bOn ); - - Sequence< Reference< XControl > > xCtrls = getControls(); - sal_Int32 nControls = xCtrls.getLength(); - Reference< XControl >* pControls = xCtrls.getArray(); - for ( sal_Int32 n = 0; n < nControls; n++ ) - pControls[n]->setDesignMode( bOn ); - - // #109067# in design mode the tab controller is not notified about - // tab index changes, therefore the tab order must be activated - // when switching from design mode to live mode - if ( mxTabController.is() && !bOn ) - mxTabController->activateTabOrder(); -} - void UnoDialogControl::createPeer( const Reference< XToolkit > & rxToolkit, const Reference< XWindowPeer > & rParentPeer ) throw(RuntimeException) { - SolarMutexGuard aSolarGuard; + SolarMutexGuard aGuard; UnoControlContainer::createPeer( rxToolkit, rParentPeer ); @@ -1305,53 +272,17 @@ void UnoDialogControl::PrepareWindowDescriptor( ::com::sun::star::awt::WindowDes // can lead to overwrites we have to set the graphic property // before the propertiesChangeEvents are sent! ::rtl::OUString aImageURL; + Reference< graphic::XGraphic > xGraphic; if (( ImplGetPropertyValue( PROPERTY_IMAGEURL ) >>= aImageURL ) && ( aImageURL.getLength() > 0 )) { - rtl::OUString absoluteUrl( aImageURL ); - if ( aImageURL.compareToAscii( UNO_NAME_GRAPHOBJ_URLPREFIX, RTL_CONSTASCII_LENGTH( UNO_NAME_GRAPHOBJ_URLPREFIX ) ) != 0 ) - absoluteUrl = - getPhysicalLocation( ImplGetPropertyValue( PROPERTY_DIALOGSOURCEURL ), + ::rtl::OUString absoluteUrl = + getPhysicalLocation( ImplGetPropertyValue( PROPERTY_DIALOGSOURCEURL ), ImplGetPropertyValue( PROPERTY_IMAGEURL )); - ImplSetPropertyValue( PROPERTY_IMAGEURL, uno::makeAny( absoluteUrl ), sal_True ); - } -} -void UnoDialogControl::elementInserted( const ContainerEvent& Event ) throw(RuntimeException) -{ - SolarMutexGuard aSolarGuard; - - Reference< XControlModel > xModel; - ::rtl::OUString aName; - - Event.Accessor >>= aName; - Event.Element >>= xModel; - ImplInsertControl( xModel, aName ); -} - -void UnoDialogControl::elementRemoved( const ContainerEvent& Event ) throw(RuntimeException) -{ - SolarMutexGuard aSolarGuard; - - Reference< XControlModel > xModel; - Event.Element >>= xModel; - if ( xModel.is() ) - ImplRemoveControl( xModel ); -} - -void UnoDialogControl::elementReplaced( const ContainerEvent& Event ) throw(RuntimeException) -{ - SolarMutexGuard aSolarGuard; - - Reference< XControlModel > xModel; - Event.ReplacedElement >>= xModel; - if ( xModel.is() ) - ImplRemoveControl( xModel ); - - ::rtl::OUString aName; - Event.Accessor >>= aName; - Event.Element >>= xModel; - ImplInsertControl( xModel, aName ); + xGraphic = ControlContainerBase::Impl_getGraphicFromURL_nothrow( absoluteUrl ); + ImplSetPropertyValue( PROPERTY_GRAPHIC, uno::makeAny( xGraphic ), sal_True ); + } } void UnoDialogControl::addTopWindowListener( const Reference< XTopWindowListener >& rxListener ) throw (RuntimeException) @@ -1376,7 +307,7 @@ void UnoDialogControl::removeTopWindowListener( const Reference< XTopWindowListe void UnoDialogControl::toFront( ) throw (RuntimeException) { - SolarMutexGuard aSolarGuard; + SolarMutexGuard aGuard; if ( getPeer().is() ) { Reference< XTopWindow > xTW( getPeer(), UNO_QUERY ); @@ -1387,7 +318,7 @@ void UnoDialogControl::toFront( ) throw (RuntimeException) void UnoDialogControl::toBack( ) throw (RuntimeException) { - SolarMutexGuard aSolarGuard; + SolarMutexGuard aGuard; if ( getPeer().is() ) { Reference< XTopWindow > xTW( getPeer(), UNO_QUERY ); @@ -1398,7 +329,7 @@ void UnoDialogControl::toBack( ) throw (RuntimeException) void UnoDialogControl::setMenuBar( const Reference< XMenuBar >& rxMenuBar ) throw (RuntimeException) { - SolarMutexGuard aSolarGuard; + SolarMutexGuard aGuard; mxMenuBar = rxMenuBar; if ( getPeer().is() ) { @@ -1490,170 +421,9 @@ throw (::com::sun::star::uno::RuntimeException) (void)e; } -// XPropertiesChangeListener -void UnoDialogControl::ImplModelPropertiesChanged( const Sequence< PropertyChangeEvent >& rEvents ) throw(RuntimeException) -{ - if( !isDesignMode() && !mbCreatingCompatiblePeer ) - { - ::rtl::OUString s1( RTL_CONSTASCII_USTRINGPARAM( "PositionX" ) ); - ::rtl::OUString s2( RTL_CONSTASCII_USTRINGPARAM( "PositionY" ) ); - ::rtl::OUString s3( RTL_CONSTASCII_USTRINGPARAM( "Width" ) ); - ::rtl::OUString s4( RTL_CONSTASCII_USTRINGPARAM( "Height" ) ); - - sal_Int32 nLen = rEvents.getLength(); - for( sal_Int32 i = 0; i < nLen; i++ ) - { - const PropertyChangeEvent& rEvt = rEvents.getConstArray()[i]; - Reference< XControlModel > xModel( rEvt.Source, UNO_QUERY ); - sal_Bool bOwnModel = (XControlModel*)xModel.get() == (XControlModel*)getModel().get(); - if ( ( rEvt.PropertyName == s1 ) || - ( rEvt.PropertyName == s2 ) || - ( rEvt.PropertyName == s3 ) || - ( rEvt.PropertyName == s4 ) ) - { - if ( bOwnModel ) - { - if ( !mbPosModified && !mbSizeModified ) - { - // Don't set new pos/size if we get new values from window listener - Reference< XControl > xThis( (XAggregation*)(::cppu::OWeakAggObject*)this, UNO_QUERY ); - ImplSetPosSize( xThis ); - } - } - else - { - Sequence<Reference<XControl> > aControlSequence(getControls()); - Reference<XControl> aControlRef( StdTabController::FindControl( aControlSequence, xModel ) ); - ImplSetPosSize( aControlRef ); - } - break; - } - else if ( bOwnModel && rEvt.PropertyName.equalsAsciiL( "ResourceResolver", 16 )) - { - ImplStartListingForResourceEvents(); - } - } - } - - sal_Int32 nLen = rEvents.getLength(); - for( sal_Int32 i = 0; i < nLen; i++ ) - { - const PropertyChangeEvent& rEvt = rEvents.getConstArray()[i]; - Reference< XControlModel > xModel( rEvt.Source, UNO_QUERY ); - sal_Bool bOwnModel = (XControlModel*)xModel.get() == (XControlModel*)getModel().get(); - if ( bOwnModel && rEvt.PropertyName.equalsAsciiL( "ImageURL", 8 )) - { - ::rtl::OUString aImageURL; - ::rtl::OUString absoluteUrl( aImageURL ); - // Ignore GraphicObject urls - if (( ImplGetPropertyValue( PROPERTY_IMAGEURL ) >>= aImageURL ) && - ( aImageURL.getLength() > 0 )) - { - absoluteUrl = aImageURL; - if ( aImageURL.compareToAscii( UNO_NAME_GRAPHOBJ_URLPREFIX, RTL_CONSTASCII_LENGTH( UNO_NAME_GRAPHOBJ_URLPREFIX ) ) != 0 ) - absoluteUrl = - getPhysicalLocation( ImplGetPropertyValue( PROPERTY_DIALOGSOURCEURL ), - ImplGetPropertyValue( PROPERTY_IMAGEURL )); - - ImplSetPropertyValue( PROPERTY_IMAGEURL, uno::makeAny( absoluteUrl ), sal_True ); - } - break; - } - } - - UnoControlContainer::ImplModelPropertiesChanged( rEvents ); -} - -void UnoDialogControl::ImplStartListingForResourceEvents() -{ - Reference< resource::XStringResourceResolver > xStringResourceResolver; - - ImplGetPropertyValue( PROPERTY_RESOURCERESOLVER ) >>= xStringResourceResolver; - - // Add our helper as listener to retrieve notifications about changes - Reference< util::XModifyListener > rListener( mxListener ); - ResourceListener* pResourceListener = static_cast< ResourceListener* >( rListener.get() ); - - // resource listener will stop listening if resolver reference is empty - if ( pResourceListener ) - pResourceListener->startListening( xStringResourceResolver ); - ImplUpdateResourceResolver(); -} - -void UnoDialogControl::ImplUpdateResourceResolver() -{ - rtl::OUString aPropName( PROPERTY_RESOURCERESOLVER ); - Reference< resource::XStringResourceResolver > xStringResourceResolver; - - ImplGetPropertyValue( aPropName ) >>= xStringResourceResolver; - if ( !xStringResourceResolver.is() ) - return; - - Any xNewStringResourceResolver; xNewStringResourceResolver <<= xStringResourceResolver; - - Sequence< rtl::OUString > aPropNames(1); - aPropNames[0] = aPropName; - - const Sequence< Reference< awt::XControl > > aSeq = getControls(); - for ( sal_Int32 i = 0; i < aSeq.getLength(); i++ ) - { - Reference< XControl > xControl( aSeq[i] ); - Reference< XPropertySet > xPropertySet; - - if ( xControl.is() ) - xPropertySet = Reference< XPropertySet >( xControl->getModel(), UNO_QUERY ); - - if ( !xPropertySet.is() ) - continue; - - try - { - Reference< resource::XStringResourceResolver > xCurrStringResourceResolver; - Any aOldValue = xPropertySet->getPropertyValue( aPropName ); - if ( ( aOldValue >>= xCurrStringResourceResolver ) - && ( xStringResourceResolver == xCurrStringResourceResolver ) - ) - { - Reference< XMultiPropertySet > xMultiPropSet( xPropertySet, UNO_QUERY ); - Reference< XPropertiesChangeListener > xListener( xPropertySet, UNO_QUERY ); - xMultiPropSet->firePropertiesChangeEvent( aPropNames, xListener ); - } - else - xPropertySet->setPropertyValue( aPropName, xNewStringResourceResolver ); - } - /*catch ( NoSuchElementException& )*/ // that's nonsense, this is never thrown above ... - catch ( const Exception& ) - { - } - } - - // propagate resource resolver changes to language dependent props of the dialog - Reference< XPropertySet > xPropertySet( getModel(), UNO_QUERY ); - if ( xPropertySet.is() ) - { - Reference< XMultiPropertySet > xMultiPropSet( xPropertySet, UNO_QUERY ); - Reference< XPropertiesChangeListener > xListener( xPropertySet, UNO_QUERY ); - xMultiPropSet->firePropertiesChangeEvent( lcl_getLanguageDependentProperties(), xListener ); - } -} - -void SAL_CALL UnoDialogControl::endDialog( ::sal_Int32 i_result ) throw (RuntimeException) -{ - Reference< XDialog2 > xPeerDialog( getPeer(), UNO_QUERY ); - if ( xPeerDialog.is() ) - xPeerDialog->endDialog( i_result ); -} - -void SAL_CALL UnoDialogControl::setHelpId( ::sal_Int32 i_id ) throw (RuntimeException) -{ - Reference< XDialog2 > xPeerDialog( getPeer(), UNO_QUERY ); - if ( xPeerDialog.is() ) - xPeerDialog->setHelpId( i_id ); -} - void UnoDialogControl::setTitle( const ::rtl::OUString& Title ) throw(RuntimeException) { - SolarMutexGuard aSolarGuard; + SolarMutexGuard aGuard; Any aAny; aAny <<= Title; ImplSetPropertyValue( GetPropertyName( BASEPROPERTY_TITLE ), aAny, sal_True ); @@ -1661,13 +431,13 @@ void UnoDialogControl::setTitle( const ::rtl::OUString& Title ) throw(RuntimeExc ::rtl::OUString UnoDialogControl::getTitle() throw(RuntimeException) { - SolarMutexGuard aSolarGuard; + SolarMutexGuard aGuard; return ImplGetPropertyValue_UString( BASEPROPERTY_TITLE ); } sal_Int16 UnoDialogControl::execute() throw(RuntimeException) { - SolarMutexGuard aSolarGuard; + SolarMutexGuard aGuard; sal_Int16 nDone = -1; if ( getPeer().is() ) { @@ -1684,7 +454,7 @@ sal_Int16 UnoDialogControl::execute() throw(RuntimeException) void UnoDialogControl::endExecute() throw(RuntimeException) { - SolarMutexGuard aSolarGuard; + SolarMutexGuard aGuard; if ( getPeer().is() ) { Reference< XDialog > xDlg( getPeer(), UNO_QUERY ); @@ -1696,53 +466,6 @@ void UnoDialogControl::endExecute() throw(RuntimeException) } } -void UnoDialogControl::addingControl( const Reference< XControl >& _rxControl ) -{ - SolarMutexGuard aSolarGuard; - UnoControlContainer::addingControl( _rxControl ); - - if ( _rxControl.is() ) - { - Reference< XMultiPropertySet > xProps( _rxControl->getModel(), UNO_QUERY ); - if ( xProps.is() ) - { - Sequence< ::rtl::OUString > aNames( 4 ); - ::rtl::OUString* pNames = aNames.getArray(); - *pNames++ = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("PositionX")); - *pNames++ = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("PositionY")); - *pNames++ = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Width")); - *pNames++ = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Height")); - - xProps->addPropertiesChangeListener( aNames, this ); - } - } -} - -void UnoDialogControl::removingControl( const Reference< XControl >& _rxControl ) -{ - SolarMutexGuard aSolarGuard; - UnoControlContainer::removingControl( _rxControl ); - - if ( _rxControl.is() ) - { - Reference< XMultiPropertySet > xProps( _rxControl->getModel(), UNO_QUERY ); - if ( xProps.is() ) - xProps->removePropertiesChangeListener( this ); - } - -} - -void SAL_CALL UnoDialogControl::changesOccurred( const ChangesEvent& ) throw (RuntimeException) -{ - SolarMutexGuard aSolarGuard; - // a tab controller model may have changed - - // #109067# in design mode don't notify the tab controller - // about tab index changes - if ( mxTabController.is() && !mbDesignMode ) - mxTabController->activateTabOrder(); -} - // XModifyListener void SAL_CALL UnoDialogControl::modified( const lang::EventObject& /*rEvent*/ ) @@ -1752,965 +475,29 @@ throw (RuntimeException) } void UnoDialogControl::ImplModelPropertiesChanged( const Sequence< PropertyChangeEvent >& rEvents ) throw(RuntimeException) -// ---------------------------------------------------- -// Helper Method to convert relative url to physical location -// ---------------------------------------------------- - -::rtl::OUString getPhysicalLocation( const ::com::sun::star::uno::Any& rbase, const ::com::sun::star::uno::Any& rUrl ) -{ - - ::rtl::OUString ret; - - ::rtl::OUString baseLocation; - ::rtl::OUString url; - - rbase >>= baseLocation; - rUrl >>= url; - - ::rtl::OUString absoluteURL( url ); - if ( url.getLength() > 0 ) - { - // Don't adjust GraphicObject url(s) - if ( url.compareToAscii( UNO_NAME_GRAPHOBJ_URLPREFIX, RTL_CONSTASCII_LENGTH( UNO_NAME_GRAPHOBJ_URLPREFIX ) ) != 0 ) - { - INetURLObject urlObj(baseLocation); - urlObj.removeSegment(); - baseLocation = urlObj.GetMainURL( INetURLObject::NO_DECODE ); - ::osl::FileBase::getAbsoluteFileURL( baseLocation, url, ret ); - } - else - ret = url; - - const INetURLObject protocolCheck( url ); - const INetProtocol protocol = protocolCheck.GetProtocol(); - if ( protocol == INET_PROT_NOT_VALID ) - { - ::rtl::OUString testAbsoluteURL; - if ( ::osl::FileBase::E_None == ::osl::FileBase::getAbsoluteFileURL( baseLocation, url, testAbsoluteURL ) ) - absoluteURL = testAbsoluteURL; - } - } - - return absoluteURL; -} - -UnoParentControl::UnoParentControl() : - mbSizeModified(false), - mbPosModified(false) -{ - maComponentInfos.nWidth = 280; - maComponentInfos.nHeight = 400; - // #TODO Do we need the ResourceListener foo ? -} - -UnoParentControl::~UnoParentControl() -{ -} - -// XInterface -Any UnoParentControl::queryAggregation( const Type & rType ) throw(RuntimeException) -{ - Any aRet( UnoParentControl_IBase::queryInterface( rType ) ); - return (aRet.hasValue() ? aRet : UnoControlContainer::queryAggregation( rType )); -} - -// XTypeProvider -IMPL_IMPLEMENTATION_ID( UnoParentControl ) -Sequence< Type > -UnoParentControl::getTypes() throw(RuntimeException) -{ - return ::comphelper::concatSequences( - UnoParentControl_IBase::getTypes(), - UnoControlContainer::getTypes() - ); -} - -void UnoParentControl::createPeer( const Reference< XToolkit > & rxToolkit, const Reference< XWindowPeer > & rParentPeer ) throw(RuntimeException) -{ - SolarMutexGuard aSolarGuard; - UnoControlContainer::createPeer( rxToolkit, rParentPeer ); -} - -void UnoParentControl::ImplInsertControl( Reference< XControlModel >& rxModel, const ::rtl::OUString& rName ) -{ - Reference< XPropertySet > xP( rxModel, UNO_QUERY ); - - ::rtl::OUString aDefCtrl; - xP->getPropertyValue( GetPropertyName( BASEPROPERTY_DEFAULTCONTROL ) ) >>= aDefCtrl; - Reference< XMultiServiceFactory > xMSF = ::comphelper::getProcessServiceFactory(); - Reference < XControl > xCtrl( xMSF->createInstance( aDefCtrl ), UNO_QUERY ); - - DBG_ASSERT( xCtrl.is(), "UnoDialogControl::ImplInsertControl: could not create the control!" ); - if ( xCtrl.is() ) - { - xCtrl->setModel( rxModel ); - addControl( rName, xCtrl ); - // will implicitly call addingControl, where we can add the PropertiesChangeListener to the model - // (which we formerly did herein) - - ImplSetPosSize( xCtrl ); - } -} - -void UnoParentControl::ImplRemoveControl( Reference< XControlModel >& rxModel ) -{ - Sequence< Reference< XControl > > aControls = getControls(); - Reference< XControl > xCtrl = StdTabController::FindControl( aControls, rxModel ); - if ( xCtrl.is() ) - removeControl( xCtrl ); -} - -void UnoParentControl::ImplSetPosSize( Reference< XControl >& rxCtrl ) -{ - Reference< XPropertySet > xP( rxCtrl->getModel(), UNO_QUERY ); - - sal_Int32 nX = 0, nY = 0, nWidth = 0, nHeight = 0; - xP->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PositionX" ) ) ) >>= nX; - xP->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PositionY" ) ) ) >>= nY; - xP->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Width" ) ) ) >>= nWidth; - xP->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Height" ) ) ) >>= nHeight; - MapMode aMode( MAP_APPFONT ); - OutputDevice*pOutDev = Application::GetDefaultDevice(); - if ( pOutDev ) - { - ::Size aTmp( nX, nY ); - aTmp = pOutDev->LogicToPixel( aTmp, aMode ); - nX = aTmp.Width(); - nY = aTmp.Height(); - aTmp = ::Size( nWidth, nHeight ); - aTmp = pOutDev->LogicToPixel( aTmp, aMode ); - nWidth = aTmp.Width(); - nHeight = aTmp.Height(); - } - else - { - Reference< XWindowPeer > xPeer = ImplGetCompatiblePeer( sal_True ); - Reference< XDevice > xD( xPeer, UNO_QUERY ); - - SimpleFontMetric aFM; - FontDescriptor aFD; - Any aVal = ImplGetPropertyValue( GetPropertyName( BASEPROPERTY_FONTDESCRIPTOR ) ); - aVal >>= aFD; - if ( aFD.StyleName.getLength() ) - { - Reference< XFont > xFont = xD->getFont( aFD ); - aFM = xFont->getFontMetric(); - } - else - { - Reference< XGraphics > xG = xD->createGraphics(); - aFM = xG->getFontMetric(); - } - - sal_Int16 nH = aFM.Ascent + aFM.Descent; - sal_Int16 nW = nH/2; // calculate avarage width?! - - nX *= nW; - nX /= 4; - nWidth *= nW; - nWidth /= 4; - nY *= nH; - nY /= 8; - nHeight *= nH; - nHeight /= 8; - } - Reference < XWindow > xW( rxCtrl, UNO_QUERY ); - xW->setPosSize( nX, nY, nWidth, nHeight, PosSize::POSSIZE ); -} - -void UnoParentControl::dispose() throw(RuntimeException) -{ - UnoControlContainer::dispose(); -} - -void SAL_CALL UnoParentControl::disposing( - const EventObject& Source ) -throw(RuntimeException) -{ - UnoControlContainer::disposing( Source ); -} - -sal_Bool UnoParentControl::setModel( const Reference< XControlModel >& rxModel ) throw(RuntimeException) -{ - SolarMutexGuard aSolarGuard; - - // destroy the old tab controller, if existent - if ( mxTabController.is() ) - { - mxTabController->setModel( NULL ); // just to be sure, should not be necessary - removeTabController( mxTabController ); - ::comphelper::disposeComponent( mxTabController ); // just to be sure, should not be necessary - mxTabController.clear(); - } - - if ( getModel().is() ) - { - Sequence< Reference< XControl > > aControls = getControls(); - const Reference< XControl >* pCtrls = aControls.getConstArray(); - const Reference< XControl >* pCtrlsEnd = pCtrls + aControls.getLength(); - - for ( ; pCtrls < pCtrlsEnd; ++pCtrls ) - removeControl( *pCtrls ); - // will implicitly call removingControl, which will remove the PropertyChangeListener - // (which we formerly did herein) - - Reference< XContainer > xC( getModel(), UNO_QUERY ); - if ( xC.is() ) - xC->removeContainerListener( this ); - - Reference< XChangesNotifier > xChangeNotifier( getModel(), UNO_QUERY ); - if ( xChangeNotifier.is() ) - xChangeNotifier->removeChangesListener( this ); - } - - sal_Bool bRet = UnoControl::setModel( rxModel ); - - if ( getModel().is() ) - { - Reference< XNameAccess > xNA( getModel(), UNO_QUERY ); - if ( xNA.is() ) - { - Sequence< ::rtl::OUString > aNames = xNA->getElementNames(); - const ::rtl::OUString* pNames = aNames.getConstArray(); - sal_uInt32 nCtrls = aNames.getLength(); - - Reference< XControlModel > xCtrlModel; - for( sal_uInt32 n = 0; n < nCtrls; ++n, ++pNames ) - { - xNA->getByName( *pNames ) >>= xCtrlModel; - ImplInsertControl( xCtrlModel, *pNames ); - } - } - - Reference< XContainer > xC( getModel(), UNO_QUERY ); - if ( xC.is() ) - xC->addContainerListener( this ); - - Reference< XChangesNotifier > xChangeNotifier( getModel(), UNO_QUERY ); - if ( xChangeNotifier.is() ) - xChangeNotifier->addChangesListener( this ); - } - - Reference< XTabControllerModel > xTabbing( getModel(), UNO_QUERY ); - if ( xTabbing.is() ) - { - mxTabController = new StdTabController; - mxTabController->setModel( xTabbing ); - addTabController( mxTabController ); - } -// ImplStartListingForResourceEvents(); - - return bRet; -} -void UnoParentControl::setDesignMode( sal_Bool bOn ) throw(RuntimeException) -{ - SolarMutexGuard aSolarGuard; - - UnoControl::setDesignMode( bOn ); - - Sequence< Reference< XControl > > xCtrls = getControls(); - sal_Int32 nControls = xCtrls.getLength(); - Reference< XControl >* pControls = xCtrls.getArray(); - for ( sal_Int32 n = 0; n < nControls; n++ ) - pControls[n]->setDesignMode( bOn ); - - // #109067# in design mode the tab controller is not notified about - // tab index changes, therefore the tab order must be activated - // when switching from design mode to live mode - if ( mxTabController.is() && !bOn ) - mxTabController->activateTabOrder(); -} - -void UnoParentControl::elementInserted( const ContainerEvent& Event ) throw(RuntimeException) -{ - SolarMutexGuard aSolarGuard; - Reference< XControlModel > xModel; - ::rtl::OUString aName; - - Event.Accessor >>= aName; - Event.Element >>= xModel; - ImplInsertControl( xModel, aName ); -} - -void UnoParentControl::elementRemoved( const ContainerEvent& Event ) throw(RuntimeException) -{ - SolarMutexGuard aSolarGuard; - - Reference< XControlModel > xModel; - Event.Element >>= xModel; - if ( xModel.is() ) - ImplRemoveControl( xModel ); -} - -void UnoParentControl::elementReplaced( const ContainerEvent& Event ) throw(RuntimeException) -{ - SolarMutexGuard aSolarGuard; - - Reference< XControlModel > xModel; - Event.ReplacedElement >>= xModel; - if ( xModel.is() ) - ImplRemoveControl( xModel ); - - ::rtl::OUString aName; - Event.Accessor >>= aName; - Event.Element >>= xModel; - ImplInsertControl( xModel, aName ); -} - -// XPropertiesChangeListener -void UnoParentControl::ImplModelPropertiesChanged( const Sequence< PropertyChangeEvent >& rEvents ) throw(RuntimeException) -{ - if( !isDesignMode() && !mbCreatingCompatiblePeer ) - { - ::rtl::OUString s1( RTL_CONSTASCII_USTRINGPARAM( "PositionX" ) ); - ::rtl::OUString s2( RTL_CONSTASCII_USTRINGPARAM( "PositionY" ) ); - ::rtl::OUString s3( RTL_CONSTASCII_USTRINGPARAM( "Width" ) ); - ::rtl::OUString s4( RTL_CONSTASCII_USTRINGPARAM( "Height" ) ); - - sal_Int32 nLen = rEvents.getLength(); - for( sal_Int32 i = 0; i < nLen; i++ ) - { - const PropertyChangeEvent& rEvt = rEvents.getConstArray()[i]; - Reference< XControlModel > xModel( rEvt.Source, UNO_QUERY ); - sal_Bool bOwnModel = (XControlModel*)xModel.get() == (XControlModel*)getModel().get(); - if ( ( rEvt.PropertyName == s1 ) || - ( rEvt.PropertyName == s2 ) || - ( rEvt.PropertyName == s3 ) || - ( rEvt.PropertyName == s4 ) ) - { - if ( bOwnModel ) - { - if ( !mbPosModified && !mbSizeModified ) - { - // Don't set new pos/size if we get new values from window listener - Reference< XControl > xThis( (XAggregation*)(::cppu::OWeakAggObject*)this, UNO_QUERY ); - ImplSetPosSize( xThis ); - } - } - else - { - Sequence<Reference<XControl> > aControlSequence(getControls()); - Reference<XControl> aControlRef( StdTabController::FindControl( aControlSequence, xModel ) ); - ImplSetPosSize( aControlRef ); - } - break; - } - } - } - UnoControlContainer::ImplModelPropertiesChanged( rEvents ); -} - -void UnoParentControl::addingControl( const Reference< XControl >& _rxControl ) -{ - SolarMutexGuard aSolarGuard; - UnoControlContainer::addingControl( _rxControl ); - - if ( _rxControl.is() ) - { - Reference< XMultiPropertySet > xProps( _rxControl->getModel(), UNO_QUERY ); - if ( xProps.is() ) - { - Sequence< ::rtl::OUString > aNames( 4 ); - ::rtl::OUString* pNames = aNames.getArray(); - *pNames++ = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("PositionX")); - *pNames++ = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("PositionY")); - *pNames++ = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Width")); - *pNames++ = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Height")); - - xProps->addPropertiesChangeListener( aNames, this ); - } - } -} - -void UnoParentControl::removingControl( const Reference< XControl >& _rxControl ) -{ - SolarMutexGuard aSolarGuard; - UnoControlContainer::removingControl( _rxControl ); - - if ( _rxControl.is() ) - { - Reference< XMultiPropertySet > xProps( _rxControl->getModel(), UNO_QUERY ); - if ( xProps.is() ) - xProps->removePropertiesChangeListener( this ); - } - -} - -void SAL_CALL UnoParentControl::changesOccurred( const ChangesEvent& ) throw (RuntimeException) -{ - SolarMutexGuard aSolarGuard; - // a tab controller model may have changed - - // #109067# in design mode don't notify the tab controller - // about tab index changes - if ( mxTabController.is() && !mbDesignMode ) - mxTabController->activateTabOrder(); -} - -// ---------------------------------------------------- -// class MultiPageControl -// ---------------------------------------------------- -UnoMultiPageControl::UnoMultiPageControl() : maTabListeners( *this ) -{ - maComponentInfos.nWidth = 280; - maComponentInfos.nHeight = 400; -} - -UnoMultiPageControl::~UnoMultiPageControl() -{ -} -// XTabListener - -void SAL_CALL UnoMultiPageControl::inserted( ::sal_Int32 /*ID*/ ) throw (RuntimeException) -{ -} -void SAL_CALL UnoMultiPageControl::removed( ::sal_Int32 /*ID*/ ) throw (RuntimeException) -{ -} -void SAL_CALL UnoMultiPageControl::changed( ::sal_Int32 /*ID*/, const Sequence< NamedValue >& /*Properties*/ ) throw (RuntimeException) -{ -} -void SAL_CALL UnoMultiPageControl::activated( ::sal_Int32 ID ) throw (RuntimeException) -{ - ImplSetPropertyValue( GetPropertyName( BASEPROPERTY_MULTIPAGEVALUE ), uno::makeAny( ID ), sal_False ); - -} -void SAL_CALL UnoMultiPageControl::deactivated( ::sal_Int32 /*ID*/ ) throw (RuntimeException) -{ -} -void SAL_CALL UnoMultiPageControl::disposing(const EventObject&) throw (RuntimeException) -{ -} - -void SAL_CALL UnoMultiPageControl::dispose() throw (RuntimeException) -{ - lang::EventObject aEvt; - aEvt.Source = (::cppu::OWeakObject*)this; - maTabListeners.disposeAndClear( aEvt ); - UnoParentControl::dispose(); -} - -// com::sun::star::awt::XSimpleTabController -::sal_Int32 SAL_CALL UnoMultiPageControl::insertTab() throw (RuntimeException) -{ - Reference< XSimpleTabController > xMultiPage( getPeer(), UNO_QUERY ); - if ( !xMultiPage.is() ) - throw RuntimeException(); - return xMultiPage->insertTab(); -} - -void SAL_CALL UnoMultiPageControl::removeTab( ::sal_Int32 ID ) throw (IndexOutOfBoundsException, RuntimeException) -{ - Reference< XSimpleTabController > xMultiPage( getPeer(), UNO_QUERY ); - if ( !xMultiPage.is() ) - throw RuntimeException(); - xMultiPage->removeTab( ID ); -} - -void SAL_CALL UnoMultiPageControl::setTabProps( ::sal_Int32 ID, const Sequence< NamedValue >& Properties ) throw (IndexOutOfBoundsException, RuntimeException) -{ - Reference< XSimpleTabController > xMultiPage( getPeer(), UNO_QUERY ); - if ( !xMultiPage.is() ) - throw RuntimeException(); - xMultiPage->setTabProps( ID, Properties ); -} - -Sequence< NamedValue > SAL_CALL UnoMultiPageControl::getTabProps( ::sal_Int32 ID ) throw (IndexOutOfBoundsException, RuntimeException) -{ - Reference< XSimpleTabController > xMultiPage( getPeer(), UNO_QUERY ); - if ( !xMultiPage.is() ) - throw RuntimeException(); - return xMultiPage->getTabProps( ID ); -} - -void SAL_CALL UnoMultiPageControl::activateTab( ::sal_Int32 ID ) throw (IndexOutOfBoundsException, RuntimeException) -{ - Reference< XSimpleTabController > xMultiPage( getPeer(), UNO_QUERY ); - if ( !xMultiPage.is() ) - throw RuntimeException(); - xMultiPage->activateTab( ID ); - ImplSetPropertyValue( GetPropertyName( BASEPROPERTY_MULTIPAGEVALUE ), uno::makeAny( ID ), sal_True ); - -} - -::sal_Int32 SAL_CALL UnoMultiPageControl::getActiveTabID() throw (RuntimeException) -{ - Reference< XSimpleTabController > xMultiPage( getPeer(), UNO_QUERY ); - if ( !xMultiPage.is() ) - throw RuntimeException(); - return xMultiPage->getActiveTabID(); -} - -void SAL_CALL UnoMultiPageControl::addTabListener( const Reference< XTabListener >& Listener ) throw (RuntimeException) -{ - maTabListeners.addInterface( Listener ); - Reference< XSimpleTabController > xMultiPage( getPeer(), UNO_QUERY ); - if ( xMultiPage.is() && maTabListeners.getLength() == 1 ) - xMultiPage->addTabListener( &maTabListeners ); -} - -void SAL_CALL UnoMultiPageControl::removeTabListener( const Reference< XTabListener >& Listener ) throw (RuntimeException) -{ - Reference< XSimpleTabController > xMultiPage( getPeer(), UNO_QUERY ); - if ( xMultiPage.is() && maTabListeners.getLength() == 1 ) - xMultiPage->removeTabListener( &maTabListeners ); - maTabListeners.removeInterface( Listener ); -} - - -// lang::XTypeProvider -IMPL_XTYPEPROVIDER_START( UnoMultiPageControl ) - getCppuType( ( uno::Reference< awt::XSimpleTabController>* ) NULL ), - getCppuType( ( uno::Reference< awt::XTabListener>* ) NULL ), - UnoParentControl::getTypes() -IMPL_XTYPEPROVIDER_END - -// uno::XInterface -uno::Any UnoMultiPageControl::queryAggregation( const uno::Type & rType ) throw(uno::RuntimeException) -{ - uno::Any aRet = ::cppu::queryInterface( rType, - SAL_STATIC_CAST( awt::XTabListener*, this ), SAL_STATIC_CAST( awt::XSimpleTabController*, this ) ); - return (aRet.hasValue() ? aRet : UnoParentControl::queryAggregation( rType )); -} - -::rtl::OUString UnoMultiPageControl::GetComponentServiceName() -{ - sal_Bool bDecoration( sal_True ); - ImplGetPropertyValue( GetPropertyName( BASEPROPERTY_DECORATION )) >>= bDecoration; - if ( bDecoration ) - return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("tabcontrol")); - // Hopefully we can tweak the tabcontrol to display without tabs - return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("tabcontrolnotabs")); -} - -void UnoMultiPageControl::bindPage( const uno::Reference< awt::XControl >& _rxControl ) -{ - uno::Reference< awt::XWindowPeer > xPage( _rxControl->getPeer() ); - uno::Reference< awt::XSimpleTabController > xTabCntrl( getPeer(), uno::UNO_QUERY ); - uno::Reference< beans::XPropertySet > xProps( _rxControl->getModel(), uno::UNO_QUERY ); - - VCLXTabPage* pXPage = dynamic_cast< VCLXTabPage* >( xPage.get() ); - TabPage* pPage = pXPage ? pXPage->getTabPage() : NULL; - if ( xTabCntrl.is() && pPage ) - { - VCLXMultiPage* pXTab = dynamic_cast< VCLXMultiPage* >( xTabCntrl.get() ); - if ( pXTab ) - { - rtl::OUString sTitle; - xProps->getPropertyValue( GetPropertyName( BASEPROPERTY_TITLE ) ) >>= sTitle; - pXTab->insertTab( pPage, sTitle); - } - } - -} - -void UnoMultiPageControl::createPeer( const Reference< XToolkit > & rxToolkit, const Reference< XWindowPeer > & rParentPeer ) throw(RuntimeException) -{ - SolarMutexGuard aSolarGuard; - - UnoControlContainer::createPeer( rxToolkit, rParentPeer ); - - uno::Sequence< uno::Reference< awt::XControl > > aCtrls = getControls(); - sal_uInt32 nCtrls = aCtrls.getLength(); - for( sal_uInt32 n = 0; n < nCtrls; n++ ) - bindPage( aCtrls[ n ] ); - sal_Int32 nActiveTab(0); - Reference< XPropertySet > xMultiProps( getModel(), UNO_QUERY ); - xMultiProps->getPropertyValue( GetPropertyName( BASEPROPERTY_MULTIPAGEVALUE ) ) >>= nActiveTab; - - uno::Reference< awt::XSimpleTabController > xTabCntrl( getPeer(), uno::UNO_QUERY ); - if ( xTabCntrl.is() ) - { - xTabCntrl->addTabListener( this ); - if ( nActiveTab && nCtrls ) // Ensure peer is initialise with correct activated tab - { - xTabCntrl->activateTab( nActiveTab ); - ImplSetPropertyValue( GetPropertyName( BASEPROPERTY_MULTIPAGEVALUE ), uno::makeAny( nActiveTab ), sal_True ); - } - } -} - -void UnoMultiPageControl::impl_createControlPeerIfNecessary( const uno::Reference< awt::XControl >& _rxControl) -{ - OSL_PRECOND( _rxControl.is(), "UnoMultiPageControl::impl_createControlPeerIfNecessary: invalid control, this will crash!" ); - - // if the container already has a peer, then also create a peer for the control - uno::Reference< awt::XWindowPeer > xMyPeer( getPeer() ); - - if( xMyPeer.is() ) - { - _rxControl->createPeer( NULL, xMyPeer ); - bindPage( _rxControl ); - ImplActivateTabControllers(); - } - -} - -// ------------- UnoMultiPageModel ----------------- - -UnoMultiPageModel::UnoMultiPageModel() : UnoControlDialogModel( false ) -{ - ImplRegisterProperty( BASEPROPERTY_DEFAULTCONTROL ); - ImplRegisterProperty( BASEPROPERTY_BACKGROUNDCOLOR ); - ImplRegisterProperty( BASEPROPERTY_ENABLEVISIBLE ); - ImplRegisterProperty( BASEPROPERTY_ENABLED ); - - ImplRegisterProperty( BASEPROPERTY_FONTDESCRIPTOR ); - ImplRegisterProperty( BASEPROPERTY_HELPTEXT ); - ImplRegisterProperty( BASEPROPERTY_HELPURL ); - ImplRegisterProperty( BASEPROPERTY_SIZEABLE ); - //ImplRegisterProperty( BASEPROPERTY_DIALOGSOURCEURL ); - ImplRegisterProperty( BASEPROPERTY_MULTIPAGEVALUE ); - ImplRegisterProperty( BASEPROPERTY_PRINTABLE ); - ImplRegisterProperty( BASEPROPERTY_USERFORMCONTAINEES ); - - Any aBool; - aBool <<= (sal_Bool) sal_True; - ImplRegisterProperty( BASEPROPERTY_MOVEABLE, aBool ); - ImplRegisterProperty( BASEPROPERTY_CLOSEABLE, aBool ); - ImplRegisterProperty( BASEPROPERTY_DECORATION, aBool ); - // MultiPage Control has the tab stop property. And the default value is True. - ImplRegisterProperty( BASEPROPERTY_TABSTOP, aBool ); -} - -UnoMultiPageModel::UnoMultiPageModel( const UnoMultiPageModel& rModel ) - : UnoControlDialogModel( rModel ) -{ -} - -UnoMultiPageModel::~UnoMultiPageModel() -{ -} - -UnoControlModel* -UnoMultiPageModel::Clone() const -{ - // clone the container itself - UnoMultiPageModel* pClone = new UnoMultiPageModel( *this ); - - // clone all children - ::std::for_each( - maModels.begin(), maModels.end(), - CloneControlModel( pClone->maModels ) - ); - - return pClone; -} - -::rtl::OUString UnoMultiPageModel::getServiceName() throw(::com::sun::star::uno::RuntimeException) -{ - return ::rtl::OUString::createFromAscii( szServiceName_UnoMultiPageModel ); -} - -uno::Any UnoMultiPageModel::ImplGetDefaultValue( sal_uInt16 nPropId ) const -{ - if ( nPropId == BASEPROPERTY_DEFAULTCONTROL ) - { - uno::Any aAny; - aAny <<= ::rtl::OUString::createFromAscii( szServiceName_UnoMultiPageControl ); - return aAny; - } - return UnoControlDialogModel::ImplGetDefaultValue( nPropId ); -} - -::cppu::IPropertyArrayHelper& UnoMultiPageModel::getInfoHelper() -{ - static UnoPropertyArrayHelper* pHelper = NULL; - if ( !pHelper ) - { - uno::Sequence<sal_Int32> aIDs = ImplGetPropertyIds(); - pHelper = new UnoPropertyArrayHelper( aIDs ); - } - return *pHelper; -} - -// beans::XMultiPropertySet -uno::Reference< beans::XPropertySetInfo > UnoMultiPageModel::getPropertySetInfo( ) throw(uno::RuntimeException) -{ - static uno::Reference< beans::XPropertySetInfo > xInfo( createPropertySetInfo( getInfoHelper() ) ); - return xInfo; -} - -void UnoMultiPageModel::insertByName( const ::rtl::OUString& aName, const Any& aElement ) throw(IllegalArgumentException, ElementExistException, WrappedTargetException, RuntimeException) -{ - Reference< XServiceInfo > xInfo; - aElement >>= xInfo; - - if ( !xInfo.is() ) - throw IllegalArgumentException(); - - // Only a Page model can be inserted into the multipage - if ( !xInfo->supportsService( rtl::OUString::createFromAscii( szServiceName_UnoPageModel ) ) ) - throw IllegalArgumentException(); - - return UnoControlDialogModel::insertByName( aName, aElement ); -} - -// ---------------------------------------------------------------------------- -sal_Bool SAL_CALL UnoMultiPageModel::getGroupControl( ) throw (RuntimeException) -{ - return sal_True; -} - -// ---------------------------------------------------- -// class UnoPageControl -// ---------------------------------------------------- -UnoPageControl::UnoPageControl() -{ - maComponentInfos.nWidth = 280; - maComponentInfos.nHeight = 400; -} - -UnoPageControl::~UnoPageControl() -{ -} - -::rtl::OUString UnoPageControl::GetComponentServiceName() -{ - return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("tabpage")); -} - - -// ------------- UnoPageModel ----------------- - -UnoPageModel::UnoPageModel() : UnoControlDialogModel( false ) -{ - ImplRegisterProperty( BASEPROPERTY_DEFAULTCONTROL ); - ImplRegisterProperty( BASEPROPERTY_BACKGROUNDCOLOR ); - ImplRegisterProperty( BASEPROPERTY_ENABLED ); - ImplRegisterProperty( BASEPROPERTY_ENABLEVISIBLE ); - - ImplRegisterProperty( BASEPROPERTY_FONTDESCRIPTOR ); - ImplRegisterProperty( BASEPROPERTY_HELPTEXT ); - ImplRegisterProperty( BASEPROPERTY_HELPURL ); - ImplRegisterProperty( BASEPROPERTY_TITLE ); - ImplRegisterProperty( BASEPROPERTY_SIZEABLE ); - ImplRegisterProperty( BASEPROPERTY_PRINTABLE ); - ImplRegisterProperty( BASEPROPERTY_USERFORMCONTAINEES ); -// ImplRegisterProperty( BASEPROPERTY_DIALOGSOURCEURL ); - - Any aBool; - aBool <<= (sal_Bool) sal_True; - ImplRegisterProperty( BASEPROPERTY_MOVEABLE, aBool ); - ImplRegisterProperty( BASEPROPERTY_CLOSEABLE, aBool ); - //ImplRegisterProperty( BASEPROPERTY_TABSTOP, aBool ); -} - -UnoPageModel::UnoPageModel( const UnoPageModel& rModel ) - : UnoControlDialogModel( rModel ) -{ -} - -UnoPageModel::~UnoPageModel() { -} - -UnoControlModel* -UnoPageModel::Clone() const -{ - // clone the container itself - UnoPageModel* pClone = new UnoPageModel( *this ); - - // clone all children - ::std::for_each( - maModels.begin(), maModels.end(), - CloneControlModel( pClone->maModels ) - ); - - return pClone; -} - -::rtl::OUString UnoPageModel::getServiceName() throw(::com::sun::star::uno::RuntimeException) -{ - return ::rtl::OUString::createFromAscii( szServiceName_UnoPageModel ); -} - -uno::Any UnoPageModel::ImplGetDefaultValue( sal_uInt16 nPropId ) const -{ - if ( nPropId == BASEPROPERTY_DEFAULTCONTROL ) - { - uno::Any aAny; - aAny <<= ::rtl::OUString::createFromAscii( szServiceName_UnoPageControl ); - return aAny; - } - return UnoControlDialogModel::ImplGetDefaultValue( nPropId ); -} - -::cppu::IPropertyArrayHelper& UnoPageModel::getInfoHelper() -{ - static UnoPropertyArrayHelper* pHelper = NULL; - if ( !pHelper ) - { - uno::Sequence<sal_Int32> aIDs = ImplGetPropertyIds(); - pHelper = new UnoPropertyArrayHelper( aIDs ); - } - return *pHelper; -} - -// beans::XMultiPropertySet -uno::Reference< beans::XPropertySetInfo > UnoPageModel::getPropertySetInfo( ) throw(uno::RuntimeException) -{ - static uno::Reference< beans::XPropertySetInfo > xInfo( createPropertySetInfo( getInfoHelper() ) ); - return xInfo; -} - -// ---------------------------------------------------------------------------- -sal_Bool SAL_CALL UnoPageModel::getGroupControl( ) throw (RuntimeException) -{ - return sal_False; -} - -// Frame control - -// ---------------------------------------------------- -// class UnoFrameControl -// ---------------------------------------------------- -UnoFrameControl::UnoFrameControl() -{ - maComponentInfos.nWidth = 280; - maComponentInfos.nHeight = 400; -} - -UnoFrameControl::~UnoFrameControl() -{ -} - -::rtl::OUString UnoFrameControl::GetComponentServiceName() -{ - return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("frame")); -} - -void UnoFrameControl::ImplSetPosSize( Reference< XControl >& rxCtrl ) -{ - bool bOwnCtrl = false; - rtl::OUString sTitle; - if ( rxCtrl.get() == Reference<XControl>( this ).get() ) - bOwnCtrl = true; - Reference< XPropertySet > xProps( getModel(), UNO_QUERY ); - //xProps->getPropertyValue( GetPropertyName( BASEPROPERTY_TITLE ) ) >>= sTitle; - xProps->getPropertyValue( GetPropertyName( BASEPROPERTY_LABEL ) ) >>= sTitle; - - UnoParentControl::ImplSetPosSize( rxCtrl ); - Reference < XWindow > xW( rxCtrl, UNO_QUERY ); - if ( !bOwnCtrl && xW.is() && sTitle.getLength() ) + sal_Int32 nLen = rEvents.getLength(); + for( sal_Int32 i = 0; i < nLen; i++ ) { - awt::Rectangle aSizePos = xW->getPosSize(); - - sal_Int32 nX = aSizePos.X, nY = aSizePos.Y, nWidth = aSizePos.Width, nHeight = aSizePos.Height; - // Retrieve the values set by the base class - OutputDevice*pOutDev = Application::GetDefaultDevice(); - if ( pOutDev ) + const PropertyChangeEvent& rEvt = rEvents.getConstArray()[i]; + Reference< XControlModel > xModel( rEvt.Source, UNO_QUERY ); + sal_Bool bOwnModel = (XControlModel*)xModel.get() == (XControlModel*)getModel().get(); + if ( bOwnModel && rEvt.PropertyName.equalsAsciiL( "ImageURL", 8 )) { - if ( !bOwnCtrl && sTitle.getLength() ) + ::rtl::OUString aImageURL; + Reference< graphic::XGraphic > xGraphic; + if (( ImplGetPropertyValue( GetPropertyName( BASEPROPERTY_IMAGEURL ) ) >>= aImageURL ) && + ( aImageURL.getLength() > 0 )) { - // Adjust Y based on height of Title - ::Rectangle aRect = pOutDev->GetTextRect( aRect, sTitle ); - nY = nY + ( aRect.GetHeight() / 2 ); - } - } - else - { - Reference< XWindowPeer > xPeer = ImplGetCompatiblePeer( sal_True ); - Reference< XDevice > xD( xPeer, UNO_QUERY ); + ::rtl::OUString absoluteUrl = + getPhysicalLocation( ImplGetPropertyValue( GetPropertyName( BASEPROPERTY_DIALOGSOURCEURL )), + uno::makeAny(aImageURL)); - SimpleFontMetric aFM; - FontDescriptor aFD; - Any aVal = ImplGetPropertyValue( GetPropertyName( BASEPROPERTY_FONTDESCRIPTOR ) ); - aVal >>= aFD; - if ( aFD.StyleName.getLength() ) - { - Reference< XFont > xFont = xD->getFont( aFD ); - aFM = xFont->getFontMetric(); + xGraphic = Impl_getGraphicFromURL_nothrow( absoluteUrl ); } - else - { - Reference< XGraphics > xG = xD->createGraphics(); - aFM = xG->getFontMetric(); - } - - sal_Int16 nH = aFM.Ascent + aFM.Descent; - if ( !bOwnCtrl && sTitle.getLength() ) - // offset y based on height of font ( not sure if my guess at the correct calculation is correct here ) - nY = nY + ( nH / 8); // how do I test this + ImplSetPropertyValue( GetPropertyName( BASEPROPERTY_GRAPHIC), uno::makeAny( xGraphic ), sal_True ); + break; } - xW->setPosSize( nX, nY, nWidth, nHeight, PosSize::POSSIZE ); - } -} - -// ------------- UnoFrameModel ----------------- - -UnoFrameModel::UnoFrameModel() : UnoControlDialogModel( false ) -{ - ImplRegisterProperty( BASEPROPERTY_DEFAULTCONTROL ); - ImplRegisterProperty( BASEPROPERTY_BACKGROUNDCOLOR ); - ImplRegisterProperty( BASEPROPERTY_ENABLED ); - ImplRegisterProperty( BASEPROPERTY_ENABLEVISIBLE ); - ImplRegisterProperty( BASEPROPERTY_FONTDESCRIPTOR ); - ImplRegisterProperty( BASEPROPERTY_HELPTEXT ); - ImplRegisterProperty( BASEPROPERTY_HELPURL ); - ImplRegisterProperty( BASEPROPERTY_PRINTABLE ); - ImplRegisterProperty( BASEPROPERTY_LABEL ); - ImplRegisterProperty( BASEPROPERTY_WRITING_MODE ); - ImplRegisterProperty( BASEPROPERTY_CONTEXT_WRITING_MODE ); - ImplRegisterProperty( BASEPROPERTY_USERFORMCONTAINEES ); -} - -UnoFrameModel::UnoFrameModel( const UnoFrameModel& rModel ) - : UnoControlDialogModel( rModel ) -{ -} - -UnoFrameModel::~UnoFrameModel() -{ -} - -UnoControlModel* -UnoFrameModel::Clone() const -{ - // clone the container itself - UnoFrameModel* pClone = new UnoFrameModel( *this ); - - // clone all children - ::std::for_each( - maModels.begin(), maModels.end(), - CloneControlModel( pClone->maModels ) - ); - - return pClone; -} - -::rtl::OUString UnoFrameModel::getServiceName() throw(::com::sun::star::uno::RuntimeException) -{ - return ::rtl::OUString::createFromAscii( szServiceName_UnoFrameModel ); -} - -uno::Any UnoFrameModel::ImplGetDefaultValue( sal_uInt16 nPropId ) const -{ - if ( nPropId == BASEPROPERTY_DEFAULTCONTROL ) - { - uno::Any aAny; - aAny <<= ::rtl::OUString::createFromAscii( szServiceName_UnoFrameControl ); - return aAny; } - return UnoControlDialogModel::ImplGetDefaultValue( nPropId ); + ControlContainerBase::ImplModelPropertiesChanged(rEvents); } - -::cppu::IPropertyArrayHelper& UnoFrameModel::getInfoHelper() -{ - static UnoPropertyArrayHelper* pHelper = NULL; - if ( !pHelper ) - { - uno::Sequence<sal_Int32> aIDs = ImplGetPropertyIds(); - pHelper = new UnoPropertyArrayHelper( aIDs ); - } - return *pHelper; -} - -// beans::XMultiPropertySet -uno::Reference< beans::XPropertySetInfo > UnoFrameModel::getPropertySetInfo( ) throw(uno::RuntimeException) -{ - static uno::Reference< beans::XPropertySetInfo > xInfo( createPropertySetInfo( getInfoHelper() ) ); - return xInfo; -} - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/toolkit/source/controls/unocontrols.cxx b/toolkit/source/controls/unocontrols.cxx index 1094c70223ea..480399241f48 100644 --- a/toolkit/source/controls/unocontrols.cxx +++ b/toolkit/source/controls/unocontrols.cxx @@ -541,7 +541,7 @@ uno::Any GraphicControlModel::ImplGetDefaultValue( sal_uInt16 nPropId ) const return UnoControlModel::ImplGetDefaultValue( nPropId ); } - uno::Reference< graphic::XGraphic > ImageHelper::getGraphicAndGraphicObjectFromURL_nothrow( uno::Reference< graphic::XGraphicObject >& xOutGraphicObj, const ::rtl::OUString& _rURL ) + uno::Reference< graphic::XGraphic > GraphicControlModel::getGraphicFromURL_nothrow( const ::rtl::OUString& _rURL ) { uno::Reference< graphic::XGraphic > xGraphic; @@ -550,10 +550,10 @@ uno::Any GraphicControlModel::ImplGetDefaultValue( sal_uInt16 nPropId ) const // graphic manager uniqueid rtl::OUString sID = _rURL.copy( sizeof( UNO_NAME_GRAPHOBJ_URLPREFIX ) - 1 ); // get the DefaultContext - xOutGraphicObj = graphic::GraphicObject::createWithId( aContext.getUNOContext(), sID ); + mxGrfObj = graphic::GraphicObject::createWithId( maContext.getUNOContext(), sID ); } else // linked - xOutGraphicObj = NULL; // release the GraphicObject + mxGrfObj = NULL; // release the GraphicObject if ( !_rURL.getLength() ) return xGraphic; @@ -577,7 +577,6 @@ uno::Any GraphicControlModel::ImplGetDefaultValue( sal_uInt16 nPropId ) const return xGraphic; } - void SAL_CALL GraphicControlModel::setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, const ::com::sun::star::uno::Any& rValue ) throw (::com::sun::star::uno::Exception) { UnoControlModel::setFastPropertyValue_NoBroadcast( nHandle, rValue ); @@ -594,7 +593,7 @@ void SAL_CALL GraphicControlModel::setFastPropertyValue_NoBroadcast( sal_Int32 n mbAdjustingGraphic = true; ::rtl::OUString sImageURL; OSL_VERIFY( rValue >>= sImageURL ); - setDependentFastPropertyValue( BASEPROPERTY_GRAPHIC, uno::makeAny( ImageHelper::getGraphicAndGraphicObjectFromURL_nothrow( mxGrfObj, sImageURL ) ) ); + setDependentFastPropertyValue( BASEPROPERTY_GRAPHIC, uno::makeAny( getGraphicFromURL_nothrow( sImageURL ) ) ); mbAdjustingGraphic = false; } break; diff --git a/toolkit/source/helper/registerservices.cxx b/toolkit/source/helper/registerservices.cxx index c28615b34162..4689b7ffa009 100644 --- a/toolkit/source/helper/registerservices.cxx +++ b/toolkit/source/helper/registerservices.cxx @@ -42,6 +42,7 @@ #include <toolkit/awt/vclxpointer.hxx> #include <toolkit/awt/vclxprinter.hxx> #include <toolkit/controls/unocontrols.hxx> +#include <toolkit/controls/dialogcontrol.hxx> #include <toolkit/controls/unocontrolcontainer.hxx> #include <toolkit/controls/unocontrolcontainermodel.hxx> #include <toolkit/controls/stdtabcontroller.hxx> @@ -175,9 +176,11 @@ IMPL_CREATEINSTANCE2( UnoControlTimeFieldModel ) IMPL_CREATEINSTANCE2( UnoControlProgressBarModel ) IMPL_CREATEINSTANCE2( UnoControlScrollBarModel ) IMPL_CREATEINSTANCE2( UnoSpinButtonModel ) +#ifdef NOEL_UNWINDS_THIS_ALL // FIXME IMPL_CREATEINSTANCE2( UnoMultiPageModel ) IMPL_CREATEINSTANCE2( UnoPageModel ) IMPL_CREATEINSTANCE2( UnoFrameModel ) +#endif IMPL_CREATEINSTANCE2( UnoControlFixedLineModel ) IMPL_CREATEINSTANCE2( UnoCurrencyFieldControl ) IMPL_CREATEINSTANCE2( UnoDateFieldControl ) @@ -198,9 +201,11 @@ IMPL_CREATEINSTANCE2( UnoProgressBarControl ) IMPL_CREATEINSTANCE2( UnoScrollBarControl ) IMPL_CREATEINSTANCE2( UnoSpinButtonControl ) IMPL_CREATEINSTANCE2( UnoFixedLineControl ) -IMPL_CREATEINSTANCE( UnoMultiPageControl ) -IMPL_CREATEINSTANCE( UnoPageControl ) -IMPL_CREATEINSTANCE( UnoFrameControl ) +#ifdef NOEL_UNWINDS_THIS_ALL // FIXME +IMPL_CREATEINSTANCE2( UnoMultiPageControl ) +IMPL_CREATEINSTANCE2( UnoPageControl ) +IMPL_CREATEINSTANCE2( UnoFrameControl ) +#endif IMPL_CREATEINSTANCE( VCLXMenuBar ) IMPL_CREATEINSTANCE( VCLXPointer ) IMPL_CREATEINSTANCE( VCLXPopupMenu ) @@ -302,12 +307,14 @@ TOOLKIT_DLLPUBLIC void* SAL_CALL component_getFactory( const sal_Char* sImplemen GET_FACTORY( VCLXPrinterServer, szServiceName_PrinterServer, szServiceName2_PrinterServer ) GET_FACTORY( UnoRoadmapControl, szServiceName_UnoControlRoadmap, szServiceName2_UnoControlRoadmap ) GET_FACTORY( UnoControlRoadmapModel, szServiceName_UnoControlRoadmapModel, szServiceName2_UnoControlRoadmapModel ) +#ifdef NOEL_UNWINDS_THIS_ALL // FIXME GET_FACTORY( UnoMultiPageModel, szServiceName_UnoMultiPageModel, NULL ) GET_FACTORY( UnoMultiPageControl, szServiceName_UnoMultiPageControl, NULL ) GET_FACTORY( UnoPageModel, szServiceName_UnoPageModel, NULL ) GET_FACTORY( UnoPageControl, szServiceName_UnoPageControl, NULL ) GET_FACTORY( UnoFrameModel, szServiceName_UnoFrameModel, NULL ) GET_FACTORY( UnoFrameControl, szServiceName_UnoFrameControl, NULL ) +#endif GET_FACTORY( UnoSpinButtonModel, szServiceName_UnoSpinButtonModel, NULL ) GET_FACTORY( UnoSpinButtonControl, szServiceName_UnoSpinButtonControl, NULL ) GET_FACTORY( TreeControl, szServiceName_TreeControl, NULL ) diff --git a/tools/Library_tl.mk b/tools/Library_tl.mk index f61f656600fc..180b7bb9ac04 100644 --- a/tools/Library_tl.mk +++ b/tools/Library_tl.mk @@ -113,6 +113,7 @@ $(eval $(call gb_Library_add_exception_objects,tl,\ tools/source/string/tenccvt \ tools/source/string/tstring \ tools/source/string/tustring \ + tools/source/string/reversemap \ tools/source/testtoolloader/testtoolloader \ tools/source/zcodec/zcodec \ )) diff --git a/tools/prj/build.lst b/tools/prj/build.lst index 2f2dc8b539e1..eeb470c384d6 100644 --- a/tools/prj/build.lst +++ b/tools/prj/build.lst @@ -1,2 +1,3 @@ tl tools : cppu external offuh ZLIB:zlib EXPAT:expat basegfx comphelper i18npool NULL tl tools\prj nmake - all tl_prj NULL +# tl tools\qa nmake - all tl_qa tl_utl NULL diff --git a/tools/source/string/reversemap.hxx b/tools/source/string/reversemap.hxx new file mode 100644 index 000000000000..84b9ddecdea8 --- /dev/null +++ b/tools/source/string/reversemap.hxx @@ -0,0 +1,943 @@ + +/* + * Urgh - checked in temporarily - until we merge m100 and + * can generate .cxx files nicely + */ + +#warning "checked in generated file - urgh" + +//Do not edit manually, generated from bestreversemap.cxx +rtl_TextEncoding getBestMSEncodingByChar(sal_Unicode c) +{ + if (c < 0x80) + return RTL_TEXTENCODING_MS_1252; + if (c < 0xa0) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0x100) + return RTL_TEXTENCODING_MS_1252; + if (c < 0x102) + return RTL_TEXTENCODING_MS_1257; + if (c < 0x108) + return RTL_TEXTENCODING_MS_1250; + if (c < 0x10c) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0x112) + return RTL_TEXTENCODING_MS_1250; + if (c < 0x114) + return RTL_TEXTENCODING_MS_1257; + if (c < 0x116) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0x11a) + return RTL_TEXTENCODING_MS_1257; + if (c < 0x11c) + return RTL_TEXTENCODING_MS_1250; + if (c < 0x11e) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0x120) + return RTL_TEXTENCODING_MS_1254; + if (c < 0x122) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0x124) + return RTL_TEXTENCODING_MS_1257; + if (c < 0x126) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0x128) + return RTL_TEXTENCODING_MS_949; + if (c < 0x12a) + return RTL_TEXTENCODING_MS_1258; + if (c < 0x12c) + return RTL_TEXTENCODING_MS_1257; + if (c < 0x12e) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0x130) + return RTL_TEXTENCODING_MS_1257; + if (c < 0x132) + return RTL_TEXTENCODING_MS_1254; + if (c < 0x134) + return RTL_TEXTENCODING_MS_949; + if (c < 0x136) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0x138) + return RTL_TEXTENCODING_MS_1257; + if (c < 0x139) + return RTL_TEXTENCODING_MS_949; + if (c < 0x13b) + return RTL_TEXTENCODING_MS_1250; + if (c < 0x13d) + return RTL_TEXTENCODING_MS_1257; + if (c < 0x13f) + return RTL_TEXTENCODING_MS_1250; + if (c < 0x143) + return RTL_TEXTENCODING_MS_949; + if (c < 0x147) + return RTL_TEXTENCODING_MS_1257; + if (c < 0x149) + return RTL_TEXTENCODING_MS_1250; + if (c < 0x14c) + return RTL_TEXTENCODING_MS_949; + if (c < 0x14e) + return RTL_TEXTENCODING_MS_1257; + if (c < 0x150) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0x152) + return RTL_TEXTENCODING_MS_1250; + if (c < 0x154) + return RTL_TEXTENCODING_MS_1252; + if (c < 0x156) + return RTL_TEXTENCODING_MS_1250; + if (c < 0x158) + return RTL_TEXTENCODING_MS_1257; + if (c < 0x15c) + return RTL_TEXTENCODING_MS_1250; + if (c < 0x15e) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0x166) + return RTL_TEXTENCODING_MS_1250; + if (c < 0x168) + return RTL_TEXTENCODING_MS_949; + if (c < 0x16a) + return RTL_TEXTENCODING_MS_1258; + if (c < 0x16c) + return RTL_TEXTENCODING_MS_1257; + if (c < 0x16e) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0x172) + return RTL_TEXTENCODING_MS_1250; + if (c < 0x174) + return RTL_TEXTENCODING_MS_1257; + if (c < 0x178) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0x179) + return RTL_TEXTENCODING_MS_1252; + if (c < 0x17f) + return RTL_TEXTENCODING_MS_1250; + if (c < 0x192) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0x193) + return RTL_TEXTENCODING_MS_1252; + if (c < 0x1a0) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0x1a2) + return RTL_TEXTENCODING_MS_1258; + if (c < 0x1af) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0x1b1) + return RTL_TEXTENCODING_MS_1258; + if (c < 0x1ce) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0x1cf) + return RTL_TEXTENCODING_MS_936; + if (c < 0x1d0) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0x1d1) + return RTL_TEXTENCODING_MS_936; + if (c < 0x1d2) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0x1d3) + return RTL_TEXTENCODING_MS_936; + if (c < 0x1d4) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0x1d5) + return RTL_TEXTENCODING_MS_936; + if (c < 0x1d6) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0x1d7) + return RTL_TEXTENCODING_MS_936; + if (c < 0x1d8) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0x1d9) + return RTL_TEXTENCODING_MS_936; + if (c < 0x1da) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0x1db) + return RTL_TEXTENCODING_MS_936; + if (c < 0x1dc) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0x1dd) + return RTL_TEXTENCODING_MS_936; + if (c < 0x251) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0x252) + return RTL_TEXTENCODING_MS_936; + if (c < 0x261) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0x262) + return RTL_TEXTENCODING_MS_936; + if (c < 0x2c6) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0x2c7) + return RTL_TEXTENCODING_MS_1252; + if (c < 0x2c8) + return RTL_TEXTENCODING_MS_1250; + if (c < 0x2c9) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0x2cc) + return RTL_TEXTENCODING_MS_936; + if (c < 0x2cd) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0x2ce) + return RTL_TEXTENCODING_MS_950; + if (c < 0x2d0) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0x2d1) + return RTL_TEXTENCODING_MS_949; + if (c < 0x2d8) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0x2dc) + return RTL_TEXTENCODING_MS_949; + if (c < 0x2dd) + return RTL_TEXTENCODING_MS_1252; + if (c < 0x2de) + return RTL_TEXTENCODING_MS_1250; + if (c < 0x300) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0x302) + return RTL_TEXTENCODING_MS_1258; + if (c < 0x303) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0x304) + return RTL_TEXTENCODING_MS_1258; + if (c < 0x309) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0x30a) + return RTL_TEXTENCODING_MS_1258; + if (c < 0x323) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0x324) + return RTL_TEXTENCODING_MS_1258; + if (c < 0x384) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0x387) + return RTL_TEXTENCODING_MS_1253; + if (c < 0x388) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0x38b) + return RTL_TEXTENCODING_MS_1253; + if (c < 0x38c) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0x38d) + return RTL_TEXTENCODING_MS_1253; + if (c < 0x38e) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0x3a2) + return RTL_TEXTENCODING_MS_1253; + if (c < 0x3a3) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0x3cf) + return RTL_TEXTENCODING_MS_1253; + if (c < 0x401) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0x40d) + return RTL_TEXTENCODING_MS_1251; + if (c < 0x40e) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0x450) + return RTL_TEXTENCODING_MS_1251; + if (c < 0x451) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0x45d) + return RTL_TEXTENCODING_MS_1251; + if (c < 0x45e) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0x460) + return RTL_TEXTENCODING_MS_1251; + if (c < 0x490) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0x492) + return RTL_TEXTENCODING_MS_1251; + if (c < 0x5b0) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0x5ba) + return RTL_TEXTENCODING_MS_1255; + if (c < 0x5bb) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0x5c4) + return RTL_TEXTENCODING_MS_1255; + if (c < 0x5d0) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0x5eb) + return RTL_TEXTENCODING_MS_1255; + if (c < 0x5f0) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0x5f5) + return RTL_TEXTENCODING_MS_1255; + if (c < 0x60c) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0x60d) + return RTL_TEXTENCODING_MS_1256; + if (c < 0x61b) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0x61c) + return RTL_TEXTENCODING_MS_1256; + if (c < 0x61f) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0x620) + return RTL_TEXTENCODING_MS_1256; + if (c < 0x621) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0x63b) + return RTL_TEXTENCODING_MS_1256; + if (c < 0x640) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0x653) + return RTL_TEXTENCODING_MS_1256; + if (c < 0x679) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0x67a) + return RTL_TEXTENCODING_MS_1256; + if (c < 0x67e) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0x67f) + return RTL_TEXTENCODING_MS_1256; + if (c < 0x686) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0x687) + return RTL_TEXTENCODING_MS_1256; + if (c < 0x688) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0x689) + return RTL_TEXTENCODING_MS_1256; + if (c < 0x691) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0x692) + return RTL_TEXTENCODING_MS_1256; + if (c < 0x698) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0x699) + return RTL_TEXTENCODING_MS_1256; + if (c < 0x6a9) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0x6aa) + return RTL_TEXTENCODING_MS_1256; + if (c < 0x6af) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0x6b0) + return RTL_TEXTENCODING_MS_1256; + if (c < 0x6ba) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0x6bb) + return RTL_TEXTENCODING_MS_1256; + if (c < 0x6be) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0x6bf) + return RTL_TEXTENCODING_MS_1256; + if (c < 0x6c1) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0x6c2) + return RTL_TEXTENCODING_MS_1256; + if (c < 0x6d2) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0x6d3) + return RTL_TEXTENCODING_MS_1256; + if (c < 0xe01) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0xe3b) + return RTL_TEXTENCODING_MS_874; + if (c < 0xe3f) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0xe5c) + return RTL_TEXTENCODING_MS_874; + if (c < 0x1e3f) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0x1e40) + return RTL_TEXTENCODING_MS_936; + if (c < 0x1ea0) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0x1efa) + return RTL_TEXTENCODING_MS_1258; + if (c < 0x200c) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0x2010) + return RTL_TEXTENCODING_MS_1256; + if (c < 0x2011) + return RTL_TEXTENCODING_MS_932; + if (c < 0x2013) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0x2017) + return RTL_TEXTENCODING_MS_936; + if (c < 0x2018) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0x201b) + return RTL_TEXTENCODING_MS_1252; + if (c < 0x201c) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0x201f) + return RTL_TEXTENCODING_MS_1252; + if (c < 0x2020) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0x2023) + return RTL_TEXTENCODING_MS_1252; + if (c < 0x2025) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0x2028) + return RTL_TEXTENCODING_MS_950; + if (c < 0x2030) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0x2031) + return RTL_TEXTENCODING_MS_1252; + if (c < 0x2032) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0x2034) + return RTL_TEXTENCODING_MS_932; + if (c < 0x2035) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0x2036) + return RTL_TEXTENCODING_MS_936; + if (c < 0x2039) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0x203b) + return RTL_TEXTENCODING_MS_1252; + if (c < 0x203c) + return RTL_TEXTENCODING_MS_932; + if (c < 0x203e) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0x203f) + return RTL_TEXTENCODING_MS_932; + if (c < 0x2074) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0x2075) + return RTL_TEXTENCODING_MS_949; + if (c < 0x207f) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0x2080) + return RTL_TEXTENCODING_MS_949; + if (c < 0x2081) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0x2085) + return RTL_TEXTENCODING_MS_949; + if (c < 0x20a9) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0x20aa) + return RTL_TEXTENCODING_MS_1361; + if (c < 0x20ab) + return RTL_TEXTENCODING_MS_1255; + if (c < 0x20ad) + return RTL_TEXTENCODING_MS_1258; + if (c < 0x2103) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0x2104) + return RTL_TEXTENCODING_MS_932; + if (c < 0x2105) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0x2106) + return RTL_TEXTENCODING_MS_936; + if (c < 0x2109) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0x210a) + return RTL_TEXTENCODING_MS_936; + if (c < 0x2113) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0x2114) + return RTL_TEXTENCODING_MS_949; + if (c < 0x2116) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0x2117) + return RTL_TEXTENCODING_MS_1251; + if (c < 0x2121) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0x2123) + return RTL_TEXTENCODING_MS_949; + if (c < 0x2126) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0x2127) + return RTL_TEXTENCODING_MS_949; + if (c < 0x212b) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0x212c) + return RTL_TEXTENCODING_MS_932; + if (c < 0x2153) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0x2155) + return RTL_TEXTENCODING_MS_949; + if (c < 0x215b) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0x215f) + return RTL_TEXTENCODING_MS_949; + if (c < 0x2160) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0x216c) + return RTL_TEXTENCODING_MS_936; + if (c < 0x2170) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0x217a) + return RTL_TEXTENCODING_MS_932; + if (c < 0x2190) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0x219a) + return RTL_TEXTENCODING_MS_949; + if (c < 0x21d2) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0x21d3) + return RTL_TEXTENCODING_MS_932; + if (c < 0x21d4) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0x21d5) + return RTL_TEXTENCODING_MS_932; + if (c < 0x2200) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0x2201) + return RTL_TEXTENCODING_MS_932; + if (c < 0x2202) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0x2204) + return RTL_TEXTENCODING_MS_932; + if (c < 0x2207) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0x2209) + return RTL_TEXTENCODING_MS_932; + if (c < 0x220b) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0x220c) + return RTL_TEXTENCODING_MS_932; + if (c < 0x220f) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0x2210) + return RTL_TEXTENCODING_MS_936; + if (c < 0x2211) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0x2213) + return RTL_TEXTENCODING_MS_932; + if (c < 0x2215) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0x2216) + return RTL_TEXTENCODING_MS_936; + if (c < 0x221a) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0x221b) + return RTL_TEXTENCODING_MS_932; + if (c < 0x221d) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0x2221) + return RTL_TEXTENCODING_MS_932; + if (c < 0x2223) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0x2224) + return RTL_TEXTENCODING_MS_936; + if (c < 0x2225) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0x2226) + return RTL_TEXTENCODING_MS_932; + if (c < 0x2227) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0x222d) + return RTL_TEXTENCODING_MS_932; + if (c < 0x222e) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0x222f) + return RTL_TEXTENCODING_MS_932; + if (c < 0x2234) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0x2238) + return RTL_TEXTENCODING_MS_936; + if (c < 0x223c) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0x223e) + return RTL_TEXTENCODING_MS_949; + if (c < 0x2248) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0x2249) + return RTL_TEXTENCODING_MS_936; + if (c < 0x224c) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0x224d) + return RTL_TEXTENCODING_MS_936; + if (c < 0x2252) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0x2253) + return RTL_TEXTENCODING_MS_932; + if (c < 0x2260) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0x2262) + return RTL_TEXTENCODING_MS_932; + if (c < 0x2264) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0x2268) + return RTL_TEXTENCODING_MS_936; + if (c < 0x226a) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0x226c) + return RTL_TEXTENCODING_MS_932; + if (c < 0x226e) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0x2270) + return RTL_TEXTENCODING_MS_936; + if (c < 0x2282) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0x2284) + return RTL_TEXTENCODING_MS_932; + if (c < 0x2286) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0x2288) + return RTL_TEXTENCODING_MS_932; + if (c < 0x2295) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0x2296) + return RTL_TEXTENCODING_MS_936; + if (c < 0x2299) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0x229a) + return RTL_TEXTENCODING_MS_936; + if (c < 0x22a5) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0x22a6) + return RTL_TEXTENCODING_MS_932; + if (c < 0x22bf) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0x22c0) + return RTL_TEXTENCODING_MS_932; + if (c < 0x22ef) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0x22f0) + return RTL_TEXTENCODING_MS_936; + if (c < 0x2312) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0x2313) + return RTL_TEXTENCODING_MS_932; + if (c < 0x2460) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0x2474) + return RTL_TEXTENCODING_MS_932; + if (c < 0x249c) + return RTL_TEXTENCODING_MS_936; + if (c < 0x24b6) + return RTL_TEXTENCODING_MS_949; + if (c < 0x24d0) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0x24ea) + return RTL_TEXTENCODING_MS_949; + if (c < 0x2500) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0x254c) + return RTL_TEXTENCODING_MS_936; + if (c < 0x2550) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0x2575) + return RTL_TEXTENCODING_MS_950; + if (c < 0x2581) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0x2590) + return RTL_TEXTENCODING_MS_936; + if (c < 0x2592) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0x2593) + return RTL_TEXTENCODING_MS_949; + if (c < 0x2596) + return RTL_TEXTENCODING_MS_936; + if (c < 0x25a0) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0x25a2) + return RTL_TEXTENCODING_MS_932; + if (c < 0x25a3) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0x25aa) + return RTL_TEXTENCODING_MS_949; + if (c < 0x25b2) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0x25b4) + return RTL_TEXTENCODING_MS_932; + if (c < 0x25b6) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0x25b8) + return RTL_TEXTENCODING_MS_949; + if (c < 0x25bc) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0x25be) + return RTL_TEXTENCODING_MS_932; + if (c < 0x25c0) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0x25c2) + return RTL_TEXTENCODING_MS_949; + if (c < 0x25c6) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0x25c9) + return RTL_TEXTENCODING_MS_949; + if (c < 0x25cb) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0x25cc) + return RTL_TEXTENCODING_MS_932; + if (c < 0x25ce) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0x25d2) + return RTL_TEXTENCODING_MS_949; + if (c < 0x25e2) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0x25e6) + return RTL_TEXTENCODING_MS_936; + if (c < 0x25ef) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0x25f0) + return RTL_TEXTENCODING_MS_932; + if (c < 0x2605) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0x2607) + return RTL_TEXTENCODING_MS_932; + if (c < 0x2609) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0x260a) + return RTL_TEXTENCODING_MS_936; + if (c < 0x260e) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0x2610) + return RTL_TEXTENCODING_MS_949; + if (c < 0x261c) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0x261d) + return RTL_TEXTENCODING_MS_949; + if (c < 0x261e) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0x261f) + return RTL_TEXTENCODING_MS_949; + if (c < 0x2640) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0x2643) + return RTL_TEXTENCODING_MS_950; + if (c < 0x2660) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0x2662) + return RTL_TEXTENCODING_MS_949; + if (c < 0x2663) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0x2666) + return RTL_TEXTENCODING_MS_949; + if (c < 0x2667) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0x266b) + return RTL_TEXTENCODING_MS_949; + if (c < 0x266c) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0x266e) + return RTL_TEXTENCODING_MS_949; + if (c < 0x266f) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0x2670) + return RTL_TEXTENCODING_MS_932; + if (c < 0x3000) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0x3004) + return RTL_TEXTENCODING_MS_932; + if (c < 0x3005) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0x3018) + return RTL_TEXTENCODING_MS_936; + if (c < 0x301c) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0x301f) + return RTL_TEXTENCODING_MS_936; + if (c < 0x3020) + return RTL_TEXTENCODING_MS_932; + if (c < 0x3021) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0x302a) + return RTL_TEXTENCODING_MS_936; + if (c < 0x3041) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0x3094) + return RTL_TEXTENCODING_MS_932; + if (c < 0x309b) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0x309f) + return RTL_TEXTENCODING_MS_932; + if (c < 0x30a1) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0x30f7) + return RTL_TEXTENCODING_MS_932; + if (c < 0x30fb) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0x30ff) + return RTL_TEXTENCODING_MS_932; + if (c < 0x3105) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0x312a) + return RTL_TEXTENCODING_MS_936; + if (c < 0x3131) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0x31ac) + return RTL_TEXTENCODING_MS_949; + if (c < 0x31ef) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0x31ff) + return RTL_TEXTENCODING_MS_949; + if (c < 0x3200) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0x321d) + return RTL_TEXTENCODING_MS_949; + if (c < 0x3220) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0x322a) + return RTL_TEXTENCODING_MS_936; + if (c < 0x3231) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0x3233) + return RTL_TEXTENCODING_MS_932; + if (c < 0x3239) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0x323a) + return RTL_TEXTENCODING_MS_932; + if (c < 0x3260) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0x327c) + return RTL_TEXTENCODING_MS_949; + if (c < 0x327f) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0x3280) + return RTL_TEXTENCODING_MS_949; + if (c < 0x32a3) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0x32a4) + return RTL_TEXTENCODING_MS_936; + if (c < 0x32a9) + return RTL_TEXTENCODING_MS_932; + if (c < 0x3303) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0x3304) + return RTL_TEXTENCODING_MS_932; + if (c < 0x330d) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0x330e) + return RTL_TEXTENCODING_MS_932; + if (c < 0x3314) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0x3315) + return RTL_TEXTENCODING_MS_932; + if (c < 0x3318) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0x3319) + return RTL_TEXTENCODING_MS_932; + if (c < 0x3322) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0x3324) + return RTL_TEXTENCODING_MS_932; + if (c < 0x3326) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0x3328) + return RTL_TEXTENCODING_MS_932; + if (c < 0x332b) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0x332c) + return RTL_TEXTENCODING_MS_932; + if (c < 0x3336) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0x3337) + return RTL_TEXTENCODING_MS_932; + if (c < 0x333b) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0x333c) + return RTL_TEXTENCODING_MS_932; + if (c < 0x3349) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0x334b) + return RTL_TEXTENCODING_MS_932; + if (c < 0x334d) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0x334e) + return RTL_TEXTENCODING_MS_932; + if (c < 0x3351) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0x3352) + return RTL_TEXTENCODING_MS_932; + if (c < 0x3357) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0x3358) + return RTL_TEXTENCODING_MS_932; + if (c < 0x337b) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0x337f) + return RTL_TEXTENCODING_MS_932; + if (c < 0x3380) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0x3385) + return RTL_TEXTENCODING_MS_949; + if (c < 0x3388) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0x33cb) + return RTL_TEXTENCODING_MS_949; + if (c < 0x33cd) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0x33ce) + return RTL_TEXTENCODING_MS_932; + if (c < 0x33cf) + return RTL_TEXTENCODING_MS_936; + if (c < 0x33d1) + return RTL_TEXTENCODING_MS_949; + if (c < 0x33d3) + return RTL_TEXTENCODING_MS_936; + if (c < 0x33d4) + return RTL_TEXTENCODING_MS_949; + if (c < 0x33d5) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0x33d6) + return RTL_TEXTENCODING_MS_936; + if (c < 0x33d7) + return RTL_TEXTENCODING_MS_949; + if (c < 0x33d8) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0x33d9) + return RTL_TEXTENCODING_MS_949; + if (c < 0x33db) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0x33de) + return RTL_TEXTENCODING_MS_949; + if (c < 0x4e00) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0x9fa6) + return RTL_TEXTENCODING_MS_936; + if (c < 0xac00) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0xd7a4) + return RTL_TEXTENCODING_MS_949; + if (c < 0xe000) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0xf849) + return RTL_TEXTENCODING_MS_950; + if (c < 0xf900) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0xfa0c) + return RTL_TEXTENCODING_MS_949; + if (c < 0xfa10) + return RTL_TEXTENCODING_MS_936; + if (c < 0xfa2e) + return RTL_TEXTENCODING_MS_932; + if (c < 0xfe30) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0xfe32) + return RTL_TEXTENCODING_MS_936; + if (c < 0xfe33) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0xfe45) + return RTL_TEXTENCODING_MS_936; + if (c < 0xfe49) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0xfe53) + return RTL_TEXTENCODING_MS_936; + if (c < 0xfe54) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0xfe58) + return RTL_TEXTENCODING_MS_936; + if (c < 0xfe59) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0xfe67) + return RTL_TEXTENCODING_MS_936; + if (c < 0xfe68) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0xfe6c) + return RTL_TEXTENCODING_MS_936; + if (c < 0xff01) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0xff5f) + return RTL_TEXTENCODING_MS_932; + if (c < 0xff61) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0xffa0) + return RTL_TEXTENCODING_MS_932; + if (c < 0xffe0) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0xffe6) + return RTL_TEXTENCODING_MS_932; + if (c < 0xffe7) + return RTL_TEXTENCODING_MS_949; + if (c < 0xfffd) + return RTL_TEXTENCODING_DONTKNOW; + if (c < 0xfffe) + return RTL_TEXTENCODING_MS_950; + return RTL_TEXTENCODING_DONTKNOW; +} diff --git a/vcl/prj/build.lst b/vcl/prj/build.lst index 3849d917273c..2cf0bd3963d5 100644 --- a/vcl/prj/build.lst +++ b/vcl/prj/build.lst @@ -1,4 +1,4 @@ -vc vcl : L10N:l10n apple_remote BOOST:boost rsc sot ucbhelper unotools ICU:icu GRAPHITE:graphite i18npool i18nutil unoil ridljar X11_EXTENSIONS:x11_extensions offuh basegfx basebmp tools l10ntools icc cpputools shell svl LIBXSLT:libxslt NULL +vc vcl : L10N:l10n apple_remote BOOST:boost rsc sot ucbhelper unotools ICU:icu GRAPHITE:graphite i18npool i18nutil unoil ridljar X11_EXTENSIONS:x11_extensions offuh basegfx basebmp tools l10ntools icc cpputools svl LIBXSLT:libxslt NULL vc vcl usr1 - all vc_mkout NULL vc vcl\inc nmake - all vc_inc NULL vc vcl\source\glyphs nmake - all vc_glyphs vc_inc NULL diff --git a/vcl/unx/gtk/a11y/makefile.mk b/vcl/unx/gtk/a11y/makefile.mk index 14d3014ddf11..30c6d5e7cfb3 100644 --- a/vcl/unx/gtk/a11y/makefile.mk +++ b/vcl/unx/gtk/a11y/makefile.mk @@ -31,10 +31,6 @@ PRJNAME=vcl TARGET=gtka11y ENABLE_EXCEPTIONS=TRUE -# workaround for makedepend hang -MKDEPENDSOLVER= -NO_DEFAULT_STL=YES - # --- Settings ----------------------------------------------------- .INCLUDE : settings.mk diff --git a/vcl/unx/inc/kde_headers.h b/vcl/unx/inc/kde_headers.h new file mode 100644 index 000000000000..7ec45fdc383d --- /dev/null +++ b/vcl/unx/inc/kde_headers.h @@ -0,0 +1,98 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef INCLUDED_VCL_KDE_HEADERS_H +#define INCLUDED_VCL_KDE_HEADERS_H + +/* ********* Suppress warnings if needed */ +#include "sal/config.h" + +#include <cstddef> + +#if defined __GNUC__ +#pragma GCC system_header +#endif + + +/* ********* Hack, but needed because of conflicting types... */ +#define Region QtXRegion + + +/* ********* Qt headers */ +#include <qaccessible.h> +#include <qcheckbox.h> +#include <qcombobox.h> +#include <qfont.h> +#include <qframe.h> +#include <qlineedit.h> +#include <qlistview.h> +#include <qmainwindow.h> +#include <qmenudata.h> +#include <qpaintdevice.h> +#include <qpainter.h> +#include <qpushbutton.h> +#include <qradiobutton.h> +#include <qrangecontrol.h> +#include <qstring.h> +#include <qtabbar.h> +#include <qtabwidget.h> +#include <qtoolbar.h> +#include <qtoolbutton.h> +#include <qwidget.h> +#include <qprogressbar.h> + +/* ********* See hack on top of this file */ +#undef Region + + +/* ********* KDE base headers */ +#include <kaboutdata.h> +#include <kapplication.h> +#include <kcmdlineargs.h> +#include <kconfig.h> +#include <kdeversion.h> +#include <kemailsettings.h> +#include <kglobal.h> +#include <kglobalsettings.h> +#include <klocale.h> +#include <kmainwindow.h> +#include <kmenubar.h> +#include <kprotocolmanager.h> +#include <kstartupinfo.h> +#include <kstyle.h> + + +/* ********* KDE address book connectivity headers */ +#include <kabc/addressbook.h> +#include <kabc/addressee.h> +#include <kabc/field.h> +#include <kabc/stdaddressbook.h> + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/unx/kde/kdedata.cxx b/vcl/unx/kde/kdedata.cxx index c7f528efba6b..b87e7a0aea5b 100644 --- a/vcl/unx/kde/kdedata.cxx +++ b/vcl/unx/kde/kdedata.cxx @@ -30,7 +30,7 @@ #include "precompiled_vcl.hxx" #define _SV_SALDATA_CXX -#include <shell/kde_headers.h> +#include <kde_headers.h> #include <unistd.h> #include <fcntl.h> diff --git a/vcl/unx/kde/salnativewidgets-kde.cxx b/vcl/unx/kde/salnativewidgets-kde.cxx index 859c4502716c..bf080084ed5b 100644 --- a/vcl/unx/kde/salnativewidgets-kde.cxx +++ b/vcl/unx/kde/salnativewidgets-kde.cxx @@ -30,7 +30,7 @@ #include "precompiled_vcl.hxx" #define _SV_SALNATIVEWIDGETS_KDE_CXX -#include <shell/kde_headers.h> +#include <kde_headers.h> #include <salunx.h> #include <saldata.hxx> |