From 1b06cbc631f4d6e58ec5b9d8f82bc882a3e4b3c7 Mon Sep 17 00:00:00 2001 From: Andre Fischer Date: Fri, 19 Mar 2010 15:06:39 +0100 Subject: renaissance1: #i107215# Reorganized and improved layouting. --- vcl/inc/vcl/splitwin.hxx | 12 +++++++ vcl/source/window/splitwin.cxx | 73 +++++++++++++++++++++++++++++++++++++++--- 2 files changed, 80 insertions(+), 5 deletions(-) diff --git a/vcl/inc/vcl/splitwin.hxx b/vcl/inc/vcl/splitwin.hxx index dbc90538eaaf..0cf9c889d619 100644 --- a/vcl/inc/vcl/splitwin.hxx +++ b/vcl/inc/vcl/splitwin.hxx @@ -204,6 +204,18 @@ public: BOOL bPropGreat = FALSE ); void SetItemSize( USHORT nId, long nNewSize ); long GetItemSize( USHORT nId ) const; + /** Set a range that limits the (variable part of the) size with an + upper and a lower bound (both are valid values themselves.) + @param nId + Id of the item for which the size limits are set. + @param aRange + Values of -1 define missing bounds, thus setting a range (-1,-1) + (the default) removes the size limitiation. + */ + void SetItemSizeRange (USHORT nId, const Range aRange); + /** Return the current size limits for the specified item. + */ + Range GetItemSizeRange (USHORT nId) const; long GetItemSize( USHORT nId, SplitWindowItemBits nBits ) const; void SetItemBits( USHORT nId, SplitWindowItemBits nNewBits ); SplitWindowItemBits GetItemBits( USHORT nId ) const; diff --git a/vcl/source/window/splitwin.cxx b/vcl/source/window/splitwin.cxx index 1e66849db73a..67d0b17ab870 100644 --- a/vcl/source/window/splitwin.cxx +++ b/vcl/source/window/splitwin.cxx @@ -52,7 +52,8 @@ // ======================================================================= -// Achtung: Darf keine Objekte enthalten, da mit memmove/memcpy gearbeitet wird +// Attention: Must not contain non-PODs because array is enlarged/copied +// with the use of memmove/memcpy. struct ImplSplitItem { long mnSize; @@ -74,6 +75,10 @@ struct ImplSplitItem SplitWindowItemBits mnBits; BOOL mbFixed; BOOL mbSubSize; + /// Minimal width or height of the item. -1 means no restriction. + long mnMinSize; + /// Maximal width or height of the item. -1 means no restriction. + long mnMaxSize; }; struct ImplSplitSet @@ -88,6 +93,28 @@ struct ImplSplitSet BOOL mbCalcPix; }; + + +/** Check whether the given size is inside the valid range defined by + [rItem.mnMinSize,rItem.mnMaxSize]. When it is not inside it then return + the upper or lower bound, respectively. Otherwise return the given size + unmodified. + Note that either mnMinSize and/or mnMaxSize can be -1 in which case the + size has not lower or upper bound. +*/ +namespace { + long ValidateSize (const long nSize, const ImplSplitItem rItem) + { + if (rItem.mnMinSize>=0 && nSize0 && nSize>rItem.mnMaxSize) + return rItem.mnMaxSize; + else + return nSize; + } +} + + #define SPLITWIN_SPLITSIZE 3 #define SPLITWIN_SPLITSIZEEX 4 #define SPLITWIN_SPLITSIZEEXLN 6 @@ -2853,7 +2880,7 @@ void SplitWindow::InsertItem( USHORT nId, Window* pWindow, long nSize, DBG_ASSERT( !ImplFindItem( mpMainSet, nId, nDbgDummy ), "SplitWindow::InsertItem() - Id already exists" ); #endif - // Size muss min. 1 sein + // Size has to be at least 1. if ( nSize < 1 ) nSize = 1; @@ -2861,7 +2888,7 @@ void SplitWindow::InsertItem( USHORT nId, Window* pWindow, long nSize, ImplSplitSet* pNewSet; ImplSplitItem* pItem; - // Platz fuer neues Item schaffen + // Make room for the new item. if ( nPos > pSet->mnItems ) nPos = pSet->mnItems; ImplSplitItem* pNewItems = new ImplSplitItem[pSet->mnItems+1]; @@ -2874,19 +2901,21 @@ void SplitWindow::InsertItem( USHORT nId, Window* pWindow, long nSize, pSet->mnItems++; pSet->mbCalcPix = TRUE; - // Item anlegen und erweitern + // Create and initialize item. pItem = &(pSet->mpItems[nPos]); memset( pItem, 0, sizeof( ImplSplitItem ) ); pItem->mnSize = nSize; pItem->mnId = nId; pItem->mnBits = nBits; + pItem->mnMinSize=-1; + pItem->mnMaxSize=-1; if ( pWindow ) { pItem->mpWindow = pWindow; pItem->mpOrgParent = pWindow->GetParent(); - // Window mit SplitWindow verbinden + // Attach window to SplitWindow. pWindow->Hide(); pWindow->SetParent( this ); } @@ -3254,6 +3283,10 @@ void SplitWindow::SplitItem( USHORT nId, long nNewSize, nItems = pSet->mnItems; pItems = pSet->mpItems; + // When there is an explicit minimum or maximum size then move nNewSize + // into that range (when it is not yet already in it.) + nNewSize = ValidateSize(nNewSize, pItems[nPos]); + if ( mbCalc ) { pItems[nPos].mnSize = nNewSize; @@ -3555,6 +3588,36 @@ long SplitWindow::GetItemSize( USHORT nId, SplitWindowItemBits nBits ) const return 0; } + + + +void SplitWindow::SetItemSizeRange (USHORT nId, const Range aRange) +{ + USHORT nPos; + ImplSplitSet* pSet = ImplFindItem(mpBaseSet, nId, nPos); + + if (pSet != NULL) + { + pSet->mpItems[nPos].mnMinSize = aRange.Min(); + pSet->mpItems[nPos].mnMaxSize = aRange.Max(); + } +} + + + + +Range SplitWindow::GetItemSizeRange (USHORT nId) const +{ + USHORT nPos; + ImplSplitSet* pSet = ImplFindItem(mpBaseSet, nId, nPos); + + if (pSet != NULL) + return Range (pSet->mpItems[nPos].mnMinSize, pSet->mpItems[nPos].mnMaxSize); + else + return Range(-1,-1); +} + + // ----------------------------------------------------------------------- void SplitWindow::SetItemBits( USHORT nId, SplitWindowItemBits nNewBits ) -- cgit v1.2.3 From 8d05e9c829aa36f00954c005fa4782eae7a8013a Mon Sep 17 00:00:00 2001 From: Armin Le Grand Date: Tue, 30 Mar 2010 17:54:56 +0200 Subject: renaissance1 #i110498# All needed changes for SoftShadow for DRawPage visualisation --- vcl/source/gdi/bitmap3.cxx | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/vcl/source/gdi/bitmap3.cxx b/vcl/source/gdi/bitmap3.cxx index 9e2a21b43e37..0610ed3b9e2f 100644 --- a/vcl/source/gdi/bitmap3.cxx +++ b/vcl/source/gdi/bitmap3.cxx @@ -961,8 +961,10 @@ BOOL Bitmap::ImplScaleFast( const double& rScaleX, const double& rScaleY ) const long nScanlineSize = pWriteAcc->GetScanlineSize(); const long nNewWidth1 = nNewWidth - 1L; const long nNewHeight1 = nNewHeight - 1L; - const long nWidth1 = pReadAcc->Width() - 1L; - const long nHeight1 = pReadAcc->Height() - 1L; + const long nWidth = pReadAcc->Width(); + const long nHeight = pReadAcc->Height(); + const long nWidth1 = nWidth - 1L; + const long nHeight1 = nHeight - 1L; long* pLutX = new long[ nNewWidth ]; long* pLutY = new long[ nNewHeight ]; long nX, nY, nMapY, nActY = 0L; @@ -970,10 +972,10 @@ BOOL Bitmap::ImplScaleFast( const double& rScaleX, const double& rScaleY ) if( nNewWidth1 && nNewHeight1 ) { for( nX = 0L; nX < nNewWidth; nX++ ) - pLutX[ nX ] = nX * nWidth1 / nNewWidth1; + pLutX[ nX ] = nX * nWidth / nNewWidth; for( nY = 0L; nY < nNewHeight; nY++ ) - pLutY[ nY ] = nY * nHeight1 / nNewHeight1; + pLutY[ nY ] = nY * nHeight / nNewHeight; while( nActY < nNewHeight ) { -- cgit v1.2.3 From a0857ef55bc3c866e2720492ef3712b938bcddb1 Mon Sep 17 00:00:00 2001 From: Armin Le Grand Date: Tue, 30 Mar 2010 18:03:50 +0200 Subject: renaissance1: corrected warning --- vcl/source/gdi/bitmap3.cxx | 2 -- 1 file changed, 2 deletions(-) diff --git a/vcl/source/gdi/bitmap3.cxx b/vcl/source/gdi/bitmap3.cxx index 0610ed3b9e2f..ec476157fbeb 100644 --- a/vcl/source/gdi/bitmap3.cxx +++ b/vcl/source/gdi/bitmap3.cxx @@ -963,8 +963,6 @@ BOOL Bitmap::ImplScaleFast( const double& rScaleX, const double& rScaleY ) const long nNewHeight1 = nNewHeight - 1L; const long nWidth = pReadAcc->Width(); const long nHeight = pReadAcc->Height(); - const long nWidth1 = nWidth - 1L; - const long nHeight1 = nHeight - 1L; long* pLutX = new long[ nNewWidth ]; long* pLutY = new long[ nNewHeight ]; long nX, nY, nMapY, nActY = 0L; -- cgit v1.2.3 From 559e58862e411cd6b435aa8e6f054c23d1ed3e7c Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Wed, 5 May 2010 13:36:41 +0200 Subject: renaissance1: #i107215# suppress mouse enter/leave when inactive --- vcl/aqua/source/window/salframeview.mm | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/vcl/aqua/source/window/salframeview.mm b/vcl/aqua/source/window/salframeview.mm index 67926a38608d..4904d7263e75 100755 --- a/vcl/aqua/source/window/salframeview.mm +++ b/vcl/aqua/source/window/salframeview.mm @@ -570,8 +570,11 @@ private: -(void)mouseEntered: (NSEvent*)pEvent { s_pMouseFrame = mpFrame; - - [self sendMouseEventToFrame:pEvent button:s_nLastButton eventtype:SALEVENT_MOUSEMOVE]; + + // #i107215# the only mouse events we get when inactive are enter/exit + // actually we would like to have all of them, but better none than some + if( [NSApp isActive] ) + [self sendMouseEventToFrame:pEvent button:s_nLastButton eventtype:SALEVENT_MOUSEMOVE]; } -(void)mouseExited: (NSEvent*)pEvent @@ -579,7 +582,10 @@ private: if( s_pMouseFrame == mpFrame ) s_pMouseFrame = NULL; - [self sendMouseEventToFrame:pEvent button:s_nLastButton eventtype:SALEVENT_MOUSELEAVE]; + // #i107215# the only mouse events we get when inactive are enter/exit + // actually we would like to have all of them, but better none than some + if( [NSApp isActive] ) + [self sendMouseEventToFrame:pEvent button:s_nLastButton eventtype:SALEVENT_MOUSELEAVE]; } -(void)rightMouseDown: (NSEvent*)pEvent -- cgit v1.2.3 From f3541e6c08af5ebaa87a9bf878e6bdaecdc37ae2 Mon Sep 17 00:00:00 2001 From: Andre Fischer Date: Fri, 28 May 2010 13:26:19 +0200 Subject: renaissance1: #i107215# Some minor fixes and improvements. --- vcl/source/window/window.cxx | 1 + 1 file changed, 1 insertion(+) diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx index 516bc53d8920..9c73f9a1cf60 100644 --- a/vcl/source/window/window.cxx +++ b/vcl/source/window/window.cxx @@ -5333,6 +5333,7 @@ long Window::Notify( NotifyEvent& rNEvt ) } } + if ( !nRet ) { if ( mpWindowImpl->mpParent && !ImplIsOverlapWindow() ) -- cgit v1.2.3 From 807468a3c078f60b8aa952619336f6c46ae97413 Mon Sep 17 00:00:00 2001 From: Andre Fischer Date: Wed, 2 Jun 2010 11:01:47 +0200 Subject: renaissance1: #i107215# Do not show PresObjs in previews. --- vcl/source/window/window.cxx | 1 - 1 file changed, 1 deletion(-) diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx index 9c73f9a1cf60..516bc53d8920 100644 --- a/vcl/source/window/window.cxx +++ b/vcl/source/window/window.cxx @@ -5333,7 +5333,6 @@ long Window::Notify( NotifyEvent& rNEvt ) } } - if ( !nRet ) { if ( mpWindowImpl->mpParent && !ImplIsOverlapWindow() ) -- cgit v1.2.3 From cd4385a9aecd65ed1c360708614eff7f6fe381bb Mon Sep 17 00:00:00 2001 From: Andre Fischer Date: Mon, 14 Jun 2010 18:00:56 +0200 Subject: renaissance1: #i107215# Fixed wrong rounding in HSBtoRGB. --- tools/source/generic/color.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/source/generic/color.cxx b/tools/source/generic/color.cxx index 37e9dedf9259..5dc41f292668 100644 --- a/tools/source/generic/color.cxx +++ b/tools/source/generic/color.cxx @@ -244,8 +244,8 @@ ColorData Color::HSBtoRGB( USHORT nHue, USHORT nSat, USHORT nBri ) f = dH - n; UINT8 a = (UINT8) ( nB * ( 100 - nSat ) / 100 ); - UINT8 b = (UINT8) ( nB * ( 100 - ( (double)nSat * f + 0.5 ) ) / 100 ); - UINT8 c = (UINT8) ( nB * ( 100 - ( (double)nSat * ( 1.0 - f ) + 0.5 ) ) / 100 ); + UINT8 b = (UINT8) ( nB * ( 100 - ( (double)nSat * f ) ) / 100 ); + UINT8 c = (UINT8) ( nB * ( 100 - ( (double)nSat * ( 1.0 - f ) ) ) / 100 ); switch( n ) { -- cgit v1.2.3 From 08b6b244b215ec4a96686866685eab5421da3dd5 Mon Sep 17 00:00:00 2001 From: Andre Fischer Date: Thu, 8 Jul 2010 12:27:24 +0200 Subject: renaissance1: resolved merge conflicts, cleanup. --- comphelper/inc/comphelper/docpasswordrequest.hxx | 0 l10ntools/java/jpropex/build.xml | 0 l10ntools/java/jpropex/jpropex | 0 l10ntools/java/jpropex/jpropex.MF | 0 l10ntools/java/jpropex/makefile.mk | 0 svtools/inc/svtools/accessiblefactory.hxx | 0 svtools/inc/svtools/toolpanel/decklayouter.hxx | 0 svtools/inc/svtools/toolpanel/tablayouter.hxx | 0 svtools/inc/svtools/toolpanel/toolpaneldeck.hxx | 0 svtools/inc/svtools/xwindowitem.hxx | 0 svtools/source/control/asynclink.cxx | 0 svtools/source/control/calendar.cxx | 0 svtools/source/control/calendar.src | 0 svtools/source/control/collatorres.cxx | 0 svtools/source/control/ctrlbox.cxx | 0 svtools/source/control/ctrlbox.src | 0 svtools/source/control/ctrldll.cxx | 0 svtools/source/control/ctrltool.cxx | 0 svtools/source/control/ctrltool.src | 0 svtools/source/control/filectrl.cxx | 0 svtools/source/control/filectrl.src | 0 svtools/source/control/filectrl2.cxx | 0 svtools/source/control/fileurlbox.cxx | 0 svtools/source/control/fixedhyper.cxx | 0 svtools/source/control/fmtfield.cxx | 0 svtools/source/control/headbar.cxx | 0 svtools/source/control/hyperlabel.cxx | 0 svtools/source/control/indexentryres.cxx | 0 svtools/source/control/inettbc.cxx | 0 svtools/source/control/makefile.mk | 0 svtools/source/control/prgsbar.cxx | 0 svtools/source/control/roadmap.cxx | 0 svtools/source/control/ruler.cxx | 0 svtools/source/control/scriptedtext.cxx | 0 svtools/source/control/scrwin.cxx | 0 svtools/source/control/stdctrl.cxx | 0 svtools/source/control/stdmenu.cxx | 0 svtools/source/control/svxbox.cxx | 0 svtools/source/control/tabbar.cxx | 0 svtools/source/control/taskbar.cxx | 0 svtools/source/control/taskbox.cxx | 0 svtools/source/control/taskmisc.cxx | 0 svtools/source/control/taskstat.cxx | 0 svtools/source/control/urlcontrol.cxx | 0 svtools/source/control/valueimp.hxx | 0 svtools/source/dialogs/makefile.mk | 0 svtools/source/misc/makefile.mk | 0 svtools/source/misc/svtaccessiblefactory.cxx | 0 svtools/source/misc/xwindowitem.cxx | 0 svtools/source/toolpanel/makefile.mk | 0 svtools/source/toolpanel/paneldecklisteners.cxx | 0 svtools/source/toolpanel/paneldecklisteners.hxx | 0 svtools/source/toolpanel/paneltabbar.cxx | 0 svtools/source/toolpanel/tablayouter.cxx | 0 svtools/source/toolpanel/toolpaneldeck.cxx | 0 svtools/source/toolpanel/toolpaneldeckpeer.cxx | 0 svtools/source/toolpanel/toolpaneldeckpeer.hxx | 0 svtools/workben/toolpanel/toolpaneltest.cxx | 0 transex3/java/jpropex/build.xml | 0 transex3/java/jpropex/jpropex | 0 transex3/java/jpropex/jpropex.MF | 0 transex3/java/jpropex/makefile.mk | 0 vcl/inc/vcl/abstdlg.hxx | 0 63 files changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 comphelper/inc/comphelper/docpasswordrequest.hxx mode change 100644 => 100755 l10ntools/java/jpropex/build.xml mode change 100644 => 100755 l10ntools/java/jpropex/jpropex mode change 100644 => 100755 l10ntools/java/jpropex/jpropex.MF mode change 100644 => 100755 l10ntools/java/jpropex/makefile.mk mode change 100644 => 100755 svtools/inc/svtools/accessiblefactory.hxx mode change 100644 => 100755 svtools/inc/svtools/toolpanel/decklayouter.hxx mode change 100644 => 100755 svtools/inc/svtools/toolpanel/tablayouter.hxx mode change 100644 => 100755 svtools/inc/svtools/toolpanel/toolpaneldeck.hxx mode change 100644 => 100755 svtools/inc/svtools/xwindowitem.hxx mode change 100644 => 100755 svtools/source/control/asynclink.cxx mode change 100644 => 100755 svtools/source/control/calendar.cxx mode change 100644 => 100755 svtools/source/control/calendar.src mode change 100644 => 100755 svtools/source/control/collatorres.cxx mode change 100644 => 100755 svtools/source/control/ctrlbox.cxx mode change 100644 => 100755 svtools/source/control/ctrlbox.src mode change 100644 => 100755 svtools/source/control/ctrldll.cxx mode change 100644 => 100755 svtools/source/control/ctrltool.cxx mode change 100644 => 100755 svtools/source/control/ctrltool.src mode change 100644 => 100755 svtools/source/control/filectrl.cxx mode change 100644 => 100755 svtools/source/control/filectrl.src mode change 100644 => 100755 svtools/source/control/filectrl2.cxx mode change 100644 => 100755 svtools/source/control/fileurlbox.cxx mode change 100644 => 100755 svtools/source/control/fixedhyper.cxx mode change 100644 => 100755 svtools/source/control/fmtfield.cxx mode change 100644 => 100755 svtools/source/control/headbar.cxx mode change 100644 => 100755 svtools/source/control/hyperlabel.cxx mode change 100644 => 100755 svtools/source/control/indexentryres.cxx mode change 100644 => 100755 svtools/source/control/inettbc.cxx mode change 100644 => 100755 svtools/source/control/makefile.mk mode change 100644 => 100755 svtools/source/control/prgsbar.cxx mode change 100644 => 100755 svtools/source/control/roadmap.cxx mode change 100644 => 100755 svtools/source/control/ruler.cxx mode change 100644 => 100755 svtools/source/control/scriptedtext.cxx mode change 100644 => 100755 svtools/source/control/scrwin.cxx mode change 100644 => 100755 svtools/source/control/stdctrl.cxx mode change 100644 => 100755 svtools/source/control/stdmenu.cxx mode change 100644 => 100755 svtools/source/control/svxbox.cxx mode change 100644 => 100755 svtools/source/control/tabbar.cxx mode change 100644 => 100755 svtools/source/control/taskbar.cxx mode change 100644 => 100755 svtools/source/control/taskbox.cxx mode change 100644 => 100755 svtools/source/control/taskmisc.cxx mode change 100644 => 100755 svtools/source/control/taskstat.cxx mode change 100644 => 100755 svtools/source/control/urlcontrol.cxx mode change 100644 => 100755 svtools/source/control/valueimp.hxx mode change 100644 => 100755 svtools/source/dialogs/makefile.mk mode change 100644 => 100755 svtools/source/misc/makefile.mk mode change 100644 => 100755 svtools/source/misc/svtaccessiblefactory.cxx mode change 100644 => 100755 svtools/source/misc/xwindowitem.cxx mode change 100644 => 100755 svtools/source/toolpanel/makefile.mk mode change 100644 => 100755 svtools/source/toolpanel/paneldecklisteners.cxx mode change 100644 => 100755 svtools/source/toolpanel/paneldecklisteners.hxx mode change 100644 => 100755 svtools/source/toolpanel/paneltabbar.cxx mode change 100644 => 100755 svtools/source/toolpanel/tablayouter.cxx mode change 100644 => 100755 svtools/source/toolpanel/toolpaneldeck.cxx mode change 100644 => 100755 svtools/source/toolpanel/toolpaneldeckpeer.cxx mode change 100644 => 100755 svtools/source/toolpanel/toolpaneldeckpeer.hxx mode change 100644 => 100755 svtools/workben/toolpanel/toolpaneltest.cxx mode change 100644 => 100755 transex3/java/jpropex/build.xml mode change 100644 => 100755 transex3/java/jpropex/jpropex mode change 100644 => 100755 transex3/java/jpropex/jpropex.MF mode change 100644 => 100755 transex3/java/jpropex/makefile.mk mode change 100644 => 100755 vcl/inc/vcl/abstdlg.hxx diff --git a/comphelper/inc/comphelper/docpasswordrequest.hxx b/comphelper/inc/comphelper/docpasswordrequest.hxx old mode 100644 new mode 100755 diff --git a/l10ntools/java/jpropex/build.xml b/l10ntools/java/jpropex/build.xml old mode 100644 new mode 100755 diff --git a/l10ntools/java/jpropex/jpropex b/l10ntools/java/jpropex/jpropex old mode 100644 new mode 100755 diff --git a/l10ntools/java/jpropex/jpropex.MF b/l10ntools/java/jpropex/jpropex.MF old mode 100644 new mode 100755 diff --git a/l10ntools/java/jpropex/makefile.mk b/l10ntools/java/jpropex/makefile.mk old mode 100644 new mode 100755 diff --git a/svtools/inc/svtools/accessiblefactory.hxx b/svtools/inc/svtools/accessiblefactory.hxx old mode 100644 new mode 100755 diff --git a/svtools/inc/svtools/toolpanel/decklayouter.hxx b/svtools/inc/svtools/toolpanel/decklayouter.hxx old mode 100644 new mode 100755 diff --git a/svtools/inc/svtools/toolpanel/tablayouter.hxx b/svtools/inc/svtools/toolpanel/tablayouter.hxx old mode 100644 new mode 100755 diff --git a/svtools/inc/svtools/toolpanel/toolpaneldeck.hxx b/svtools/inc/svtools/toolpanel/toolpaneldeck.hxx old mode 100644 new mode 100755 diff --git a/svtools/inc/svtools/xwindowitem.hxx b/svtools/inc/svtools/xwindowitem.hxx old mode 100644 new mode 100755 diff --git a/svtools/source/control/asynclink.cxx b/svtools/source/control/asynclink.cxx old mode 100644 new mode 100755 diff --git a/svtools/source/control/calendar.cxx b/svtools/source/control/calendar.cxx old mode 100644 new mode 100755 diff --git a/svtools/source/control/calendar.src b/svtools/source/control/calendar.src old mode 100644 new mode 100755 diff --git a/svtools/source/control/collatorres.cxx b/svtools/source/control/collatorres.cxx old mode 100644 new mode 100755 diff --git a/svtools/source/control/ctrlbox.cxx b/svtools/source/control/ctrlbox.cxx old mode 100644 new mode 100755 diff --git a/svtools/source/control/ctrlbox.src b/svtools/source/control/ctrlbox.src old mode 100644 new mode 100755 diff --git a/svtools/source/control/ctrldll.cxx b/svtools/source/control/ctrldll.cxx old mode 100644 new mode 100755 diff --git a/svtools/source/control/ctrltool.cxx b/svtools/source/control/ctrltool.cxx old mode 100644 new mode 100755 diff --git a/svtools/source/control/ctrltool.src b/svtools/source/control/ctrltool.src old mode 100644 new mode 100755 diff --git a/svtools/source/control/filectrl.cxx b/svtools/source/control/filectrl.cxx old mode 100644 new mode 100755 diff --git a/svtools/source/control/filectrl.src b/svtools/source/control/filectrl.src old mode 100644 new mode 100755 diff --git a/svtools/source/control/filectrl2.cxx b/svtools/source/control/filectrl2.cxx old mode 100644 new mode 100755 diff --git a/svtools/source/control/fileurlbox.cxx b/svtools/source/control/fileurlbox.cxx old mode 100644 new mode 100755 diff --git a/svtools/source/control/fixedhyper.cxx b/svtools/source/control/fixedhyper.cxx old mode 100644 new mode 100755 diff --git a/svtools/source/control/fmtfield.cxx b/svtools/source/control/fmtfield.cxx old mode 100644 new mode 100755 diff --git a/svtools/source/control/headbar.cxx b/svtools/source/control/headbar.cxx old mode 100644 new mode 100755 diff --git a/svtools/source/control/hyperlabel.cxx b/svtools/source/control/hyperlabel.cxx old mode 100644 new mode 100755 diff --git a/svtools/source/control/indexentryres.cxx b/svtools/source/control/indexentryres.cxx old mode 100644 new mode 100755 diff --git a/svtools/source/control/inettbc.cxx b/svtools/source/control/inettbc.cxx old mode 100644 new mode 100755 diff --git a/svtools/source/control/makefile.mk b/svtools/source/control/makefile.mk old mode 100644 new mode 100755 diff --git a/svtools/source/control/prgsbar.cxx b/svtools/source/control/prgsbar.cxx old mode 100644 new mode 100755 diff --git a/svtools/source/control/roadmap.cxx b/svtools/source/control/roadmap.cxx old mode 100644 new mode 100755 diff --git a/svtools/source/control/ruler.cxx b/svtools/source/control/ruler.cxx old mode 100644 new mode 100755 diff --git a/svtools/source/control/scriptedtext.cxx b/svtools/source/control/scriptedtext.cxx old mode 100644 new mode 100755 diff --git a/svtools/source/control/scrwin.cxx b/svtools/source/control/scrwin.cxx old mode 100644 new mode 100755 diff --git a/svtools/source/control/stdctrl.cxx b/svtools/source/control/stdctrl.cxx old mode 100644 new mode 100755 diff --git a/svtools/source/control/stdmenu.cxx b/svtools/source/control/stdmenu.cxx old mode 100644 new mode 100755 diff --git a/svtools/source/control/svxbox.cxx b/svtools/source/control/svxbox.cxx old mode 100644 new mode 100755 diff --git a/svtools/source/control/tabbar.cxx b/svtools/source/control/tabbar.cxx old mode 100644 new mode 100755 diff --git a/svtools/source/control/taskbar.cxx b/svtools/source/control/taskbar.cxx old mode 100644 new mode 100755 diff --git a/svtools/source/control/taskbox.cxx b/svtools/source/control/taskbox.cxx old mode 100644 new mode 100755 diff --git a/svtools/source/control/taskmisc.cxx b/svtools/source/control/taskmisc.cxx old mode 100644 new mode 100755 diff --git a/svtools/source/control/taskstat.cxx b/svtools/source/control/taskstat.cxx old mode 100644 new mode 100755 diff --git a/svtools/source/control/urlcontrol.cxx b/svtools/source/control/urlcontrol.cxx old mode 100644 new mode 100755 diff --git a/svtools/source/control/valueimp.hxx b/svtools/source/control/valueimp.hxx old mode 100644 new mode 100755 diff --git a/svtools/source/dialogs/makefile.mk b/svtools/source/dialogs/makefile.mk old mode 100644 new mode 100755 diff --git a/svtools/source/misc/makefile.mk b/svtools/source/misc/makefile.mk old mode 100644 new mode 100755 diff --git a/svtools/source/misc/svtaccessiblefactory.cxx b/svtools/source/misc/svtaccessiblefactory.cxx old mode 100644 new mode 100755 diff --git a/svtools/source/misc/xwindowitem.cxx b/svtools/source/misc/xwindowitem.cxx old mode 100644 new mode 100755 diff --git a/svtools/source/toolpanel/makefile.mk b/svtools/source/toolpanel/makefile.mk old mode 100644 new mode 100755 diff --git a/svtools/source/toolpanel/paneldecklisteners.cxx b/svtools/source/toolpanel/paneldecklisteners.cxx old mode 100644 new mode 100755 diff --git a/svtools/source/toolpanel/paneldecklisteners.hxx b/svtools/source/toolpanel/paneldecklisteners.hxx old mode 100644 new mode 100755 diff --git a/svtools/source/toolpanel/paneltabbar.cxx b/svtools/source/toolpanel/paneltabbar.cxx old mode 100644 new mode 100755 diff --git a/svtools/source/toolpanel/tablayouter.cxx b/svtools/source/toolpanel/tablayouter.cxx old mode 100644 new mode 100755 diff --git a/svtools/source/toolpanel/toolpaneldeck.cxx b/svtools/source/toolpanel/toolpaneldeck.cxx old mode 100644 new mode 100755 diff --git a/svtools/source/toolpanel/toolpaneldeckpeer.cxx b/svtools/source/toolpanel/toolpaneldeckpeer.cxx old mode 100644 new mode 100755 diff --git a/svtools/source/toolpanel/toolpaneldeckpeer.hxx b/svtools/source/toolpanel/toolpaneldeckpeer.hxx old mode 100644 new mode 100755 diff --git a/svtools/workben/toolpanel/toolpaneltest.cxx b/svtools/workben/toolpanel/toolpaneltest.cxx old mode 100644 new mode 100755 diff --git a/transex3/java/jpropex/build.xml b/transex3/java/jpropex/build.xml old mode 100644 new mode 100755 diff --git a/transex3/java/jpropex/jpropex b/transex3/java/jpropex/jpropex old mode 100644 new mode 100755 diff --git a/transex3/java/jpropex/jpropex.MF b/transex3/java/jpropex/jpropex.MF old mode 100644 new mode 100755 diff --git a/transex3/java/jpropex/makefile.mk b/transex3/java/jpropex/makefile.mk old mode 100644 new mode 100755 diff --git a/vcl/inc/vcl/abstdlg.hxx b/vcl/inc/vcl/abstdlg.hxx old mode 100644 new mode 100755 -- cgit v1.2.3 From 1086d8c4ec1339dc7be45e497f676d8f282360b8 Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Thu, 26 Aug 2010 15:02:13 +0200 Subject: impress200: #i114123# fix graphics context refcount for drawEPS --- vcl/aqua/source/gdi/salgdi.cxx | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/vcl/aqua/source/gdi/salgdi.cxx b/vcl/aqua/source/gdi/salgdi.cxx index 8a4744d1efcd..ca3fcc04769a 100644 --- a/vcl/aqua/source/gdi/salgdi.cxx +++ b/vcl/aqua/source/gdi/salgdi.cxx @@ -1453,16 +1453,24 @@ BOOL AquaSalGraphics::drawEPS( long nX, long nY, long nWidth, long nHeight, // prepare the target context NSGraphicsContext* pOrigNSCtx = [NSGraphicsContext currentContext]; + [pOrigNSCtx retain]; + + // create new context NSGraphicsContext* pDrawNSCtx = [NSGraphicsContext graphicsContextWithGraphicsPort: mrContext flipped: IsFlipped()]; + // set it, setCurrentContext also releases the prviously set one [NSGraphicsContext setCurrentContext: pDrawNSCtx]; + // draw the EPS const NSRect aDstRect = {{nX,nY},{nWidth,nHeight}}; const BOOL bOK = [xEpsImage drawInRect: aDstRect]; + + // restore the NSGraphicsContext + [NSGraphicsContext setCurrentContext: pOrigNSCtx]; + [pOrigNSCtx release]; // restore the original retain count + CGContextRestoreGState( mrContext ); // mark the destination rectangle as updated RefreshRect( aDstRect ); - // restore the NSGraphicsContext, TODO: do we need this? - [NSGraphicsContext setCurrentContext: pOrigNSCtx]; return bOK; } -- cgit v1.2.3 From 4c4cca5a49da75f24e860a7612cd45f552de8f7d Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Thu, 29 Apr 2010 10:05:04 +0200 Subject: fs33a: #i111238# add support for images to AWT's ListBoxControl/Model --- toolkit/inc/toolkit/awt/vclxwindows.hxx | 31 +- toolkit/inc/toolkit/controls/roadmapcontrol.hxx | 6 - toolkit/inc/toolkit/controls/unocontrol.hxx | 2 +- toolkit/inc/toolkit/controls/unocontrolmodel.hxx | 1 - toolkit/inc/toolkit/controls/unocontrols.hxx | 123 +++-- toolkit/source/awt/vclxwindows.cxx | 136 +++++- toolkit/source/controls/unocontrolmodel.cxx | 21 +- toolkit/source/controls/unocontrols.cxx | 558 +++++++++++++++++++++-- vcl/inc/vcl/lstbox.hxx | 1 + vcl/source/control/lstbox.cxx | 9 + 10 files changed, 759 insertions(+), 129 deletions(-) diff --git a/toolkit/inc/toolkit/awt/vclxwindows.hxx b/toolkit/inc/toolkit/awt/vclxwindows.hxx index c334e4d9af65..8efe01b526ba 100644 --- a/toolkit/inc/toolkit/awt/vclxwindows.hxx +++ b/toolkit/inc/toolkit/awt/vclxwindows.hxx @@ -83,7 +83,9 @@ #include #include #include +#include #include +#include #include #include "toolkit/awt/vclxwindow.hxx" @@ -677,9 +679,12 @@ public: // ---------------------------------------------------- // class VCLXListBox // ---------------------------------------------------- -class VCLXListBox : public ::com::sun::star::awt::XListBox, - public ::com::sun::star::awt::XTextLayoutConstrains, - public VCLXWindow +typedef ::cppu::ImplInheritanceHelper3 < VCLXWindow + , ::com::sun::star::awt::XListBox + , ::com::sun::star::awt::XTextLayoutConstrains + , ::com::sun::star::awt::XItemListListener + > VCLXListBox_Base; +class VCLXListBox : public VCLXListBox_Base { private: ActionListenerMultiplexer maActionListeners; @@ -694,16 +699,6 @@ protected: public: VCLXListBox(); - // ::com::sun::star::uno::XInterface - ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException); - void SAL_CALL acquire() throw() { OWeakObject::acquire(); } - void SAL_CALL release() throw() { OWeakObject::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); - - // ::com::sun::star::lang::XComponent void SAL_CALL dispose( ) throw(::com::sun::star::uno::RuntimeException); @@ -744,6 +739,16 @@ public: void SAL_CALL setProperty( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Any& Value ) throw(::com::sun::star::uno::RuntimeException); ::com::sun::star::uno::Any SAL_CALL getProperty( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::uno::RuntimeException); + // XItemListListener + virtual void SAL_CALL listItemInserted( const ::com::sun::star::awt::ItemListEvent& Event ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL listItemRemoved( const ::com::sun::star::awt::ItemListEvent& Event ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL listItemModified( const ::com::sun::star::awt::ItemListEvent& Event ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL allItemsRemoved( const ::com::sun::star::lang::EventObject& Event ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL itemListChanged( const ::com::sun::star::lang::EventObject& Event ) throw (::com::sun::star::uno::RuntimeException); + + // XEventListener + virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& i_rEvent ) throw (::com::sun::star::uno::RuntimeException); + static void ImplGetPropertyIds( std::list< sal_uInt16 > &aIds ); virtual void GetPropertyIds( std::list< sal_uInt16 > &aIds ) { return ImplGetPropertyIds( aIds ); } }; diff --git a/toolkit/inc/toolkit/controls/roadmapcontrol.hxx b/toolkit/inc/toolkit/controls/roadmapcontrol.hxx index 7ac858a6a7b7..46f31947b276 100644 --- a/toolkit/inc/toolkit/controls/roadmapcontrol.hxx +++ b/toolkit/inc/toolkit/controls/roadmapcontrol.hxx @@ -132,15 +132,9 @@ namespace toolkit{ // ::com::sun::star::io::XPersistObject ::rtl::OUString SAL_CALL getServiceName() throw(::com::sun::star::uno::RuntimeException); - // ::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::lang::XServiceInfo DECLIMPL_SERVICEINFO_DERIVED( UnoControlRoadmapModel, UnoControlModel, szServiceName2_UnoControlRoadmapModel ) -// void ImplPropertyChanged( sal_uInt16 nPropId ); - sal_Int32 SAL_CALL getCount() throw (RuntimeException); virtual Any SAL_CALL getByIndex( sal_Int32 Index ) throw (IndexOutOfBoundsException, WrappedTargetException, RuntimeException ); diff --git a/toolkit/inc/toolkit/controls/unocontrol.hxx b/toolkit/inc/toolkit/controls/unocontrol.hxx index 578b5070e8e8..19d498ef2a85 100644 --- a/toolkit/inc/toolkit/controls/unocontrol.hxx +++ b/toolkit/inc/toolkit/controls/unocontrol.hxx @@ -119,7 +119,7 @@ protected: ::osl::Mutex& GetMutex() { return maMutex; } ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow > getParentPeer() const; - void updateFromModel(); + virtual void updateFromModel(); void peerCreated(); bool ImplCheckLocalize( ::rtl::OUString& _rPossiblyLocalizable ); ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer > ImplGetCompatiblePeer( sal_Bool bAcceptExistingPeer ); diff --git a/toolkit/inc/toolkit/controls/unocontrolmodel.hxx b/toolkit/inc/toolkit/controls/unocontrolmodel.hxx index 2de5e36aa02c..a443cb4d2d6b 100644 --- a/toolkit/inc/toolkit/controls/unocontrolmodel.hxx +++ b/toolkit/inc/toolkit/controls/unocontrolmodel.hxx @@ -74,7 +74,6 @@ protected: void ImplRegisterProperties( const std::list< sal_uInt16 > &rIds ); void ImplRegisterProperty( sal_uInt16 nPropId, const ::com::sun::star::uno::Any& rDefault ); ::com::sun::star::uno::Sequence ImplGetPropertyIds() const; - virtual void ImplPropertyChanged( sal_uInt16 nPropId ); virtual ::com::sun::star::uno::Any ImplGetDefaultValue( sal_uInt16 nPropId ) const; sal_Bool ImplHasProperty( sal_uInt16 nPropId ) const; diff --git a/toolkit/inc/toolkit/controls/unocontrols.hxx b/toolkit/inc/toolkit/controls/unocontrols.hxx index a4015dfd3b44..5c612c887859 100644 --- a/toolkit/inc/toolkit/controls/unocontrols.hxx +++ b/toolkit/inc/toolkit/controls/unocontrols.hxx @@ -51,6 +51,7 @@ #include #include #include +#include #include #include #include @@ -58,12 +59,17 @@ #include #include #include +#include #include #include #include #include #include +#include + +#include +#include #define UNO_NAME_GRAPHOBJ_URLPREFIX "vnd.sun.star.GraphicObject:" #define UNO_NAME_GRAPHOBJ_URLPKGPREFIX "vnd.sun.star.Package:" @@ -751,19 +757,18 @@ public: // ---------------------------------------------------- // class UnoControlListBoxModel // ---------------------------------------------------- -class UnoControlListBoxModel : public UnoControlModel +struct UnoControlListBoxModel_Data; +typedef ::cppu::AggImplInheritanceHelper1 < UnoControlModel + , ::com::sun::star::awt::XItemList + > UnoControlListBoxModel_Base; +class UnoControlListBoxModel :public UnoControlListBoxModel_Base { -protected: - ::com::sun::star::uno::Any ImplGetDefaultValue( sal_uInt16 nPropId ) const; - ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper(); - public: UnoControlListBoxModel(); - UnoControlListBoxModel( const UnoControlListBoxModel& rModel ) : UnoControlModel( rModel ) {;} + UnoControlListBoxModel( const UnoControlListBoxModel& i_rSource ); UnoControlModel* Clone() const { return new UnoControlListBoxModel( *this ); } - void ImplPropertyChanged( sal_uInt16 nPropId ); virtual void ImplNormalizePropertySequence( const sal_Int32 _nCount, /// the number of entries in the arrays sal_Int32* _pHandles, /// the handles of the properties to set @@ -780,41 +785,85 @@ public: // ::com::sun::star::lang::XServiceInfo DECLIMPL_SERVICEINFO_DERIVED( UnoControlListBoxModel, UnoControlModel, szServiceName2_UnoControlListBoxModel ) + // ::com::sun::star::awt::XItemList + virtual ::sal_Int32 SAL_CALL getItemCount() throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL insertItem( ::sal_Int32 Position, const ::rtl::OUString& ItemText, const ::rtl::OUString& ItemImageURL ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL insertItemText( ::sal_Int32 Position, const ::rtl::OUString& ItemText ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL insertItemImage( ::sal_Int32 Position, const ::rtl::OUString& ItemImageURL ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeItem( ::sal_Int32 Position ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeAllItems( ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setItemText( ::sal_Int32 Position, const ::rtl::OUString& ItemText ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setItemImage( ::sal_Int32 Position, const ::rtl::OUString& ItemImageURL ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setItemTextAndImage( ::sal_Int32 Position, const ::rtl::OUString& ItemText, const ::rtl::OUString& ItemImageURL ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); + virtual ::rtl::OUString SAL_CALL getItemText( ::sal_Int32 Position ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); + virtual ::rtl::OUString SAL_CALL getItemImage( ::sal_Int32 Position ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::beans::Pair< ::rtl::OUString, ::rtl::OUString > SAL_CALL getItemTextAndImage( ::sal_Int32 Position ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Pair< ::rtl::OUString, ::rtl::OUString > > SAL_CALL getAllItems( ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL addItemListListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XItemListListener >& Listener ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeItemListListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XItemListListener >& Listener ) throw (::com::sun::star::uno::RuntimeException); + + // OPropertySetHelper + void SAL_CALL setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, const ::com::sun::star::uno::Any& rValue ) throw (::com::sun::star::uno::Exception); + +protected: + ::com::sun::star::uno::Any ImplGetDefaultValue( sal_uInt16 nPropId ) const; + ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper(); + +private: + void impl_notifyItemListEvent_nolck( + const sal_Int32 i_nItemPosition, + const ::boost::optional< ::rtl::OUString >& i_rItemText, + const ::boost::optional< ::rtl::OUString >& i_rItemImageURL, + void ( SAL_CALL ::com::sun::star::awt::XItemListListener::*NotificationMethod )( const ::com::sun::star::awt::ItemListEvent& ) + ); + + void impl_handleInsert( + const sal_Int32 i_nItemPosition, + const ::boost::optional< ::rtl::OUString >& i_rItemText, + const ::boost::optional< ::rtl::OUString >& i_rItemImageURL, + ::osl::ClearableMutexGuard& i_rClearBeforeNotify + ); + + void impl_handleRemove( + const sal_Int32 i_nItemPosition, + ::osl::ClearableMutexGuard& i_rClearBeforeNotify + ); + + void impl_handleModify( + const sal_Int32 i_nItemPosition, + const ::boost::optional< ::rtl::OUString >& i_rItemText, + const ::boost::optional< ::rtl::OUString >& i_rItemImageURL, + ::osl::ClearableMutexGuard& i_rClearBeforeNotify + ); + + void impl_getStringItemList( ::std::vector< ::rtl::OUString >& o_rStringItems ) const; + void impl_setStringItemList_nolck( const ::std::vector< ::rtl::OUString >& i_rStringItems ); + +private: + ::boost::scoped_ptr< UnoControlListBoxModel_Data > m_pData; + ::cppu::OInterfaceContainerHelper m_aItemListListeners; }; // ---------------------------------------------------- // class UnoListBoxControl // ---------------------------------------------------- -class UnoListBoxControl : public UnoControlBase, - public ::com::sun::star::awt::XListBox, - public ::com::sun::star::awt::XItemListener, - public ::com::sun::star::awt::XLayoutConstrains, - public ::com::sun::star::awt::XTextLayoutConstrains +typedef ::cppu::AggImplInheritanceHelper5 < UnoControlBase + , ::com::sun::star::awt::XListBox + , ::com::sun::star::awt::XItemListener + , ::com::sun::star::awt::XLayoutConstrains + , ::com::sun::star::awt::XTextLayoutConstrains + , ::com::sun::star::awt::XItemListListener + > UnoListBoxControl_Base; +class UnoListBoxControl : public UnoListBoxControl_Base { -private: - ActionListenerMultiplexer maActionListeners; - ItemListenerMultiplexer maItemListeners; - public: - UnoListBoxControl(); ::rtl::OUString GetComponentServiceName(); - void ImplUpdateSelectedItemsProperty(); - void ImplSetPeerProperty( const ::rtl::OUString& rPropName, const ::com::sun::star::uno::Any& rVal ); - - ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException) { return UnoControlBase::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 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); void SAL_CALL dispose( ) throw(::com::sun::star::uno::RuntimeException); void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw(::com::sun::star::uno::RuntimeException) { UnoControlBase::disposing( Source ); } - // ::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); - // ::com::sun::star::awt::XListBox void SAL_CALL addItemListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XItemListener >& l ) throw(::com::sun::star::uno::RuntimeException); void SAL_CALL removeItemListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XItemListener >& l ) throw(::com::sun::star::uno::RuntimeException); @@ -851,9 +900,27 @@ public: ::com::sun::star::awt::Size SAL_CALL getMinimumSize( sal_Int16 nCols, sal_Int16 nLines ) throw(::com::sun::star::uno::RuntimeException); void SAL_CALL getColumnsAndLines( sal_Int16& nCols, sal_Int16& nLines ) throw(::com::sun::star::uno::RuntimeException); + // XUnoControl + sal_Bool SAL_CALL setModel(const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel >& Model) throw ( ::com::sun::star::uno::RuntimeException ); + + // XItemListListener + virtual void SAL_CALL listItemInserted( const ::com::sun::star::awt::ItemListEvent& Event ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL listItemRemoved( const ::com::sun::star::awt::ItemListEvent& Event ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL listItemModified( const ::com::sun::star::awt::ItemListEvent& Event ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL allItemsRemoved( const ::com::sun::star::lang::EventObject& Event ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL itemListChanged( const ::com::sun::star::lang::EventObject& Event ) throw (::com::sun::star::uno::RuntimeException); + // ::com::sun::star::lang::XServiceInfo DECLIMPL_SERVICEINFO_DERIVED( UnoListBoxControl, UnoControlBase, szServiceName2_UnoControlListBox ) +protected: + void ImplUpdateSelectedItemsProperty(); + virtual void ImplSetPeerProperty( const ::rtl::OUString& rPropName, const ::com::sun::star::uno::Any& rVal ); + virtual void updateFromModel(); + +private: + ActionListenerMultiplexer maActionListeners; + ItemListenerMultiplexer maItemListeners; }; // ---------------------------------------------------- diff --git a/toolkit/source/awt/vclxwindows.cxx b/toolkit/source/awt/vclxwindows.cxx index e2fc78421d5e..ff4dc6fb5ec4 100644 --- a/toolkit/source/awt/vclxwindows.cxx +++ b/toolkit/source/awt/vclxwindows.cxx @@ -29,7 +29,7 @@ #include "precompiled_toolkit.hxx" #include #include -#include +#include #include #include #include @@ -43,6 +43,9 @@ #include #include #include +#include +#include +#include #include #ifndef _SV_BUTTON_HXX @@ -58,12 +61,17 @@ #include #include #include -#include +#include using ::com::sun::star::uno::Any; using ::com::sun::star::uno::Reference; using ::com::sun::star::uno::makeAny; +using ::com::sun::star::uno::RuntimeException; +using ::com::sun::star::lang::EventObject; +using ::com::sun::star::awt::ItemListEvent; +using ::com::sun::star::awt::XItemList; using ::com::sun::star::graphic::XGraphic; +using ::com::sun::star::graphic::XGraphicProvider; using namespace ::com::sun::star; using namespace ::com::sun::star::awt::VisualEffect; @@ -1550,22 +1558,6 @@ VCLXListBox::VCLXListBox() { } -// ::com::sun::star::uno::XInterface -::com::sun::star::uno::Any VCLXListBox::queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException) -{ - ::com::sun::star::uno::Any aRet = ::cppu::queryInterface( rType, - SAL_STATIC_CAST( ::com::sun::star::awt::XListBox*, this ), - SAL_STATIC_CAST( ::com::sun::star::awt::XTextLayoutConstrains*, this ) ); - return (aRet.hasValue() ? aRet : VCLXWindow::queryInterface( rType )); -} - -// ::com::sun::star::lang::XTypeProvider -IMPL_XTYPEPROVIDER_START( VCLXListBox ) - getCppuType( ( ::com::sun::star::uno::Reference< ::com::sun::star::awt::XListBox>* ) NULL ), - getCppuType( ( ::com::sun::star::uno::Reference< ::com::sun::star::awt::XTextLayoutConstrains>* ) NULL ), - VCLXWindow::getTypes() -IMPL_XTYPEPROVIDER_END - void VCLXListBox::dispose() throw(::com::sun::star::uno::RuntimeException) { ::vos::OGuard aGuard( GetMutex() ); @@ -2096,6 +2088,114 @@ void VCLXListBox::ImplCallItemListeners() } } +namespace +{ + Image lcl_getImageFromURL( const ::rtl::OUString& i_rImageURL ) + { + if ( !i_rImageURL.getLength() ) + return Image(); + + try + { + ::comphelper::ComponentContext aContext( ::comphelper::getProcessServiceFactory() ); + Reference< XGraphicProvider > xProvider; + if ( aContext.createComponent( "com.sun.star.graphic.GraphicProvider", xProvider ) ) + { + ::comphelper::NamedValueCollection aMediaProperties; + aMediaProperties.put( "URL", i_rImageURL ); + Reference< XGraphic > xGraphic = xProvider->queryGraphic( aMediaProperties.getPropertyValues() ); + return Image( xGraphic ); + } + } + catch( const uno::Exception& ) + { + DBG_UNHANDLED_EXCEPTION(); + } + return Image(); + } +} + +void SAL_CALL VCLXListBox::listItemInserted( const ItemListEvent& i_rEvent ) throw (RuntimeException) +{ + ::vos::OGuard aGuard( GetMutex() ); + + ListBox* pListBox = dynamic_cast< ListBox* >( GetWindow() ); + + ENSURE_OR_RETURN_VOID( pListBox, "VCLXListBox::listItemInserted: no ListBox?!" ); + ENSURE_OR_RETURN_VOID( ( i_rEvent.ItemPosition >= 0 ) && ( i_rEvent.ItemPosition <= sal_Int32( pListBox->GetEntryCount() ) ), + "VCLXListBox::listItemInserted: illegal (inconsistent) item position!" ); + pListBox->InsertEntry( + i_rEvent.ItemText.IsPresent ? i_rEvent.ItemText.Value : ::rtl::OUString(), + i_rEvent.ItemImageURL.IsPresent ? lcl_getImageFromURL( i_rEvent.ItemImageURL.Value ) : Image(), + i_rEvent.ItemPosition ); +} + +void SAL_CALL VCLXListBox::listItemRemoved( const ItemListEvent& i_rEvent ) throw (RuntimeException) +{ + ::vos::OGuard aGuard( GetMutex() ); + + ListBox* pListBox = dynamic_cast< ListBox* >( GetWindow() ); + + ENSURE_OR_RETURN_VOID( pListBox, "VCLXListBox::listItemRemoved: no ListBox?!" ); + ENSURE_OR_RETURN_VOID( ( i_rEvent.ItemPosition >= 0 ) && ( i_rEvent.ItemPosition < sal_Int32( pListBox->GetEntryCount() ) ), + "VCLXListBox::listItemRemoved: illegal (inconsistent) item position!" ); + + pListBox->RemoveEntry( i_rEvent.ItemPosition ); +} + +void SAL_CALL VCLXListBox::listItemModified( const ItemListEvent& i_rEvent ) throw (RuntimeException) +{ + ::vos::OGuard aGuard( GetMutex() ); + + ListBox* pListBox = dynamic_cast< ListBox* >( GetWindow() ); + + ENSURE_OR_RETURN_VOID( pListBox, "VCLXListBox::listItemModified: no ListBox?!" ); + ENSURE_OR_RETURN_VOID( ( i_rEvent.ItemPosition >= 0 ) && ( i_rEvent.ItemPosition < sal_Int32( pListBox->GetEntryCount() ) ), + "VCLXListBox::listItemModified: illegal (inconsistent) item position!" ); + + // VCL's ListBox does not support changing an entry's text or image, so remove and re-insert + + const ::rtl::OUString sNewText = i_rEvent.ItemText.IsPresent ? i_rEvent.ItemText.Value : pListBox->GetEntry( i_rEvent.ItemPosition ); + const Image aNewImage( i_rEvent.ItemImageURL.IsPresent ? lcl_getImageFromURL( i_rEvent.ItemImageURL.Value ) : pListBox->GetEntryImage( i_rEvent.ItemPosition ) ); + + pListBox->RemoveEntry( i_rEvent.ItemPosition ); + pListBox->InsertEntry( sNewText, aNewImage, i_rEvent.ItemPosition ); +} + +void SAL_CALL VCLXListBox::allItemsRemoved( const EventObject& i_rEvent ) throw (RuntimeException) +{ + ::vos::OGuard aGuard( GetMutex() ); + + ListBox* pListBox = dynamic_cast< ListBox* >( GetWindow() ); + ENSURE_OR_RETURN_VOID( pListBox, "VCLXListBox::listItemModified: no ListBox?!" ); + + pListBox->Clear(); + + (void)i_rEvent; +} + +void SAL_CALL VCLXListBox::itemListChanged( const EventObject& i_rEvent ) throw (RuntimeException) +{ + ::vos::OGuard aGuard( GetMutex() ); + + ListBox* pListBox = dynamic_cast< ListBox* >( GetWindow() ); + ENSURE_OR_RETURN_VOID( pListBox, "VCLXListBox::listItemModified: no ListBox?!" ); + + pListBox->Clear(); + + Reference< XItemList > xItemList( i_rEvent.Source, uno::UNO_QUERY_THROW ); + uno::Sequence< beans::Pair< ::rtl::OUString, ::rtl::OUString > > aItems = xItemList->getAllItems(); + for ( sal_Int32 i=0; iInsertEntry( aItems[i].First, lcl_getImageFromURL( aItems[i].Second ) ); + } +} + +void SAL_CALL VCLXListBox::disposing( const EventObject& i_rEvent ) throw (RuntimeException) +{ + // just disambiguate + VCLXWindow::disposing( i_rEvent ); +} // ---------------------------------------------------- // class VCLXMessageBox diff --git a/toolkit/source/controls/unocontrolmodel.cxx b/toolkit/source/controls/unocontrolmodel.cxx index 29b683a5ed40..d34f5d9d9006 100644 --- a/toolkit/source/controls/unocontrolmodel.cxx +++ b/toolkit/source/controls/unocontrolmodel.cxx @@ -216,10 +216,6 @@ sal_Bool UnoControlModel::ImplHasProperty( sal_uInt16 nPropId ) const return mpData->Get( nPropId ) ? sal_True : sal_False; } -void UnoControlModel::ImplPropertyChanged( sal_uInt16 ) -{ -} - ::com::sun::star::uno::Any UnoControlModel::ImplGetDefaultValue( sal_uInt16 nPropId ) const { ::com::sun::star::uno::Any aDefault; @@ -1259,22 +1255,13 @@ sal_Bool UnoControlModel::convertFastPropertyValue( Any & rConvertedValue, Any & void UnoControlModel::setFastPropertyValue_NoBroadcast( sal_Int32 nPropId, const ::com::sun::star::uno::Any& rValue ) throw (::com::sun::star::uno::Exception) { - ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() ); - // Fehlt: Die gefakten Einzelproperties des FontDescriptors... ImplControlProperty* pProp = mpData->Get( nPropId ); - if ( pProp ) - { - DBG_ASSERT( ( rValue.getValueType().getTypeClass() != ::com::sun::star::uno::TypeClass_VOID ) || ( GetPropertyAttribs( (sal_uInt16)nPropId ) & ::com::sun::star::beans::PropertyAttribute::MAYBEVOID ), "Property darf nicht VOID sein!" ); - ImplPropertyChanged( (sal_uInt16)nPropId ); - pProp->SetValue( rValue ); - } - else - { - // exception... - DBG_ERROR( "SetPropertyValues: Invalid Property!" ); - } + ENSURE_OR_RETURN_VOID( pProp, "UnoControlModel::setFastPropertyValue_NoBroadcast: invalid property id!" ); + + DBG_ASSERT( ( rValue.getValueType().getTypeClass() != ::com::sun::star::uno::TypeClass_VOID ) || ( GetPropertyAttribs( (sal_uInt16)nPropId ) & ::com::sun::star::beans::PropertyAttribute::MAYBEVOID ), "Property darf nicht VOID sein!" ); + pProp->SetValue( rValue ); } void UnoControlModel::getFastPropertyValue( ::com::sun::star::uno::Any& rValue, sal_Int32 nPropId ) const diff --git a/toolkit/source/controls/unocontrols.cxx b/toolkit/source/controls/unocontrols.cxx index ae9e59d045e7..a4b7037b3b73 100644 --- a/toolkit/source/controls/unocontrols.cxx +++ b/toolkit/source/controls/unocontrols.cxx @@ -73,8 +73,11 @@ #include #include +#include using namespace ::com::sun::star; +using ::com::sun::star::graphic::XGraphic; +using ::com::sun::star::uno::Reference; using namespace ::toolkit; @@ -1841,19 +1844,100 @@ sal_Bool UnoGroupBoxControl::isTransparent() throw(uno::RuntimeException) return sal_True; } -// ---------------------------------------------------- -// class UnoControlListBoxModel -// ---------------------------------------------------- +// ===================================================================================================================== +// = UnoControlListBoxModel_Data +// ===================================================================================================================== +typedef beans::Pair< ::rtl::OUString, ::rtl::OUString > ListItem; +struct UnoControlListBoxModel_Data +{ + UnoControlListBoxModel_Data( UnoControlListBoxModel& i_rAntiImpl ) + :m_rAntiImpl( i_rAntiImpl ) + ,m_aListItems() + ,m_bSettingLegacyProperty( false ) + { + } + + sal_Int32 getItemCount() const { return sal_Int32( m_aListItems.size() ); } + + const ListItem& getItem( const sal_Int32 i_nIndex ) const + { + if ( ( i_nIndex < 0 ) || ( i_nIndex >= sal_Int32( m_aListItems.size() ) ) ) + throw IndexOutOfBoundsException( ::rtl::OUString(), m_rAntiImpl ); + return m_aListItems[ i_nIndex ]; + } + + ListItem& getItem( const sal_Int32 i_nIndex ) + { + return const_cast< ListItem& >( static_cast< const UnoControlListBoxModel_Data* >( this )->getItem( i_nIndex ) ); + } + + ListItem& insertItem( const sal_Int32 i_nIndex ) + { + if ( ( i_nIndex < 0 ) || ( i_nIndex > sal_Int32( m_aListItems.size() ) ) ) + throw IndexOutOfBoundsException( ::rtl::OUString(), m_rAntiImpl ); + return *m_aListItems.insert( m_aListItems.begin() + i_nIndex, ListItem() ); + } + + Sequence< ListItem > getAllItems() const + { + Sequence< ListItem > aItems( sal_Int32( m_aListItems.size() ) ); + ::std::copy( m_aListItems.begin(), m_aListItems.end(), aItems.getArray() ); + return aItems; + } + + void setAllItems( const ::std::vector< ListItem >& i_rItems ) + { + m_aListItems = i_rItems; + } + + void removeItem( const sal_Int32 i_nIndex ) + { + if ( ( i_nIndex < 0 ) || ( i_nIndex >= sal_Int32( m_aListItems.size() ) ) ) + throw IndexOutOfBoundsException( ::rtl::OUString(), m_rAntiImpl ); + m_aListItems.erase( m_aListItems.begin() + i_nIndex ); + } + + void removeAllItems() + { + ::std::vector< ListItem > aEmpty; + m_aListItems.swap( aEmpty ); + } + +public: + bool m_bSettingLegacyProperty; + +private: + UnoControlListBoxModel& m_rAntiImpl; + ::std::vector< ListItem > m_aListItems; +}; + +// ===================================================================================================================== +// = UnoControlListBoxModel +// ===================================================================================================================== +// --------------------------------------------------------------------------------------------------------------------- UnoControlListBoxModel::UnoControlListBoxModel() + :UnoControlListBoxModel_Base() + ,m_pData( new UnoControlListBoxModel_Data( *this ) ) + ,m_aItemListListeners( GetMutex() ) { UNO_CONTROL_MODEL_REGISTER_PROPERTIES( VCLXListBox ); } +// --------------------------------------------------------------------------------------------------------------------- +UnoControlListBoxModel::UnoControlListBoxModel( const UnoControlListBoxModel& i_rSource ) + :UnoControlListBoxModel_Base( i_rSource ) + ,m_pData( new UnoControlListBoxModel_Data( *this ) ) + ,m_aItemListListeners( GetMutex() ) +{ +} + +// --------------------------------------------------------------------------------------------------------------------- ::rtl::OUString UnoControlListBoxModel::getServiceName() throw(::com::sun::star::uno::RuntimeException) { return ::rtl::OUString::createFromAscii( szServiceName_UnoControlListBoxModel ); } +// --------------------------------------------------------------------------------------------------------------------- uno::Any UnoControlListBoxModel::ImplGetDefaultValue( sal_uInt16 nPropId ) const { if ( nPropId == BASEPROPERTY_DEFAULTCONTROL ) @@ -1865,6 +1949,7 @@ uno::Any UnoControlListBoxModel::ImplGetDefaultValue( sal_uInt16 nPropId ) const return UnoControlModel::ImplGetDefaultValue( nPropId ); } +// --------------------------------------------------------------------------------------------------------------------- ::cppu::IPropertyArrayHelper& UnoControlListBoxModel::getInfoHelper() { static UnoPropertyArrayHelper* pHelper = NULL; @@ -1876,6 +1961,7 @@ uno::Any UnoControlListBoxModel::ImplGetDefaultValue( sal_uInt16 nPropId ) const return *pHelper; } +// --------------------------------------------------------------------------------------------------------------------- // beans::XMultiPropertySet uno::Reference< beans::XPropertySetInfo > UnoControlListBoxModel::getPropertySetInfo( ) throw(uno::RuntimeException) { @@ -1883,19 +1969,61 @@ uno::Reference< beans::XPropertySetInfo > UnoControlListBoxModel::getPropertySet return xInfo; } -void UnoControlListBoxModel::ImplPropertyChanged( sal_uInt16 nPropId ) +// --------------------------------------------------------------------------------------------------------------------- +namespace +{ + struct CreateListItem : public ::std::unary_function< ::rtl::OUString, ListItem > + { + ListItem operator()( const ::rtl::OUString& i_rItemText ) + { + return ListItem( i_rItemText, ::rtl::OUString() ); + } + }; +} + +// --------------------------------------------------------------------------------------------------------------------- +void SAL_CALL UnoControlListBoxModel::setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, const uno::Any& rValue ) throw (uno::Exception) { - if ( nPropId == BASEPROPERTY_STRINGITEMLIST ) + UnoControlModel::setFastPropertyValue_NoBroadcast( nHandle, rValue ); + + if ( nHandle == BASEPROPERTY_STRINGITEMLIST ) { + // reset selection uno::Sequence aSeq; uno::Any aAny; aAny <<= aSeq; setPropertyValue( GetPropertyName( BASEPROPERTY_SELECTEDITEMS ), aAny ); - } - UnoControlModel::ImplPropertyChanged( nPropId ); + if ( !m_pData->m_bSettingLegacyProperty ) + { + // synchronize the legacy StringItemList property with our list items + Sequence< ::rtl::OUString > aStringItemList; + Any aPropValue; + getFastPropertyValue( aPropValue, BASEPROPERTY_STRINGITEMLIST ); + OSL_VERIFY( aPropValue >>= aStringItemList ); + + ::std::vector< ListItem > aItems( aStringItemList.getLength() ); + ::std::transform( + aStringItemList.getConstArray(), + aStringItemList.getConstArray() + aStringItemList.getLength(), + aItems.begin(), + CreateListItem() + ); + m_pData->setAllItems( aItems ); + + // since an XItemListListener does not have a "all items modified" or some such method, + // we simulate this by notifying removal of all items, followed by insertion of all new + // items + lang::EventObject aEvent; + aEvent.Source = *this; + m_aItemListListeners.notifyEach( &XItemListListener::itemListChanged, aEvent ); + // TODO: OPropertySetHelper calls into this method with the mutex locked ... + // which is wrong for the above notifications ... + } + } } +// --------------------------------------------------------------------------------------------------------------------- void UnoControlListBoxModel::ImplNormalizePropertySequence( const sal_Int32 _nCount, sal_Int32* _pHandles, uno::Any* _pValues, sal_Int32* _pValidHandles ) const SAL_THROW(()) { @@ -1906,12 +2034,311 @@ void UnoControlListBoxModel::ImplNormalizePropertySequence( const sal_Int32 _nCo UnoControlModel::ImplNormalizePropertySequence( _nCount, _pHandles, _pValues, _pValidHandles ); } +// --------------------------------------------------------------------------------------------------------------------- +::sal_Int32 SAL_CALL UnoControlListBoxModel::getItemCount() throw (RuntimeException) +{ + ::osl::MutexGuard aGuard( GetMutex() ); + return m_pData->getItemCount(); +} + +// --------------------------------------------------------------------------------------------------------------------- +void SAL_CALL UnoControlListBoxModel::insertItem( ::sal_Int32 i_nPosition, const ::rtl::OUString& i_rItemText, const ::rtl::OUString& i_rItemImageURL ) throw (IndexOutOfBoundsException, RuntimeException) +{ + ::osl::ClearableMutexGuard aGuard( GetMutex() ); + // SYNCHRONIZED -----> + ListItem& rItem( m_pData->insertItem( i_nPosition ) ); + rItem.First = i_rItemText; + rItem.Second = i_rItemImageURL; + + impl_handleInsert( i_nPosition, i_rItemText, i_rItemImageURL, aGuard ); + // <----- SYNCHRONIZED +} + +// --------------------------------------------------------------------------------------------------------------------- +void SAL_CALL UnoControlListBoxModel::insertItemText( ::sal_Int32 i_nPosition, const ::rtl::OUString& i_rItemText ) throw (IndexOutOfBoundsException, RuntimeException) +{ + ::osl::ClearableMutexGuard aGuard( GetMutex() ); + // SYNCHRONIZED -----> + ListItem& rItem( m_pData->insertItem( i_nPosition ) ); + rItem.First = i_rItemText; + + impl_handleInsert( i_nPosition, i_rItemText, ::boost::optional< ::rtl::OUString >(), aGuard ); + // <----- SYNCHRONIZED +} + +// --------------------------------------------------------------------------------------------------------------------- +void SAL_CALL UnoControlListBoxModel::insertItemImage( ::sal_Int32 i_nPosition, const ::rtl::OUString& i_rItemImageURL ) throw (IndexOutOfBoundsException, RuntimeException) +{ + ::osl::ClearableMutexGuard aGuard( GetMutex() ); + // SYNCHRONIZED -----> + ListItem& rItem( m_pData->insertItem( i_nPosition ) ); + rItem.Second = i_rItemImageURL; + + impl_handleInsert( i_nPosition, ::boost::optional< ::rtl::OUString >(), i_rItemImageURL, aGuard ); + // <----- SYNCHRONIZED +} + +// --------------------------------------------------------------------------------------------------------------------- +void SAL_CALL UnoControlListBoxModel::removeItem( ::sal_Int32 i_nPosition ) throw (IndexOutOfBoundsException, RuntimeException) +{ + ::osl::ClearableMutexGuard aGuard( GetMutex() ); + // SYNCHRONIZED -----> + m_pData->removeItem( i_nPosition ); + + impl_handleRemove( i_nPosition, aGuard ); + // <----- SYNCHRONIZED +} + +// --------------------------------------------------------------------------------------------------------------------- +void SAL_CALL UnoControlListBoxModel::removeAllItems( ) throw (::com::sun::star::uno::RuntimeException) +{ + ::osl::ClearableMutexGuard aGuard( GetMutex() ); + // SYNCHRONIZED -----> + m_pData->removeAllItems(); + + impl_handleRemove( -1, aGuard ); + // <----- SYNCHRONIZED +} + +// --------------------------------------------------------------------------------------------------------------------- +void SAL_CALL UnoControlListBoxModel::setItemText( ::sal_Int32 i_nPosition, const ::rtl::OUString& i_rItemText ) throw (IndexOutOfBoundsException, RuntimeException) +{ + ::osl::ClearableMutexGuard aGuard( GetMutex() ); + // SYNCHRONIZED -----> + ListItem& rItem( m_pData->getItem( i_nPosition ) ); + rItem.First = i_rItemText; + + impl_handleModify( i_nPosition, i_rItemText, ::boost::optional< ::rtl::OUString >(), aGuard ); + // <----- SYNCHRONIZED +} + +// --------------------------------------------------------------------------------------------------------------------- +void SAL_CALL UnoControlListBoxModel::setItemImage( ::sal_Int32 i_nPosition, const ::rtl::OUString& i_rItemImageURL ) throw (IndexOutOfBoundsException, RuntimeException) +{ + ::osl::ClearableMutexGuard aGuard( GetMutex() ); + // SYNCHRONIZED -----> + ListItem& rItem( m_pData->getItem( i_nPosition ) ); + rItem.Second = i_rItemImageURL; + + impl_handleModify( i_nPosition, ::boost::optional< ::rtl::OUString >(), i_rItemImageURL, aGuard ); + // <----- SYNCHRONIZED +} + +// --------------------------------------------------------------------------------------------------------------------- +void SAL_CALL UnoControlListBoxModel::setItemTextAndImage( ::sal_Int32 i_nPosition, const ::rtl::OUString& i_rItemText, const ::rtl::OUString& i_rItemImageURL ) throw (IndexOutOfBoundsException, RuntimeException) +{ + ::osl::ClearableMutexGuard aGuard( GetMutex() ); + // SYNCHRONIZED -----> + ListItem& rItem( m_pData->getItem( i_nPosition ) ); + rItem.First = i_rItemText; + rItem.Second = i_rItemImageURL; + + impl_handleModify( i_nPosition, i_rItemText, i_rItemImageURL, aGuard ); + // <----- SYNCHRONIZED +} + +// --------------------------------------------------------------------------------------------------------------------- +::rtl::OUString SAL_CALL UnoControlListBoxModel::getItemText( ::sal_Int32 i_nPosition ) throw (IndexOutOfBoundsException, RuntimeException) +{ + ::osl::MutexGuard aGuard( GetMutex() ); + ListItem& rItem( m_pData->getItem( i_nPosition ) ); + return rItem.First; +} + +// --------------------------------------------------------------------------------------------------------------------- +::rtl::OUString SAL_CALL UnoControlListBoxModel::getItemImage( ::sal_Int32 i_nPosition ) throw (IndexOutOfBoundsException, RuntimeException) +{ + ::osl::MutexGuard aGuard( GetMutex() ); + ListItem& rItem( m_pData->getItem( i_nPosition ) ); + return rItem.Second; +} + +// --------------------------------------------------------------------------------------------------------------------- +beans::Pair< ::rtl::OUString, ::rtl::OUString > SAL_CALL UnoControlListBoxModel::getItemTextAndImage( ::sal_Int32 i_nPosition ) throw (IndexOutOfBoundsException, RuntimeException) +{ + ::osl::MutexGuard aGuard( GetMutex() ); + ListItem& rItem( m_pData->getItem( i_nPosition ) ); + return rItem; +} + +// --------------------------------------------------------------------------------------------------------------------- +Sequence< beans::Pair< ::rtl::OUString, ::rtl::OUString > > SAL_CALL UnoControlListBoxModel::getAllItems( ) throw (RuntimeException) +{ + ::osl::MutexGuard aGuard( GetMutex() ); + return m_pData->getAllItems(); +} + +// --------------------------------------------------------------------------------------------------------------------- +void SAL_CALL UnoControlListBoxModel::addItemListListener( const uno::Reference< awt::XItemListListener >& i_Listener ) throw (uno::RuntimeException) +{ + if ( i_Listener.is() ) + m_aItemListListeners.addInterface( i_Listener ); +} + +// --------------------------------------------------------------------------------------------------------------------- +void SAL_CALL UnoControlListBoxModel::removeItemListListener( const uno::Reference< awt::XItemListListener >& i_Listener ) throw (uno::RuntimeException) +{ + if ( i_Listener.is() ) + m_aItemListListeners.removeInterface( i_Listener ); +} + +// --------------------------------------------------------------------------------------------------------------------- +void UnoControlListBoxModel::impl_getStringItemList( ::std::vector< ::rtl::OUString >& o_rStringItems ) const +{ + Sequence< ::rtl::OUString > aStringItemList; + Any aPropValue; + getFastPropertyValue( aPropValue, BASEPROPERTY_STRINGITEMLIST ); + OSL_VERIFY( aPropValue >>= aStringItemList ); + + o_rStringItems.resize( size_t( aStringItemList.getLength() ) ); + ::std::copy( + aStringItemList.getConstArray(), + aStringItemList.getConstArray() + aStringItemList.getLength(), + o_rStringItems.begin() + ); +} + +// --------------------------------------------------------------------------------------------------------------------- +void UnoControlListBoxModel::impl_setStringItemList_nolck( const ::std::vector< ::rtl::OUString >& i_rStringItems ) +{ + Sequence< ::rtl::OUString > aStringItems( i_rStringItems.size() ); + ::std::copy( + i_rStringItems.begin(), + i_rStringItems.end(), + aStringItems.getArray() + ); + m_pData->m_bSettingLegacyProperty = true; + try + { + setFastPropertyValue( BASEPROPERTY_STRINGITEMLIST, uno::makeAny( aStringItems ) ); + } + catch( const Exception& ) + { + m_pData->m_bSettingLegacyProperty = false; + throw; + } + m_pData->m_bSettingLegacyProperty = false; +} + +// --------------------------------------------------------------------------------------------------------------------- +void UnoControlListBoxModel::impl_handleInsert( const sal_Int32 i_nItemPosition, const ::boost::optional< ::rtl::OUString >& i_rItemText, + const ::boost::optional< ::rtl::OUString >& i_rItemImageURL, ::osl::ClearableMutexGuard& i_rClearBeforeNotify ) +{ + // SYNCHRONIZED -----> + // sync with legacy StringItemList property + ::std::vector< ::rtl::OUString > aStringItems; + impl_getStringItemList( aStringItems ); + OSL_ENSURE( size_t( i_nItemPosition ) <= aStringItems.size(), "UnoControlListBoxModel::impl_handleInsert" ); + if ( size_t( i_nItemPosition ) <= aStringItems.size() ) + { + const ::rtl::OUString sItemText( !!i_rItemText ? *i_rItemText : ::rtl::OUString() ); + aStringItems.insert( aStringItems.begin() + i_nItemPosition, sItemText ); + } + + i_rClearBeforeNotify.clear(); + // <----- SYNCHRONIZED + impl_setStringItemList_nolck( aStringItems ); + + // notify ItemListListeners + impl_notifyItemListEvent_nolck( i_nItemPosition, i_rItemText, i_rItemImageURL, &XItemListListener::listItemInserted ); +} + +// --------------------------------------------------------------------------------------------------------------------- +void UnoControlListBoxModel::impl_handleRemove( const sal_Int32 i_nItemPosition, ::osl::ClearableMutexGuard& i_rClearBeforeNotify ) +{ + // SYNCHRONIZED -----> + const bool bAllItems = ( i_nItemPosition < 0 ); + // sync with legacy StringItemList property + ::std::vector< ::rtl::OUString > aStringItems; + impl_getStringItemList( aStringItems ); + if ( !bAllItems ) + { + OSL_ENSURE( size_t( i_nItemPosition ) < aStringItems.size(), "UnoControlListBoxModel::impl_handleRemove" ); + if ( size_t( i_nItemPosition ) < aStringItems.size() ) + { + aStringItems.erase( aStringItems.begin() + i_nItemPosition ); + } + } + else + { + aStringItems.resize(0); + } + + i_rClearBeforeNotify.clear(); + // <----- SYNCHRONIZED + impl_setStringItemList_nolck( aStringItems ); + + // notify ItemListListeners + if ( bAllItems ) + { + EventObject aEvent( *this ); + m_aItemListListeners.notifyEach( &XItemListListener::allItemsRemoved, aEvent ); + } + else + { + impl_notifyItemListEvent_nolck( i_nItemPosition, ::boost::optional< ::rtl::OUString >(), ::boost::optional< ::rtl::OUString >(), + &XItemListListener::listItemRemoved ); + } +} + +// --------------------------------------------------------------------------------------------------------------------- +void UnoControlListBoxModel::impl_handleModify( const sal_Int32 i_nItemPosition, const ::boost::optional< ::rtl::OUString >& i_rItemText, + const ::boost::optional< ::rtl::OUString >& i_rItemImageURL, ::osl::ClearableMutexGuard& i_rClearBeforeNotify ) +{ + // SYNCHRONIZED -----> + if ( !!i_rItemText ) + { + // sync with legacy StringItemList property + ::std::vector< ::rtl::OUString > aStringItems; + impl_getStringItemList( aStringItems ); + OSL_ENSURE( size_t( i_nItemPosition ) < aStringItems.size(), "UnoControlListBoxModel::impl_handleModify" ); + if ( size_t( i_nItemPosition ) < aStringItems.size() ) + { + aStringItems[ i_nItemPosition] = *i_rItemText; + } + + i_rClearBeforeNotify.clear(); + // <----- SYNCHRONIZED + impl_setStringItemList_nolck( aStringItems ); + } + else + { + i_rClearBeforeNotify.clear(); + // <----- SYNCHRONIZED + } + + // notify ItemListListeners + impl_notifyItemListEvent_nolck( i_nItemPosition, i_rItemText, i_rItemImageURL, &XItemListListener::listItemModified ); +} + +// --------------------------------------------------------------------------------------------------------------------- +void UnoControlListBoxModel::impl_notifyItemListEvent_nolck( const sal_Int32 i_nItemPosition, const ::boost::optional< ::rtl::OUString >& i_rItemText, + const ::boost::optional< ::rtl::OUString >& i_rItemImageURL, + void ( SAL_CALL XItemListListener::*NotificationMethod )( const ItemListEvent& ) ) +{ + ItemListEvent aEvent; + aEvent.Source = *this; + aEvent.ItemPosition = i_nItemPosition; + if ( !!i_rItemText ) + { + aEvent.ItemText.IsPresent = sal_True; + aEvent.ItemText.Value = *i_rItemText; + } + if ( !!i_rItemImageURL ) + { + aEvent.ItemImageURL.IsPresent = sal_True; + aEvent.ItemImageURL.Value = *i_rItemImageURL; + } + + m_aItemListListeners.notifyEach( NotificationMethod, aEvent ); +} + // ---------------------------------------------------- // class UnoListBoxControl // ---------------------------------------------------- UnoListBoxControl::UnoListBoxControl() - : maActionListeners( *this ), - maItemListeners( *this ) + :maActionListeners( *this ) + ,maItemListeners( *this ) { maComponentInfos.nWidth = 100; maComponentInfos.nHeight = 12; @@ -1922,27 +2349,6 @@ UnoListBoxControl::UnoListBoxControl() return ::rtl::OUString::createFromAscii( "listbox" ); } -// uno::XInterface -uno::Any UnoListBoxControl::queryAggregation( const uno::Type & rType ) throw(uno::RuntimeException) -{ - uno::Any aRet = ::cppu::queryInterface( rType, - SAL_STATIC_CAST( awt::XListBox*, this ), - SAL_STATIC_CAST( awt::XItemListener*, this ), - SAL_STATIC_CAST( lang::XEventListener*, SAL_STATIC_CAST( awt::XItemListener*, this ) ), - SAL_STATIC_CAST( awt::XLayoutConstrains*, this ), - SAL_STATIC_CAST( awt::XTextLayoutConstrains*, this ) ); - return (aRet.hasValue() ? aRet : UnoControlBase::queryAggregation( rType )); -} - -// lang::XTypeProvider -IMPL_XTYPEPROVIDER_START( UnoListBoxControl ) - getCppuType( ( uno::Reference< awt::XListBox>* ) NULL ), - getCppuType( ( uno::Reference< awt::XItemListener>* ) NULL ), - getCppuType( ( uno::Reference< awt::XLayoutConstrains>* ) NULL ), - getCppuType( ( uno::Reference< awt::XTextLayoutConstrains>* ) NULL ), - UnoControlBase::getTypes() -IMPL_XTYPEPROVIDER_END - void UnoListBoxControl::dispose() throw(uno::RuntimeException) { lang::EventObject aEvt; @@ -1966,24 +2372,26 @@ void UnoListBoxControl::ImplUpdateSelectedItemsProperty() } } -void UnoListBoxControl::ImplSetPeerProperty( const ::rtl::OUString& rPropName, const uno::Any& rVal ) +void UnoListBoxControl::updateFromModel() { - UnoControl::ImplSetPeerProperty( rPropName, rVal ); + UnoControlBase::updateFromModel(); + + Reference< XItemListListener > xItemListListener( getPeer(), UNO_QUERY ); + ENSURE_OR_RETURN_VOID( xItemListListener.is(), "UnoListBoxControl::updateFromModel: a peer which is no ItemListListener?!" ); + + EventObject aEvent( getModel() ); + xItemListListener->itemListChanged( aEvent ); +} - // Wenn die SelectedItems vor der StringItemList gesetzt werden, - // hat das keine Auswirkung... +void UnoListBoxControl::ImplSetPeerProperty( const ::rtl::OUString& rPropName, const uno::Any& rVal ) +{ if ( rPropName == GetPropertyName( BASEPROPERTY_STRINGITEMLIST ) ) - { - ::rtl::OUString aSelPropName = GetPropertyName( BASEPROPERTY_SELECTEDITEMS ); - uno::Any aVal = ImplGetPropertyValue( aSelPropName ); - if ( !( aVal.getValueType().getTypeClass() == uno::TypeClass_VOID ) ) - { - uno::Reference< awt::XVclWindowPeer > xW( getPeer(), uno::UNO_QUERY ); - if (xW.is()) - // same comment as in UnoControl::ImplSetPeerProperty - see there - xW->setProperty( aSelPropName, aVal ); - } - } + // do not forward this to our peer. We are a XItemListListener at our model, and changes in the string item + // list (which is a legacy property) will, later, arrive as changes in the ItemList. Those latter changes + // will be forwarded to the peer, which will update itself accordingly. + return; + + UnoControl::ImplSetPeerProperty( rPropName, rVal ); } void UnoListBoxControl::createPeer( const uno::Reference< awt::XToolkit > & rxToolkit, const uno::Reference< awt::XWindowPeer > & rParentPeer ) throw(uno::RuntimeException) @@ -2281,6 +2689,66 @@ void UnoListBoxControl::getColumnsAndLines( sal_Int16& nCols, sal_Int16& nLines Impl_getColumnsAndLines( nCols, nLines ); } +sal_Bool SAL_CALL UnoListBoxControl::setModel( const uno::Reference< awt::XControlModel >& i_rModel ) throw ( uno::RuntimeException ) +{ + ::osl::MutexGuard aGuard( GetMutex() ); + + const Reference< XItemList > xOldItems( getModel(), UNO_QUERY ); + OSL_ENSURE( xOldItems.is() || !getModel().is(), "UnoListBoxControl::setModel: illegal old model!" ); + const Reference< XItemList > xNewItems( i_rModel, UNO_QUERY ); + OSL_ENSURE( xNewItems.is() || !i_rModel.is(), "UnoListBoxControl::setModel: illegal new model!" ); + + if ( !UnoListBoxControl_Base::setModel( i_rModel ) ) + return sal_False; + + if ( xOldItems.is() ) + xOldItems->removeItemListListener( this ); + if ( xNewItems.is() ) + xNewItems->addItemListListener( this ); + + return sal_True; +} + +void SAL_CALL UnoListBoxControl::listItemInserted( const awt::ItemListEvent& i_rEvent ) throw (uno::RuntimeException) +{ + const Reference< XItemListListener > xPeerListener( getPeer(), UNO_QUERY ); + OSL_ENSURE( xPeerListener.is() || !getPeer().is(), "UnoListBoxControl::listItemInserted: invalid peer!" ); + if ( xPeerListener.is() ) + xPeerListener->listItemInserted( i_rEvent ); +} + +void SAL_CALL UnoListBoxControl::listItemRemoved( const awt::ItemListEvent& i_rEvent ) throw (uno::RuntimeException) +{ + const Reference< XItemListListener > xPeerListener( getPeer(), UNO_QUERY ); + OSL_ENSURE( xPeerListener.is() || !getPeer().is(), "UnoListBoxControl::listItemRemoved: invalid peer!" ); + if ( xPeerListener.is() ) + xPeerListener->listItemRemoved( i_rEvent ); +} + +void SAL_CALL UnoListBoxControl::listItemModified( const awt::ItemListEvent& i_rEvent ) throw (uno::RuntimeException) +{ + const Reference< XItemListListener > xPeerListener( getPeer(), UNO_QUERY ); + OSL_ENSURE( xPeerListener.is() || !getPeer().is(), "UnoListBoxControl::listItemModified: invalid peer!" ); + if ( xPeerListener.is() ) + xPeerListener->listItemModified( i_rEvent ); +} + +void SAL_CALL UnoListBoxControl::allItemsRemoved( const lang::EventObject& i_rEvent ) throw (uno::RuntimeException) +{ + const Reference< XItemListListener > xPeerListener( getPeer(), UNO_QUERY ); + OSL_ENSURE( xPeerListener.is() || !getPeer().is(), "UnoListBoxControl::allItemsRemoved: invalid peer!" ); + if ( xPeerListener.is() ) + xPeerListener->allItemsRemoved( i_rEvent ); +} + +void SAL_CALL UnoListBoxControl::itemListChanged( const lang::EventObject& i_rEvent ) throw (uno::RuntimeException) +{ + const Reference< XItemListListener > xPeerListener( getPeer(), UNO_QUERY ); + OSL_ENSURE( xPeerListener.is() || !getPeer().is(), "UnoListBoxControl::itemListChanged: invalid peer!" ); + if ( xPeerListener.is() ) + xPeerListener->itemListChanged( i_rEvent ); +} + // ---------------------------------------------------- // class UnoControlComboBoxModel // ---------------------------------------------------- diff --git a/vcl/inc/vcl/lstbox.hxx b/vcl/inc/vcl/lstbox.hxx index 98cd05d999dd..3659e5aee485 100644 --- a/vcl/inc/vcl/lstbox.hxx +++ b/vcl/inc/vcl/lstbox.hxx @@ -130,6 +130,7 @@ public: virtual USHORT GetEntryPos( const XubString& rStr ) const; virtual USHORT GetEntryPos( const void* pData ) const; + Image GetEntryImage( USHORT nPos ) const; virtual XubString GetEntry( USHORT nPos ) const; virtual USHORT GetEntryCount() const; diff --git a/vcl/source/control/lstbox.cxx b/vcl/source/control/lstbox.cxx index 70b67c0a3d57..dde34d52806c 100644 --- a/vcl/source/control/lstbox.cxx +++ b/vcl/source/control/lstbox.cxx @@ -1081,6 +1081,15 @@ void ListBox::RemoveEntry( USHORT nPos ) // ----------------------------------------------------------------------- +Image ListBox::GetEntryImage( USHORT nPos ) const +{ + if ( mpImplLB->GetEntryList()->HasEntryImage( nPos ) ) + return mpImplLB->GetEntryList()->GetEntryImage( nPos ); + return Image(); +} + +// ----------------------------------------------------------------------- + USHORT ListBox::GetEntryPos( const XubString& rStr ) const { USHORT nPos = mpImplLB->GetEntryList()->FindEntry( rStr ); -- cgit v1.2.3 From 850d1272686417389b67794ace4a01d3269ea2e6 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Thu, 29 Apr 2010 14:10:03 +0200 Subject: fs33a: #i111238# now with UserData support --- toolkit/inc/toolkit/controls/unocontrols.hxx | 2 + toolkit/source/controls/unocontrols.cxx | 84 +++++++++++++++++++++------- 2 files changed, 67 insertions(+), 19 deletions(-) diff --git a/toolkit/inc/toolkit/controls/unocontrols.hxx b/toolkit/inc/toolkit/controls/unocontrols.hxx index 5c612c887859..71e0a915788d 100644 --- a/toolkit/inc/toolkit/controls/unocontrols.hxx +++ b/toolkit/inc/toolkit/controls/unocontrols.hxx @@ -795,9 +795,11 @@ public: virtual void SAL_CALL setItemText( ::sal_Int32 Position, const ::rtl::OUString& ItemText ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); virtual void SAL_CALL setItemImage( ::sal_Int32 Position, const ::rtl::OUString& ItemImageURL ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); virtual void SAL_CALL setItemTextAndImage( ::sal_Int32 Position, const ::rtl::OUString& ItemText, const ::rtl::OUString& ItemImageURL ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setUserData( ::sal_Int32 Position, const ::com::sun::star::uno::Any& DataValue ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); virtual ::rtl::OUString SAL_CALL getItemText( ::sal_Int32 Position ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); virtual ::rtl::OUString SAL_CALL getItemImage( ::sal_Int32 Position ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); virtual ::com::sun::star::beans::Pair< ::rtl::OUString, ::rtl::OUString > SAL_CALL getItemTextAndImage( ::sal_Int32 Position ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Any SAL_CALL getUserData( ::sal_Int32 Position ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Pair< ::rtl::OUString, ::rtl::OUString > > SAL_CALL getAllItems( ) throw (::com::sun::star::uno::RuntimeException); virtual void SAL_CALL addItemListListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XItemListListener >& Listener ) throw (::com::sun::star::uno::RuntimeException); virtual void SAL_CALL removeItemListListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XItemListListener >& Listener ) throw (::com::sun::star::uno::RuntimeException); diff --git a/toolkit/source/controls/unocontrols.cxx b/toolkit/source/controls/unocontrols.cxx index a4b7037b3b73..975040ca9070 100644 --- a/toolkit/source/controls/unocontrols.cxx +++ b/toolkit/source/controls/unocontrols.cxx @@ -1847,7 +1847,37 @@ sal_Bool UnoGroupBoxControl::isTransparent() throw(uno::RuntimeException) // ===================================================================================================================== // = UnoControlListBoxModel_Data // ===================================================================================================================== -typedef beans::Pair< ::rtl::OUString, ::rtl::OUString > ListItem; +struct ListItem +{ + ::rtl::OUString ItemText; + ::rtl::OUString ItemImageURL; + Any ItemUserData; + + ListItem() + :ItemText() + ,ItemImageURL() + ,ItemUserData() + { + } + + ListItem( const ::rtl::OUString& i_rItemText ) + :ItemText( i_rItemText ) + ,ItemImageURL() + ,ItemUserData() + { + } +}; + +typedef beans::Pair< ::rtl::OUString, ::rtl::OUString > UnoListItem; + +struct StripItemData : public ::std::unary_function< ListItem, UnoListItem > +{ + UnoListItem operator()( const ListItem& i_rItem ) + { + return UnoListItem( i_rItem.ItemText, i_rItem.ItemImageURL ); + } +}; + struct UnoControlListBoxModel_Data { UnoControlListBoxModel_Data( UnoControlListBoxModel& i_rAntiImpl ) @@ -1878,10 +1908,10 @@ struct UnoControlListBoxModel_Data return *m_aListItems.insert( m_aListItems.begin() + i_nIndex, ListItem() ); } - Sequence< ListItem > getAllItems() const + Sequence< UnoListItem > getAllItems() const { - Sequence< ListItem > aItems( sal_Int32( m_aListItems.size() ) ); - ::std::copy( m_aListItems.begin(), m_aListItems.end(), aItems.getArray() ); + Sequence< UnoListItem > aItems( sal_Int32( m_aListItems.size() ) ); + ::std::transform( m_aListItems.begin(), m_aListItems.end(), aItems.getArray(), StripItemData() ); return aItems; } @@ -1976,7 +2006,7 @@ namespace { ListItem operator()( const ::rtl::OUString& i_rItemText ) { - return ListItem( i_rItemText, ::rtl::OUString() ); + return ListItem( i_rItemText ); } }; } @@ -2047,8 +2077,8 @@ void SAL_CALL UnoControlListBoxModel::insertItem( ::sal_Int32 i_nPosition, const ::osl::ClearableMutexGuard aGuard( GetMutex() ); // SYNCHRONIZED -----> ListItem& rItem( m_pData->insertItem( i_nPosition ) ); - rItem.First = i_rItemText; - rItem.Second = i_rItemImageURL; + rItem.ItemText = i_rItemText; + rItem.ItemImageURL = i_rItemImageURL; impl_handleInsert( i_nPosition, i_rItemText, i_rItemImageURL, aGuard ); // <----- SYNCHRONIZED @@ -2060,7 +2090,7 @@ void SAL_CALL UnoControlListBoxModel::insertItemText( ::sal_Int32 i_nPosition, c ::osl::ClearableMutexGuard aGuard( GetMutex() ); // SYNCHRONIZED -----> ListItem& rItem( m_pData->insertItem( i_nPosition ) ); - rItem.First = i_rItemText; + rItem.ItemText = i_rItemText; impl_handleInsert( i_nPosition, i_rItemText, ::boost::optional< ::rtl::OUString >(), aGuard ); // <----- SYNCHRONIZED @@ -2072,7 +2102,7 @@ void SAL_CALL UnoControlListBoxModel::insertItemImage( ::sal_Int32 i_nPosition, ::osl::ClearableMutexGuard aGuard( GetMutex() ); // SYNCHRONIZED -----> ListItem& rItem( m_pData->insertItem( i_nPosition ) ); - rItem.Second = i_rItemImageURL; + rItem.ItemImageURL = i_rItemImageURL; impl_handleInsert( i_nPosition, ::boost::optional< ::rtl::OUString >(), i_rItemImageURL, aGuard ); // <----- SYNCHRONIZED @@ -2106,7 +2136,7 @@ void SAL_CALL UnoControlListBoxModel::setItemText( ::sal_Int32 i_nPosition, cons ::osl::ClearableMutexGuard aGuard( GetMutex() ); // SYNCHRONIZED -----> ListItem& rItem( m_pData->getItem( i_nPosition ) ); - rItem.First = i_rItemText; + rItem.ItemText = i_rItemText; impl_handleModify( i_nPosition, i_rItemText, ::boost::optional< ::rtl::OUString >(), aGuard ); // <----- SYNCHRONIZED @@ -2118,7 +2148,7 @@ void SAL_CALL UnoControlListBoxModel::setItemImage( ::sal_Int32 i_nPosition, con ::osl::ClearableMutexGuard aGuard( GetMutex() ); // SYNCHRONIZED -----> ListItem& rItem( m_pData->getItem( i_nPosition ) ); - rItem.Second = i_rItemImageURL; + rItem.ItemImageURL = i_rItemImageURL; impl_handleModify( i_nPosition, ::boost::optional< ::rtl::OUString >(), i_rItemImageURL, aGuard ); // <----- SYNCHRONIZED @@ -2130,35 +2160,51 @@ void SAL_CALL UnoControlListBoxModel::setItemTextAndImage( ::sal_Int32 i_nPositi ::osl::ClearableMutexGuard aGuard( GetMutex() ); // SYNCHRONIZED -----> ListItem& rItem( m_pData->getItem( i_nPosition ) ); - rItem.First = i_rItemText; - rItem.Second = i_rItemImageURL; + rItem.ItemText = i_rItemText; + rItem.ItemImageURL = i_rItemImageURL; impl_handleModify( i_nPosition, i_rItemText, i_rItemImageURL, aGuard ); // <----- SYNCHRONIZED } +// --------------------------------------------------------------------------------------------------------------------- +void SAL_CALL UnoControlListBoxModel::setUserData( ::sal_Int32 i_nPosition, const Any& i_rDataValue ) throw (IndexOutOfBoundsException, RuntimeException) +{ + ::osl::ClearableMutexGuard aGuard( GetMutex() ); + ListItem& rItem( m_pData->getItem( i_nPosition ) ); + rItem.ItemUserData = i_rDataValue; +} + // --------------------------------------------------------------------------------------------------------------------- ::rtl::OUString SAL_CALL UnoControlListBoxModel::getItemText( ::sal_Int32 i_nPosition ) throw (IndexOutOfBoundsException, RuntimeException) { ::osl::MutexGuard aGuard( GetMutex() ); - ListItem& rItem( m_pData->getItem( i_nPosition ) ); - return rItem.First; + const ListItem& rItem( m_pData->getItem( i_nPosition ) ); + return rItem.ItemText; } // --------------------------------------------------------------------------------------------------------------------- ::rtl::OUString SAL_CALL UnoControlListBoxModel::getItemImage( ::sal_Int32 i_nPosition ) throw (IndexOutOfBoundsException, RuntimeException) { ::osl::MutexGuard aGuard( GetMutex() ); - ListItem& rItem( m_pData->getItem( i_nPosition ) ); - return rItem.Second; + const ListItem& rItem( m_pData->getItem( i_nPosition ) ); + return rItem.ItemImageURL; } // --------------------------------------------------------------------------------------------------------------------- beans::Pair< ::rtl::OUString, ::rtl::OUString > SAL_CALL UnoControlListBoxModel::getItemTextAndImage( ::sal_Int32 i_nPosition ) throw (IndexOutOfBoundsException, RuntimeException) { ::osl::MutexGuard aGuard( GetMutex() ); - ListItem& rItem( m_pData->getItem( i_nPosition ) ); - return rItem; + const ListItem& rItem( m_pData->getItem( i_nPosition ) ); + return beans::Pair< ::rtl::OUString, ::rtl::OUString >( rItem.ItemText, rItem.ItemImageURL ); +} + +// --------------------------------------------------------------------------------------------------------------------- +Any SAL_CALL UnoControlListBoxModel::getUserData( ::sal_Int32 i_nPosition ) throw (IndexOutOfBoundsException, RuntimeException) +{ + ::osl::ClearableMutexGuard aGuard( GetMutex() ); + const ListItem& rItem( m_pData->getItem( i_nPosition ) ); + return rItem.ItemUserData; } // --------------------------------------------------------------------------------------------------------------------- -- cgit v1.2.3 From 6b310decbc330847cd88bd001e6120f3042d1b7c Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Thu, 29 Apr 2010 15:29:46 +0200 Subject: fs33a: #i111238# [s|g]etUserData -> [s|g]etItemData --- toolkit/inc/toolkit/controls/unocontrols.hxx | 4 ++-- toolkit/source/controls/unocontrols.cxx | 14 +++++++------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/toolkit/inc/toolkit/controls/unocontrols.hxx b/toolkit/inc/toolkit/controls/unocontrols.hxx index 71e0a915788d..88449418c70a 100644 --- a/toolkit/inc/toolkit/controls/unocontrols.hxx +++ b/toolkit/inc/toolkit/controls/unocontrols.hxx @@ -795,11 +795,11 @@ public: virtual void SAL_CALL setItemText( ::sal_Int32 Position, const ::rtl::OUString& ItemText ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); virtual void SAL_CALL setItemImage( ::sal_Int32 Position, const ::rtl::OUString& ItemImageURL ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); virtual void SAL_CALL setItemTextAndImage( ::sal_Int32 Position, const ::rtl::OUString& ItemText, const ::rtl::OUString& ItemImageURL ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL setUserData( ::sal_Int32 Position, const ::com::sun::star::uno::Any& DataValue ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setItemData( ::sal_Int32 Position, const ::com::sun::star::uno::Any& DataValue ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); virtual ::rtl::OUString SAL_CALL getItemText( ::sal_Int32 Position ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); virtual ::rtl::OUString SAL_CALL getItemImage( ::sal_Int32 Position ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); virtual ::com::sun::star::beans::Pair< ::rtl::OUString, ::rtl::OUString > SAL_CALL getItemTextAndImage( ::sal_Int32 Position ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); - virtual ::com::sun::star::uno::Any SAL_CALL getUserData( ::sal_Int32 Position ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Any SAL_CALL getItemData( ::sal_Int32 Position ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Pair< ::rtl::OUString, ::rtl::OUString > > SAL_CALL getAllItems( ) throw (::com::sun::star::uno::RuntimeException); virtual void SAL_CALL addItemListListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XItemListListener >& Listener ) throw (::com::sun::star::uno::RuntimeException); virtual void SAL_CALL removeItemListListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XItemListListener >& Listener ) throw (::com::sun::star::uno::RuntimeException); diff --git a/toolkit/source/controls/unocontrols.cxx b/toolkit/source/controls/unocontrols.cxx index 975040ca9070..8b37978c58e6 100644 --- a/toolkit/source/controls/unocontrols.cxx +++ b/toolkit/source/controls/unocontrols.cxx @@ -1851,19 +1851,19 @@ struct ListItem { ::rtl::OUString ItemText; ::rtl::OUString ItemImageURL; - Any ItemUserData; + Any ItemData; ListItem() :ItemText() ,ItemImageURL() - ,ItemUserData() + ,ItemData() { } ListItem( const ::rtl::OUString& i_rItemText ) :ItemText( i_rItemText ) ,ItemImageURL() - ,ItemUserData() + ,ItemData() { } }; @@ -2168,11 +2168,11 @@ void SAL_CALL UnoControlListBoxModel::setItemTextAndImage( ::sal_Int32 i_nPositi } // --------------------------------------------------------------------------------------------------------------------- -void SAL_CALL UnoControlListBoxModel::setUserData( ::sal_Int32 i_nPosition, const Any& i_rDataValue ) throw (IndexOutOfBoundsException, RuntimeException) +void SAL_CALL UnoControlListBoxModel::setItemData( ::sal_Int32 i_nPosition, const Any& i_rDataValue ) throw (IndexOutOfBoundsException, RuntimeException) { ::osl::ClearableMutexGuard aGuard( GetMutex() ); ListItem& rItem( m_pData->getItem( i_nPosition ) ); - rItem.ItemUserData = i_rDataValue; + rItem.ItemData = i_rDataValue; } // --------------------------------------------------------------------------------------------------------------------- @@ -2200,11 +2200,11 @@ beans::Pair< ::rtl::OUString, ::rtl::OUString > SAL_CALL UnoControlListBoxModel: } // --------------------------------------------------------------------------------------------------------------------- -Any SAL_CALL UnoControlListBoxModel::getUserData( ::sal_Int32 i_nPosition ) throw (IndexOutOfBoundsException, RuntimeException) +Any SAL_CALL UnoControlListBoxModel::getItemData( ::sal_Int32 i_nPosition ) throw (IndexOutOfBoundsException, RuntimeException) { ::osl::ClearableMutexGuard aGuard( GetMutex() ); const ListItem& rItem( m_pData->getItem( i_nPosition ) ); - return rItem.ItemUserData; + return rItem.ItemData; } // --------------------------------------------------------------------------------------------------------------------- -- cgit v1.2.3 From 3bb8f0226dca5c1e565feaed3aeff7c1ee1a6042 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Sun, 2 May 2010 13:19:38 +0200 Subject: fs33a: compile errors on unxlngi6.pro / unxmacxi.pro --- toolkit/source/awt/vclxwindows.cxx | 2 +- toolkit/source/controls/unocontrols.cxx | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/toolkit/source/awt/vclxwindows.cxx b/toolkit/source/awt/vclxwindows.cxx index ff4dc6fb5ec4..43e0e50c315d 100644 --- a/toolkit/source/awt/vclxwindows.cxx +++ b/toolkit/source/awt/vclxwindows.cxx @@ -2155,7 +2155,7 @@ void SAL_CALL VCLXListBox::listItemModified( const ItemListEvent& i_rEvent ) thr // VCL's ListBox does not support changing an entry's text or image, so remove and re-insert - const ::rtl::OUString sNewText = i_rEvent.ItemText.IsPresent ? i_rEvent.ItemText.Value : pListBox->GetEntry( i_rEvent.ItemPosition ); + const ::rtl::OUString sNewText = i_rEvent.ItemText.IsPresent ? i_rEvent.ItemText.Value : ::rtl::OUString( pListBox->GetEntry( i_rEvent.ItemPosition ) ); const Image aNewImage( i_rEvent.ItemImageURL.IsPresent ? lcl_getImageFromURL( i_rEvent.ItemImageURL.Value ) : pListBox->GetEntryImage( i_rEvent.ItemPosition ) ); pListBox->RemoveEntry( i_rEvent.ItemPosition ); diff --git a/toolkit/source/controls/unocontrols.cxx b/toolkit/source/controls/unocontrols.cxx index 8b37978c58e6..3b037e3ca0d3 100644 --- a/toolkit/source/controls/unocontrols.cxx +++ b/toolkit/source/controls/unocontrols.cxx @@ -1881,9 +1881,9 @@ struct StripItemData : public ::std::unary_function< ListItem, UnoListItem > struct UnoControlListBoxModel_Data { UnoControlListBoxModel_Data( UnoControlListBoxModel& i_rAntiImpl ) - :m_rAntiImpl( i_rAntiImpl ) + :m_bSettingLegacyProperty( false ) + ,m_rAntiImpl( i_rAntiImpl ) ,m_aListItems() - ,m_bSettingLegacyProperty( false ) { } -- cgit v1.2.3 From 52fd9e2d3c036373651927bbc933f5293ee98bfd Mon Sep 17 00:00:00 2001 From: ka Date: Wed, 9 Jun 2010 07:07:59 +0200 Subject: avmedia101: added GStreamer backend for Unix --- vcl/inc/vcl/javachild.hxx | 2 - vcl/inc/vcl/syschild.hxx | 6 ++ vcl/source/window/javachild.cxx | 154 ++----------------------------------- vcl/source/window/syschild.cxx | 164 +++++++++++++++++++++++++++++++++++++--- 4 files changed, 166 insertions(+), 160 deletions(-) diff --git a/vcl/inc/vcl/javachild.hxx b/vcl/inc/vcl/javachild.hxx index 62b447f26571..c5ec3c678900 100644 --- a/vcl/inc/vcl/javachild.hxx +++ b/vcl/inc/vcl/javachild.hxx @@ -47,8 +47,6 @@ public: private: - SAL_DLLPRIVATE void implTestJavaException( void* pEnv ); - // Copy assignment is forbidden and not implemented. SAL_DLLPRIVATE JavaChildWindow (const JavaChildWindow &); SAL_DLLPRIVATE JavaChildWindow & operator= (const JavaChildWindow &); diff --git a/vcl/inc/vcl/syschild.hxx b/vcl/inc/vcl/syschild.hxx index da4ffcd51a22..e914adbdffed 100644 --- a/vcl/inc/vcl/syschild.hxx +++ b/vcl/inc/vcl/syschild.hxx @@ -44,6 +44,7 @@ class VCL_DLLPUBLIC SystemChildWindow : public Window private: using Window::ImplInit; SAL_DLLPRIVATE void ImplInitSysChild( Window* pParent, WinBits nStyle, SystemWindowData *pData, BOOL bShow = FALSE ); + SAL_DLLPRIVATE void ImplTestJavaException( void* pEnv ); // Copy assignment is forbidden and not implemented. SAL_DLLPRIVATE SystemChildWindow (const SystemChildWindow &); @@ -62,6 +63,11 @@ public: // however, this might not always be required void EnableEraseBackground( BOOL bEnable = TRUE ); BOOL IsEraseBackgroundEnabled(); + + // return the platform specific handle/id of this window; + // in case the flag bUseJava is set, a java compatible overlay window + // is created on which other java windows can be created (plugin interface) + sal_IntPtr GetParentWindowHandle( sal_Bool bUseJava = sal_False ); }; #endif // _SV_SYSCHILD_HXX diff --git a/vcl/source/window/javachild.cxx b/vcl/source/window/javachild.cxx index 2cd18b897ff5..aa198c85c138 100644 --- a/vcl/source/window/javachild.cxx +++ b/vcl/source/window/javachild.cxx @@ -2,10 +2,13 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2000, 2010 Oracle and/or its affiliates. + * Copyright 2008 by Sun Microsystems, Inc. * * OpenOffice.org - a multi-platform office productivity suite * + * $RCSfile: javachild.cxx,v $ + * $Revision: 1.12 $ + * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify @@ -28,32 +31,7 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_vcl.hxx" - -#ifdef SOLAR_JAVA -#include -#endif -#include - -#include -#include -#include -#include -#include -#include -#include - -#ifndef _SV_SVSYS_HXX -#include -#endif -#include -#include -#include -#include #include -#include -#include - -using namespace ::com::sun::star; // ------------------- // - JavaChildWindow - @@ -79,129 +57,7 @@ JavaChildWindow::~JavaChildWindow() // ----------------------------------------------------------------------- -void JavaChildWindow::implTestJavaException( void* pEnv ) -{ -#ifdef SOLAR_JAVA - JNIEnv* pJavaEnv = reinterpret_cast< JNIEnv* >( pEnv ); - jthrowable jtThrowable = pJavaEnv->ExceptionOccurred(); - - if( jtThrowable ) - { // is it a java exception ? -#if OSL_DEBUG_LEVEL > 1 - pJavaEnv->ExceptionDescribe(); -#endif // OSL_DEBUG_LEVEL > 1 - pJavaEnv->ExceptionClear(); - - jclass jcThrowable = pJavaEnv->FindClass("java/lang/Throwable"); - jmethodID jmThrowable_getMessage = pJavaEnv->GetMethodID(jcThrowable, "getMessage", "()Ljava/lang/String;"); - jstring jsMessage = (jstring) pJavaEnv->CallObjectMethod(jtThrowable, jmThrowable_getMessage); - ::rtl::OUString ouMessage; - - if(jsMessage) - { - const jchar * jcMessage = pJavaEnv->GetStringChars(jsMessage, NULL); - ouMessage = ::rtl::OUString(jcMessage); - pJavaEnv->ReleaseStringChars(jsMessage, jcMessage); - } - - throw uno::RuntimeException(ouMessage, uno::Reference()); - } -#endif // SOLAR_JAVA -} - -// ----------------------------------------------------------------------- - sal_IntPtr JavaChildWindow::getParentWindowHandleForJava() { - sal_IntPtr nRet = 0; - -#if defined WNT - nRet = reinterpret_cast< sal_IntPtr >( GetSystemData()->hWnd ); -#elif defined QUARTZ - // FIXME: this is wrong - nRet = reinterpret_cast< sal_IntPtr >( GetSystemData()->pView ); -#elif defined UNX -#ifdef SOLAR_JAVA - uno::Reference< lang::XMultiServiceFactory > xFactory( vcl::unohelper::GetMultiServiceFactory() ); - - if( xFactory.is() && ( GetSystemData()->aWindow > 0 ) ) - { - try - { - ::rtl::Reference< ::jvmaccess::VirtualMachine > xVM; - uno::Reference< java::XJavaVM > xJavaVM( xFactory->createInstance( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.java.JavaVirtualMachine") ) ), uno::UNO_QUERY ); - uno::Sequence< sal_Int8 > aProcessID( 17 ); - - rtl_getGlobalProcessId( (sal_uInt8*) aProcessID.getArray() ); - aProcessID[ 16 ] = 0; - OSL_ENSURE(sizeof (sal_Int64) >= sizeof (jvmaccess::VirtualMachine *), "Pointer cannot be represented as sal_Int64"); - sal_Int64 nPointer = reinterpret_cast< sal_Int64 >( static_cast< jvmaccess::VirtualMachine * >(0)); - xJavaVM->getJavaVM(aProcessID) >>= nPointer; - xVM = reinterpret_cast< jvmaccess::VirtualMachine * >(nPointer); - - if( xVM.is() ) - { - try - { - ::jvmaccess::VirtualMachine::AttachGuard aVMAttachGuard( xVM ); - JNIEnv* pEnv = aVMAttachGuard.getEnvironment(); - - jclass jcToolkit = pEnv->FindClass("java/awt/Toolkit"); - implTestJavaException(pEnv); - - jmethodID jmToolkit_getDefaultToolkit = pEnv->GetStaticMethodID( jcToolkit, "getDefaultToolkit", "()Ljava/awt/Toolkit;" ); - implTestJavaException(pEnv); - - pEnv->CallStaticObjectMethod(jcToolkit, jmToolkit_getDefaultToolkit); - implTestJavaException(pEnv); - - jclass jcMotifAppletViewer = pEnv->FindClass("sun/plugin/navig/motif/MotifAppletViewer"); - if( pEnv->ExceptionOccurred() ) - { - pEnv->ExceptionClear(); - - jcMotifAppletViewer = pEnv->FindClass( "sun/plugin/viewer/MNetscapePluginContext"); - implTestJavaException(pEnv); - } - - jclass jcClassLoader = pEnv->FindClass("java/lang/ClassLoader"); - implTestJavaException(pEnv); - - jmethodID jmClassLoader_loadLibrary = pEnv->GetStaticMethodID( jcClassLoader, "loadLibrary", "(Ljava/lang/Class;Ljava/lang/String;Z)V"); - implTestJavaException(pEnv); - - jstring jsplugin = pEnv->NewStringUTF("javaplugin_jni"); - implTestJavaException(pEnv); - - pEnv->CallStaticVoidMethod(jcClassLoader, jmClassLoader_loadLibrary, jcMotifAppletViewer, jsplugin, JNI_FALSE); - implTestJavaException(pEnv); - - jmethodID jmMotifAppletViewer_getWidget = pEnv->GetStaticMethodID( jcMotifAppletViewer, "getWidget", "(IIIII)I" ); - implTestJavaException(pEnv); - - const Size aSize( GetOutputSizePixel() ); - jint ji_widget = pEnv->CallStaticIntMethod( jcMotifAppletViewer, jmMotifAppletViewer_getWidget, - GetSystemData()->aWindow, 0, 0, aSize.Width(), aSize.Height() ); - implTestJavaException(pEnv); - - nRet = static_cast< sal_IntPtr >( ji_widget ); - } - catch( uno::RuntimeException& ) - { - } - - if( !nRet ) - nRet = static_cast< sal_IntPtr >( GetSystemData()->aWindow ); - } - } - catch( ... ) - { - } - } -#endif // SOLAR_JAVA -#else // WNT || QUARTZ || UNX - // TBD -#endif - - return nRet; + return SystemChildWindow::GetParentWindowHandle( sal_True ); } diff --git a/vcl/source/window/syschild.cxx b/vcl/source/window/syschild.cxx index ef71f83df1ee..4e897eef4a8b 100644 --- a/vcl/source/window/syschild.cxx +++ b/vcl/source/window/syschild.cxx @@ -28,25 +28,34 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_vcl.hxx" -#ifndef _SV_SVSYS_HXX #include -#endif +#include +#include +#include +#include #include #include #include #include - -#ifndef _SV_RC_H -#include -#endif #include -#ifndef _SV_WIDNOW_H -#include -#endif +#include #include #include +#include +#ifdef SOLAR_JAVA +#include +#endif + +#include +#include +#include +#include +#include + +#include +using namespace ::com::sun::star; // ======================================================================= @@ -183,6 +192,8 @@ void SystemChildWindow::EnableEraseBackground( BOOL bEnable ) mpWindowImpl->mpSysObj->EnableEraseBackground( bEnable ); } +// ----------------------------------------------------------------------- + BOOL SystemChildWindow::IsEraseBackgroundEnabled() { if ( mpWindowImpl->mpSysObj ) @@ -190,3 +201,138 @@ BOOL SystemChildWindow::IsEraseBackgroundEnabled() else return FALSE; } + +// ----------------------------------------------------------------------- + +void SystemChildWindow::ImplTestJavaException( void* pEnv ) +{ +#ifdef SOLAR_JAVA + JNIEnv* pJavaEnv = reinterpret_cast< JNIEnv* >( pEnv ); + jthrowable jtThrowable = pJavaEnv->ExceptionOccurred(); + + if( jtThrowable ) + { // is it a java exception ? +#if OSL_DEBUG_LEVEL > 1 + pJavaEnv->ExceptionDescribe(); +#endif // OSL_DEBUG_LEVEL > 1 + pJavaEnv->ExceptionClear(); + + jclass jcThrowable = pJavaEnv->FindClass("java/lang/Throwable"); + jmethodID jmThrowable_getMessage = pJavaEnv->GetMethodID(jcThrowable, "getMessage", "()Ljava/lang/String;"); + jstring jsMessage = (jstring) pJavaEnv->CallObjectMethod(jtThrowable, jmThrowable_getMessage); + ::rtl::OUString ouMessage; + + if(jsMessage) + { + const jchar * jcMessage = pJavaEnv->GetStringChars(jsMessage, NULL); + ouMessage = ::rtl::OUString(jcMessage); + pJavaEnv->ReleaseStringChars(jsMessage, jcMessage); + } + + throw uno::RuntimeException(ouMessage, uno::Reference()); + } +#endif // SOLAR_JAVA +} + +// ----------------------------------------------------------------------- + +sal_IntPtr SystemChildWindow::GetParentWindowHandle( sal_Bool bUseJava ) +{ + sal_IntPtr nRet = 0; + +#if defined WNT + nRet = reinterpret_cast< sal_IntPtr >( GetSystemData()->hWnd ); +#elif defined QUARTZ + // FIXME: this is wrong + nRet = reinterpret_cast< sal_IntPtr >( GetSystemData()->pView ); +#elif defined UNX + if( !bUseJava ) + { + nRet = (sal_IntPtr) GetSystemData()->aWindow; + } +#ifdef SOLAR_JAVA + else + { + uno::Reference< lang::XMultiServiceFactory > xFactory( vcl::unohelper::GetMultiServiceFactory() ); + + if( xFactory.is() && ( GetSystemData()->aWindow > 0 ) ) + { + try + { + ::rtl::Reference< ::jvmaccess::VirtualMachine > xVM; + uno::Reference< java::XJavaVM > xJavaVM( xFactory->createInstance( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.java.JavaVirtualMachine") ) ), uno::UNO_QUERY ); + uno::Sequence< sal_Int8 > aProcessID( 17 ); + + rtl_getGlobalProcessId( (sal_uInt8*) aProcessID.getArray() ); + aProcessID[ 16 ] = 0; + OSL_ENSURE(sizeof (sal_Int64) >= sizeof (jvmaccess::VirtualMachine *), "Pointer cannot be represented as sal_Int64"); + sal_Int64 nPointer = reinterpret_cast< sal_Int64 >( static_cast< jvmaccess::VirtualMachine * >(0)); + xJavaVM->getJavaVM(aProcessID) >>= nPointer; + xVM = reinterpret_cast< jvmaccess::VirtualMachine * >(nPointer); + + if( xVM.is() ) + { + try + { + ::jvmaccess::VirtualMachine::AttachGuard aVMAttachGuard( xVM ); + JNIEnv* pEnv = aVMAttachGuard.getEnvironment(); + + jclass jcToolkit = pEnv->FindClass("java/awt/Toolkit"); + ImplTestJavaException(pEnv); + + jmethodID jmToolkit_getDefaultToolkit = pEnv->GetStaticMethodID( jcToolkit, "getDefaultToolkit", "()Ljava/awt/Toolkit;" ); + ImplTestJavaException(pEnv); + + pEnv->CallStaticObjectMethod(jcToolkit, jmToolkit_getDefaultToolkit); + ImplTestJavaException(pEnv); + + jclass jcMotifAppletViewer = pEnv->FindClass("sun/plugin/navig/motif/MotifAppletViewer"); + if( pEnv->ExceptionOccurred() ) + { + pEnv->ExceptionClear(); + + jcMotifAppletViewer = pEnv->FindClass( "sun/plugin/viewer/MNetscapePluginContext"); + ImplTestJavaException(pEnv); + } + + jclass jcClassLoader = pEnv->FindClass("java/lang/ClassLoader"); + ImplTestJavaException(pEnv); + + jmethodID jmClassLoader_loadLibrary = pEnv->GetStaticMethodID( jcClassLoader, "loadLibrary", "(Ljava/lang/Class;Ljava/lang/String;Z)V"); + ImplTestJavaException(pEnv); + + jstring jsplugin = pEnv->NewStringUTF("javaplugin_jni"); + ImplTestJavaException(pEnv); + + pEnv->CallStaticVoidMethod(jcClassLoader, jmClassLoader_loadLibrary, jcMotifAppletViewer, jsplugin, JNI_FALSE); + ImplTestJavaException(pEnv); + + jmethodID jmMotifAppletViewer_getWidget = pEnv->GetStaticMethodID( jcMotifAppletViewer, "getWidget", "(IIIII)I" ); + ImplTestJavaException(pEnv); + + const Size aSize( GetOutputSizePixel() ); + jint ji_widget = pEnv->CallStaticIntMethod( jcMotifAppletViewer, jmMotifAppletViewer_getWidget, + GetSystemData()->aWindow, 0, 0, aSize.Width(), aSize.Height() ); + ImplTestJavaException(pEnv); + + nRet = static_cast< sal_IntPtr >( ji_widget ); + } + catch( uno::RuntimeException& ) + { + } + + if( !nRet ) + nRet = static_cast< sal_IntPtr >( GetSystemData()->aWindow ); + } + } + catch( ... ) + { + } + } + } +#endif // SOLAR_JAVA +#else // WNT || QUARTZ || UNX +#endif + + return nRet; +} -- cgit v1.2.3 From 333d1e3dcc2e819f8c62c9713cca96fbedaba3de Mon Sep 17 00:00:00 2001 From: sj Date: Wed, 16 Jun 2010 06:33:39 +0200 Subject: impress186: #i4499# graphic dialog reorganisation - added support of bitmap resolution --- svl/inc/svl/svtools.hrc | 18 +- .../filter.vcl/filter/SvFilterOptionsDialog.cxx | 143 +- .../filter.vcl/filter/SvFilterOptionsDialog.hxx | 18 +- svtools/source/filter.vcl/filter/dlgejpg.cxx | 96 -- svtools/source/filter.vcl/filter/dlgejpg.hrc | 39 - svtools/source/filter.vcl/filter/dlgejpg.hxx | 72 - svtools/source/filter.vcl/filter/dlgejpg.src | 136 -- svtools/source/filter.vcl/filter/dlgepng.cxx | 90 -- svtools/source/filter.vcl/filter/dlgepng.hrc | 35 - svtools/source/filter.vcl/filter/dlgepng.hxx | 71 - svtools/source/filter.vcl/filter/dlgepng.src | 119 -- svtools/source/filter.vcl/filter/dlgexpor.cxx | 442 ------ svtools/source/filter.vcl/filter/dlgexpor.hrc | 58 - svtools/source/filter.vcl/filter/dlgexpor.hxx | 127 -- svtools/source/filter.vcl/filter/dlgexpor.src | 315 ----- svtools/source/filter.vcl/filter/exportdialog.cxx | 1474 ++++++++++++++++++++ svtools/source/filter.vcl/filter/exportdialog.hrc | 99 ++ svtools/source/filter.vcl/filter/exportdialog.hxx | 211 +++ svtools/source/filter.vcl/filter/exportdialog.src | 505 +++++++ svtools/source/filter.vcl/filter/filter.cxx | 10 +- svtools/source/filter.vcl/filter/makefile.mk | 35 +- svtools/source/filter.vcl/filter/strings.hrc | 27 - svtools/source/filter.vcl/filter/strings.src | 85 -- vcl/inc/vcl/arrange.hxx | 14 +- vcl/prj/d.lst | 1 + 25 files changed, 2374 insertions(+), 1866 deletions(-) delete mode 100644 svtools/source/filter.vcl/filter/dlgejpg.cxx delete mode 100644 svtools/source/filter.vcl/filter/dlgejpg.hrc delete mode 100644 svtools/source/filter.vcl/filter/dlgejpg.hxx delete mode 100644 svtools/source/filter.vcl/filter/dlgejpg.src delete mode 100644 svtools/source/filter.vcl/filter/dlgepng.cxx delete mode 100644 svtools/source/filter.vcl/filter/dlgepng.hrc delete mode 100644 svtools/source/filter.vcl/filter/dlgepng.hxx delete mode 100644 svtools/source/filter.vcl/filter/dlgepng.src delete mode 100644 svtools/source/filter.vcl/filter/dlgexpor.cxx delete mode 100644 svtools/source/filter.vcl/filter/dlgexpor.hrc delete mode 100644 svtools/source/filter.vcl/filter/dlgexpor.hxx delete mode 100644 svtools/source/filter.vcl/filter/dlgexpor.src create mode 100755 svtools/source/filter.vcl/filter/exportdialog.cxx create mode 100755 svtools/source/filter.vcl/filter/exportdialog.hrc create mode 100755 svtools/source/filter.vcl/filter/exportdialog.hxx create mode 100755 svtools/source/filter.vcl/filter/exportdialog.src delete mode 100644 svtools/source/filter.vcl/filter/strings.hrc delete mode 100644 svtools/source/filter.vcl/filter/strings.src diff --git a/svl/inc/svl/svtools.hrc b/svl/inc/svl/svtools.hrc index 738bee6cbf21..d820a9e88929 100644 --- a/svl/inc/svl/svtools.hrc +++ b/svl/inc/svl/svtools.hrc @@ -35,22 +35,12 @@ //............................................................................. // various unsorted stuff -#define DLG_EXPORT_PIX (RID_SVTOOLS_START+1) -#define DLG_EXPORT_VEC (RID_SVTOOLS_START+2) #define DLG_TWAIN_SOURCE (RID_SVTOOLS_START+3) #define DLG_SVT_EXPLORERFILE (RID_SVTOOLS_START+4) #define DLG_SVT_QUERYFOLDERNAME (RID_SVTOOLS_START+5) #define DLG_SVT_QUERYDELETE (RID_SVTOOLS_START+6) -#define EXPORT_DIALOG_TITLE (RID_SVTOOLS_START+4) -#define KEY_MODE (RID_SVTOOLS_START+5) -#define KEY_RES (RID_SVTOOLS_START+6) -#define KEY_SIZE (RID_SVTOOLS_START+7) - -#define KEY_COLORS (RID_SVTOOLS_START+9) -#define KEY_RLE_CODING (RID_SVTOOLS_START+10) - #define STR_SVT_AUTOMATIC_COLOR (RID_SVTOOLS_START+16) #define STR_SVT_FILEVIEW_COLUMN_TITLE (RID_SVTOOLS_START + 20) @@ -408,16 +398,16 @@ //............................................................................. // dialogs -#define DLG_EXPORT_JPG_START (RID_SVTOOLS_START+110) -#define DLG_EXPORT_JPG (RID_SVTOOLS_START+111) -#define DLG_EXPORT_JPG_END (RID_SVTOOLS_START+112) +#define DLG_EXPORT_START (STR_ARR_SVT_LANGUAGE_TABLE_END + 1) +#define DLG_EXPORT DLG_EXPORT_START +#define DLG_EXPORT_TITLE (DLG_EXPORT_START + 1) +#define DLG_EXPORT_END (DLG_EXPORT_TITLE) #define DLG_LOGIN (RID_SVTOOLS_START+113) #define DLG_ADDRESSBOOKSOURCE (RID_SVTOOLS_START+114) #define DLG_REGISTRATION_REQUEST (RID_SVTOOLS_START+115) -#define DLG_EXPORT_EPNG (RID_SVTOOLS_START+116) //............................................................................. // bitmaps diff --git a/svtools/source/filter.vcl/filter/SvFilterOptionsDialog.cxx b/svtools/source/filter.vcl/filter/SvFilterOptionsDialog.cxx index 038930ef80ee..1c4eeeff1bbf 100644 --- a/svtools/source/filter.vcl/filter/SvFilterOptionsDialog.cxx +++ b/svtools/source/filter.vcl/filter/SvFilterOptionsDialog.cxx @@ -36,9 +36,7 @@ #include #include #include -#include "dlgexpor.hxx" -#include "dlgejpg.hxx" -#include "dlgepng.hxx" +#include "exportdialog.hxx" #include #include #include @@ -49,12 +47,6 @@ #include #include "vcl/svapp.hxx" -#if defined WIN || (defined OS2 && !defined ICC) -#define EXPDLG_FUNCTION_NAME "_DoExportDialog" -#else -#define EXPDLG_FUNCTION_NAME "DoExportDialog" -#endif - using namespace ::rtl; using namespace ::com::sun::star; @@ -93,9 +85,10 @@ uno::Sequence< OUString > SAL_CALL SvFilterOptionsDialog_getSupportedServiceName // ----------------------------------------------------------------------------- -SvFilterOptionsDialog::SvFilterOptionsDialog( const uno::Reference< lang::XMultiServiceFactory > & xMgr ) : - rxMgr ( xMgr ), - eFieldUnit ( FUNIT_CM ) +SvFilterOptionsDialog::SvFilterOptionsDialog( const uno::Reference< lang::XMultiServiceFactory > xMgr ) : + mxMgr ( xMgr ), + meFieldUnit ( FUNIT_CM ), + mbExportSelection ( sal_False ) { } @@ -148,18 +141,18 @@ uno::Sequence< beans::PropertyValue > SvFilterOptionsDialog::getPropertyValues() throw ( uno::RuntimeException ) { sal_Int32 i, nCount; - for ( i = 0, nCount = aMediaDescriptor.getLength(); i < nCount; i++ ) + for ( i = 0, nCount = maMediaDescriptor.getLength(); i < nCount; i++ ) { - if ( aMediaDescriptor[ i ].Name.equalsAscii( "FilterData" ) ) + if ( maMediaDescriptor[ i ].Name.equalsAscii( "FilterData" ) ) break; } if ( i == nCount ) - aMediaDescriptor.realloc( ++nCount ); + maMediaDescriptor.realloc( ++nCount ); // the "FilterData" Property is an Any that will contain our PropertySequence of Values - aMediaDescriptor[ i ].Name = String( RTL_CONSTASCII_USTRINGPARAM( "FilterData" ) ); - aMediaDescriptor[ i ].Value <<= aFilterDataSequence; - return aMediaDescriptor; + maMediaDescriptor[ i ].Name = String( RTL_CONSTASCII_USTRINGPARAM( "FilterData" ) ); + maMediaDescriptor[ i ].Value <<= maFilterDataSequence; + return maMediaDescriptor; } void SvFilterOptionsDialog::setPropertyValues( const uno::Sequence< beans::PropertyValue > & aProps ) @@ -167,15 +160,18 @@ void SvFilterOptionsDialog::setPropertyValues( const uno::Sequence< beans::Prope lang::IllegalArgumentException, lang::WrappedTargetException, uno::RuntimeException ) { - aMediaDescriptor = aProps; + maMediaDescriptor = aProps; sal_Int32 i, nCount; - for ( i = 0, nCount = aMediaDescriptor.getLength(); i < nCount; i++ ) + for ( i = 0, nCount = maMediaDescriptor.getLength(); i < nCount; i++ ) { - if ( aMediaDescriptor[ i ].Name.equalsAscii( "FilterData" ) ) + if ( maMediaDescriptor[ i ].Name.equalsAscii( "FilterData" ) ) { - aMediaDescriptor[ i ].Value >>= aFilterDataSequence; - break; + maMediaDescriptor[ i ].Value >>= maFilterDataSequence; + } + else if ( maMediaDescriptor[ i ].Name.equalsAscii( "SelectionOnly" ) ) + { + maMediaDescriptor[ i ].Value >>= mbExportSelection; } } } @@ -184,7 +180,7 @@ void SvFilterOptionsDialog::setPropertyValues( const uno::Sequence< beans::Prope void SvFilterOptionsDialog::setTitle( const OUString& aTitle ) throw ( uno::RuntimeException ) { - aDialogTitle = aTitle; + maDialogTitle = aTitle; } sal_Int16 SvFilterOptionsDialog::execute() @@ -194,13 +190,13 @@ sal_Int16 SvFilterOptionsDialog::execute() String aFilterNameStr( RTL_CONSTASCII_USTRINGPARAM( "FilterName" ) ); String aInternalFilterName; - sal_Int32 j, nCount = aMediaDescriptor.getLength(); + sal_Int32 j, nCount = maMediaDescriptor.getLength(); for ( j = 0; j < nCount; j++ ) { - if ( aMediaDescriptor[ j ].Name.equals( aFilterNameStr ) ) + if ( maMediaDescriptor[ j ].Name.equals( aFilterNameStr ) ) { OUString aStr; - aMediaDescriptor[ j ].Value >>= aStr; + maMediaDescriptor[ j ].Value >>= aStr; aInternalFilterName = aStr; aInternalFilterName.SearchAndReplace( String( RTL_CONSTASCII_USTRINGPARAM( "draw_" ) ), String(), 0 ); aInternalFilterName.SearchAndReplace( String( RTL_CONSTASCII_USTRINGPARAM( "impress_" ) ), String(), 0 ); @@ -219,79 +215,24 @@ sal_Int16 SvFilterOptionsDialog::execute() } if ( nFormat < nFilterCount ) { - FltCallDialogParameter aFltCallDlgPara( Application::GetDefDialogParent(), NULL, eFieldUnit ); - aFltCallDlgPara.aFilterData = aFilterDataSequence; - - String aFilterName( aGraphicFilter.pConfig->GetExportFilterName( nFormat ) ); - if ( aGraphicFilter.pConfig->IsExportInternalFilter( nFormat ) ) - { - // Export-Dialog fuer Bitmap's, SVM's und WMF's - if( ( aFilterName.EqualsIgnoreCaseAscii( EXP_BMP ) ) || - ( aFilterName.EqualsIgnoreCaseAscii( EXP_SVMETAFILE ) ) || - ( aFilterName.EqualsIgnoreCaseAscii( EXP_WMF ) ) || - ( aFilterName.EqualsIgnoreCaseAscii( EXP_EMF ) ) || - ( aFilterName.EqualsIgnoreCaseAscii( EXP_JPEG ) )|| - ( aFilterName.EqualsIgnoreCaseAscii( EXP_PNG ) ) ) - { - ByteString aResMgrName( "svt", 3 ); - ResMgr* pResMgr; - - pResMgr = ResMgr::CreateResMgr( aResMgrName.GetBuffer(), Application::GetSettings().GetUILocale() ); - aFltCallDlgPara.pResMgr = pResMgr; - // JPEG-Dialog - if( aFilterName.EqualsIgnoreCaseAscii( EXP_JPEG ) ) - { - if ( DlgExportEJPG( aFltCallDlgPara ).Execute() == RET_OK ) - nRet = ui::dialogs::ExecutableDialogResults::OK; - } - else if ( aFilterName.EqualsIgnoreCaseAscii( EXP_PNG ) ) - { - if ( DlgExportEPNG( aFltCallDlgPara ).Execute() == RET_OK ) - nRet = ui::dialogs::ExecutableDialogResults::OK; - } - else if( aFilterName.EqualsIgnoreCaseAscii( EXP_BMP ) ) - { - // Fuer Vektorformate nehmen wir den Vektor-Dialog - aFltCallDlgPara.aFilterExt = aGraphicFilter.pConfig->GetExportFormatShortName( nFormat ); - if ( DlgExportPix( aFltCallDlgPara ).Execute() == RET_OK ) - nRet = ui::dialogs::ExecutableDialogResults::OK; - } - else - { - aFltCallDlgPara.aFilterExt = aGraphicFilter.pConfig->GetExportFormatShortName( nFormat ); - if ( DlgExportVec( aFltCallDlgPara ).Execute() == RET_OK ) - nRet = ui::dialogs::ExecutableDialogResults::OK; - } - delete pResMgr; - } - } - else // ladbare Filter - { - xub_StrLen i, nTokenCount = aGraphicFilter.aFilterPath.GetTokenCount( ';' ); - for ( i = 0; i < nTokenCount; i++ ) - { - - OUString aPathURL; - - ::osl::FileBase::getFileURLFromSystemPath( aGraphicFilter.aFilterPath.GetToken( i ), aPathURL ); - aPathURL += String( '/' ); - - OUString aSystemPath; - ::osl::FileBase::getSystemPathFromFileURL( aPathURL, aSystemPath ); - aSystemPath += OUString( aFilterName ); - - osl::Module aLibrary( aSystemPath ); - PFilterDlgCall pFunc = (PFilterDlgCall) aLibrary.getFunctionSymbol( UniString::CreateFromAscii( EXPDLG_FUNCTION_NAME ) ); - // Dialog in DLL ausfuehren - if( pFunc ) - { - if ( (*pFunc)( aFltCallDlgPara ) ) - nRet = ui::dialogs::ExecutableDialogResults::OK; - } - } - } + FltCallDialogParameter aFltCallDlgPara( Application::GetDefDialogParent(), NULL, meFieldUnit ); + aFltCallDlgPara.aFilterData = maFilterDataSequence; + + ByteString aResMgrName( "svt", 3 ); + ResMgr* pResMgr; + + pResMgr = ResMgr::CreateResMgr( aResMgrName.GetBuffer(), Application::GetSettings().GetUILocale() ); + aFltCallDlgPara.pResMgr = pResMgr; + + aFltCallDlgPara.aFilterExt = aGraphicFilter.pConfig->GetExportFormatShortName( nFormat ); + sal_Bool bIsPixelFormat( aGraphicFilter.pConfig->IsExportPixelFormat( nFormat ) ); + if ( ExportDialog( aFltCallDlgPara, mxMgr, mxSourceDocument, mbExportSelection, bIsPixelFormat ).Execute() == RET_OK ) + nRet = ui::dialogs::ExecutableDialogResults::OK; + + delete pResMgr; + // taking the out parameter from the dialog - aFilterDataSequence = aFltCallDlgPara.aFilterData; + maFilterDataSequence = aFltCallDlgPara.aFilterData; } } return nRet; @@ -301,6 +242,8 @@ sal_Int16 SvFilterOptionsDialog::execute() void SvFilterOptionsDialog::setSourceDocument( const uno::Reference< lang::XComponent >& xDoc ) throw ( lang::IllegalArgumentException, uno::RuntimeException ) { + mxSourceDocument = xDoc; + // try to set the corresponding metric unit String aConfigPath; uno::Reference< lang::XServiceInfo > xServiceInfo @@ -320,7 +263,7 @@ void SvFilterOptionsDialog::setSourceDocument( const uno::Reference< lang::XComp aPropertyName = String( RTL_CONSTASCII_USTRINGPARAM( "Metric" ) ); else aPropertyName = String( RTL_CONSTASCII_USTRINGPARAM( "NonMetric" ) ); - eFieldUnit = (FieldUnit)aConfigItem.ReadInt32( aPropertyName, FUNIT_CM ); + meFieldUnit = (FieldUnit)aConfigItem.ReadInt32( aPropertyName, FUNIT_CM ); } } } diff --git a/svtools/source/filter.vcl/filter/SvFilterOptionsDialog.hxx b/svtools/source/filter.vcl/filter/SvFilterOptionsDialog.hxx index a55fc4c84520..16592bac8df7 100644 --- a/svtools/source/filter.vcl/filter/SvFilterOptionsDialog.hxx +++ b/svtools/source/filter.vcl/filter/SvFilterOptionsDialog.hxx @@ -46,18 +46,22 @@ class SvFilterOptionsDialog : public cppu::WeakImplHelper5 com::sun::star::lang::XServiceInfo > { - const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory > & - rxMgr; + const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory > + mxMgr; com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > - aMediaDescriptor; + maMediaDescriptor; com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > - aFilterDataSequence; - rtl::OUString aDialogTitle; - FieldUnit eFieldUnit; + maFilterDataSequence; + com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent > + mxSourceDocument; + + rtl::OUString maDialogTitle; + FieldUnit meFieldUnit; + sal_Bool mbExportSelection; public: - SvFilterOptionsDialog( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxORB ); + SvFilterOptionsDialog( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > _rxORB ); ~SvFilterOptionsDialog(); // XInterface diff --git a/svtools/source/filter.vcl/filter/dlgejpg.cxx b/svtools/source/filter.vcl/filter/dlgejpg.cxx deleted file mode 100644 index 377697023de3..000000000000 --- a/svtools/source/filter.vcl/filter/dlgejpg.cxx +++ /dev/null @@ -1,96 +0,0 @@ -/************************************************************************* - * - * 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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_svtools.hxx" -#include "dlgejpg.hxx" -#include "dlgejpg.hrc" -#include "strings.hrc" -#include - -#define KEY_QUALITY "Quality" -#define KEY_GRAYSCALES "ColorMode" - -/************************************************************************* -|* -|* Ctor -|* -\************************************************************************/ - -DlgExportEJPG::DlgExportEJPG( FltCallDialogParameter& rPara ) : - ModalDialog ( rPara.pWindow, ResId( DLG_EXPORT_JPG, *rPara.pResMgr ) ), - rFltCallPara ( rPara ), - aFiDescr ( this, ResId( FI_DESCR, *rPara.pResMgr ) ), - aNumFldQuality ( this, ResId( NUM_FLD_QUALITY, *rPara.pResMgr ) ), - aGrpQuality ( this, ResId( GRP_QUALITY, *rPara.pResMgr ) ), - aRbGray ( this, ResId( RB_GRAY, *rPara.pResMgr ) ), - aRbRGB ( this, ResId( RB_RGB, *rPara.pResMgr ) ), - aGrpColors ( this, ResId( GRP_COLORS, *rPara.pResMgr ) ), - aBtnOK ( this, ResId( BTN_OK, *rPara.pResMgr ) ), - aBtnCancel ( this, ResId( BTN_CANCEL, *rPara.pResMgr ) ), - aBtnHelp ( this, ResId( BTN_HELP, *rPara.pResMgr ) ) -{ - FreeResource(); - String aFilterConfigPath( RTL_CONSTASCII_USTRINGPARAM( "Office.Common/Filter/Graphic/Export/JPG" ) ); - pConfigItem = new FilterConfigItem( aFilterConfigPath, &rPara.aFilterData ); - - // reading filter options - sal_Int32 nQuality = pConfigItem->ReadInt32( String( RTL_CONSTASCII_USTRINGPARAM( KEY_QUALITY ) ), 75 ); - sal_Int32 nColorMode = pConfigItem->ReadInt32( String( RTL_CONSTASCII_USTRINGPARAM( KEY_GRAYSCALES ) ), 0 ); - aNumFldQuality.SetValue( nQuality ); - - if ( nColorMode ) - aRbGray.Check( sal_True ); - else - aRbRGB.Check( sal_True ); - - aBtnOK.SetClickHdl( LINK( this, DlgExportEJPG, OK ) ); -} - - -/************************************************************************* -|* -|* Speichert eingestellte Werte in ini-Datei -|* -\************************************************************************/ - -IMPL_LINK( DlgExportEJPG, OK, void *, EMPTYARG ) -{ - // Config-Parameter schreiben - pConfigItem->WriteInt32( String( RTL_CONSTASCII_USTRINGPARAM( KEY_QUALITY ) ), (sal_Int32)aNumFldQuality.GetValue() ); - pConfigItem->WriteInt32( String( RTL_CONSTASCII_USTRINGPARAM( KEY_GRAYSCALES ) ), aRbGray.IsChecked() ? 1 : 0 ); - rFltCallPara.aFilterData = pConfigItem->GetFilterData(); - EndDialog( RET_OK ); - return 0; -} - -DlgExportEJPG::~DlgExportEJPG() -{ - delete pConfigItem; -} - - diff --git a/svtools/source/filter.vcl/filter/dlgejpg.hrc b/svtools/source/filter.vcl/filter/dlgejpg.hrc deleted file mode 100644 index 523a1d9553f1..000000000000 --- a/svtools/source/filter.vcl/filter/dlgejpg.hrc +++ /dev/null @@ -1,39 +0,0 @@ -/************************************************************************* - * - * 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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -#include - -#define BTN_OK 1 -#define BTN_CANCEL 1 -#define BTN_HELP 1 -#define FI_DESCR 1 -#define NUM_FLD_QUALITY 1 -#define GRP_QUALITY 1 -#define GRP_COLORS 2 -#define RB_GRAY 1 -#define RB_RGB 2 - - diff --git a/svtools/source/filter.vcl/filter/dlgejpg.hxx b/svtools/source/filter.vcl/filter/dlgejpg.hxx deleted file mode 100644 index d80682574a54..000000000000 --- a/svtools/source/filter.vcl/filter/dlgejpg.hxx +++ /dev/null @@ -1,72 +0,0 @@ -/************************************************************************* - * - * 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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - - -#ifndef _DLGEJPG_HXX_ -#define _DLGEJPG_HXX_ - -#include -#include -#include -#include -#include -#include -#include -#include - -/************************************************************************* -|* -|* Dialog zum Einstellen von Filteroptionen -|* -\************************************************************************/ -class FilterConfigItem; -class DlgExportEJPG : public ModalDialog -{ -private: - - FltCallDialogParameter& rFltCallPara; - - FixedInfo aFiDescr; - NumericField aNumFldQuality; - FixedLine aGrpQuality; - RadioButton aRbGray; - RadioButton aRbRGB; - FixedLine aGrpColors; - OKButton aBtnOK; - CancelButton aBtnCancel; - HelpButton aBtnHelp; - FilterConfigItem* pConfigItem; - - DECL_LINK( OK, void * ); - -public: - DlgExportEJPG( FltCallDialogParameter& rDlgPara ); - ~DlgExportEJPG(); -}; - -#endif // _DLGEJPG_HXX_ - diff --git a/svtools/source/filter.vcl/filter/dlgejpg.src b/svtools/source/filter.vcl/filter/dlgejpg.src deleted file mode 100644 index fd224f22c409..000000000000 --- a/svtools/source/filter.vcl/filter/dlgejpg.src +++ /dev/null @@ -1,136 +0,0 @@ -/************************************************************************* - * - * 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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#include "dlgejpg.hrc" -ModalDialog DLG_EXPORT_JPG -{ - OutputSize = TRUE ; - SVLook = TRUE ; - Size = MAP_APPFONT ( 159 , 92 ) ; - Text [ en-US ] = "JPEG Options" ; - Moveable = TRUE ; - Closeable = TRUE ; - OKButton BTN_OK - { - Pos = MAP_APPFONT ( 103 , 6 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - TabStop = TRUE ; - DefButton = TRUE ; - }; - CancelButton BTN_CANCEL - { - Pos = MAP_APPFONT ( 103 , 23 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - TabStop = TRUE ; - }; - HelpButton BTN_HELP - { - Pos = MAP_APPFONT ( 103 , 43 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - TabStop = TRUE ; - }; - FixedLine GRP_QUALITY - { - Pos = MAP_APPFONT ( 6 , 3 ) ; - Size = MAP_APPFONT ( 90 , 8 ) ; - Text [ en-US ] = "Quality" ; - }; - FixedText FI_DESCR - { - Pos = MAP_APPFONT ( 12 , 14 ) ; - Size = MAP_APPFONT ( 81 , 16 ) ; - Text [ en-US ] = "1: min. quality\n100: max. quality" ; - }; - NumericField NUM_FLD_QUALITY - { - Border = TRUE ; - Pos = MAP_APPFONT ( 12 , 33 ) ; - Size = MAP_APPFONT ( 50 , 12 ) ; - TabStop = TRUE ; - Spin = TRUE ; - Minimum = 1; - Maximum = 100 ; - StrictFormat = TRUE ; - Last = 100 ; - Repeat = TRUE ; - }; - FixedLine GRP_COLORS - { - Pos = MAP_APPFONT ( 6 , 51 ) ; - Size = MAP_APPFONT ( 90 , 8 ) ; - Text [ en-US ] = "Color resolution" ; - }; - RadioButton RB_GRAY - { - Pos = MAP_APPFONT ( 12 , 62 ) ; - Size = MAP_APPFONT ( 81 , 10 ) ; - TabStop = TRUE ; - Text [ en-US ] = "Grayscale" ; - }; - RadioButton RB_RGB - { - Pos = MAP_APPFONT ( 12 , 76 ) ; - Size = MAP_APPFONT ( 81 , 10 ) ; - TabStop = TRUE ; - Text [ en-US ] = "True Colors" ; - }; -}; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/svtools/source/filter.vcl/filter/dlgepng.cxx b/svtools/source/filter.vcl/filter/dlgepng.cxx deleted file mode 100644 index bd551e9a4bda..000000000000 --- a/svtools/source/filter.vcl/filter/dlgepng.cxx +++ /dev/null @@ -1,90 +0,0 @@ -/************************************************************************* - * - * 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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_svtools.hxx" -#include -#include -#include "dlgepng.hxx" -#include "dlgepng.hrc" - -using namespace ::rtl; -using namespace ::com::sun::star::uno; - -/************************************************************************* -|* -|* Ctor -|* -\************************************************************************/ - -DlgExportEPNG::DlgExportEPNG( FltCallDialogParameter& rPara ) : - ModalDialog ( rPara.pWindow, ResId( DLG_EXPORT_EPNG, *rPara.pResMgr ) ), - FilterConfigItem ( OUString( RTL_CONSTASCII_USTRINGPARAM( "Office.Common/Filter/Graphic/Export/PNG" ) ), &rPara.aFilterData ), - rFltCallPara ( rPara ), - aGrpCompression ( this, ResId( GRP_COMPRESSION, *rPara.pResMgr ) ), - aFiCompression ( this, ResId( FI_COMPRESSION, *rPara.pResMgr ) ), - aNumCompression ( this, ResId( NUM_COMPRESSION, *rPara.pResMgr ) ), - aCbxInterlaced ( this, ResId( CBX_INTERLACED, *rPara.pResMgr ) ), - aBtnOK ( this, ResId( BTN_OK, *rPara.pResMgr ) ), - aBtnCancel ( this, ResId( BTN_CANCEL, *rPara.pResMgr ) ), - aBtnHelp ( this, ResId( BTN_HELP, *rPara.pResMgr ) ), - pMgr ( rPara.pResMgr ) -{ - FreeResource(); - - // Config-Parameter lesen - sal_Int32 nCompression = ReadInt32( OUString( RTL_CONSTASCII_USTRINGPARAM( "Compression" ) ), 6 ); - if ( ( nCompression < 0 ) || ( nCompression > 9 ) ) - nCompression = 6; - aNumCompression.SetValue( nCompression ); - - sal_Int32 nInterlaced = ReadInt32( OUString( RTL_CONSTASCII_USTRINGPARAM( "Interlaced" ) ), 0 ); - sal_Bool bInterlaced = nInterlaced != 0; - aCbxInterlaced.Check( bInterlaced ); - - aBtnOK.SetClickHdl( LINK( this, DlgExportEPNG, OK ) ); -} - -/************************************************************************* -|* -|* Speichert eingestellte Werte in ini-Datei -|* -\************************************************************************/ - -IMPL_LINK( DlgExportEPNG, OK, void *, EMPTYARG ) -{ - // Config-Parameter schreiben - WriteInt32( OUString( RTL_CONSTASCII_USTRINGPARAM( "Compression" ) ), static_cast(aNumCompression.GetValue()) ); - sal_Int32 nInterlace = 0; - if ( aCbxInterlaced.IsChecked() ) - nInterlace++; - WriteInt32( OUString( RTL_CONSTASCII_USTRINGPARAM( "Interlaced" ) ), nInterlace ); - rFltCallPara.aFilterData = GetFilterData(); - EndDialog( RET_OK ); - - return 0; -} diff --git a/svtools/source/filter.vcl/filter/dlgepng.hrc b/svtools/source/filter.vcl/filter/dlgepng.hrc deleted file mode 100644 index 4a05771534ab..000000000000 --- a/svtools/source/filter.vcl/filter/dlgepng.hrc +++ /dev/null @@ -1,35 +0,0 @@ -/************************************************************************* - * - * 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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -#include - -#define BTN_OK 1 -#define BTN_CANCEL 1 -#define BTN_HELP 1 -#define GRP_COMPRESSION 1 -#define FI_COMPRESSION 1 -#define NUM_COMPRESSION 1 -#define CBX_INTERLACED 1 diff --git a/svtools/source/filter.vcl/filter/dlgepng.hxx b/svtools/source/filter.vcl/filter/dlgepng.hxx deleted file mode 100644 index 469985afee59..000000000000 --- a/svtools/source/filter.vcl/filter/dlgepng.hxx +++ /dev/null @@ -1,71 +0,0 @@ -/************************************************************************* - * - * 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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - - -#ifndef _DLGEPNG_HXX_ -#define _DLGEPNG_HXX_ -#include -#include -#include -#include -#include -#include -#include - - -/************************************************************************* -|* -|* Dialog zum Einstellen von Filteroptionen -|* -\************************************************************************/ - -class ResMgr; - -class DlgExportEPNG : public ModalDialog, FilterConfigItem -{ - - private: - - FltCallDialogParameter& rFltCallPara; - - FixedLine aGrpCompression; - FixedInfo aFiCompression; - NumericField aNumCompression; - CheckBox aCbxInterlaced; - OKButton aBtnOK; - CancelButton aBtnCancel; - HelpButton aBtnHelp; - ResMgr* pMgr; - - DECL_LINK( OK, void * ); - - public: - - DlgExportEPNG( FltCallDialogParameter& rPara ); -}; - -#endif // _DLGEPNG_HXX_ diff --git a/svtools/source/filter.vcl/filter/dlgepng.src b/svtools/source/filter.vcl/filter/dlgepng.src deleted file mode 100644 index aa778842dc48..000000000000 --- a/svtools/source/filter.vcl/filter/dlgepng.src +++ /dev/null @@ -1,119 +0,0 @@ -/************************************************************************* - * - * 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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#include "dlgepng.hrc" -ModalDialog DLG_EXPORT_EPNG -{ - OutputSize = TRUE ; - SVLook = TRUE ; - Size = MAP_APPFONT ( 169 , 64 ) ; - Moveable = TRUE ; - Closeable = TRUE ; - Text [ en-US ] = "PNG Options" ; - OKButton BTN_OK - { - Pos = MAP_APPFONT ( 113 , 6 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - TabStop = TRUE ; - DefButton = TRUE ; - }; - CancelButton BTN_CANCEL - { - Pos = MAP_APPFONT ( 113 , 23 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - TabStop = TRUE ; - }; - HelpButton BTN_HELP - { - Pos = MAP_APPFONT ( 113 , 43 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - TabStop = TRUE ; - }; - FixedLine GRP_COMPRESSION - { - Pos = MAP_APPFONT ( 6 , 3 ) ; - Size = MAP_APPFONT ( 100 , 8 ) ; - Text[ en-US ] = "Mode"; - }; - FixedText FI_COMPRESSION - { - Pos = MAP_APPFONT ( 12 , 14 ) ; - Size = MAP_APPFONT ( 80 , 8 ) ; - Text[ en-US ] = "~Compression 0..9"; - }; - NumericField NUM_COMPRESSION - { - Border = TRUE ; - Pos = MAP_APPFONT ( 12 , 25 ) ; - Size = MAP_APPFONT ( 40 , 12 ) ; - TabStop = TRUE ; - Spin = TRUE ; - Minimum = 0 ; - Maximum = 9 ; - First = 0 ; - Last = 9 ; - StrictFormat = TRUE ; - Repeat = TRUE ; - }; - CheckBox CBX_INTERLACED - { - Pos = MAP_APPFONT ( 12 , 43 ) ; - Size = MAP_APPFONT ( 80 , 12 ) ; - TabStop = TRUE ; - Text [ en-US ] = "~Interlaced" ; - }; -}; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/svtools/source/filter.vcl/filter/dlgexpor.cxx b/svtools/source/filter.vcl/filter/dlgexpor.cxx deleted file mode 100644 index b4b7c0fc949d..000000000000 --- a/svtools/source/filter.vcl/filter/dlgexpor.cxx +++ /dev/null @@ -1,442 +0,0 @@ -/************************************************************************* - * - * 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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_svtools.hxx" - -#ifndef GCC -# pragma hdrstop -#endif - -#include -#include -#include -#include -#include "dlgexpor.hxx" -#include "dlgexpor.hrc" -#include "strings.hrc" - -/************************************************************************* -|* -|* Ctor -|* -\************************************************************************/ - -DlgExportPix::DlgExportPix( FltCallDialogParameter& rPara ) : - ModalDialog ( rPara.pWindow, ResId( DLG_EXPORT_PIX, *rPara.pResMgr ) ), - rFltCallPara ( rPara ), - aBtnOK ( this, ResId( BTN_OK_PIX, *rPara.pResMgr ) ), - aBtnCancel ( this, ResId( BTN_CANCEL_PIX, *rPara.pResMgr ) ), - aBtnHelp ( this, ResId( BTN_HELP_PIX, *rPara.pResMgr ) ), - aLbColors ( this, ResId( LB_COLORS, *rPara.pResMgr ) ), - aCbxRLE ( this, ResId( CBX_RLE, *rPara.pResMgr ) ), - aGrpColors ( this, ResId( GRP_COLORS, *rPara.pResMgr ) ), - aRbOriginal ( this, ResId( RB_ORIGINAL_PIX, *rPara.pResMgr ) ), - aRbRes ( this, ResId( RB_RES_PIX, *rPara.pResMgr ) ), - aRbSize ( this, ResId( RB_SIZE_PIX, *rPara.pResMgr ) ), - aFtSizeX ( this, ResId( FT_SIZEX_PIX, *rPara.pResMgr ) ), - aMtfSizeX ( this, ResId( MTF_SIZEX_PIX, *rPara.pResMgr ) ), - aFtSizeY ( this, ResId( FT_SIZEY_PIX, *rPara.pResMgr ) ), - aMtfSizeY ( this, ResId( MTF_SIZEY_PIX, *rPara.pResMgr ) ), - aGrpMode ( this, ResId( GRP_MODE_PIX, *rPara.pResMgr ) ), - aCbbRes ( this, ResId( CBB_RES_PIX, *rPara.pResMgr ) ), - pMgr ( rPara.pResMgr ), - aExt ( rPara.aFilterExt ) -{ - aExt.ToUpperAscii(); - String aFilterConfigPath( RTL_CONSTASCII_USTRINGPARAM( "Office.Common/Filter/Graphic/Export/" ) ); - aFilterConfigPath.Append( aExt ); - pConfigItem = new FilterConfigItem( aFilterConfigPath, &rPara.aFilterData ); - - String aTitle( aExt ); - FreeResource(); - - aBtnOK.SetClickHdl( LINK( this, DlgExportPix, OK ) ); - aRbOriginal.SetClickHdl( LINK( this, DlgExportPix, ClickRbOriginal ) ); - aRbRes.SetClickHdl( LINK( this, DlgExportPix, ClickRbRes ) ); - aRbSize.SetClickHdl( LINK( this, DlgExportPix, ClickRbSize ) ); - aLbColors.SetSelectHdl( LINK( this, DlgExportPix, SelectLbColors ) ); - - aTitle.ToUpperAscii(); - aTitle += String( ResId( EXPORT_DIALOG_TITLE, *pMgr ) ); - SetText( aTitle ); - - // Config-Parameter lesen - sal_Int32 nColors = pConfigItem->ReadInt32( String( ResId( KEY_COLORS, *pMgr ) ), 0 ); - sal_Int32 nMode = pConfigItem->ReadInt32( String( ResId( KEY_MODE, *pMgr ) ), 0 ); - sal_Int32 nRes = pConfigItem->ReadInt32( String( ResId( KEY_RES, *pMgr ) ), 75 ); - sal_Bool bRleCoding = pConfigItem->ReadBool( String( ResId( KEY_RLE_CODING, *pMgr ) ), sal_True ); - - aLbColors.SelectEntryPos( Min( (sal_uInt16) 7, (sal_uInt16)nColors ) ); - - String aStrRes( String::CreateFromInt32( nRes ) ); - aStrRes.Append( String( RTL_CONSTASCII_USTRINGPARAM( " DPI" ) ) ); - aCbbRes.SetText( aStrRes ); - - ::com::sun::star::awt::Size aDefault( 10000, 10000 ); - ::com::sun::star::awt::Size aSize; - aSize = pConfigItem->ReadSize( String( ResId( KEY_SIZE, *pMgr ) ), aDefault ); - - aCbxRLE.Check( bRleCoding ); - - aMtfSizeX.SetDefaultUnit( FUNIT_MM ); - aMtfSizeY.SetDefaultUnit( FUNIT_MM ); - - aMtfSizeX.SetValue( aSize.Width ); - aMtfSizeY.SetValue( aSize.Height ); - - switch ( rPara.eFieldUnit ) - { -// case FUNIT_NONE : -// case FUNIT_KM : -// case FUNIT_PERCENT : -// case FUNIT_CUSTOM : -// case FUNIT_MILE : -// case FUNIT_FOOT : -// case FUNIT_M : - case FUNIT_MM : - case FUNIT_CM : - case FUNIT_TWIP : - case FUNIT_POINT : - case FUNIT_PICA : - case FUNIT_INCH : - case FUNIT_100TH_MM : - { - aMtfSizeX.SetUnit( rPara.eFieldUnit ); - aMtfSizeY.SetUnit( rPara.eFieldUnit ); - } - break; - - default: - break; // -Wall multiple values not handled. - } - - switch ( nMode ) - { - case 2 : - { - aRbSize.Check( TRUE ); - ClickRbSize( NULL ); - } - break; - case 1 : - { - aRbRes.Check( TRUE ); - ClickRbRes( NULL ); - } - break; - default : - { - aRbOriginal.Check( TRUE ); - ClickRbOriginal( NULL ); - } - break; - } - SelectLbColors( &aLbColors ); -} - -DlgExportPix::~DlgExportPix() -{ - delete pConfigItem; -} - - -/************************************************************************* -|* -|* Speichert eingestellte Werte in ini-Datei -|* -\************************************************************************/ - -IMPL_LINK( DlgExportPix, OK, void *, EMPTYARG ) -{ - // Config-Parameter schreiben - - sal_Int32 nRes = Max( Min( aCbbRes.GetText().ToInt32(), sal_Int32( 600 ) ), sal_Int32( 75 ) ); - ::com::sun::star::awt::Size aSize( - static_cast(MetricField::ConvertDoubleValue( static_cast(aMtfSizeX.GetValue()), 2, aMtfSizeX.GetUnit(), MAP_100TH_MM )), - static_cast(MetricField::ConvertDoubleValue( static_cast(aMtfSizeY.GetValue()), 2, aMtfSizeY.GetUnit(), MAP_100TH_MM )) ); - - sal_Int32 nMode; - if ( aRbRes.IsChecked() ) - nMode = 1; - else if ( aRbSize.IsChecked() ) - nMode = 2; - else - nMode = 0; - - pConfigItem->WriteInt32( String( ResId( KEY_MODE, *pMgr ) ), nMode ); - pConfigItem->WriteInt32( String( ResId( KEY_RES, *pMgr ) ), nRes ); - pConfigItem->WriteSize( String( ResId( KEY_SIZE, *pMgr ) ), aSize ); - pConfigItem->WriteInt32( String( ResId( KEY_COLORS, *pMgr ) ), (sal_Int32)aLbColors.GetSelectEntryPos() ); - pConfigItem->WriteBool( String( ResId( KEY_RLE_CODING, *pMgr ) ), aCbxRLE.IsChecked() ); - rFltCallPara.aFilterData = pConfigItem->GetFilterData(); - EndDialog( RET_OK ); - - return 0; -} - -/************************************************************************* -|* -|* Enabled/Disabled Controls -|* -\************************************************************************/ - -IMPL_LINK( DlgExportPix, ClickRbOriginal, void*, EMPTYARG ) -{ - aCbbRes.Disable(); - - aFtSizeX.Disable(); - aMtfSizeX.Disable(); - aFtSizeY.Disable(); - aMtfSizeY.Disable(); - - return 0; -} - - -/************************************************************************* -|* -|* Enabled/Disabled Controls -|* -\************************************************************************/ - -IMPL_LINK( DlgExportPix, ClickRbRes, void*, EMPTYARG ) -{ - aCbbRes.Enable(); - - aFtSizeX.Disable(); - aMtfSizeX.Disable(); - aFtSizeY.Disable(); - aMtfSizeY.Disable(); - - return 0; -} - - -/************************************************************************* -|* -|* Enabled/Disabled Controls -|* -\************************************************************************/ - -IMPL_LINK( DlgExportPix, ClickRbSize, void*, EMPTYARG ) -{ - aFtSizeX.Enable(); - aMtfSizeX.Enable(); - aFtSizeY.Enable(); - aMtfSizeY.Enable(); - - aCbbRes.Disable(); - - return 0; -} - - -/************************************************************************* -|* -|* Enabled/Disabled Controls -|* -\************************************************************************/ - -IMPL_LINK( DlgExportPix, SelectLbColors, void*, EMPTYARG ) -{ - const USHORT nLbPos = aLbColors.GetSelectEntryPos(); - - if ( ( nLbPos >= 3 ) && ( nLbPos <= 6 ) ) - aCbxRLE.Enable(); - else - aCbxRLE.Disable(); - - return 0L; -} - - -/******************************************************************************/ - - -/************************************************************************* -|* -|* Ctor -|* -\************************************************************************/ - -DlgExportVec::DlgExportVec( FltCallDialogParameter& rPara ) : - ModalDialog ( rPara.pWindow, ResId( DLG_EXPORT_VEC, *rPara.pResMgr ) ), - rFltCallPara ( rPara ), - aBtnOK ( this, ResId( BTN_OK_VEC, *rPara.pResMgr ) ), - aBtnCancel ( this, ResId( BTN_CANCEL_VEC, *rPara.pResMgr ) ), - aBtnHelp ( this, ResId( BTN_HELP_VEC, *rPara.pResMgr ) ), - aRbOriginal ( this, ResId( RB_ORIGINAL_VEC, *rPara.pResMgr ) ), - aRbSize ( this, ResId( RB_SIZE_VEC, *rPara.pResMgr ) ), - aGrpMode ( this, ResId( GRP_MODE_VEC, *rPara.pResMgr ) ), - aFtSizeX ( this, ResId( FT_SIZEX_VEC, *rPara.pResMgr ) ), - aMtfSizeX ( this, ResId( MTF_SIZEX_VEC, *rPara.pResMgr ) ), - aFtSizeY ( this, ResId( FT_SIZEY_VEC, *rPara.pResMgr ) ), - aMtfSizeY ( this, ResId( MTF_SIZEY_VEC, *rPara.pResMgr ) ), - aGrpSize ( this, ResId( GRP_SIZE_VEC, *rPara.pResMgr ) ), - pMgr ( rPara.pResMgr ), - aExt ( rPara.aFilterExt ) -{ - aExt.ToUpperAscii(); - String aFilterConfigPath( RTL_CONSTASCII_USTRINGPARAM( "Office.Common/Filter/Graphic/Export/" ) ); - aFilterConfigPath.Append( aExt ); - pConfigItem = new FilterConfigItem( aFilterConfigPath, &rPara.aFilterData ); - - String aTitle( aExt ); - FreeResource(); - - aBtnOK.SetClickHdl( LINK( this, DlgExportVec, OK ) ); - aRbOriginal.SetClickHdl( LINK( this, DlgExportVec, ClickRbOriginal ) ); - aRbSize.SetClickHdl( LINK( this, DlgExportVec, ClickRbSize ) ); - - aTitle.ToUpperAscii(); - aTitle += String( ResId( EXPORT_DIALOG_TITLE, *pMgr ) ); - SetText( aTitle ); - - // reading config-parameter - sal_Int32 nMode = pConfigItem->ReadInt32( String( ResId( KEY_MODE, *pMgr ) ), 0 ); - - ::com::sun::star::awt::Size aDefault( 10000, 10000 ); - ::com::sun::star::awt::Size aSize; - aSize = pConfigItem->ReadSize( String( ResId( KEY_SIZE, *pMgr ) ), aDefault ); - - aMtfSizeX.SetDefaultUnit( FUNIT_MM ); - aMtfSizeY.SetDefaultUnit( FUNIT_MM ); - aMtfSizeX.SetValue( aSize.Width ); - aMtfSizeY.SetValue( aSize.Height ); - - switch ( rPara.eFieldUnit ) - { -// case FUNIT_NONE : -// case FUNIT_KM : -// case FUNIT_PERCENT : -// case FUNIT_CUSTOM : -// case FUNIT_MILE : -// case FUNIT_FOOT : - case FUNIT_MM : - case FUNIT_CM : - case FUNIT_M : - case FUNIT_TWIP : - case FUNIT_POINT : - case FUNIT_PICA : - case FUNIT_INCH : - case FUNIT_100TH_MM : - { - aMtfSizeX.SetUnit( rPara.eFieldUnit ); - aMtfSizeY.SetUnit( rPara.eFieldUnit ); - } - break; - default: - break; // -Wall Multiple values not handled. - } - - switch ( nMode ) - { - case 1 : - { - aRbSize.Check( TRUE ); - ClickRbSize( NULL ); - } - break; - - default : - { - aRbOriginal.Check( TRUE ); - ClickRbOriginal( NULL ); - } - break; - } -} - -DlgExportVec::~DlgExportVec() -{ - delete pConfigItem; -} -/************************************************************************* -|* -|* Speichert eingestellte Werte in ini-Datei -|* -\************************************************************************/ - -IMPL_LINK( DlgExportVec, OK, void *, EMPTYARG ) -{ - // Config-Parameter schreiben - ::com::sun::star::awt::Size aSize( - static_cast(MetricField::ConvertDoubleValue( static_cast(aMtfSizeX.GetValue()), 2, aMtfSizeX.GetUnit(), MAP_100TH_MM )), - static_cast(MetricField::ConvertDoubleValue( static_cast(aMtfSizeY.GetValue()), 2, aMtfSizeY.GetUnit(), MAP_100TH_MM )) ); - - sal_Int32 nMode; - if ( aRbSize.IsChecked() ) - nMode = 1; - else - nMode = 0; - - pConfigItem->WriteInt32( String( ResId( KEY_MODE, *pMgr ) ), nMode ); - pConfigItem->WriteSize( String( ResId( KEY_SIZE, *pMgr ) ), aSize ); - rFltCallPara.aFilterData = pConfigItem->GetFilterData(); - EndDialog( RET_OK ); - - return 0; -} - -/************************************************************************* -|* -|* Enabled/Disabled Controls -|* -\************************************************************************/ - -IMPL_LINK( DlgExportVec, ClickRbOriginal, void*, EMPTYARG ) -{ - aGrpSize.Disable(); - aFtSizeX.Disable(); - aMtfSizeX.Disable(); - aFtSizeY.Disable(); - aMtfSizeY.Disable(); - - return 0; -} - - -/************************************************************************* -|* -|* Enabled/Disabled Controls -|* -\************************************************************************/ - -IMPL_LINK( DlgExportVec, ClickRbSize, void*, EMPTYARG ) -{ - aGrpSize.Enable(); - aFtSizeX.Enable(); - aMtfSizeX.Enable(); - aFtSizeY.Enable(); - aMtfSizeY.Enable(); - - return 0; -} - - - diff --git a/svtools/source/filter.vcl/filter/dlgexpor.hrc b/svtools/source/filter.vcl/filter/dlgexpor.hrc deleted file mode 100644 index 2e5377ce4fcb..000000000000 --- a/svtools/source/filter.vcl/filter/dlgexpor.hrc +++ /dev/null @@ -1,58 +0,0 @@ -/************************************************************************* - * - * 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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -#include - -#define BTN_OK_PIX 1 -#define BTN_CANCEL_PIX 1 -#define BTN_HELP_PIX 1 -#define CBX_RES_PIX 1 -#define CBX_SIZE_PIX 2 -#define CBX_RLE 3 -#define CBB_RES_PIX 1 -#define LB_COLORS 1 -#define MTF_SIZEX_PIX 1 -#define MTF_SIZEY_PIX 2 -#define FT_SIZEX_PIX 1 -#define FT_SIZEY_PIX 2 -#define GRP_MODE_PIX 1 -#define GRP_COLORS 4 -#define RB_ORIGINAL_PIX 1 -#define RB_RES_PIX 2 -#define RB_SIZE_PIX 3 - -#define BTN_OK_VEC 1 -#define BTN_CANCEL_VEC 1 -#define BTN_HELP_VEC 1 -#define CBX_SIZE_VEC 2 -#define MTF_SIZEX_VEC 1 -#define MTF_SIZEY_VEC 2 -#define FT_SIZEX_VEC 1 -#define FT_SIZEY_VEC 2 -#define GRP_SIZE_VEC 1 -#define GRP_MODE_VEC 2 -#define RB_ORIGINAL_VEC 1 -#define RB_SIZE_VEC 2 diff --git a/svtools/source/filter.vcl/filter/dlgexpor.hxx b/svtools/source/filter.vcl/filter/dlgexpor.hxx deleted file mode 100644 index 8c7b2d462e70..000000000000 --- a/svtools/source/filter.vcl/filter/dlgexpor.hxx +++ /dev/null @@ -1,127 +0,0 @@ -/************************************************************************* - * - * 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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - - -#ifndef _DLGEXPOR_HXX_ -#define _DLGEXPOR_HXX_ - -#include -#include -#include -#include -#include -#include - -/************************************************************************* -|* -|* Dialog zum Einstellen von Filteroptionen bei Pixelformaten -|* -\************************************************************************/ - -class FilterConfigItem; -class DlgExportPix : public ModalDialog -{ -private: - - FltCallDialogParameter& rFltCallPara; - - OKButton aBtnOK; - CancelButton aBtnCancel; - HelpButton aBtnHelp; - - ListBox aLbColors; - CheckBox aCbxRLE; - FixedLine aGrpColors; - - RadioButton aRbOriginal; - RadioButton aRbRes; - RadioButton aRbSize; - FixedText aFtSizeX; - MetricField aMtfSizeX; - FixedText aFtSizeY; - MetricField aMtfSizeY; - FixedLine aGrpMode; - ComboBox aCbbRes; - - FilterConfigItem* pConfigItem; - ResMgr* pMgr; - - String aExt; - - DECL_LINK( OK, void* p ); - DECL_LINK( ClickRbOriginal,void* p ); - DECL_LINK( ClickRbRes,void* p ); - DECL_LINK( ClickRbSize,void* p ); - DECL_LINK( SelectLbColors, void* p ); - -public: - DlgExportPix( FltCallDialogParameter& rPara ); - ~DlgExportPix(); -}; - - -/************************************************************************* -|* -|* Dialog zum Einstellen von Filteroptionen bei Vektorformaten -|* -\************************************************************************/ -class DlgExportVec : public ModalDialog -{ -private: - - FltCallDialogParameter& rFltCallPara; - - OKButton aBtnOK; - CancelButton aBtnCancel; - HelpButton aBtnHelp; - - RadioButton aRbOriginal; - RadioButton aRbSize; - FixedLine aGrpMode; - - FixedText aFtSizeX; - MetricField aMtfSizeX; - FixedText aFtSizeY; - MetricField aMtfSizeY; - FixedLine aGrpSize; - - FilterConfigItem* pConfigItem; - ResMgr* pMgr; - - String aExt; - - DECL_LINK( OK, void* p ); - DECL_LINK( ClickRbOriginal,void* p ); - DECL_LINK( ClickRbSize,void* p ); - -public: - DlgExportVec( FltCallDialogParameter& rPara ); - ~DlgExportVec(); -}; - -#endif // _DLGEXPOR_HXX_ - diff --git a/svtools/source/filter.vcl/filter/dlgexpor.src b/svtools/source/filter.vcl/filter/dlgexpor.src deleted file mode 100644 index 7573b394d72f..000000000000 --- a/svtools/source/filter.vcl/filter/dlgexpor.src +++ /dev/null @@ -1,315 +0,0 @@ -/************************************************************************* - * - * 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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - - -#include "dlgexpor.hrc" - -ModalDialog DLG_EXPORT_PIX -{ - OutputSize = TRUE ; - SVLook = TRUE ; - Size = MAP_APPFONT ( 178 , 135 ) ; - Moveable = TRUE ; - Closeable = TRUE ; - FixedLine GRP_COLORS - { - Pos = MAP_APPFONT ( 6 , 3 ) ; - Size = MAP_APPFONT ( 110 , 8 ) ; - Text [ en-US ] = "Color resolution" ; - }; - ListBox LB_COLORS - { - Pos = MAP_APPFONT ( 12 , 14 ) ; - Size = MAP_APPFONT ( 98 , 90 ) ; - TabStop = TRUE ; - DropDown = TRUE ; - AutoHScroll = TRUE ; - StringList [ en-US ] = - { - < "Original" ; Default ; > ; - < "1 Bit - Threshold Value" ; Default ; > ; - < "1 Bit - Dithering" ; Default ; > ; - < "4 Bit - Grayscale" ; Default ; > ; - < "4 Bit - Color Palette" ; Default ; > ; - < "8 Bit - Grayscales" ; Default ; > ; - < "8 Bit - Color Palette" ; Default ; > ; - < "24 Bit - True Colors" ; Default ; > ; - }; - }; - CheckBox CBX_RLE - { - Pos = MAP_APPFONT ( 12 , 31 ) ; - Size = MAP_APPFONT ( 98 , 12 ) ; - TabStop = TRUE ; - Text [ en-US ] = "RLE coding" ; - }; - FixedLine GRP_MODE_PIX - { - Pos = MAP_APPFONT ( 6 , 48 ) ; - Size = MAP_APPFONT ( 110 , 8 ) ; - Text [ en-US ] = "Mode" ; - }; - RadioButton RB_ORIGINAL_PIX - { - Pos = MAP_APPFONT ( 12 , 59 ) ; - Size = MAP_APPFONT ( 98 , 10 ) ; - TabStop = TRUE ; - Text [ en-US ] = "~Original" ; - }; - RadioButton RB_RES_PIX - { - Pos = MAP_APPFONT ( 12 , 73 ) ; - Size = MAP_APPFONT ( 55 , 10 ) ; - TabStop = TRUE ; - Text [ en-US ] = "~Resolution" ; - }; - ComboBox CBB_RES_PIX - { - Pos = MAP_APPFONT ( 70 , 73 ) ; - Size = MAP_APPFONT ( 40 , 50 ) ; - TabStop = TRUE ; - DropDown = TRUE ; - StringList = - { - "75 DPI" ; - "150 DPI" ; - "300 DPI" ; - "600 DPI" ; - }; - }; - RadioButton RB_SIZE_PIX - { - Pos = MAP_APPFONT ( 12 , 87 ) ; - Size = MAP_APPFONT ( 98 , 10 ) ; - TabStop = TRUE ; - Text [ en-US ] = "~Size" ; - }; - MetricField MTF_SIZEX_PIX - { - Border = TRUE ; - Pos = MAP_APPFONT ( 60 , 101 ) ; - Size = MAP_APPFONT ( 50 , 12 ) ; - TabStop = TRUE ; - Repeat = TRUE ; - Spin = TRUE ; - Minimum = 100 ; - Maximum = 99999 ; - StrictFormat = TRUE ; - DecimalDigits = 2 ; - Unit = FUNIT_MM ; - First = 100 ; - Last = 99999 ; - SpinSize = 100 ; - }; - FixedText FT_SIZEX_PIX - { - Pos = MAP_APPFONT ( 18 , 102 ) ; - Size = MAP_APPFONT ( 41 , 10 ) ; - Text [ en-US ] = "Width" ; - }; - MetricField MTF_SIZEY_PIX - { - Border = TRUE ; - Pos = MAP_APPFONT ( 60 , 117 ) ; - Size = MAP_APPFONT ( 50 , 12 ) ; - TabStop = TRUE ; - Repeat = TRUE ; - Spin = TRUE ; - Minimum = 100 ; - Maximum = 99999 ; - StrictFormat = TRUE ; - DecimalDigits = 2 ; - Unit = FUNIT_MM ; - First = 100 ; - Last = 99999 ; - SpinSize = 100 ; - }; - FixedText FT_SIZEY_PIX - { - Pos = MAP_APPFONT ( 18 , 118 ) ; - Size = MAP_APPFONT ( 41 , 10 ) ; - Text [ en-US ] = "Height" ; - }; - OKButton BTN_OK_PIX - { - Pos = MAP_APPFONT ( 122 , 6 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - TabStop = TRUE ; - DefButton = TRUE ; - }; - CancelButton BTN_CANCEL_PIX - { - Pos = MAP_APPFONT ( 122 , 23 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - TabStop = TRUE ; - }; - HelpButton BTN_HELP_PIX - { - Pos = MAP_APPFONT ( 122 , 43 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - TabStop = TRUE ; - }; -}; -ModalDialog DLG_EXPORT_VEC -{ - OutputSize = TRUE ; - SVLook = TRUE ; - Size = MAP_APPFONT ( 178 , 89 ) ; - Moveable = TRUE ; - Closeable = TRUE ; - - FixedLine GRP_MODE_VEC - { - Pos = MAP_APPFONT ( 6 , 3 ) ; - Size = MAP_APPFONT ( 110 , 8 ) ; - Text [ en-US ] = "Mode" ; - }; - RadioButton RB_ORIGINAL_VEC - { - Pos = MAP_APPFONT ( 12 , 14 ) ; - Size = MAP_APPFONT ( 98 , 10 ) ; - TabStop = TRUE ; - Text [ en-US ] = "~Original" ; - }; - RadioButton RB_SIZE_VEC - { - Pos = MAP_APPFONT ( 12 , 28 ) ; - Size = MAP_APPFONT ( 98 , 10 ) ; - TabStop = TRUE ; - Text [ en-US ] = "~Size" ; - }; - FixedLine GRP_SIZE_VEC - { - Pos = MAP_APPFONT ( 6 , 44 ) ; - Size = MAP_APPFONT ( 110 , 8 ) ; - Text [ en-US ] = "Size" ; - }; - FixedText FT_SIZEX_VEC - { - Pos = MAP_APPFONT ( 12 , 56 ) ; - Size = MAP_APPFONT ( 45 , 10 ) ; - Text [ en-US ] = "Width" ; - }; - MetricField MTF_SIZEX_VEC - { - Border = TRUE ; - Pos = MAP_APPFONT ( 60 , 55 ) ; - Size = MAP_APPFONT ( 50 , 12 ) ; - TabStop = TRUE ; - Repeat = TRUE ; - Spin = TRUE ; - Minimum = 100 ; - Maximum = 99999 ; - StrictFormat = TRUE ; - DecimalDigits = 2 ; - Unit = FUNIT_MM ; - First = 100 ; - Last = 99999 ; - SpinSize = 100 ; - }; - FixedText FT_SIZEY_VEC - { - Pos = MAP_APPFONT ( 12 , 72 ) ; - Size = MAP_APPFONT ( 45 , 10 ) ; - Text [ en-US ] = "Height" ; - }; - MetricField MTF_SIZEY_VEC - { - Border = TRUE ; - Pos = MAP_APPFONT ( 60 , 71 ) ; - Size = MAP_APPFONT ( 50 , 12 ) ; - TabStop = TRUE ; - Repeat = TRUE ; - Spin = TRUE ; - Minimum = 100 ; - Maximum = 99999 ; - StrictFormat = TRUE ; - DecimalDigits = 2 ; - Unit = FUNIT_MM ; - First = 100 ; - Last = 99999 ; - SpinSize = 100 ; - }; - OKButton BTN_OK_VEC - { - Pos = MAP_APPFONT ( 122 , 6 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - TabStop = TRUE ; - DefButton = TRUE ; - }; - CancelButton BTN_CANCEL_VEC - { - Pos = MAP_APPFONT ( 122 , 24 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - TabStop = TRUE ; - }; - HelpButton BTN_HELP_VEC - { - Pos = MAP_APPFONT ( 122 , 43 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - TabStop = TRUE ; - }; -}; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/svtools/source/filter.vcl/filter/exportdialog.cxx b/svtools/source/filter.vcl/filter/exportdialog.cxx new file mode 100755 index 000000000000..7e56be261dbb --- /dev/null +++ b/svtools/source/filter.vcl/filter/exportdialog.cxx @@ -0,0 +1,1474 @@ +/************************************************************************* + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_svtools.hxx" + +#ifndef GCC +# pragma hdrstop +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "exportdialog.hxx" +#include "exportdialog.hrc" + +#define FORMAT_UNKNOWN 0 +#define FORMAT_JPG 1 +#define FORMAT_PNG 2 +#define FORMAT_BMP 3 +#define FORMAT_GIF 4 +#define FORMAT_PBM 5 +#define FORMAT_PGM 6 +#define FORMAT_PPM 7 +#define FORMAT_PCT 8 +#define FORMAT_RAS 9 +#define FORMAT_TIF 10 +#define FORMAT_XPM 11 +#define FORMAT_WMF 12 +#define FORMAT_EMF 13 +#define FORMAT_EPS 14 +#define FORMAT_MET 15 +#define FORMAT_SVG 16 +#define FORMAT_SVM 17 + +#define UNIT_INCH 0 +#define UNIT_CM 1 +#define UNIT_MM 2 +#define UNIT_POINT 3 +#define UNIT_PIXEL 4 +#define UNIT_MAX_ID UNIT_PIXEL + +using namespace ::com::sun::star; + +static sal_Int16 GetFilterFormat( String& rExt ) +{ + sal_Int16 nFormat = FORMAT_UNKNOWN; + ByteString aExt( rExt, RTL_TEXTENCODING_UTF8 ); + if ( aExt.Equals( "JPG" ) ) + nFormat = FORMAT_JPG; + else if ( aExt.Equals( "PNG" ) ) + nFormat = FORMAT_PNG; + else if ( aExt.Equals( "BMP" ) ) + nFormat = FORMAT_BMP; + else if ( aExt.Equals( "GIF" ) ) + nFormat = FORMAT_GIF; + else if ( aExt.Equals( "PBM" ) ) + nFormat = FORMAT_PBM; + else if ( aExt.Equals( "PGM" ) ) + nFormat = FORMAT_PGM; + else if ( aExt.Equals( "PPM" ) ) + nFormat = FORMAT_PPM; + else if ( aExt.Equals( "PCT" ) ) + nFormat = FORMAT_PCT; + else if ( aExt.Equals( "RAS" ) ) + nFormat = FORMAT_RAS; + else if ( aExt.Equals( "TIF" ) ) + nFormat = FORMAT_TIF; + else if ( aExt.Equals( "XPM" ) ) + nFormat = FORMAT_XPM; + else if ( aExt.Equals( "WMF" ) ) + nFormat = FORMAT_WMF; + else if ( aExt.Equals( "EMF" ) ) + nFormat = FORMAT_EMF; + else if ( aExt.Equals( "EPS" ) ) + nFormat = FORMAT_EPS; + else if ( aExt.Equals( "MET" ) ) + nFormat = FORMAT_MET; + else if ( aExt.Equals( "SVG" ) ) + nFormat = FORMAT_SVG; + else if ( aExt.Equals( "SVM" ) ) + nFormat = FORMAT_SVM; + return nFormat; +} + +static MapUnit GetMapUnit( sal_Int32 nUnit ) +{ + MapUnit aMapUnit( MAP_PIXEL ); + switch( nUnit ) + { + case UNIT_INCH : aMapUnit = MAP_INCH; break; + case UNIT_CM : aMapUnit = MAP_CM; break; + case UNIT_MM : aMapUnit = MAP_MM; break; + case UNIT_POINT : aMapUnit = MAP_POINT; break; + case UNIT_PIXEL : aMapUnit = MAP_PIXEL; break; + } + return aMapUnit; +} + +static basegfx::B2DRange GetShapeRangeForXShape( const uno::Reference< drawing::XShape >& rxShape, + const uno::Reference< graphic::XPrimitiveFactory2D >& rxPrimitiveFactory2D, const uno::Sequence< beans::PropertyValue >& rViewInformation ) +{ + basegfx::B2DRange aShapeRange; + + const uno::Sequence< beans::PropertyValue > aParams; + const uno::Sequence< uno::Reference< graphic::XPrimitive2D > > aPrimitiveSequence( rxPrimitiveFactory2D->createPrimitivesFromXShape( rxShape, aParams ) ); + + const sal_Int32 nCount = aPrimitiveSequence.getLength(); + for( sal_Int32 nIndex = 0; nIndex < nCount; nIndex++ ) + { + const geometry::RealRectangle2D aRect( aPrimitiveSequence[ nIndex ]->getRange( rViewInformation ) ); + aShapeRange.expand( basegfx::B2DTuple( aRect.X1, aRect.Y1 ) ); + aShapeRange.expand( basegfx::B2DTuple( aRect.X2, aRect.Y2 ) ); + } + return aShapeRange; +} + +uno::Sequence< beans::PropertyValue > ExportDialog::GetFilterData( sal_Bool bUpdateConfig ) +{ + if ( bUpdateConfig ) + { + sal_Int32 nUnit = maLbSizeX.GetSelectEntryPos(); + if ( nUnit < 0 ) + nUnit = UNIT_CM; + + // updating ui configuration + if ( mbIsPixelFormat ) + { + if ( nUnit > UNIT_MAX_ID ) + nUnit = UNIT_PIXEL; + + sal_Int32 nResolution = maNfResolution.GetValue(); + if ( nResolution < 1 ) + nResolution = 96; + + mpOptionsItem->WriteInt32( String( RTL_CONSTASCII_USTRINGPARAM( "PixelExportUnit" ) ), nUnit ); + mpOptionsItem->WriteInt32( String( RTL_CONSTASCII_USTRINGPARAM( "PixelExportResolution" ) ), nResolution ); + mpOptionsItem->WriteInt32( String( RTL_CONSTASCII_USTRINGPARAM( "PixelExportResolutionUnit" ) ), maLbResolution.GetSelectEntryPos() ); + } + else + { + if ( nUnit >= UNIT_PIXEL ) + nUnit = UNIT_CM; + + mpOptionsItem->WriteInt32( String( RTL_CONSTASCII_USTRINGPARAM( "VectorExportUnit" ) ), nUnit ); + } + } + + FilterConfigItem* pFilterOptions; + if ( bUpdateConfig ) + pFilterOptions = mpFilterOptionsItem; + else + { + uno::Sequence< beans::PropertyValue > aFilterData( mpFilterOptionsItem->GetFilterData() ); + pFilterOptions = new FilterConfigItem( &aFilterData ); + } + + const String sLogicalWidth( String( RTL_CONSTASCII_USTRINGPARAM( "LogicalWidth" ) ) ); + const String sLogicalHeight( String( RTL_CONSTASCII_USTRINGPARAM( "LogicalHeight" ) ) ); + if ( mbIsPixelFormat ) + { + pFilterOptions->WriteInt32( String( RTL_CONSTASCII_USTRINGPARAM( "PixelWidth" ) ), static_cast< sal_Int32 >( maSize.Width ) ); + pFilterOptions->WriteInt32( String( RTL_CONSTASCII_USTRINGPARAM( "PixelHeight" ) ), static_cast< sal_Int32 >( maSize.Height ) ); + if ( maResolution.Width && maResolution.Height ) + { + const double f100thmmPerPixelX = 100000.0 / maResolution.Width; + const double f100thmmPerPixelY = 100000.0 / maResolution.Height; + sal_Int32 nLogicalWidth = static_cast< sal_Int32 >( f100thmmPerPixelX * maSize.Width ); + sal_Int32 nLogicalHeight= static_cast< sal_Int32 >( f100thmmPerPixelY * maSize.Height ); + if ( nLogicalWidth && nLogicalHeight ) + { + pFilterOptions->WriteInt32( sLogicalWidth, nLogicalWidth ); + pFilterOptions->WriteInt32( sLogicalHeight, nLogicalHeight ); + } + } + } + else + { + pFilterOptions->WriteInt32( sLogicalWidth, static_cast< sal_Int32 >( maSize.Width ) ); + pFilterOptions->WriteInt32( sLogicalHeight, static_cast< sal_Int32 >( maSize.Height ) ); + } + switch ( mnFormat ) + { + case FORMAT_JPG : + { + sal_Int32 nColor = maLbColorDepth.GetSelectEntryPos(); + if ( nColor == 1 ) + nColor = 0; + else + nColor = 1; + pFilterOptions->WriteInt32( String( RTL_CONSTASCII_USTRINGPARAM( "ColorMode" ) ), nColor ); + pFilterOptions->WriteInt32( String( RTL_CONSTASCII_USTRINGPARAM( "Quality" ) ), static_cast< sal_Int32 >( maSbCompression.GetThumbPos() ) ); + } + break; + + case FORMAT_PNG : + { + pFilterOptions->WriteInt32( String( RTL_CONSTASCII_USTRINGPARAM( "Compression" ) ), static_cast< sal_Int32 >( maSbCompression.GetThumbPos() ) ); + sal_Int32 nInterlace = 0; + if ( maCbInterlaced.IsChecked() ) + nInterlace++; + pFilterOptions->WriteInt32( String( RTL_CONSTASCII_USTRINGPARAM( "Interlaced" ) ), nInterlace ); + } + break; + + case FORMAT_BMP : + { + pFilterOptions->WriteInt32( String( RTL_CONSTASCII_USTRINGPARAM( "Color" ) ), maLbColorDepth.GetSelectEntryPos() + 1 ); + pFilterOptions->WriteBool( String( RTL_CONSTASCII_USTRINGPARAM( "RLE_Coding" ) ), maCbRLEEncoding.IsChecked() ); + } + break; + + case FORMAT_GIF : + { + sal_Int32 nValue = 0; + if ( maCbInterlaced.IsChecked() ) + nValue++; + pFilterOptions->WriteInt32( String( RTL_CONSTASCII_USTRINGPARAM( "Interlaced" ) ), nValue ); + + nValue = 0; + if ( maCbSaveTransparency.IsChecked() ) + nValue++; + pFilterOptions->WriteInt32( String( RTL_CONSTASCII_USTRINGPARAM( "Translucent" ) ), nValue ); + } + break; + + case FORMAT_PBM : + case FORMAT_PGM : + case FORMAT_PPM : + { + sal_Int32 nFormat = 0; + if ( maRbText.IsChecked() ) + nFormat++; + pFilterOptions->WriteInt32( String( RTL_CONSTASCII_USTRINGPARAM( "FileFormat" ) ), nFormat ); + } + break; + + case FORMAT_EPS : + { + sal_Int32 nCheck = 0; + if ( maCbEPSPreviewTIFF.IsChecked() ) + nCheck++; + if ( maCbEPSPreviewEPSI.IsChecked() ) + nCheck += 2; + pFilterOptions->WriteInt32( String( RTL_CONSTASCII_USTRINGPARAM( "Preview" ) ), nCheck ); + + nCheck = 1; + if ( maRbEPSLevel2.IsChecked() ) + nCheck++; + pFilterOptions->WriteInt32( String( RTL_CONSTASCII_USTRINGPARAM( "Version" ) ), nCheck ); + + nCheck = 1; + if ( maRbEPSColorFormat2.IsChecked() ) + nCheck++; + pFilterOptions->WriteInt32( String( RTL_CONSTASCII_USTRINGPARAM( "ColorFormat" ) ), nCheck ); + + nCheck = 1; + if ( maRbEPSCompressionNone.IsChecked() ) + nCheck++; + pFilterOptions->WriteInt32( String( RTL_CONSTASCII_USTRINGPARAM( "CompressionMode" ) ), nCheck ); + } + break; + } + + uno::Sequence< beans::PropertyValue > aRet( pFilterOptions->GetFilterData() ); + if ( bUpdateConfig == sal_False ) + delete pFilterOptions; + return aRet; +} + +// +awt::Size ExportDialog::GetOriginalSize() +{ + basegfx::B2DRange aShapesRange; + + if ( mxPage.is () ) + { + uno::Reference< beans::XPropertySet > xPagePropSet( mxPage, uno::UNO_QUERY ); + if ( xPagePropSet.is() ) + { + sal_Int32 nWidth = 0; + sal_Int32 nHeight= 0; + com::sun::star::uno::Any aAny; + aAny = xPagePropSet->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Width" ) ) ); + aAny >>= nWidth; + aAny = xPagePropSet->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Height" ) ) ); + aAny >>= nHeight; + aShapesRange = basegfx::B2DRange( 0, 0, nWidth, nHeight ); + } + } + else + { + uno::Reference< graphic::XPrimitiveFactory2D > xPrimitiveFactory( + mxMgr->createInstance( String( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.graphic.PrimitiveFactory2D" ) ) ), uno::UNO_QUERY ); + if ( xPrimitiveFactory.is() ) + { + basegfx::B2DHomMatrix aViewTransformation( Application::GetDefaultDevice()->GetViewTransformation() ); + com::sun::star::geometry::AffineMatrix2D aTransformation; + aTransformation.m00 = aViewTransformation.get(0,0); + aTransformation.m01 = aViewTransformation.get(0,1); + aTransformation.m02 = aViewTransformation.get(0,2); + aTransformation.m10 = aViewTransformation.get(1,0); + aTransformation.m11 = aViewTransformation.get(1,1); + aTransformation.m12 = aViewTransformation.get(1,2); + + const rtl::OUString sViewTransformation( RTL_CONSTASCII_USTRINGPARAM( "ViewTransformation" ) ); + uno::Sequence< beans::PropertyValue > aViewInformation( 1 ); + aViewInformation[ 0 ].Value <<= aTransformation; + aViewInformation[ 0 ].Name = sViewTransformation; + + if ( mxShape.is() ) + aShapesRange = GetShapeRangeForXShape( mxShape, xPrimitiveFactory, aViewInformation ); + else if ( mxShapes.is() ) + { + const sal_Int32 nCount = mxShapes->getCount(); + for( sal_Int32 nIndex = 0; nIndex < nCount; nIndex++ ) + { + uno::Reference< drawing::XShape > xShape; + mxShapes->getByIndex( nIndex ) >>= xShape; + aShapesRange.expand( GetShapeRangeForXShape( xShape, xPrimitiveFactory, aViewInformation ) ); + } + } + } + } + return awt::Size( aShapesRange.getWidth(), aShapesRange.getHeight() ); +} + +void ExportDialog::GetGraphicSource() +{ + if ( mxSourceDocument.is() ) + { + uno::Reference< frame::XModel > xModel( mxSourceDocument, uno::UNO_QUERY ); + if ( xModel.is() ) + { + uno::Reference< frame::XController > xController( xModel->getCurrentController() ); + if ( xController.is() ) + { + if ( mbExportSelection ) // check if there is a selection + { + uno::Reference< view::XSelectionSupplier > xSelectionSupplier( xController, uno::UNO_QUERY ); + if ( xSelectionSupplier.is() ) + { + uno::Any aAny( xSelectionSupplier->getSelection() ); + if ( ! ( aAny >>= mxShapes ) ) + aAny >>= mxShape; + } + } + if ( !mxShape.is() && !mxShapes.is() ) + { + uno::Reference< drawing::XDrawView > xDrawView( xController, uno::UNO_QUERY ); + if ( xDrawView.is() ) + { + uno::Reference< drawing::XDrawPage > xCurrentPage( xDrawView->getCurrentPage() ); + if ( xCurrentPage.is() ) + { + mxPage = xCurrentPage; // exporting whole page + } + } + } + } + } + } +} + +sal_Bool ExportDialog::GetGraphicStream() +{ + sal_Bool bRet = sal_False; + + if ( !IsTempExportAvailable() ) + { + delete mpTempStream, mpTempStream = new SvMemoryStream(); + maBitmap = Bitmap(); + return bRet; + } + + sal_Bool bRecreateOutputStream = mpTempStream->Tell() == 0; + + static uno::Sequence< beans::PropertyValue > aOldFilterData; + uno::Sequence< beans::PropertyValue > aNewFilterData( GetFilterData( sal_False ) ); + if ( aOldFilterData != aNewFilterData ) + { + aOldFilterData = aNewFilterData; + bRecreateOutputStream = sal_True; + } + try + { + if ( bRecreateOutputStream ) + { + delete mpTempStream, mpTempStream = new SvMemoryStream(); + maBitmap = Bitmap(); + + uno::Reference < io::XStream > xStream( new utl::OStreamWrapper( *mpTempStream ) ); + uno::Reference < io::XOutputStream > xOutputStream( xStream->getOutputStream() ); + + uno::Reference< document::XExporter > xGraphicExporter( + mxMgr->createInstance( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.GraphicExportFilter") ) ), uno::UNO_QUERY_THROW ); + uno::Reference< document::XFilter > xFilter( xGraphicExporter, uno::UNO_QUERY_THROW ); + + sal_Int32 nProperties = 2; + uno::Sequence< beans::PropertyValue > aFilterData( nProperties ); + + + rtl::OUString sFormat( maExt ); + uno::Sequence< beans::PropertyValue > aDescriptor( 3 ); + aDescriptor[0].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("OutputStream") ); + aDescriptor[0].Value <<= xOutputStream; + aDescriptor[1].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("FilterName") ); + aDescriptor[1].Value <<= sFormat; + aDescriptor[2].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("FilterData") ); + aDescriptor[2].Value <<= aNewFilterData; + + uno::Reference< lang::XComponent > xSourceDoc; + if ( mxPage.is() ) + xSourceDoc = uno::Reference< lang::XComponent >( mxPage, uno::UNO_QUERY_THROW ); + else if ( mxShapes.is() ) + xSourceDoc = uno::Reference< lang::XComponent >( mxShapes, uno::UNO_QUERY_THROW ); + else if ( mxShape.is() ) + xSourceDoc = uno::Reference< lang::XComponent >( mxShape, uno::UNO_QUERY_THROW );; + if ( xSourceDoc.is() ) + { + xGraphicExporter->setSourceDocument( xSourceDoc ); + xFilter->filter( aDescriptor ); + bRet = sal_True; + + if ( mnFormat == FORMAT_JPG ) + { + mpTempStream->Seek( STREAM_SEEK_TO_BEGIN ); + maBitmap = GetGraphicBitmap( *mpTempStream ); + mpTempStream->Seek( STREAM_SEEK_TO_END ); + } + } + } + else + bRet = sal_True; + } + catch( uno::Exception& ) + { + + // ups + + } + return bRet; +} + +Bitmap ExportDialog::GetGraphicBitmap( SvStream& rInputStream ) +{ + Bitmap aRet; + Graphic aGraphic; + GraphicFilter aFilter( sal_False ); + if ( aFilter.ImportGraphic( aGraphic, String(), rInputStream, GRFILTER_FORMAT_NOTFOUND, NULL, 0, NULL ) == GRFILTER_OK ) + { + aRet = aGraphic.GetBitmap(); + } + return aRet; +} + +sal_uInt32 ExportDialog::GetRawFileSize() const +{ + sal_uInt64 nRawFileSize = 0; + if ( mbIsPixelFormat ) + { + sal_Int32 nBitsPerPixel = 24; + String aEntry( maLbColorDepth.GetSelectEntry() ); + if ( ms1BitTreshold == aEntry ) + nBitsPerPixel = 1; + else if ( ms1BitDithered == aEntry ) + nBitsPerPixel = 1; + else if ( ms4BitGrayscale == aEntry ) + nBitsPerPixel = 4; + else if ( ms4BitColorPalette == aEntry ) + nBitsPerPixel = 8; + else if ( ms8BitGrayscale == aEntry ) + nBitsPerPixel = 8; + else if ( ms8BitColorPalette == aEntry ) + nBitsPerPixel = 8; + else if ( ms24BitColor == aEntry ) + nBitsPerPixel = 24; + + if ( mbIsPixelFormat ) + { + nRawFileSize = ( maSize.Width * nBitsPerPixel + 7 ) &~ 7; // rounding up to 8 bits + nRawFileSize /= 8; // in bytes + nRawFileSize *= maSize.Height; + } + if ( nRawFileSize > SAL_MAX_UINT32 ) + nRawFileSize = 0; + } + return static_cast< sal_uInt32 >( nRawFileSize ); +} + +// checks if the source dimension/resolution is not too big +// to determine the exact graphic output size and preview for jpg +sal_Bool ExportDialog::IsTempExportAvailable() const +{ + return GetRawFileSize() < mnMaxFilesizeForRealtimePreview; +} + +ExportDialog::ExportDialog( FltCallDialogParameter& rPara, + const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory > rxMgr, + const com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent >& rxSourceDocument, + sal_Bool bExportSelection, sal_Bool bIsPixelFormat ) : + ModalDialog ( rPara.pWindow, ResId( DLG_EXPORT, *rPara.pResMgr ) ), + mrFltCallPara ( rPara ), + mpMgr ( rPara.pResMgr ), + mxMgr ( rxMgr ), + mxSourceDocument ( rxSourceDocument ), + maFlExportSize ( this, ResId( FL_EXPORT_SIZE, *rPara.pResMgr ) ), + maFtSizeX ( this, ResId( FT_SIZEX, *rPara.pResMgr ) ), + maMfSizeX ( this, ResId( MF_SIZEX, *rPara.pResMgr ) ), + maLbSizeX ( this, ResId( LB_SIZEX, *rPara.pResMgr ) ), + maFtSizeY ( this, ResId( FT_SIZEY, *rPara.pResMgr ) ), + maMfSizeY ( this, ResId( MF_SIZEY, *rPara.pResMgr ) ), + maLbSizeY ( this, ResId( LB_SIZEY, *rPara.pResMgr ) ), + maFtResolution ( this, ResId( FT_RESOLUTION, *rPara.pResMgr ) ), + maNfResolution ( this, ResId( NF_RESOLUTION, *rPara.pResMgr ) ), + maLbResolution ( this, ResId( LB_RESOLUTION, *rPara.pResMgr ) ), + maFlColorDepth ( this, ResId( FL_COLOR_DEPTH, *rPara.pResMgr ) ), + maLbColorDepth ( this, ResId( LB_COLOR_DEPTH, *rPara.pResMgr ) ), + maFlJPGQuality ( this, ResId( FL_JPG_QUALITY, *rPara.pResMgr ) ), + maFlMode ( this, ResId( FL_MODE, *rPara.pResMgr ) ), + maFlPBMOptions ( this, ResId( FL_PBM_OPTIONS, *rPara.pResMgr ) ), + maSbCompression ( this, ResId( SB_COMPRESSION, *rPara.pResMgr ) ), + maNfCompression ( this, ResId( NF_COMPRESSION, *rPara.pResMgr ) ), + maFtJPGMin ( this, ResId( FT_JPG_MIN, *rPara.pResMgr ) ), + maFtJPGMax ( this, ResId( FT_JPG_MAX, *rPara.pResMgr ) ), + maFtPNGMin ( this, ResId( FT_PNG_MIN, *rPara.pResMgr ) ), + maFtPNGMax ( this, ResId( FT_PNG_MAX, *rPara.pResMgr ) ), + maCbJPGPreview ( this, ResId( CB_JPG_PREVIEW, *rPara.pResMgr ) ), + maCbInterlaced ( this, ResId( CB_INTERLACED, *rPara.pResMgr ) ), + maCbRLEEncoding ( this, ResId( CB_RLE_ENCODING, *rPara.pResMgr ) ), + maFlGIFDrawingObjects ( this, ResId( FL_GIF_DRAWING_OBJECTS, *rPara.pResMgr ) ), + maCbSaveTransparency ( this, ResId( CB_SAVE_TRANSPARENCY, *rPara.pResMgr ) ), + maFlEPSPreview ( this, ResId( FL_EPS_PREVIEW, *rPara.pResMgr ) ), + maCbEPSPreviewTIFF ( this, ResId( CB_EPS_PREVIEW_TIFF, *rPara.pResMgr ) ), + maCbEPSPreviewEPSI ( this, ResId( CB_EPS_PREVIEW_EPSI, *rPara.pResMgr ) ), + maFlEPSVersion ( this, ResId( FL_EPS_VERSION, *rPara.pResMgr ) ), + maRbEPSLevel1 ( this, ResId( RB_EPS_LEVEL1, *rPara.pResMgr ) ), + maRbEPSLevel2 ( this, ResId( RB_EPS_LEVEL2, *rPara.pResMgr ) ), + maFlEPSColorFormat ( this, ResId( FL_EPS_COLOR_FORMAT, *rPara.pResMgr ) ), + maRbEPSColorFormat1 ( this, ResId( RB_EPS_COLOR_FORMAT1, *rPara.pResMgr ) ), + maRbEPSColorFormat2 ( this, ResId( RB_EPS_COLOR_FORMAT2, *rPara.pResMgr ) ), + maFlCompression ( this, ResId( FL_COMPRESSION, *rPara.pResMgr ) ), + maRbEPSCompressionLZW ( this, ResId( RB_EPS_COMPRESSION_LZW, *rPara.pResMgr ) ), + maRbEPSCompressionNone ( this, ResId( RB_EPS_COMPRESSION_NONE, *rPara.pResMgr ) ), + maRbBinary ( this, ResId( RB_BINARY, *rPara.pResMgr ) ), + maRbText ( this, ResId( RB_TEXT, *rPara.pResMgr ) ), + maFlEstimatedSize ( this, ResId( FL_ESTIMATED_SIZE, *rPara.pResMgr ) ), + maFtEstimatedSize ( this, ResId( FT_ESTIMATED_SIZE, *rPara.pResMgr ) ), + msEstimatedSizePix1 ( ResId( STR_ESTIMATED_SIZE_PIX_1, *rPara.pResMgr ) ), + msEstimatedSizePix2 ( ResId( STR_ESTIMATED_SIZE_PIX_2, *rPara.pResMgr ) ), + msEstimatedSizeVec ( ResId( STR_ESTIMATED_SIZE_VEC, *rPara.pResMgr ) ), + maFlButtons ( this, ResId( FL_BUTTONS, *rPara.pResMgr ) ), + maFbJPGPreview ( this, ResId( FB_JPG_PREVIEW, *rPara.pResMgr ) ), + maSbZoom ( this, ResId( SB_ZOOM, *rPara.pResMgr ) ), + maNfZoom ( this, ResId( NF_ZOOM, *rPara.pResMgr ) ), + maSbJPGPreviewHorz ( this, ResId( SB_JPG_PREVIEW_HORZ, *rPara.pResMgr ) ), + maSbJPGPreviewVert ( this, ResId( SB_JPG_PREVIEW_VERT, *rPara.pResMgr ) ), + maBtnOK ( this, ResId( BTN_OK, *rPara.pResMgr ) ), + maBtnCancel ( this, ResId( BTN_CANCEL, *rPara.pResMgr ) ), + maBtnHelp ( this, ResId( BTN_HELP, *rPara.pResMgr ) ), + ms1BitTreshold ( ResId( STR_1BIT_THRESHOLD, *rPara.pResMgr ) ), + ms1BitDithered ( ResId( STR_1BIT_DITHERED, *rPara.pResMgr ) ), + ms4BitGrayscale ( ResId( STR_4BIT_GRAYSCALE, *rPara.pResMgr ) ), + ms4BitColorPalette ( ResId( STR_4BIT_COLOR_PALETTE, *rPara.pResMgr ) ), + ms8BitGrayscale ( ResId( STR_8BIT_GRAYSCALE, *rPara.pResMgr ) ), + ms8BitColorPalette ( ResId( STR_8BIT_COLOR_PALETTE, *rPara.pResMgr ) ), + ms24BitColor ( ResId( STR_24BIT_TRUE_COLOR, *rPara.pResMgr ) ), + maExt ( rPara.aFilterExt ), + mnFormat ( FORMAT_UNKNOWN ), + mnMaxFilesizeForRealtimePreview( 0 ), + mpTempStream ( new SvMemoryStream() ), + maOriginalSize ( awt::Size( 0, 0 ) ), + mbPreview ( sal_False ), + mbIsPixelFormat ( bIsPixelFormat ), + mbExportSelection ( bExportSelection ), + mbPreserveAspectRatio ( sal_True ) +{ + GetGraphicSource(); + + maExt.ToUpperAscii(); + + String aFilterConfigPath( RTL_CONSTASCII_USTRINGPARAM( "Office.Common/Filter/Graphic/Export/" ) ); + mpOptionsItem = new FilterConfigItem( aFilterConfigPath, &rPara.aFilterData ); + aFilterConfigPath.Append( maExt ); + mpFilterOptionsItem = new FilterConfigItem( aFilterConfigPath, &rPara.aFilterData ); + + mnMaxFilesizeForRealtimePreview = mpOptionsItem->ReadInt32( String( RTL_CONSTASCII_USTRINGPARAM( "MaxFilesizeForRealtimePreview" ) ), 0 ); + + String aTitle( maExt ); + aTitle += String( ResId( DLG_EXPORT_TITLE, *mpMgr ) ); + SetText( aTitle ); + + mnFormat = GetFilterFormat( maExt ); + + Size aResolution( Application::GetDefaultDevice()->LogicToPixel( Size( 100, 100 ), MAP_CM ) ); + maResolution.Width = aResolution.Width(); + maResolution.Height= aResolution.Height(); + maOriginalSize = GetOriginalSize(); + if ( bIsPixelFormat ) + { + double fPixelsPer100thmm = static_cast< double >( maResolution.Width ) / 100000.0; + maSize = awt::Size( static_cast< sal_Int32 >( ( fPixelsPer100thmm * maOriginalSize.Width ) + 0.5 ), + static_cast< sal_Int32 >( ( fPixelsPer100thmm * maOriginalSize.Height ) + 0.5 ) ); + } + else + { + maSize = maOriginalSize; + } + + // Size + maLbSizeX.SetSelectHdl( LINK( this, ExportDialog, UpdateHdl ) ); + + maSbCompression.SetScrollHdl( LINK( this, ExportDialog, SbCompressionUpdateHdl ) ); + maNfCompression.SetModifyHdl( LINK( this, ExportDialog, UpdateHdl ) ); + + maMfSizeX.SetModifyHdl( LINK( this, ExportDialog, UpdateHdlMtfSizeX ) ); + maMfSizeY.SetModifyHdl( LINK( this, ExportDialog, UpdateHdlMtfSizeY ) ); + + maNfResolution.SetModifyHdl( LINK( this, ExportDialog, UpdateHdlNfResolution ) ); + maLbResolution.SetSelectHdl( LINK( this, ExportDialog, UpdateHdl ) ); + + maLbColorDepth.SetSelectHdl( LINK( this, ExportDialog, UpdateHdl ) ); + + maCbInterlaced.SetClickHdl( LINK( this, ExportDialog, UpdateHdl ) ); + + maCbSaveTransparency.SetClickHdl( LINK( this, ExportDialog, UpdateHdl ) ); + + maCbEPSPreviewTIFF.SetClickHdl( LINK( this, ExportDialog, UpdateHdl ) ); + maCbEPSPreviewEPSI.SetClickHdl( LINK( this, ExportDialog, UpdateHdl ) ); + + maRbEPSCompressionLZW.SetClickHdl( LINK( this, ExportDialog, UpdateHdl ) ); + maRbEPSCompressionNone.SetClickHdl( LINK( this, ExportDialog, UpdateHdl ) ); + + maRbBinary.SetClickHdl( LINK( this, ExportDialog, UpdateHdl ) ); + maRbText.SetClickHdl( LINK( this, ExportDialog, UpdateHdl ) ); + + + // JPG Preview +// maCbJPGPreview.SetClickHdl( LINK( this, ExportDialog, UpdateHdl ) ); +maCbJPGPreview.Enable( sal_False ); + + maSbJPGPreviewVert.SetScrollHdl( LINK( this, ExportDialog, UpdateHdl ) ); + maSbJPGPreviewHorz.SetScrollHdl( LINK( this, ExportDialog, UpdateHdl ) ); + maSbZoom.SetScrollHdl( LINK( this, ExportDialog, UpdateHdl ) ); + + // BMP + maCbRLEEncoding.SetClickHdl( LINK( this, ExportDialog, UpdateHdl ) ); + + // EPS + maRbEPSLevel1.SetClickHdl( LINK( this, ExportDialog, UpdateHdl ) ); + maRbEPSLevel2.SetClickHdl( LINK( this, ExportDialog, UpdateHdl ) ); + + maBtnOK.SetClickHdl( LINK( this, ExportDialog, OK ) ); + + setupLayout(); + updateControls(); + + FreeResource(); +} + +void ExportDialog::createSizeControls( vcl::RowOrColumn& rLayout ) +{ + size_t nIndex; + Size aBorder( LogicToPixel( Size( 5, 5 ), MapMode( MAP_APPFONT ) ) ); + long nIndent = aBorder.Width(); + + // Size controls + rLayout.addWindow( &maFlExportSize ); + + Size aLbMax( maLbSizeX.GetSizePixel() ); + aLbMax.Width() = Max( aLbMax.Width(), maLbResolution.GetSizePixel().Width() ); + + boost::shared_ptr< vcl::LabelColumn > xSizeColumns( new vcl::LabelColumn( &rLayout ) ); + rLayout.addChild( xSizeColumns ); + + // row 1 + boost::shared_ptr< vcl::RowOrColumn > xColumn( new vcl::RowOrColumn( xSizeColumns.get(), false ) ); + xSizeColumns->addRow( &maFtSizeX, xColumn, nIndent ); + Size aMinSize( maMfSizeX.GetSizePixel() ); + nIndex = xColumn->addWindow( &maMfSizeX ); + xColumn->setMinimumSize( nIndex, aMinSize ); + nIndex = xColumn->addWindow( &maLbSizeX ); + xColumn->setMinimumSize( nIndex, aLbMax ); + + // row 2 + xColumn = boost::shared_ptr< vcl::RowOrColumn >( new vcl::RowOrColumn( xSizeColumns.get(), false ) ); + xSizeColumns->addRow( &maFtSizeY, xColumn, nIndent ); + nIndex = xColumn->addWindow( &maMfSizeY ); + xColumn->setMinimumSize( nIndex, aMinSize ); + nIndex = xColumn->addWindow( &maLbSizeY ); + xColumn->setMinimumSize( nIndex, aLbMax ); + + // row 3 + if ( mbIsPixelFormat ) // TODO: (metafileresolutionsupport) + { + xColumn = boost::shared_ptr< vcl::RowOrColumn >( new vcl::RowOrColumn( xSizeColumns.get(), false ) ); + xSizeColumns->addRow( &maFtResolution, xColumn, nIndent ); + nIndex = xColumn->addWindow( &maNfResolution ); + xColumn->setMinimumSize( nIndex, aMinSize ); + nIndex = xColumn->addWindow( &maLbResolution ); + xColumn->setMinimumSize( nIndex, aLbMax ); + } + + sal_Int32 nUnit = mbIsPixelFormat + ? mpOptionsItem->ReadInt32( String( RTL_CONSTASCII_USTRINGPARAM( "PixelExportUnit" ) ), UNIT_PIXEL ) + : mpOptionsItem->ReadInt32( String( RTL_CONSTASCII_USTRINGPARAM( "VectorExportUnit" ) ), UNIT_CM ); + if ( !mbIsPixelFormat ) + { + maLbSizeX.RemoveEntry( UNIT_PIXEL ); // removing pixel + if ( nUnit >= UNIT_PIXEL ) + nUnit = UNIT_CM; + } + else if ( nUnit > UNIT_MAX_ID ) + nUnit = UNIT_PIXEL; + if ( nUnit < 0 ) + nUnit = UNIT_CM; + maLbSizeX.SelectEntryPos( static_cast< USHORT >( nUnit ) ); + + if ( mbIsPixelFormat ) // TODO: (metafileresolutionsupport) should be supported for vector formats also... this makes + { // sense eg for bitmap fillings in metafiles, to preserve high dpi output + // (atm without special vector support the bitmaps are rendered with 96dpi) + sal_Int32 nResolution = mpOptionsItem->ReadInt32( String( RTL_CONSTASCII_USTRINGPARAM( "PixelExportResolution" ) ), 96 ); + if ( nResolution < 1 ) + nResolution = 96; + maNfResolution.SetValue( nResolution ); + + sal_Int32 nResolutionUnit = mpOptionsItem->ReadInt32( String( RTL_CONSTASCII_USTRINGPARAM( "PixelExportResolutionUnit" ) ), 1 ); + if ( ( nResolutionUnit < 0 ) || ( nResolutionUnit > 2 ) ) + nResolutionUnit = 1; + maLbResolution.SelectEntryPos( static_cast< USHORT >( nResolutionUnit ) ); + } + + boost::shared_ptr< vcl::Spacer > xSpacer( new vcl::Spacer( &rLayout, 2 ) ); + rLayout.addChild( xSpacer ); +} + +void ExportDialog::createColorDepthControls( vcl::RowOrColumn& rLayout ) +{ + // Color Depth + Size aBorder( LogicToPixel( Size( 5, 5 ), MapMode( MAP_APPFONT ) ) ); + long nIndent = aBorder.Width(); + + boost::shared_ptr< vcl::RowOrColumn > xRow( new vcl::RowOrColumn( &rLayout, false ) ); + rLayout.addChild( xRow ); + xRow->addWindow( &maFlColorDepth ); + + xRow = boost::shared_ptr< vcl::RowOrColumn >( new vcl::RowOrColumn( &rLayout, false ) ); + rLayout.addChild( xRow ); + boost::shared_ptr< vcl::Indenter > xIndenter( new vcl::Indenter( &rLayout, nIndent ) ); + xRow->addChild( xIndenter ); + boost::shared_ptr< vcl::RowOrColumn > xRows( new vcl::RowOrColumn( &rLayout, true ) ); + xIndenter->setChild( xRows ); + xRows->addWindow( &maLbColorDepth ); + + boost::shared_ptr< vcl::Spacer > xSpacer( new vcl::Spacer( &rLayout, 2 ) ); + rLayout.addChild( xSpacer ); +} + +void ExportDialog::createScrollBar( vcl::RowOrColumn& rLayout ) +{ + boost::shared_ptr< vcl::RowOrColumn > xRow( new vcl::RowOrColumn( &rLayout, false ) ); + rLayout.addChild( xRow ); + + Size aMinSize( maSbCompression.GetSizePixel() ); + size_t nIndex = xRow->addWindow( &maSbCompression ); + xRow->setMinimumSize( nIndex, aMinSize ); + aMinSize = maNfCompression.GetSizePixel(); + nIndex = xRow->addWindow( &maNfCompression ); + xRow->setMinimumSize( nIndex, aMinSize ); +} + +void ExportDialog::createFilterOptions( vcl::RowOrColumn& rLayout ) +{ + Size aBorder( LogicToPixel( Size( 5, 5 ), MapMode( MAP_APPFONT ) ) ); + long nIndent = aBorder.Width(); + + switch( mnFormat ) + { + case FORMAT_JPG : + { + sal_Int32 nColor = mpFilterOptionsItem->ReadInt32( String( RTL_CONSTASCII_USTRINGPARAM( "ColorMode" ) ), 0 ); + if ( nColor == 1 ) + nColor = 0; + else + nColor = 1; + maLbColorDepth.InsertEntry( ms8BitGrayscale ); + maLbColorDepth.InsertEntry( ms24BitColor ); + maLbColorDepth.SelectEntryPos( nColor ); + createColorDepthControls( maLayout ); + + rLayout.addWindow( &maFlJPGQuality ); + + // Quality + boost::shared_ptr< vcl::Indenter > xIndenter( new vcl::Indenter( &rLayout, nIndent ) ); + rLayout.addChild( xIndenter ); + boost::shared_ptr< vcl::RowOrColumn > xRows( new vcl::RowOrColumn( &rLayout, true ) ); + xIndenter->setChild( xRows ); + createScrollBar( *xRows.get() ); + xRows->addWindow( &maFtJPGMin ); + xRows->addWindow( &maFtJPGMax ); + if ( maCbJPGPreview.IsEnabled() ) + xRows->addWindow( &maCbJPGPreview ); + + boost::shared_ptr< vcl::Spacer > xSpacer( new vcl::Spacer( &rLayout, 2 ) ); + rLayout.addChild( xSpacer ); + + sal_Int32 nQuality = mpFilterOptionsItem->ReadInt32( String( RTL_CONSTASCII_USTRINGPARAM( "Quality" ) ), 75 ); + if ( ( nQuality < 1 ) || ( nQuality > 100 ) ) + nQuality = 75; + + maSbCompression.SetRangeMin( 1 ); + maSbCompression.SetRangeMax( 100 ); + maNfCompression.SetMin( 1 ); + maNfCompression.SetMax( 100 ); + maNfCompression.SetValue( nQuality ); + maNfCompression.SetStrictFormat( sal_True ); + if ( maCbJPGPreview.IsEnabled() ) + maCbJPGPreview.Check( sal_False ); + } + break; + case FORMAT_PNG : + { + rLayout.addWindow( &maFlCompression ); + + // Compression 1..9 + boost::shared_ptr< vcl::Indenter > xIndenter( new vcl::Indenter( &rLayout, nIndent ) ); + rLayout.addChild( xIndenter ); + boost::shared_ptr< vcl::RowOrColumn > xRows( new vcl::RowOrColumn( &rLayout, true ) ); + xIndenter->setChild( xRows ); + createScrollBar( *xRows.get() ); + xRows->addWindow( &maFtPNGMin ); + xRows->addWindow( &maFtPNGMax ); + boost::shared_ptr< vcl::Spacer > xSpacer( new vcl::Spacer( &rLayout, 2 ) ); + rLayout.addChild( xSpacer ); + + // Interlaced + rLayout.addWindow( &maFlMode ); + xIndenter.reset( new vcl::Indenter( &rLayout, nIndent ) ); + rLayout.addChild( xIndenter ); + xRows.reset( new vcl::RowOrColumn( &rLayout, true ) ); + xIndenter->setChild( xRows ); + xRows->addWindow( &maCbInterlaced ); + + xSpacer.reset( new vcl::Spacer( &rLayout, 2 ) ); + rLayout.addChild( xSpacer ); + + sal_Int32 nCompression = mpFilterOptionsItem->ReadInt32( String( RTL_CONSTASCII_USTRINGPARAM( "Compression" ) ), 6 ); + if ( ( nCompression < 1 ) || ( nCompression > 9 ) ) + nCompression = 6; + maSbCompression.SetRangeMin( 1 ); + maSbCompression.SetRangeMax( 9 ); + maNfCompression.SetMin( 1 ); + maNfCompression.SetMax( 9 ); + maNfCompression.SetValue( 9 ); + maNfCompression.SetStrictFormat( sal_True ); + + maCbInterlaced.Check( mpFilterOptionsItem->ReadInt32( String( RTL_CONSTASCII_USTRINGPARAM( "Interlaced" ) ), 0 ) != 0 ); + } + break; + case FORMAT_BMP : + { + sal_Int32 nColor = mpFilterOptionsItem->ReadInt32( String( RTL_CONSTASCII_USTRINGPARAM( "Color" ) ), 0 ); + if ( nColor == 0 ) + nColor = 6; + else + nColor--; + maLbColorDepth.InsertEntry( ms1BitTreshold ); + maLbColorDepth.InsertEntry( ms1BitDithered ); + maLbColorDepth.InsertEntry( ms4BitGrayscale ); + maLbColorDepth.InsertEntry( ms4BitColorPalette ); + maLbColorDepth.InsertEntry( ms8BitGrayscale ); + maLbColorDepth.InsertEntry( ms8BitColorPalette ); + maLbColorDepth.InsertEntry( ms24BitColor ); + maLbColorDepth.SelectEntryPos( nColor ); + createColorDepthControls( maLayout ); + + rLayout.addWindow( &maFlCompression ); + // RLE coding + boost::shared_ptr< vcl::Indenter > xIndenter( new vcl::Indenter( &rLayout, nIndent ) ); + rLayout.addChild( xIndenter ); + boost::shared_ptr< vcl::RowOrColumn > xRows( new vcl::RowOrColumn( &rLayout, true ) ); + xIndenter->setChild( xRows ); + xRows->addWindow( &maCbRLEEncoding ); + boost::shared_ptr< vcl::Spacer > xSpacer( new vcl::Spacer( &rLayout, 2 ) ); + rLayout.addChild( xSpacer ); + + maCbRLEEncoding.Check( mpFilterOptionsItem->ReadBool( String( RTL_CONSTASCII_USTRINGPARAM( "RLE_Coding" ) ), sal_True ) ); + } + break; + case FORMAT_GIF : + { + rLayout.addWindow( &maFlMode ); + boost::shared_ptr< vcl::Indenter > xIndenter( new vcl::Indenter( &rLayout, nIndent ) ); + rLayout.addChild( xIndenter ); + boost::shared_ptr< vcl::RowOrColumn > xRows( new vcl::RowOrColumn( &rLayout, true ) ); + xIndenter->setChild( xRows ); + xRows->addWindow( &maCbInterlaced ); + boost::shared_ptr< vcl::Spacer > xSpacer( new vcl::Spacer( &rLayout, 2 ) ); + rLayout.addChild( xSpacer ); + + rLayout.addWindow( &maFlGIFDrawingObjects ); + xIndenter = boost::shared_ptr< vcl::Indenter >( new vcl::Indenter( &rLayout, nIndent ) ); + rLayout.addChild( xIndenter ); + xRows = boost::shared_ptr< vcl::RowOrColumn >( new vcl::RowOrColumn( &rLayout, true ) ); + xIndenter->setChild( xRows ); + xRows->addWindow( &maCbSaveTransparency ); + xSpacer.reset( new vcl::Spacer( &rLayout, 2 ) ); + rLayout.addChild( xSpacer ); + + maCbInterlaced.Check( mpFilterOptionsItem->ReadInt32( String( RTL_CONSTASCII_USTRINGPARAM( "Interlaced" ) ), 1 ) != 0 ); + maCbSaveTransparency.Check( mpFilterOptionsItem->ReadInt32( String( RTL_CONSTASCII_USTRINGPARAM( "Translucent" ) ), 1 ) != 0 ); + } + break; + case FORMAT_PBM : + case FORMAT_PGM : + case FORMAT_PPM : + { + rLayout.addWindow( &maFlJPGQuality ); + + // RB Binary / Text + boost::shared_ptr< vcl::Indenter > xIndenter( new vcl::Indenter( &rLayout, nIndent ) ); + rLayout.addChild( xIndenter ); + boost::shared_ptr< vcl::RowOrColumn > xRows( new vcl::RowOrColumn( &rLayout, true ) ); + xIndenter->setChild( xRows ); + xRows->addWindow( &maRbBinary ); + xRows->addWindow( &maRbText ); + boost::shared_ptr< vcl::Spacer > xSpacer( new vcl::Spacer( &rLayout, 2 ) ); + rLayout.addChild( xSpacer ); + + sal_Int32 nFormat = mpFilterOptionsItem->ReadInt32( String( RTL_CONSTASCII_USTRINGPARAM( "FileFormat" ) ), 1 ); + maRbBinary.Check( nFormat == 0 ); + maRbText.Check( nFormat != 0 ); + } + break; + case FORMAT_EPS : + { + boost::shared_ptr< vcl::RowOrColumn > xColumns( new vcl::RowOrColumn( &rLayout, false ) ); + rLayout.addChild( xColumns ); + boost::shared_ptr< vcl::RowOrColumn > xLeft( new vcl::RowOrColumn( &rLayout, true ) ); + xColumns->addChild( xLeft ); + + xLeft->addWindow( &maFlEPSPreview ); + boost::shared_ptr< vcl::Indenter > xIndenter( new vcl::Indenter( xLeft.get(), nIndent ) ); + xLeft->addChild( xIndenter ); + boost::shared_ptr< vcl::RowOrColumn > xRows( new vcl::RowOrColumn( xLeft.get(), true ) ); + xIndenter->setChild( xRows ); + xRows->addWindow( &maCbEPSPreviewTIFF ); + xRows->addWindow( &maCbEPSPreviewEPSI ); + boost::shared_ptr< vcl::Spacer > xSpacer( new vcl::Spacer( xLeft.get(), 2 ) ); + xLeft->addChild( xSpacer ); + + xLeft->addWindow( &maFlEPSVersion ); + xIndenter = boost::shared_ptr< vcl::Indenter >( new vcl::Indenter( xLeft.get(), nIndent ) ); + xLeft->addChild( xIndenter ); + xRows = boost::shared_ptr< vcl::RowOrColumn >( new vcl::RowOrColumn( xLeft.get(), true ) ); + xIndenter->setChild( xRows ); + xRows->addWindow( &maRbEPSLevel1 ); + xRows->addWindow( &maRbEPSLevel2 ); + xSpacer.reset( new vcl::Spacer( xLeft.get(), 2 ) ); + xLeft->addChild( xSpacer ); + + boost::shared_ptr< vcl::RowOrColumn > xRight( new vcl::RowOrColumn( &rLayout, true ) ); + xColumns->addChild( xRight ); + + xRight->addWindow( &maFlEPSColorFormat ); + xIndenter = boost::shared_ptr< vcl::Indenter >( new vcl::Indenter( xRight.get(), nIndent ) ); + xRight->addChild( xIndenter ); + xRows = boost::shared_ptr< vcl::RowOrColumn >( new vcl::RowOrColumn( xRight.get(), true ) ); + xIndenter->setChild( xRows ); + xRows->addWindow( &maRbEPSColorFormat1 ); + xRows->addWindow( &maRbEPSColorFormat2 ); + xSpacer.reset( new vcl::Spacer( xRight.get(), 2 ) ); + xRight->addChild( xSpacer ); + + xRight->addWindow( &maFlCompression ); + xIndenter = boost::shared_ptr< vcl::Indenter >( new vcl::Indenter( xRight.get(), nIndent ) ); + xRight->addChild( xIndenter ); + xRows = boost::shared_ptr< vcl::RowOrColumn >( new vcl::RowOrColumn( xRight.get(), true ) ); + xIndenter->setChild( xRows ); + xRows->addWindow( &maRbEPSCompressionLZW ); + xRows->addWindow( &maRbEPSCompressionNone ); + + xSpacer.reset( new vcl::Spacer( &rLayout, 2 ) ); + rLayout.addChild( xSpacer ); + + sal_Int32 nPreview = mpFilterOptionsItem->ReadInt32( String( RTL_CONSTASCII_USTRINGPARAM( "Preview" ) ), 0 ); + sal_Int32 nVersion = mpFilterOptionsItem->ReadInt32( String( RTL_CONSTASCII_USTRINGPARAM( "Version" ) ), 2 ); + sal_Int32 nColor = mpFilterOptionsItem->ReadInt32( String( RTL_CONSTASCII_USTRINGPARAM( "ColorFormat" ) ), 0 ); + sal_Int32 nCompr = mpFilterOptionsItem->ReadInt32( String( RTL_CONSTASCII_USTRINGPARAM( "CompressionMode" ) ), 2 ); + + mpFilterOptionsItem->ReadInt32( String( RTL_CONSTASCII_USTRINGPARAM( "TextMode" ) ), 0 ); + + maCbEPSPreviewTIFF.Check( ( nPreview & 1 ) != 0 ); + maCbEPSPreviewEPSI.Check( ( nPreview & 2 ) != 0 ); + + maRbEPSLevel1.Check( nVersion == 1 ); + maRbEPSLevel2.Check( nVersion == 2 ); + + maRbEPSColorFormat1.Check( nColor == 1 ); + maRbEPSColorFormat2.Check( nColor != 1 ); + + maRbEPSCompressionLZW.Check( nCompr == 1 ); + maRbEPSCompressionNone.Check( nCompr != 1 ); + } + break; + } +} + +void ExportDialog::createButtons( vcl::RowOrColumn& rLayout ) +{ + rLayout.addWindow( &maFlButtons ); + boost::shared_ptr< vcl::Spacer > xSpacer( new vcl::Spacer( &rLayout, 2 ) ); + rLayout.addChild( xSpacer ); + + Size aBorder( LogicToPixel( Size( 5, 5 ), MapMode( MAP_APPFONT ) ) ); + + boost::shared_ptr< vcl::RowOrColumn > xButtons( new vcl::RowOrColumn( &rLayout, false ) ); + size_t nIndex = rLayout.addChild( xButtons ); + rLayout.setBorders( nIndex, aBorder.Width(), 0, aBorder.Width(), aBorder.Width() ); + + Size aMinSize( maBtnCancel.GetSizePixel() ); + // insert help button + xButtons->setMinimumSize( xButtons->addWindow( &maBtnHelp ), aMinSize ); + + // insert a spacer, cancel and OK buttons are right aligned + + xSpacer.reset( new vcl::Spacer( xButtons.get(), 2 ) ); + xButtons->addChild( xSpacer ); + xButtons->setMinimumSize( xButtons->addWindow( &maBtnOK ), aMinSize ); + xButtons->setMinimumSize( xButtons->addWindow( &maBtnCancel ), aMinSize ); +} + +void ExportDialog::setupLayout() +{ + Size aBorder( LogicToPixel( Size( 5, 5 ), MapMode( MAP_APPFONT ) ) ); + maLayout.setParentWindow( this ); + maLayout.setOuterBorder( aBorder.Width() ); + + createSizeControls( maLayout ); + createFilterOptions( maLayout ); + + if ( mnMaxFilesizeForRealtimePreview || mbIsPixelFormat ) + { + maLayout.addWindow( &maFlEstimatedSize ); + maLayout.addWindow( &maFtEstimatedSize ); + } + createButtons( maLayout ); + + maLayout.show(); + maDialogSize = maLayout.getOptimalSize( WINDOWSIZE_PREFERRED ); + maLayout.setManagedArea( Rectangle( Point(), maDialogSize ) ); + SetOutputSizePixel( Size( mbPreview ? maDialogSize.Width() * 2 : maDialogSize.Width(), maDialogSize.Height() ) ); + + maRectFlButtons = Rectangle( maFlButtons.GetPosPixel(), maFlButtons.GetSizePixel() ); + maRectBtnHelp = Rectangle( maBtnHelp.GetPosPixel(), maBtnHelp.GetSizePixel() ); + maRectBtnOK = Rectangle( maBtnOK.GetPosPixel(), maBtnOK.GetSizePixel() ); + maRectBtnCancel = Rectangle( maBtnCancel.GetPosPixel(), maBtnOK.GetSizePixel() ); + + maLbSizeY.Hide(); +} + +static rtl::OUString ImpValueOfInKB( const sal_Int64& rVal ) +{ + double fVal( static_cast( rVal ) ); + fVal /= ( 1 << 10 ); + fVal += 0.05; + rtl::OUStringBuffer aVal( rtl::OUString::valueOf( fVal ) ); + sal_Int32 nX( rtl::OUString( aVal.getStr() ).indexOf( '.', 0 ) ); + if ( nX > 0 ) + aVal.setLength( nX + 2 ); + return aVal.makeStringAndClear(); +} + +sal_Int32 static GetZoomValueFromThumbPos( sal_Int32 nThumbPos ) +{ + sal_Int32 nProz = 0; + if ( nThumbPos <= 50 ) + nProz = nThumbPos * 2; // so a range of 50 represents 100% + else + nProz = ( ( nThumbPos - 50 ) * 60 ) + 100; // we want to scale up to 3000% + return nProz; +} + +void ExportDialog::updatePreview() +{ + // JPG +// maCbJPGPreview.Enable( IsTempExportAvailable() ); + +// if ( maCbJPGPreview.IsEnabled() && maCbJPGPreview.IsChecked() ) + if ( mbPreview ) + { + long nScrollBarSize = Application::GetSettings().GetStyleSettings().GetScrollBarSize(); + + Point aPreviewPos( maDialogSize.Width(), 0 ); + Size aPreviewSize( maDialogSize.Width(), maFlButtons.GetPosPixel().Y() ); + + Point aFixedBitmapPos( aPreviewPos ); + Size aFixedBitmapSize( aPreviewSize ); + + maSbZoom.Show( sal_False ); + maSbZoom.SetPosPixel( Point( aPreviewPos.X(), aPreviewPos.Y() ) ); + maSbZoom.SetSizePixel( Size( aPreviewSize.Width() / 4, nScrollBarSize ) ); + maNfZoom.Show( sal_False ); + maNfZoom.SetPosPixel( Point( aPreviewPos.X() + aPreviewSize.Width() / 4, aPreviewPos.Y() ) ); + maNfZoom.SetSizePixel( Size( aPreviewSize.Width() / 6, nScrollBarSize ) ); + maNfZoom.SetValue( GetZoomValueFromThumbPos( maSbZoom.GetThumbPos() ) ); + maFbJPGPreview.Show( sal_True ); + + sal_Int32 nZoom = GetZoomValueFromThumbPos( maSbZoom.GetThumbPos() ); + double fSizePixelX = static_cast< double >( maSize.Width * nZoom ) / 100.0; + double fSizePixelY = static_cast< double >( maSize.Height * nZoom ) / 100.0; + + double fXRatio = fSizePixelX / maSize.Width; // the size of each pixel + double fYRatio = fSizePixelY / maSize.Height; + + sal_Bool bHorzSb = fSizePixelX > aFixedBitmapSize.Width(); + sal_Bool bVertSb = fSizePixelY > aFixedBitmapSize.Height(); + if ( bHorzSb ) + { + aFixedBitmapSize.Height() -= nScrollBarSize; + + maSbJPGPreviewHorz.Show( sal_True ); + maSbJPGPreviewHorz.SetPosPixel( Point( aFixedBitmapPos.X(), aFixedBitmapPos.Y() + aFixedBitmapSize.Height() ) ); + maSbJPGPreviewHorz.SetSizePixel( Size( aFixedBitmapSize.Width(), nScrollBarSize ) ); + } + else + { + maSbJPGPreviewHorz.Show( sal_False ); + } + + + if ( bVertSb ) + { + aFixedBitmapSize.Width() -= nScrollBarSize; + + maSbJPGPreviewVert.Show( sal_True ); + maSbJPGPreviewVert.SetPosPixel( Point( aFixedBitmapPos.X() + aFixedBitmapSize.Width(), aFixedBitmapPos.Y() ) ); + maSbJPGPreviewVert.SetSizePixel( Size( nScrollBarSize, aFixedBitmapSize.Height() ) ); + } + else + { + maSbJPGPreviewVert.Show( sal_False ); + } + + Point aPos( 0, 0 ); + Size aSize; + if ( fXRatio > 1.0 ) + { + aSize.Width() = Max( maSize.Width, aFixedBitmapSize.Width() ); + aSize.Width() /= fXRatio; + } + else + { + aSize.Width() = Min( maSize.Width, aFixedBitmapSize.Width() ); + aSize.Width() /= fXRatio; + } + + if ( fYRatio > 1.0 ) + { + aSize.Height() = Max( maSize.Height, aFixedBitmapSize.Height() ); + aSize.Height() /= fYRatio; + } + else + { + aSize.Height() = Min( maSize.Height, aFixedBitmapSize.Height() ); + aSize.Height() /= fYRatio; + } + + if ( aSize.Width() < maSize.Width ) + { + sal_Int32 nXDiff = static_cast< sal_Int32 >( ( ( ( maSize.Width - aSize.Width() ) * maSbJPGPreviewHorz.GetThumbPos() ) / 100.0 ) ); + aPos.X() += nXDiff; + } + if ( aSize.Height() < maSize.Height ) + { + sal_Int32 nYDiff = static_cast< sal_Int32 >( ( ( ( maSize.Height - aSize.Height() ) * maSbJPGPreviewVert.GetThumbPos() ) / 100.0 ) ); + aPos.Y() += nYDiff; + } + + Bitmap aCroppedBitmap( maBitmap ); + aCroppedBitmap.Crop( Rectangle( aPos, aSize ) ); + aSize = aCroppedBitmap.GetSizePixel(); + aSize = Size( aSize.Width() * fXRatio, aSize.Height() * fYRatio ); + aCroppedBitmap.Scale( aSize ); + + if ( aSize.Width() > aFixedBitmapSize.Width() ) + aSize.Width() = aFixedBitmapSize.Width(); + if ( aSize.Height() > aFixedBitmapSize.Height() ) + aSize.Height() = aFixedBitmapSize.Height(); + Point aPoint( aFixedBitmapPos ); + if ( aSize.Width() < aFixedBitmapSize.Width() ) + aPoint.X() += ( aFixedBitmapSize.Width() - aSize.Width() ) / 2; + if ( aSize.Height() < aFixedBitmapSize.Height() ) + aPoint.Y() += ( aFixedBitmapSize.Height() - aSize.Height() ) / 2; + + maFbJPGPreview.SetPosPixel( aPoint ); + maFbJPGPreview.SetSizePixel( aSize ); + maFbJPGPreview.SetBitmap( aCroppedBitmap ); + + SetOutputSizePixel( Size( maDialogSize.Width() * 2, maDialogSize.Height() ) ); + + maFlButtons.SetSizePixel( Size( maRectFlButtons.GetWidth() * 2, maRectFlButtons.GetHeight() ) ); + maBtnHelp.SetPosPixel( Point( maRectBtnHelp.Left() + maDialogSize.Width(), maRectBtnHelp.Top() ) ); + maBtnOK.SetPosPixel( Point( maRectBtnOK.Left() + maDialogSize.Width(), maRectBtnOK.Top() ) ); + maBtnCancel.SetPosPixel( Point( maRectBtnCancel.Left() + maDialogSize.Width(), maRectBtnCancel.Top() ) ); + } + else + { + maSbZoom.Show( sal_False ); + maNfZoom.Show( sal_False ); + maFbJPGPreview.Show( sal_False ); + maSbJPGPreviewHorz.Show( sal_False ); + maSbJPGPreviewVert.Show( sal_False ); + + SetOutputSizePixel( maDialogSize ); + + maFlButtons.SetSizePixel( Size( maRectFlButtons.GetWidth(), maRectFlButtons.GetHeight() ) ); + maBtnHelp.SetPosPixel( Point( maRectBtnHelp.Left(), maRectBtnHelp.Top() ) ); + maBtnOK.SetPosPixel( Point( maRectBtnOK.Left(), maRectBtnOK.Top() ) ); + maBtnCancel.SetPosPixel( Point( maRectBtnCancel.Left(), maRectBtnCancel.Top() ) ); + } +} + +void ExportDialog::updateControls() +{ + GetGraphicStream(); + + // Size Controls + if ( !mbIsPixelFormat ) + { + awt::Size aSize100thmm( maSize ); + Size aSize( LogicToLogic( Size( aSize100thmm.Width * 100, aSize100thmm.Height * 100 ), MAP_100TH_MM, + MapMode( GetMapUnit( maLbSizeX.GetSelectEntryPos() ) ) ) ); + maMfSizeX.SetValue( aSize.Width() ); + maMfSizeY.SetValue( aSize.Height() ); + } + else + { + MapUnit aMapUnit( GetMapUnit( maLbSizeX.GetSelectEntryPos() ) ); + if ( aMapUnit == MAP_PIXEL ) + { // calculating pixel count via resolution and original graphic size + maMfSizeX.SetDecimalDigits( 0 ); + maMfSizeY.SetDecimalDigits( 0 ); + maMfSizeX.SetValue( maSize.Width ); + maMfSizeY.SetValue( maSize.Height ); + } + else + { + maMfSizeX.SetDecimalDigits( 2 ); + maMfSizeY.SetDecimalDigits( 2 ); + double fRatio; + switch( GetMapUnit( maLbSizeX.GetSelectEntryPos() ) ) + { + case MAP_INCH : fRatio = static_cast< double >( maResolution.Width ) * 0.0254; break; + case MAP_MM : fRatio = static_cast< double >( maResolution.Width ) * 0.001; break; + case MAP_POINT :fRatio = ( static_cast< double >( maResolution.Width ) * 0.0254 ) / 72.0; break; + default: + case MAP_CM : fRatio = static_cast< double >( maResolution.Width ) * 0.01; break; + } + maMfSizeX.SetValue( static_cast< sal_Int32 >( ( static_cast< double >( maSize.Width * 100 ) / fRatio ) + 0.5 ) ); + maMfSizeY.SetValue( static_cast< sal_Int32 >( ( static_cast< double >( maSize.Height * 100 ) / fRatio ) + 0.5 ) ); + } + } + sal_Int32 nResolution = 0; + switch( maLbResolution.GetSelectEntryPos() ) + { + case 0 : nResolution = maResolution.Width / 100; break; // pixels / cm + case 2 : nResolution = maResolution.Width; break; // pixels / meter + default: + case 1 : nResolution = maResolution.Width * 0.0254; break; // pixels / inch + } + maNfResolution.SetValue( nResolution ); + + if ( maSbCompression.IsVisible() ) + maSbCompression.SetThumbPos( maNfCompression.GetValue() ); + + // updating estimated size + sal_Int64 nRealFileSize( mpTempStream->Tell() ); + if ( mbIsPixelFormat ) + { + String aEst( nRealFileSize ? msEstimatedSizePix2 : msEstimatedSizePix1 ); + sal_Int64 nRawFileSize( GetRawFileSize() ); + xub_StrLen nInd = aEst.Search( '%' ); + aEst.Replace( nInd, 2, ImpValueOfInKB( nRawFileSize ) ); + + if ( nRealFileSize ) + { + nInd = aEst.Search( '%', nInd ); + aEst.Replace( nInd, 2, ImpValueOfInKB( nRealFileSize ) ); + } + maFtEstimatedSize.SetText( aEst ); + } + else + { + if ( mnMaxFilesizeForRealtimePreview ) + { + String aEst( msEstimatedSizeVec ); + xub_StrLen nInd = aEst.Search( '%', 0 ); + aEst.Replace( nInd, 2, ImpValueOfInKB( nRealFileSize ) ); + maFtEstimatedSize.SetText( aEst ); + } + } + updatePreview(); + + // EPS + if ( maRbEPSLevel1.IsVisible() ) + { + sal_Bool bEnabled = maRbEPSLevel1.IsChecked() == sal_False; + maRbEPSColorFormat1.Enable( bEnabled ); + maRbEPSColorFormat2.Enable( bEnabled ); + maRbEPSCompressionLZW.Enable( bEnabled ); + maRbEPSCompressionNone.Enable( bEnabled ); + } +} + +ExportDialog::~ExportDialog() +{ + delete mpFilterOptionsItem; + delete mpOptionsItem; +} + + +/************************************************************************* +|* +|* Speichert eingestellte Werte in ini-Datei +|* +\************************************************************************/ +IMPL_LINK( ExportDialog, UpdateHdl, void *, EMPTYARG ) +{ + updateControls(); + return 0; +} + +IMPL_LINK( ExportDialog, UpdateHdlMtfSizeX, void *, EMPTYARG ) +{ + double fRatio = static_cast< double >( maOriginalSize.Height ) / maOriginalSize.Width; + + if ( mbIsPixelFormat ) + { + switch( GetMapUnit( maLbSizeX.GetSelectEntryPos() ) ) + { + case MAP_INCH : maSize.Width = static_cast< sal_Int32 >( static_cast< double >( maResolution.Width ) * 0.0254 * maMfSizeX.GetValue() / 100.0 + 0.5 ); break; + case MAP_CM : maSize.Width = static_cast< sal_Int32 >( static_cast< double >( maResolution.Width ) * 0.01 * maMfSizeX.GetValue() / 100.0 + 0.5 ); break; + case MAP_MM : maSize.Width = static_cast< sal_Int32 >( static_cast< double >( maResolution.Width ) * 0.001 * maMfSizeX.GetValue() / 100.0 + 0.5 ); break; + case MAP_POINT : maSize.Width = static_cast< sal_Int32 >( static_cast< double >( maResolution.Width ) * 0.0254 * maMfSizeX.GetValue() / 100.0 * 72 + 0.5 ); break; + case MAP_PIXEL : maSize.Width = maMfSizeX.GetValue(); break; + } + maSize.Height = static_cast< sal_Int32 >( fRatio * maSize.Width + 0.5 ); + } + else + { + Fraction aFract( 1, 100 ); + sal_Int32 nWidth = maMfSizeX.GetValue(); + sal_Int32 nHeight= static_cast< sal_Int32 >( nWidth * fRatio ); + const Size aSource( static_cast< sal_Int32 >( nWidth ), static_cast< sal_Int32 >( nHeight ) ); + MapMode aSourceMapMode( GetMapUnit( maLbSizeX.GetSelectEntryPos() ),Point(), aFract, aFract ); + Size aDest( LogicToLogic( aSource, aSourceMapMode, MAP_100TH_MM ) ); + + maSize.Width = aDest.Width(); + if ( mbPreserveAspectRatio ) + maSize.Height = aDest.Height(); + } + updateControls(); + return 0; +} + +IMPL_LINK( ExportDialog, UpdateHdlMtfSizeY, void *, EMPTYARG ) +{ + double fRatio = static_cast< double >( maOriginalSize.Width ) / maOriginalSize.Height; + + if ( mbIsPixelFormat ) + { + switch( GetMapUnit( maLbSizeX.GetSelectEntryPos() ) ) + { + case MAP_INCH : maSize.Height = static_cast< sal_Int32 >( static_cast< double >( maResolution.Height ) * 0.0254 * maMfSizeY.GetValue() / 100.0 + 0.5 ); break; + case MAP_CM : maSize.Height = static_cast< sal_Int32 >( static_cast< double >( maResolution.Height ) * 0.01 * maMfSizeY.GetValue() / 100.0 + 0.5 ); break; + case MAP_MM : maSize.Height = static_cast< sal_Int32 >( static_cast< double >( maResolution.Height ) * 0.001 * maMfSizeY.GetValue() / 100.0 + 0.5 ); break; + case MAP_POINT : maSize.Height = static_cast< sal_Int32 >( static_cast< double >( maResolution.Height ) * 0.0254 * maMfSizeY.GetValue() / 100.0 * 72 + 0.5 ); break; + case MAP_PIXEL : maSize.Height = maMfSizeY.GetValue(); break; + } + maSize.Width = static_cast< sal_Int32 >( fRatio * maSize.Height + 0.5 ); + } + else + { + Fraction aFract( 1, 100 ); + sal_Int32 nHeight= maMfSizeY.GetValue(); + sal_Int32 nWidth = static_cast< sal_Int32 >( nHeight * fRatio ); + const Size aSource( static_cast< sal_Int32 >( nWidth ), static_cast< sal_Int32 >( nHeight ) ); + MapMode aSourceMapMode( GetMapUnit( maLbSizeX.GetSelectEntryPos() ),Point(), aFract, aFract ); + Size aDest( LogicToLogic( aSource, aSourceMapMode, MAP_100TH_MM ) ); + + maSize.Height = aDest.Height(); + if ( mbPreserveAspectRatio ) + maSize.Width = aDest.Width(); + } + updateControls(); + return 0; +} + +IMPL_LINK( ExportDialog, UpdateHdlNfResolution, void *, EMPTYARG ) +{ + sal_Int32 nResolution = maNfResolution.GetValue(); + if ( maLbResolution.GetSelectEntryPos() == 0 ) // pixels / cm + nResolution *= 100; + else if ( maLbResolution.GetSelectEntryPos() == 1 ) // pixels / inch + nResolution = static_cast< sal_Int32 >( ( ( static_cast< double >( nResolution ) + 0.5 ) / 0.0254 ) ); + maResolution.Width = nResolution; + maResolution.Height= nResolution; + + updateControls(); + return 0; +} + +IMPL_LINK( ExportDialog, SbCompressionUpdateHdl, void *, EMPTYARG ) +{ + maNfCompression.SetValue( maSbCompression.GetThumbPos() ); + updateControls(); + return 0; +} + +IMPL_LINK( ExportDialog, OK, void *, EMPTYARG ) +{ + // writing config parameter + + + mrFltCallPara.aFilterData = GetFilterData( sal_True ); + EndDialog( RET_OK ); + + return 0; +} + diff --git a/svtools/source/filter.vcl/filter/exportdialog.hrc b/svtools/source/filter.vcl/filter/exportdialog.hrc new file mode 100755 index 000000000000..df18684dd333 --- /dev/null +++ b/svtools/source/filter.vcl/filter/exportdialog.hrc @@ -0,0 +1,99 @@ +/************************************************************************* + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +#include + +#define BTN_OK 1 +#define BTN_CANCEL 1 +#define BTN_HELP 1 + +#define FL_EXPORT_SIZE 1 +#define FL_COLOR_DEPTH 2 +#define FL_JPG_QUALITY 3 +#define FL_COMPRESSION 4 +#define FL_MODE 5 +#define FL_GIF_DRAWING_OBJECTS 6 +#define FL_PBM_OPTIONS 7 +#define FL_EPS_PREVIEW 8 +#define FL_EPS_VERSION 9 +#define FL_EPS_COLOR_FORMAT 10 +#define FL_ESTIMATED_SIZE 11 +#define FL_BUTTONS 12 + +#define FT_SIZEX 1 +#define FT_SIZEY 2 +#define FT_RESOLUTION 3 +#define FT_JPG_MIN 4 +#define FT_JPG_MAX 5 +#define FT_PNG_MIN 6 +#define FT_PNG_MAX 7 +#define FT_ESTIMATED_SIZE 8 + +#define NF_RESOLUTION 1 +#define NF_COMPRESSION 2 +#define NF_ZOOM 3 + +#define MF_SIZEX 1 +#define MF_SIZEY 2 + +#define LB_SIZEX 1 +#define LB_SIZEY 2 +#define LB_RESOLUTION 3 +#define LB_COLOR_DEPTH 4 + +#define RB_BINARY 1 +#define RB_TEXT 2 +#define RB_EPS_LEVEL1 3 +#define RB_EPS_LEVEL2 4 +#define RB_EPS_COLOR_FORMAT1 5 +#define RB_EPS_COLOR_FORMAT2 6 +#define RB_EPS_COMPRESSION_LZW 7 +#define RB_EPS_COMPRESSION_NONE 8 + +#define CB_JPG_PREVIEW 1 +#define CB_INTERLACED 2 +#define CB_RLE_ENCODING 3 +#define CB_SAVE_TRANSPARENCY 4 +#define CB_EPS_PREVIEW_TIFF 5 +#define CB_EPS_PREVIEW_EPSI 6 + +#define FB_JPG_PREVIEW 1 + +#define SB_COMPRESSION 1 +#define SB_JPG_PREVIEW_HORZ 2 +#define SB_JPG_PREVIEW_VERT 3 +#define SB_ZOOM 4 + +#define STR_1BIT_THRESHOLD 1 +#define STR_1BIT_DITHERED 2 +#define STR_4BIT_GRAYSCALE 3 +#define STR_4BIT_COLOR_PALETTE 4 +#define STR_8BIT_GRAYSCALE 5 +#define STR_8BIT_COLOR_PALETTE 6 +#define STR_24BIT_TRUE_COLOR 7 +#define STR_ESTIMATED_SIZE_PIX_1 8 +#define STR_ESTIMATED_SIZE_PIX_2 9 +#define STR_ESTIMATED_SIZE_VEC 10 diff --git a/svtools/source/filter.vcl/filter/exportdialog.hxx b/svtools/source/filter.vcl/filter/exportdialog.hxx new file mode 100755 index 000000000000..564b1111c647 --- /dev/null +++ b/svtools/source/filter.vcl/filter/exportdialog.hxx @@ -0,0 +1,211 @@ +/************************************************************************* + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + + +#ifndef _EXPORTDIALOG_HXX_ +#define _EXPORTDIALOG_HXX_ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/************************************************************************* +|* +|* Dialog zum Einstellen von Filteroptionen bei Pixelformaten +|* +\************************************************************************/ + +class FilterConfigItem; +class ExportDialog : public ModalDialog +{ +private: + + FltCallDialogParameter& + mrFltCallPara; + + ResMgr* mpMgr; + + const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory > + mxMgr; + const com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent >& + mxSourceDocument; + + FixedLine maFlExportSize; + FixedText maFtSizeX; + MetricField maMfSizeX; + ListBox maLbSizeX; + FixedText maFtSizeY; + MetricField maMfSizeY; + ListBox maLbSizeY; + FixedText maFtResolution; + NumericField maNfResolution; + ListBox maLbResolution; + FixedLine maFlColorDepth; + ListBox maLbColorDepth; + FixedLine maFlJPGQuality; + FixedLine maFlMode; + FixedLine maFlPBMOptions; + ScrollBar maSbCompression; + NumericField maNfCompression; + FixedText maFtJPGMin; + FixedText maFtJPGMax; + FixedText maFtPNGMin; + FixedText maFtPNGMax; + CheckBox maCbJPGPreview; + CheckBox maCbInterlaced; + CheckBox maCbRLEEncoding; + FixedLine maFlGIFDrawingObjects; + CheckBox maCbSaveTransparency; + RadioButton maRbBinary; + RadioButton maRbText; + FixedLine maFlEPSPreview; + CheckBox maCbEPSPreviewTIFF; + CheckBox maCbEPSPreviewEPSI; + FixedLine maFlEPSVersion; + RadioButton maRbEPSLevel1; + RadioButton maRbEPSLevel2; + FixedLine maFlEPSColorFormat; + RadioButton maRbEPSColorFormat1; + RadioButton maRbEPSColorFormat2; + FixedLine maFlCompression; + RadioButton maRbEPSCompressionLZW; + RadioButton maRbEPSCompressionNone; + FixedLine maFlEstimatedSize; + FixedText maFtEstimatedSize; + String msEstimatedSizePix1; + String msEstimatedSizePix2; + String msEstimatedSizeVec; + FixedLine maFlButtons; + FixedBitmap maFbJPGPreview; + ScrollBar maSbZoom; + NumericField maNfZoom; + ScrollBar maSbJPGPreviewHorz; + ScrollBar maSbJPGPreviewVert; + OKButton maBtnOK; + CancelButton maBtnCancel; + HelpButton maBtnHelp; + + String ms1BitTreshold; + String ms1BitDithered; + String ms4BitGrayscale; + String ms4BitColorPalette; + String ms8BitGrayscale; + String ms8BitColorPalette; + String ms24BitColor; + + vcl::RowOrColumn maLayout; + Size maDialogSize; + + FilterConfigItem* mpOptionsItem; + FilterConfigItem* mpFilterOptionsItem; + + String maExt; + String maEstimatedSizeText; + sal_Int16 mnFormat; + sal_Int32 mnMaxFilesizeForRealtimePreview; + + sal_Bool mbPreview; + sal_Bool mbIsPixelFormat; + sal_Bool mbExportSelection; + sal_Bool mbPreserveAspectRatio; + + Rectangle maRectFlButtons; + Rectangle maRectBtnHelp; + Rectangle maRectBtnOK; + Rectangle maRectBtnCancel; + + SvStream* mpTempStream; + Bitmap maBitmap; + + com::sun::star::awt::Size + maOriginalSize; // the original graphic size in 1/100mm + com::sun::star::awt::Size + maSize; // for vector graphics it always contains the logical size in 1/100mm + // for pixel graphics it always contains the pixel count + com::sun::star::awt::Size + maResolution; // it always contains the number of pixels per meter + + com::sun::star::uno::Reference< com::sun::star::drawing::XShape > + mxShape; + com::sun::star::uno::Reference< com::sun::star::drawing::XShapes > + mxShapes; + com::sun::star::uno::Reference< com::sun::star::drawing::XDrawPage > + mxPage; + + + DECL_LINK( UpdateHdl,void* p ); + DECL_LINK( UpdateHdlMtfSizeX,void* p ); + DECL_LINK( UpdateHdlMtfSizeY,void* p ); + DECL_LINK( UpdateHdlNfResolution,void* p ); + DECL_LINK( SbCompressionUpdateHdl,void* p ); + DECL_LINK( NfCompressionUpdateHdlX,void* p ); + + DECL_LINK( OK, void* p ); + + void createSizeControls( vcl::RowOrColumn& ); + void createColorDepthControls( vcl::RowOrColumn& ); + void createFilterOptions( vcl::RowOrColumn& ); + void createButtons( vcl::RowOrColumn& ); + void createScrollBar( vcl::RowOrColumn& ); + void setupLayout(); + void updatePreview(); + void updateControls(); + + void GetGraphicSource(); + sal_Bool GetGraphicStream(); + Bitmap GetGraphicBitmap( SvStream& rStream ); + ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > + GetFilterData( sal_Bool bUpdateConfig ); + + sal_uInt32 GetRawFileSize() const; + sal_Bool IsTempExportAvailable() const; + + com::sun::star::awt::Size + GetOriginalSize(); + +public: + ExportDialog( FltCallDialogParameter& rPara, + const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory > rxMgr, + const com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent >& rxSourceDocument, + sal_Bool bExportSelection, sal_Bool bIsExportVectorFormat ); + ~ExportDialog(); +}; + + + +#endif // _EXPORTDIALOG_HXX_ + diff --git a/svtools/source/filter.vcl/filter/exportdialog.src b/svtools/source/filter.vcl/filter/exportdialog.src new file mode 100755 index 000000000000..065fcee6ba18 --- /dev/null +++ b/svtools/source/filter.vcl/filter/exportdialog.src @@ -0,0 +1,505 @@ +/************************************************************************* + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include "exportdialog.hrc" + +String DLG_EXPORT_TITLE +{ + Text [ en-US ] = " Options" ; +}; + +ModalDialog DLG_EXPORT +{ + OutputSize = TRUE ; + SVLook = TRUE ; + Size = MAP_APPFONT ( 178 , 135 ) ; + Moveable = TRUE ; + Closeable = TRUE ; + + FixedLine FL_EXPORT_SIZE + { + Hide = TRUE; + Size = MAP_APPFONT ( 110 , 8 ) ; + Text [ en-US ] = "Size" ; + }; + FixedText FT_SIZEX + { + Hide = TRUE; + Size = MAP_APPFONT ( 41 , 10 ) ; + Text [ en-US ] = "Width:" ; + }; + MetricField MF_SIZEX + { + Hide = TRUE; + Border = TRUE; + Size = MAP_APPFONT ( 30, 12 ) ; + TabStop = TRUE; + Repeat = TRUE; + Spin = FALSE; + StrictFormat = TRUE; + DecimalDigits = 2; + Unit = FUNIT_NONE; + Maximum = 99999; + Last = 255; + }; + ListBox LB_SIZEX + { + Hide = TRUE; + Border = TRUE ; + Size = MAP_APPFONT ( 60, 80 ) ; + DropDown = TRUE ; + Sort = FALSE ; + StringList [ en-US ] = + { + < "inches" ; > ; + < "cm" ; Default ; > ; + < "mm" ; > ; + < "points" ; > ; + < "pixels" ; > ; + }; + }; + FixedText FT_SIZEY + { + Hide = TRUE; + Size = MAP_APPFONT ( 41 , 10 ) ; + Text [ en-US ] = "Height:" ; + }; + MetricField MF_SIZEY + { + Hide = TRUE; + Border = TRUE; + Size = MAP_APPFONT ( 30, 12 ); + TabStop = TRUE; + Repeat = TRUE; + Spin = FALSE; + StrictFormat = TRUE; + DecimalDigits = 2; + Unit = FUNIT_NONE; + Maximum = 99999; + Last = 255 ; + }; + ListBox LB_SIZEY + { + Hide = TRUE; + Border = TRUE ; + Size = MAP_APPFONT ( 60, 80 ) ; + DropDown = TRUE ; + Sort = FALSE ; + StringList [ en-US ] = + { + < "inches" ; > ; + < "cm" ; Default ; > ; + < "mm" ; > ; + < "points" ; > ; + < "pixels" ; > ; + }; + }; + FixedText FT_RESOLUTION + { + Hide = TRUE; + Size = MAP_APPFONT ( 41 , 10 ) ; + Text [ en-US ] = "Resolution:" ; + }; + NumericField NF_RESOLUTION + { + Hide = TRUE; + Border = TRUE ; + Size = MAP_APPFONT ( 30, 12 ) ; + TabStop = TRUE ; + Repeat = TRUE ; + Spin = FALSE ; + Maximum = 99999; + Last = 255 ; + }; + ListBox LB_RESOLUTION + { + Hide = TRUE; + Border = TRUE ; + Size = MAP_APPFONT ( 60, 80 ) ; + DropDown = TRUE ; + Sort = FALSE ; + StringList [ en-US ] = + { + < "pixels/cm" ; > ; + < "pixels/inch" ; Default ; > ; + < "pixels/meter" ; > ; + }; + }; + FixedLine FL_COLOR_DEPTH + { + Hide = TRUE; + Size = MAP_APPFONT ( 110 , 8 ) ; + Text [ en-US ] = "Color Depth" ; + }; + ListBox LB_COLOR_DEPTH + { + Hide = TRUE; + Border = TRUE ; + Size = MAP_APPFONT ( 60, 80 ) ; + DropDown = TRUE ; + Sort = FALSE ; + }; + String STR_1BIT_THRESHOLD + { + Text [ en-US ] = "1 bit threshold"; + }; + String STR_1BIT_DITHERED + { + Text [ en-US ] = "1 bit dithered"; + }; + String STR_4BIT_GRAYSCALE + { + Text [ en-US ] = "4 bit grayscale"; + }; + String STR_4BIT_COLOR_PALETTE + { + Text [ en-US ] = "4 bit color"; + }; + String STR_8BIT_GRAYSCALE + { + Text [ en-US ] = "8 bit grayscale"; + }; + String STR_8BIT_COLOR_PALETTE + { + Text [ en-US ] = "8 bit color"; + }; + String STR_24BIT_TRUE_COLOR + { + Text [ en-US ] = "24 bit true color"; + }; + FixedLine FL_JPG_QUALITY + { + Hide = TRUE; + Size = MAP_APPFONT ( 110 , 8 ) ; + Text [ en-US ] = "Quality" ; + }; + FixedLine FL_COMPRESSION + { + Hide = TRUE; + Size = MAP_APPFONT ( 110 , 8 ) ; + Text [ en-US ] = "Compression" ; + }; + FixedLine FL_MODE + { + Hide = TRUE; + Size = MAP_APPFONT ( 110 , 8 ) ; + Text [ en-US ] = "Mode" ; + }; + FixedLine FL_PBM_OPTIONS + { + Hide = TRUE; + Size = MAP_APPFONT ( 110 , 8 ) ; + Text [ en-US ] = "File Format" ; + }; + ScrollBar SB_COMPRESSION + { + Hide = TRUE; + Size = MAP_APPFONT ( 48, 10 ) ; + VScroll = FALSE ; + HScroll = TRUE; + Drag = TRUE ; + }; + NumericField NF_COMPRESSION + { + Hide = TRUE; + Border = TRUE ; + Size = MAP_APPFONT ( 30, 12 ) ; + TabStop = TRUE ; + Repeat = TRUE ; + Spin = FALSE ; + Maximum = 99999; + Last = 255 ; + }; + FixedText FT_JPG_MIN + { + Hide = TRUE; + Size = MAP_APPFONT ( 41 , 10 ) ; + Text [ en-US ] = "1 is minimum Quality and smallest file size." ; + }; + FixedText FT_JPG_MAX + { + Hide = TRUE; + Size = MAP_APPFONT ( 41 , 10 ) ; + Text [ en-US ] = "100 is maximum Quality and biggest file size." ; + }; + FixedText FT_PNG_MIN + { + Hide = TRUE; + Size = MAP_APPFONT ( 41 , 10 ) ; + Text [ en-US ] = "0 is biggest file size and fastest loading." ; + }; + FixedText FT_PNG_MAX + { + Hide = TRUE; + Size = MAP_APPFONT ( 41 , 10 ) ; + Text [ en-US ] = "9 is smallest file size and slowest loading." ; + }; + CheckBox CB_JPG_PREVIEW + { + Hide = TRUE; + Size = MAP_APPFONT ( 60 , 10 ) ; + Text [ en-US ] = "Preview" ; + }; + CheckBox CB_INTERLACED + { + Hide = TRUE; + Size = MAP_APPFONT ( 60 , 10 ) ; + Text [ en-US ] = "Interlaced" ; + }; + CheckBox CB_RLE_ENCODING + { + Hide = TRUE; + Size = MAP_APPFONT ( 60 , 10 ) ; + Text [ en-US ] = "RLE encoding" ; + }; + FixedLine FL_GIF_DRAWING_OBJECTS + { + Hide = TRUE; + Size = MAP_APPFONT ( 110 , 8 ) ; + Text [ en-US ] = "Drawing Objects" ; + }; + CheckBox CB_SAVE_TRANSPARENCY + { + Hide = TRUE; + Size = MAP_APPFONT ( 60 , 10 ) ; + Text [ en-US ] = "Save transparency" ; + }; + RadioButton RB_BINARY + { + Hide = TRUE; + Size = MAP_APPFONT ( 105 , 10 ) ; + Text [ en-US ] = "Binary" ; + }; + RadioButton RB_TEXT + { + Hide = TRUE; + Size = MAP_APPFONT ( 105 , 10 ) ; + Text [ en-US ] = "Text" ; + }; + FixedLine FL_EPS_PREVIEW + { + Hide = TRUE; + Size = MAP_APPFONT ( 110 , 8 ) ; + Text [ en-US ] = "Preview" ; + }; + CheckBox CB_EPS_PREVIEW_TIFF + { + Hide = TRUE; + Size = MAP_APPFONT ( 60 , 10 ) ; + Text [ en-US ] = "Image Preview (TIFF)" ; + }; + CheckBox CB_EPS_PREVIEW_EPSI + { + Hide = TRUE; + Size = MAP_APPFONT ( 60 , 10 ) ; + Text [ en-US ] = "Interchange (EPSI)" ; + }; + FixedLine FL_EPS_VERSION + { + Hide = TRUE; + Size = MAP_APPFONT ( 41 , 10 ) ; + Text [ en-US ] = "Version" ; + }; + RadioButton RB_EPS_LEVEL1 + { + Hide = TRUE; + Size = MAP_APPFONT ( 105 , 10 ) ; + Text [ en-US ] = "Level 1" ; + }; + RadioButton RB_EPS_LEVEL2 + { + Hide = TRUE; + Size = MAP_APPFONT ( 105 , 10 ) ; + Text [ en-US ] = "Level 2" ; + }; + FixedLine FL_EPS_COLOR_FORMAT + { + Hide = TRUE; + Size = MAP_APPFONT ( 41 , 10 ) ; + Text [ en-US ] = "Color format" ; + }; + RadioButton RB_EPS_COLOR_FORMAT1 + { + Hide = TRUE; + Size = MAP_APPFONT ( 105 , 10 ) ; + Text [ en-US ] = "Color" ; + }; + RadioButton RB_EPS_COLOR_FORMAT2 + { + Hide = TRUE; + Size = MAP_APPFONT ( 105 , 10 ) ; + Text [ en-US ] = "Grayscale" ; + }; + RadioButton RB_EPS_COMPRESSION_LZW + { + Hide = TRUE; + Size = MAP_APPFONT ( 105 , 10 ) ; + Text [ en-US ] = "LZW encoding" ; + }; + RadioButton RB_EPS_COMPRESSION_NONE + { + Hide = TRUE; + Size = MAP_APPFONT ( 105 , 10 ) ; + Text [ en-US ] = "None" ; + }; + FixedLine FL_ESTIMATED_SIZE + { + Hide = TRUE; + Size = MAP_APPFONT ( 41 , 10 ) ; + }; + FixedText FT_ESTIMATED_SIZE + { + Hide = TRUE; + Size = MAP_APPFONT ( 41 , 10 ) ; + }; + String STR_ESTIMATED_SIZE_PIX_1 + { + Text [ en-US ] = "The picture needs about %1 KB of memory."; + }; + String STR_ESTIMATED_SIZE_PIX_2 + { + Text [ en-US ] = "The picture needs about %1 KB of memory,\n the file size is %2 KB."; + }; + String STR_ESTIMATED_SIZE_VEC + { + Text [ en-US ] = "The file size is %1 KB."; + }; + FixedLine FL_BUTTONS + { + Hide = TRUE; + Size = MAP_APPFONT ( 41 , 10 ) ; + }; + FixedBitmap FB_JPG_PREVIEW + { + Hide = TRUE; + OutputSize = TRUE ; + Scale = TRUE; + Border = TRUE; + }; + ScrollBar SB_ZOOM + { + Hide = TRUE; + Size = MAP_APPFONT ( 48, 10 ); + VScroll = FALSE; + HScroll = TRUE; + Drag = TRUE; + MinPos = 5; + MaxPos = 100; + ThumbPos = 50; + }; + NumericField NF_ZOOM + { + Hide = TRUE; + Border = TRUE ; + Size = MAP_APPFONT ( 30, 12 ) ; + TabStop = TRUE ; + Repeat = TRUE ; + Spin = FALSE ; + Maximum = 3000; + Last = 255 ; + }; + ScrollBar SB_JPG_PREVIEW_HORZ + { + Hide = TRUE; + Size = MAP_APPFONT ( 48, 10 ); + VScroll = FALSE; + HScroll = TRUE; + Drag = TRUE; + MinPos = 0; + MaxPos = 100; + ThumbPos = 50; + }; + ScrollBar SB_JPG_PREVIEW_VERT + { + Hide = TRUE; + Size = MAP_APPFONT ( 48, 10 ); + VScroll = TRUE; + HScroll = FALSE; + Drag = TRUE; + MinPos = 0; + MaxPos = 100; + ThumbPos = 50; + }; + OKButton BTN_OK + { + Hide = TRUE; + Size = MAP_APPFONT ( 50 , 14 ) ; + TabStop = TRUE ; + DefButton = TRUE ; + }; + CancelButton BTN_CANCEL + { + Hide = TRUE; + Size = MAP_APPFONT ( 50 , 14 ) ; + TabStop = TRUE ; + }; + HelpButton BTN_HELP + { + Hide = TRUE; + Size = MAP_APPFONT ( 50 , 14 ) ; + TabStop = TRUE ; + }; +}; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/svtools/source/filter.vcl/filter/filter.cxx b/svtools/source/filter.vcl/filter/filter.cxx index e8121f1d7e94..2888c2fcaa24 100644 --- a/svtools/source/filter.vcl/filter/filter.cxx +++ b/svtools/source/filter.vcl/filter/filter.cxx @@ -52,7 +52,7 @@ #include "xbmread.hxx" #include "xpmread.hxx" #include -#include "strings.hrc" +#include #include "sgffilt.hxx" #include "osl/module.hxx" #include @@ -752,7 +752,7 @@ static Graphic ImpGetScaledGraphic( const Graphic& rGraphic, FilterConfigItem& r if ( rGraphic.GetType() != GRAPHIC_NONE ) { - sal_Int32 nMode = rConfigItem.ReadInt32( String( ResId( KEY_MODE, *pResMgr ) ), -1 ); + sal_Int32 nMode = rConfigItem.ReadInt32( String( RTL_CONSTASCII_USTRINGPARAM( "ExportMode" ) ), -1 ); if ( nMode == -1 ) // the property is not there, this is possible, if the graphic filter { // is called via UnoGraphicExporter and not from a graphic export Dialog @@ -782,7 +782,7 @@ static Graphic ImpGetScaledGraphic( const Graphic& rGraphic, FilterConfigItem& r Bitmap aBitmap( rGraphic.GetBitmap() ); MapMode aMap( MAP_100TH_INCH ); - sal_Int32 nDPI = rConfigItem.ReadInt32( String( ResId( KEY_RES, *pResMgr ) ), 75 ); + sal_Int32 nDPI = rConfigItem.ReadInt32( String( RTL_CONSTASCII_USTRINGPARAM( "Resolution" ) ), 75 ); Fraction aFrac( 1, Min( Max( nDPI, sal_Int32( 75 ) ), sal_Int32( 600 ) ) ); aMap.SetScaleX( aFrac ); @@ -806,7 +806,7 @@ static Graphic ImpGetScaledGraphic( const Graphic& rGraphic, FilterConfigItem& r else aGraphic = rGraphic; - sal_Int32 nColors = rConfigItem.ReadInt32( String( ResId( KEY_COLORS, *pResMgr ) ), 0 ); // #92767# + sal_Int32 nColors = rConfigItem.ReadInt32( String( RTL_CONSTASCII_USTRINGPARAM( "Color" ) ), 0 ); // #92767# if ( nColors ) // graphic conversion necessary ? { BitmapEx aBmpEx( aGraphic.GetBitmapEx() ); @@ -1769,7 +1769,7 @@ USHORT GraphicFilter::ExportGraphic( const Graphic& rGraphic, const String& rPat aBmp = aGraphic.GetBitmap(); } ResMgr* pResMgr = CREATERESMGR( svt ); - sal_Bool bRleCoding = aConfigItem.ReadBool( String( ResId( KEY_RLE_CODING, *pResMgr ) ), sal_True ); + sal_Bool bRleCoding = aConfigItem.ReadBool( String( RTL_CONSTASCII_USTRINGPARAM( "RLE_Coding" ) ), sal_True ); // Wollen wir RLE-Kodiert speichern? aBmp.Write( rOStm, bRleCoding ); delete pResMgr; diff --git a/svtools/source/filter.vcl/filter/makefile.mk b/svtools/source/filter.vcl/filter/makefile.mk index 272bb9a76b03..11d35150bda8 100644 --- a/svtools/source/filter.vcl/filter/makefile.mk +++ b/svtools/source/filter.vcl/filter/makefile.mk @@ -41,16 +41,11 @@ SOLARINC+=-I../../inc # --- Files -------------------------------------------------------- SRS1NAME=$(TARGET) -SRC1FILES= strings.src \ - dlgexpor.src \ - dlgepng.src \ - dlgejpg.src +SRC1FILES=exportdialog.src SLOFILES= $(SLO)$/filter.obj \ $(SLO)$/filter2.obj \ - $(SLO)$/dlgexpor.obj \ - $(SLO)$/dlgejpg.obj \ - $(SLO)$/dlgepng.obj \ + $(SLO)$/exportdialog.obj \ $(SLO)$/sgfbram.obj \ $(SLO)$/sgvmain.obj \ $(SLO)$/sgvtext.obj \ @@ -59,28 +54,26 @@ SLOFILES= $(SLO)$/filter.obj \ $(SLO)$/FilterConfigCache.obj \ $(SLO)$/SvFilterOptionsDialog.obj +EXCEPTIONSFILES= $(SLO)$/exportdialog.obj + EXCEPTIONSNOOPTFILES= $(SLO)$/filter.obj \ $(SLO)$/FilterConfigItem.obj \ $(SLO)$/FilterConfigCache.obj \ $(SLO)$/SvFilterOptionsDialog.obj LIB1TARGET= $(SLB)$/$(TARGET).uno.lib -LIB1OBJFILES= \ - $(SLO)$/dlgexpor.obj \ - $(SLO)$/dlgejpg.obj \ - $(SLO)$/dlgepng.obj \ - $(SLO)$/SvFilterOptionsDialog.obj +LIB1OBJFILES= $(SLO)$/exportdialog.obj \ + $(SLO)$/SvFilterOptionsDialog.obj LIB2TARGET= $(SLB)$/$(TARGET).lib -LIB2OBJFILES= \ - $(SLO)$/filter.obj \ - $(SLO)$/filter2.obj \ - $(SLO)$/sgfbram.obj \ - $(SLO)$/sgvmain.obj \ - $(SLO)$/sgvtext.obj \ - $(SLO)$/sgvspln.obj \ - $(SLO)$/FilterConfigItem.obj \ - $(SLO)$/FilterConfigCache.obj +LIB2OBJFILES= $(SLO)$/filter.obj \ + $(SLO)$/filter2.obj \ + $(SLO)$/sgfbram.obj \ + $(SLO)$/sgvmain.obj \ + $(SLO)$/sgvtext.obj \ + $(SLO)$/sgvspln.obj \ + $(SLO)$/FilterConfigItem.obj \ + $(SLO)$/FilterConfigCache.obj # --- Targets ------------------------------------------------------- diff --git a/svtools/source/filter.vcl/filter/strings.hrc b/svtools/source/filter.vcl/filter/strings.hrc deleted file mode 100644 index ac162bff09f4..000000000000 --- a/svtools/source/filter.vcl/filter/strings.hrc +++ /dev/null @@ -1,27 +0,0 @@ -/************************************************************************* - * - * 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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -#include diff --git a/svtools/source/filter.vcl/filter/strings.src b/svtools/source/filter.vcl/filter/strings.src deleted file mode 100644 index 60e628ee0b5c..000000000000 --- a/svtools/source/filter.vcl/filter/strings.src +++ /dev/null @@ -1,85 +0,0 @@ -/************************************************************************* - * - * 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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#include "strings.hrc" - -String EXPORT_DIALOG_TITLE -{ - Text [ en-US ] = " Options" ; -}; - -String KEY_MODE -{ - Text = "ExportMode" ; -}; - -String KEY_RES -{ - Text = "Resolution" ; -}; - -String KEY_SIZE -{ - Text = "Size" ; -}; - -String KEY_COLORS -{ - Text = "Color" ; -}; - -String KEY_RLE_CODING -{ - Text = "RLE_Coding" ; -}; - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/vcl/inc/vcl/arrange.hxx b/vcl/inc/vcl/arrange.hxx index 8846d9bbe948..83568609f87b 100644 --- a/vcl/inc/vcl/arrange.hxx +++ b/vcl/inc/vcl/arrange.hxx @@ -48,7 +48,7 @@ namespace vcl or a child WindowArranger (a node in the hierarchy), but never both */ - class WindowArranger + class VCL_DLLPUBLIC WindowArranger { protected: struct Element @@ -189,7 +189,7 @@ namespace vcl } }; - class RowOrColumn : public WindowArranger + class VCL_DLLPUBLIC RowOrColumn : public WindowArranger { long m_nBorderWidth; bool m_bColumn; @@ -230,7 +230,7 @@ namespace vcl long getBorderWidth() const { return m_nBorderWidth; } }; - class LabeledElement : public WindowArranger + class VCL_DLLPUBLIC LabeledElement : public WindowArranger { WindowArranger::Element m_aLabel; WindowArranger::Element m_aElement; @@ -274,7 +274,7 @@ namespace vcl { return m_aElement.getOptimalSize( i_eType ); } }; - class LabelColumn : public RowOrColumn + class VCL_DLLPUBLIC LabelColumn : public RowOrColumn { long getLabelWidth() const; public: @@ -291,7 +291,7 @@ namespace vcl size_t addRow( Window* i_pLabel, Window* i_pElement, long i_nIndent = 0 ); }; - class Indenter : public WindowArranger + class VCL_DLLPUBLIC Indenter : public WindowArranger { long m_nIndent; WindowArranger::Element m_aElement; @@ -325,7 +325,7 @@ namespace vcl { setChild( boost::shared_ptr( i_pChild ), i_nExpandPrio ); } }; - class Spacer : public WindowArranger + class VCL_DLLPUBLIC Spacer : public WindowArranger { WindowArranger::Element m_aElement; Size m_aSize; @@ -351,7 +351,7 @@ namespace vcl virtual bool isVisible() const { return true; } }; - class MatrixArranger : public WindowArranger + class VCL_DLLPUBLIC MatrixArranger : public WindowArranger { long m_nBorderX; long m_nBorderY; diff --git a/vcl/prj/d.lst b/vcl/prj/d.lst index 8345b155ce58..cb69983fe2aa 100644 --- a/vcl/prj/d.lst +++ b/vcl/prj/d.lst @@ -17,6 +17,7 @@ mkdir: %_DEST%\inc%_EXT%\vcl ..\inc\vcl\alpha.hxx %_DEST%\inc%_EXT%\vcl\alpha.hxx ..\inc\vcl\animate.hxx %_DEST%\inc%_EXT%\vcl\animate.hxx ..\inc\vcl\apptypes.hxx %_DEST%\inc%_EXT%\vcl\apptypes.hxx +..\inc\vcl\arrange.hxx %_DEST%\inc%_EXT%\vcl\arrange.hxx ..\inc\vcl\bitmap.hxx %_DEST%\inc%_EXT%\vcl\bitmap.hxx ..\inc\vcl\bitmapex.hxx %_DEST%\inc%_EXT%\vcl\bitmapex.hxx ..\inc\vcl\bmpacc.hxx %_DEST%\inc%_EXT%\vcl\bmpacc.hxx -- cgit v1.2.3 From 00647682535858694ab42cc90e0db6142053df3b Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Wed, 16 Jun 2010 09:53:37 +0200 Subject: fs33a: fixed supportsService --- toolkit/source/controls/unocontrol.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/toolkit/source/controls/unocontrol.cxx b/toolkit/source/controls/unocontrol.cxx index 1abe0b34004f..4db6dbb17b81 100644 --- a/toolkit/source/controls/unocontrol.cxx +++ b/toolkit/source/controls/unocontrol.cxx @@ -1463,7 +1463,7 @@ sal_Bool UnoControl::supportsService( const ::rtl::OUString& rServiceName ) thro Sequence< ::rtl::OUString > aSNL = getSupportedServiceNames(); const ::rtl::OUString* pArray = aSNL.getConstArray(); - const ::rtl::OUString* pArrayEnd = aSNL.getConstArray(); + const ::rtl::OUString* pArrayEnd = aSNL.getConstArray() + aSNL.getLength(); for (; pArray != pArrayEnd; ++pArray ) if( *pArray == rServiceName ) break; -- cgit v1.2.3 From 873a6fcf3d0322e5b701a7991979856ca688262f Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Wed, 16 Jun 2010 14:30:30 +0200 Subject: fs33a: fixed VCLXFixedText::calcAdjustedSize to respect the given size --- toolkit/source/awt/vclxwindows.cxx | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/toolkit/source/awt/vclxwindows.cxx b/toolkit/source/awt/vclxwindows.cxx index e2fc78421d5e..eaff4abf8621 100644 --- a/toolkit/source/awt/vclxwindows.cxx +++ b/toolkit/source/awt/vclxwindows.cxx @@ -2865,16 +2865,15 @@ short VCLXFixedText::getAlignment() throw(::com::sun::star::uno::RuntimeExceptio return getMinimumSize(); } -::com::sun::star::awt::Size VCLXFixedText::calcAdjustedSize( const ::com::sun::star::awt::Size& rNewSize ) throw(::com::sun::star::uno::RuntimeException) +::com::sun::star::awt::Size VCLXFixedText::calcAdjustedSize( const ::com::sun::star::awt::Size& rMaxSize ) throw(::com::sun::star::uno::RuntimeException) { ::vos::OGuard aGuard( GetMutex() ); - ::com::sun::star::awt::Size aSz = rNewSize; - ::com::sun::star::awt::Size aMinSz = getMinimumSize(); - if ( aSz.Height != aMinSz.Height ) - aSz.Height = aMinSz.Height; - - return aSz; + Size aAdjustedSize( VCLUnoHelper::ConvertToVCLSize( rMaxSize ) ); + FixedText* pFixedText = (FixedText*)GetWindow(); + if ( pFixedText ) + aAdjustedSize = pFixedText->CalcMinimumSize( rMaxSize.Width ); + return VCLUnoHelper::ConvertToAWTSize( aAdjustedSize ); } // ---------------------------------------------------- -- cgit v1.2.3 From 34aaddf76fc80f377aff5fcf2c28d47b7842bc42 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Wed, 16 Jun 2010 09:53:37 +0200 Subject: fs33a: fixed supportsService --- toolkit/source/controls/unocontrol.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/toolkit/source/controls/unocontrol.cxx b/toolkit/source/controls/unocontrol.cxx index 1abe0b34004f..4db6dbb17b81 100644 --- a/toolkit/source/controls/unocontrol.cxx +++ b/toolkit/source/controls/unocontrol.cxx @@ -1463,7 +1463,7 @@ sal_Bool UnoControl::supportsService( const ::rtl::OUString& rServiceName ) thro Sequence< ::rtl::OUString > aSNL = getSupportedServiceNames(); const ::rtl::OUString* pArray = aSNL.getConstArray(); - const ::rtl::OUString* pArrayEnd = aSNL.getConstArray(); + const ::rtl::OUString* pArrayEnd = aSNL.getConstArray() + aSNL.getLength(); for (; pArray != pArrayEnd; ++pArray ) if( *pArray == rServiceName ) break; -- cgit v1.2.3 From 50178be7f5b3d4bbecdf008b1edf4e1543d4df4d Mon Sep 17 00:00:00 2001 From: sj Date: Wed, 16 Jun 2010 10:19:21 +0200 Subject: impress186: solved merge problems --- svtools/inc/svtools/svtools.hrc | 19 ++++--------------- svtools/source/filter.vcl/filter/exportdialog.hrc | 2 +- svtools/source/filter.vcl/filter/filter.cxx | 2 +- 3 files changed, 6 insertions(+), 17 deletions(-) diff --git a/svtools/inc/svtools/svtools.hrc b/svtools/inc/svtools/svtools.hrc index a57a0f5bb0fe..3dd2f0706a2e 100644 --- a/svtools/inc/svtools/svtools.hrc +++ b/svtools/inc/svtools/svtools.hrc @@ -38,22 +38,12 @@ //............................................................................. // various unsorted stuff -#define DLG_EXPORT_PIX (RID_SVTOOLS_START+1) -#define DLG_EXPORT_VEC (RID_SVTOOLS_START+2) #define DLG_TWAIN_SOURCE (RID_SVTOOLS_START+3) #define DLG_SVT_EXPLORERFILE (RID_SVTOOLS_START+4) #define DLG_SVT_QUERYFOLDERNAME (RID_SVTOOLS_START+5) #define DLG_SVT_QUERYDELETE (RID_SVTOOLS_START+6) -#define EXPORT_DIALOG_TITLE (RID_SVTOOLS_START+4) -#define KEY_MODE (RID_SVTOOLS_START+5) -#define KEY_RES (RID_SVTOOLS_START+6) -#define KEY_SIZE (RID_SVTOOLS_START+7) - -#define KEY_COLORS (RID_SVTOOLS_START+9) -#define KEY_RLE_CODING (RID_SVTOOLS_START+10) - #define STR_SVT_AUTOMATIC_COLOR (RID_SVTOOLS_START+16) #define STR_SVT_FILEVIEW_COLUMN_TITLE (RID_SVTOOLS_START + 20) @@ -289,17 +279,16 @@ //............................................................................. // dialogs - -#define DLG_EXPORT_JPG_START (RID_SVTOOLS_START+110) -#define DLG_EXPORT_JPG (RID_SVTOOLS_START+111) -#define DLG_EXPORT_JPG_END (RID_SVTOOLS_START+112) +#define DLG_EXPORT_START (STR_ARR_SVT_LANGUAGE_TABLE_END + 1) +#define DLG_EXPORT (DLG_EXPORT_START) +#define DLG_EXPORT_TITLE (DLG_EXPORT_START+1) +#define DLG_EXPORT_END (DLG_EXPORT_TITLE) #define DLG_LOGIN (RID_SVTOOLS_START+113) #define DLG_ADDRESSBOOKSOURCE (RID_SVTOOLS_START+114) #define DLG_REGISTRATION_REQUEST (RID_SVTOOLS_START+115) -#define DLG_EXPORT_EPNG (RID_SVTOOLS_START+116) //............................................................................. // bitmaps diff --git a/svtools/source/filter.vcl/filter/exportdialog.hrc b/svtools/source/filter.vcl/filter/exportdialog.hrc index df18684dd333..e230bcd2c5c3 100755 --- a/svtools/source/filter.vcl/filter/exportdialog.hrc +++ b/svtools/source/filter.vcl/filter/exportdialog.hrc @@ -24,7 +24,7 @@ * for a copy of the LGPLv3 License. * ************************************************************************/ -#include +#include #define BTN_OK 1 #define BTN_CANCEL 1 diff --git a/svtools/source/filter.vcl/filter/filter.cxx b/svtools/source/filter.vcl/filter/filter.cxx index 2888c2fcaa24..c7dd30354e10 100644 --- a/svtools/source/filter.vcl/filter/filter.cxx +++ b/svtools/source/filter.vcl/filter/filter.cxx @@ -52,7 +52,7 @@ #include "xbmread.hxx" #include "xpmread.hxx" #include -#include +#include #include "sgffilt.hxx" #include "osl/module.hxx" #include -- cgit v1.2.3 From c2eab77d2f47c58d91740ce9e624d1438a87c19c Mon Sep 17 00:00:00 2001 From: sj Date: Wed, 16 Jun 2010 14:29:37 +0200 Subject: impress186: fixed warnings --- svtools/source/filter.vcl/filter/exportdialog.cxx | 8 +++++--- svtools/source/filter.vcl/filter/exportdialog.hxx | 13 +++++++------ 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/svtools/source/filter.vcl/filter/exportdialog.cxx b/svtools/source/filter.vcl/filter/exportdialog.cxx index 7e56be261dbb..d23934155a2e 100755 --- a/svtools/source/filter.vcl/filter/exportdialog.cxx +++ b/svtools/source/filter.vcl/filter/exportdialog.cxx @@ -535,7 +535,7 @@ sal_uInt32 ExportDialog::GetRawFileSize() const // to determine the exact graphic output size and preview for jpg sal_Bool ExportDialog::IsTempExportAvailable() const { - return GetRawFileSize() < mnMaxFilesizeForRealtimePreview; + return GetRawFileSize() < static_cast< sal_uInt32 >( mnMaxFilesizeForRealtimePreview ); } ExportDialog::ExportDialog( FltCallDialogParameter& rPara, @@ -573,6 +573,8 @@ ExportDialog::ExportDialog( FltCallDialogParameter& rPara, maCbRLEEncoding ( this, ResId( CB_RLE_ENCODING, *rPara.pResMgr ) ), maFlGIFDrawingObjects ( this, ResId( FL_GIF_DRAWING_OBJECTS, *rPara.pResMgr ) ), maCbSaveTransparency ( this, ResId( CB_SAVE_TRANSPARENCY, *rPara.pResMgr ) ), + maRbBinary ( this, ResId( RB_BINARY, *rPara.pResMgr ) ), + maRbText ( this, ResId( RB_TEXT, *rPara.pResMgr ) ), maFlEPSPreview ( this, ResId( FL_EPS_PREVIEW, *rPara.pResMgr ) ), maCbEPSPreviewTIFF ( this, ResId( CB_EPS_PREVIEW_TIFF, *rPara.pResMgr ) ), maCbEPSPreviewEPSI ( this, ResId( CB_EPS_PREVIEW_EPSI, *rPara.pResMgr ) ), @@ -585,8 +587,6 @@ ExportDialog::ExportDialog( FltCallDialogParameter& rPara, maFlCompression ( this, ResId( FL_COMPRESSION, *rPara.pResMgr ) ), maRbEPSCompressionLZW ( this, ResId( RB_EPS_COMPRESSION_LZW, *rPara.pResMgr ) ), maRbEPSCompressionNone ( this, ResId( RB_EPS_COMPRESSION_NONE, *rPara.pResMgr ) ), - maRbBinary ( this, ResId( RB_BINARY, *rPara.pResMgr ) ), - maRbText ( this, ResId( RB_TEXT, *rPara.pResMgr ) ), maFlEstimatedSize ( this, ResId( FL_ESTIMATED_SIZE, *rPara.pResMgr ) ), maFtEstimatedSize ( this, ResId( FT_ESTIMATED_SIZE, *rPara.pResMgr ) ), msEstimatedSizePix1 ( ResId( STR_ESTIMATED_SIZE_PIX_1, *rPara.pResMgr ) ), @@ -1386,6 +1386,7 @@ IMPL_LINK( ExportDialog, UpdateHdlMtfSizeX, void *, EMPTYARG ) case MAP_CM : maSize.Width = static_cast< sal_Int32 >( static_cast< double >( maResolution.Width ) * 0.01 * maMfSizeX.GetValue() / 100.0 + 0.5 ); break; case MAP_MM : maSize.Width = static_cast< sal_Int32 >( static_cast< double >( maResolution.Width ) * 0.001 * maMfSizeX.GetValue() / 100.0 + 0.5 ); break; case MAP_POINT : maSize.Width = static_cast< sal_Int32 >( static_cast< double >( maResolution.Width ) * 0.0254 * maMfSizeX.GetValue() / 100.0 * 72 + 0.5 ); break; + default: case MAP_PIXEL : maSize.Width = maMfSizeX.GetValue(); break; } maSize.Height = static_cast< sal_Int32 >( fRatio * maSize.Width + 0.5 ); @@ -1419,6 +1420,7 @@ IMPL_LINK( ExportDialog, UpdateHdlMtfSizeY, void *, EMPTYARG ) case MAP_CM : maSize.Height = static_cast< sal_Int32 >( static_cast< double >( maResolution.Height ) * 0.01 * maMfSizeY.GetValue() / 100.0 + 0.5 ); break; case MAP_MM : maSize.Height = static_cast< sal_Int32 >( static_cast< double >( maResolution.Height ) * 0.001 * maMfSizeY.GetValue() / 100.0 + 0.5 ); break; case MAP_POINT : maSize.Height = static_cast< sal_Int32 >( static_cast< double >( maResolution.Height ) * 0.0254 * maMfSizeY.GetValue() / 100.0 * 72 + 0.5 ); break; + default: case MAP_PIXEL : maSize.Height = maMfSizeY.GetValue(); break; } maSize.Width = static_cast< sal_Int32 >( fRatio * maSize.Height + 0.5 ); diff --git a/svtools/source/filter.vcl/filter/exportdialog.hxx b/svtools/source/filter.vcl/filter/exportdialog.hxx index 564b1111c647..a9692e646746 100755 --- a/svtools/source/filter.vcl/filter/exportdialog.hxx +++ b/svtools/source/filter.vcl/filter/exportdialog.hxx @@ -138,11 +138,6 @@ private: sal_Int16 mnFormat; sal_Int32 mnMaxFilesizeForRealtimePreview; - sal_Bool mbPreview; - sal_Bool mbIsPixelFormat; - sal_Bool mbExportSelection; - sal_Bool mbPreserveAspectRatio; - Rectangle maRectFlButtons; Rectangle maRectBtnHelp; Rectangle maRectBtnOK; @@ -155,7 +150,13 @@ private: maOriginalSize; // the original graphic size in 1/100mm com::sun::star::awt::Size maSize; // for vector graphics it always contains the logical size in 1/100mm - // for pixel graphics it always contains the pixel count + + sal_Bool mbPreview; + sal_Bool mbIsPixelFormat; + sal_Bool mbExportSelection; + sal_Bool mbPreserveAspectRatio; + + // for pixel graphics it always contains the pixel count com::sun::star::awt::Size maResolution; // it always contains the number of pixels per meter -- cgit v1.2.3 From 90f2e0f4128d9fa122957a5657d16308ce7af3c0 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Wed, 16 Jun 2010 14:30:30 +0200 Subject: fs33a: fixed VCLXFixedText::calcAdjustedSize to respect the given size --- toolkit/source/awt/vclxwindows.cxx | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/toolkit/source/awt/vclxwindows.cxx b/toolkit/source/awt/vclxwindows.cxx index 43e0e50c315d..8b8cb23e1276 100644 --- a/toolkit/source/awt/vclxwindows.cxx +++ b/toolkit/source/awt/vclxwindows.cxx @@ -2965,16 +2965,15 @@ short VCLXFixedText::getAlignment() throw(::com::sun::star::uno::RuntimeExceptio return getMinimumSize(); } -::com::sun::star::awt::Size VCLXFixedText::calcAdjustedSize( const ::com::sun::star::awt::Size& rNewSize ) throw(::com::sun::star::uno::RuntimeException) +::com::sun::star::awt::Size VCLXFixedText::calcAdjustedSize( const ::com::sun::star::awt::Size& rMaxSize ) throw(::com::sun::star::uno::RuntimeException) { ::vos::OGuard aGuard( GetMutex() ); - ::com::sun::star::awt::Size aSz = rNewSize; - ::com::sun::star::awt::Size aMinSz = getMinimumSize(); - if ( aSz.Height != aMinSz.Height ) - aSz.Height = aMinSz.Height; - - return aSz; + Size aAdjustedSize( VCLUnoHelper::ConvertToVCLSize( rMaxSize ) ); + FixedText* pFixedText = (FixedText*)GetWindow(); + if ( pFixedText ) + aAdjustedSize = pFixedText->CalcMinimumSize( rMaxSize.Width ); + return VCLUnoHelper::ConvertToAWTSize( aAdjustedSize ); } // ---------------------------------------------------- -- cgit v1.2.3 From d3f7ff0321d03c423d9eaff787b3921862f47f8c Mon Sep 17 00:00:00 2001 From: sj Date: Wed, 16 Jun 2010 16:50:36 +0200 Subject: impress186: #i4499# reserving two text lines to display the estimated file size --- svtools/source/filter.vcl/filter/exportdialog.cxx | 1 + 1 file changed, 1 insertion(+) diff --git a/svtools/source/filter.vcl/filter/exportdialog.cxx b/svtools/source/filter.vcl/filter/exportdialog.cxx index d23934155a2e..1e2c669afa33 100755 --- a/svtools/source/filter.vcl/filter/exportdialog.cxx +++ b/svtools/source/filter.vcl/filter/exportdialog.cxx @@ -628,6 +628,7 @@ ExportDialog::ExportDialog( FltCallDialogParameter& rPara, mpFilterOptionsItem = new FilterConfigItem( aFilterConfigPath, &rPara.aFilterData ); mnMaxFilesizeForRealtimePreview = mpOptionsItem->ReadInt32( String( RTL_CONSTASCII_USTRINGPARAM( "MaxFilesizeForRealtimePreview" ) ), 0 ); + maFtEstimatedSize.SetText( String( RTL_CONSTASCII_USTRINGPARAM( " \n " ) ) ); String aTitle( maExt ); aTitle += String( ResId( DLG_EXPORT_TITLE, *mpMgr ) ); -- cgit v1.2.3 From e3bc1a277ca0480c2a62c6b1bb95924560f7d0d3 Mon Sep 17 00:00:00 2001 From: "Herbert Duerr [hdu]" Date: Wed, 16 Jun 2010 17:04:56 +0200 Subject: #i112247# shrink glyph-fallback font if needed (thanks cmc!) --- vcl/inc/vcl/salgdi.hxx | 2 +- vcl/source/gdi/outdev3.cxx | 26 ++++++++++++++++++++++++++ vcl/unx/headless/svpgdi.hxx | 2 +- vcl/unx/headless/svppspgraphics.cxx | 2 +- vcl/unx/headless/svppspgraphics.hxx | 2 +- vcl/unx/headless/svptext.cxx | 9 ++++++--- vcl/unx/inc/pspgraphics.h | 2 +- vcl/unx/inc/salgdi.h | 2 +- vcl/unx/source/gdi/pspgraphics.cxx | 2 +- vcl/unx/source/gdi/salgdi3.cxx | 13 ++++++++----- 10 files changed, 47 insertions(+), 15 deletions(-) diff --git a/vcl/inc/vcl/salgdi.hxx b/vcl/inc/vcl/salgdi.hxx index 510e797678b0..a79e73968808 100644 --- a/vcl/inc/vcl/salgdi.hxx +++ b/vcl/inc/vcl/salgdi.hxx @@ -233,7 +233,7 @@ public: // release the fonts void ReleaseFonts() { SetFont( NULL, 0 ); } // get the current font's metrics - virtual void GetFontMetric( ImplFontMetricData* ) = 0; + virtual void GetFontMetric( ImplFontMetricData*, int nFallbackLevel = 0 ) = 0; // get kernign pairs of the current font // return only PairCount if (pKernPairs == NULL) diff --git a/vcl/source/gdi/outdev3.cxx b/vcl/source/gdi/outdev3.cxx index f4fcba72b0c2..bed1a5b69985 100644 --- a/vcl/source/gdi/outdev3.cxx +++ b/vcl/source/gdi/outdev3.cxx @@ -6056,6 +6056,11 @@ SalLayout* OutputDevice::ImplGlyphFallbackLayout( SalLayout* pSalLayout, ImplLay rtl::OUString aMissingCodes = aMissingCodeBuf.makeStringAndClear(); ImplFontSelectData aFontSelData = mpFontEntry->maFontSelData; + + ImplFontMetricData aOrigMetric( aFontSelData ); + // TODO: use cached metric in fontentry + mpGraphics->GetFontMetric( &aOrigMetric ); + // when device specific font substitution may have been performed for // the originally selected font then make sure that a fallback to that // font is performed first @@ -6100,7 +6105,28 @@ SalLayout* OutputDevice::ImplGlyphFallbackLayout( SalLayout* pSalLayout, ImplLay } #endif + // TODO: try to get the metric data from the GFB's mpFontEntry + ImplFontMetricData aSubstituteMetric( aFontSelData ); pFallbackFont->mnSetFontFlags = mpGraphics->SetFont( &aFontSelData, nFallbackLevel ); + mpGraphics->GetFontMetric( &aSubstituteMetric, nFallbackLevel ); + + const long nOriginalHeight = aOrigMetric.mnAscent + aOrigMetric.mnDescent; + const long nSubstituteHeight = aSubstituteMetric.mnAscent + aSubstituteMetric.mnDescent; + // Too tall, shrink it a bit. Need a better calculation to include extra + // factors and any extra wriggle room we might have available? + // TODO: should we scale by max-ascent/max-descent instead of design height? + if( nSubstituteHeight > nOriginalHeight ) + { + const float fScale = nOriginalHeight / (float)nSubstituteHeight; +fprintf(stderr,"fScale=%5.3f\n",fScale);//######### + const float fOrigHeight = aFontSelData.mfExactHeight; + const int nOrigHeight = aFontSelData.mnHeight; + aFontSelData.mfExactHeight *= fScale; + aFontSelData.mnHeight = static_cast(aFontSelData.mfExactHeight); + pFallbackFont->mnSetFontFlags = mpGraphics->SetFont( &aFontSelData, nFallbackLevel ); + aFontSelData.mnHeight = nOrigHeight; + aFontSelData.mfExactHeight = fOrigHeight; + } // create and add glyph fallback layout to multilayout rLayoutArgs.ResetPos(); diff --git a/vcl/unx/headless/svpgdi.hxx b/vcl/unx/headless/svpgdi.hxx index 132dafaa9adf..f48a2885c45e 100644 --- a/vcl/unx/headless/svpgdi.hxx +++ b/vcl/unx/headless/svpgdi.hxx @@ -86,7 +86,7 @@ public: virtual void SetTextColor( SalColor nSalColor ); virtual USHORT SetFont( ImplFontSelectData*, int nFallbackLevel ); - virtual void GetFontMetric( ImplFontMetricData* ); + virtual void GetFontMetric( ImplFontMetricData*, int nFallbackLevel ); virtual ULONG GetKernPairs( ULONG nPairs, ImplKernPairData* pKernPairs ); virtual ImplFontCharMap* GetImplFontCharMap() const; virtual void GetDevFontList( ImplDevFontList* ); diff --git a/vcl/unx/headless/svppspgraphics.cxx b/vcl/unx/headless/svppspgraphics.cxx index 7f551051c1a7..2bb943a4eeb8 100644 --- a/vcl/unx/headless/svppspgraphics.cxx +++ b/vcl/unx/headless/svppspgraphics.cxx @@ -792,7 +792,7 @@ void PspGraphics::GetDevFontSubstList( OutputDevice* pOutDev ) } } -void PspGraphics::GetFontMetric( ImplFontMetricData *pMetric ) +void PspGraphics::GetFontMetric( ImplFontMetricData *pMetric, int ) { const psp::PrintFontManager& rMgr = psp::PrintFontManager::get(); psp::PrintFontInfo aInfo; diff --git a/vcl/unx/headless/svppspgraphics.hxx b/vcl/unx/headless/svppspgraphics.hxx index 82ba613615cb..83e295e7e23a 100644 --- a/vcl/unx/headless/svppspgraphics.hxx +++ b/vcl/unx/headless/svppspgraphics.hxx @@ -105,7 +105,7 @@ public: virtual void SetTextColor( SalColor nSalColor ); virtual USHORT SetFont( ImplFontSelectData*, int nFallbackLevel ); - virtual void GetFontMetric( ImplFontMetricData* ); + virtual void GetFontMetric( ImplFontMetricData*, int nFallbackLevel ); virtual ULONG GetKernPairs( ULONG nPairs, ImplKernPairData* pKernPairs ); virtual ImplFontCharMap* GetImplFontCharMap() const; virtual void GetDevFontList( ImplDevFontList* ); diff --git a/vcl/unx/headless/svptext.cxx b/vcl/unx/headless/svptext.cxx index ecb8b11b7e04..34941fc777db 100644 --- a/vcl/unx/headless/svptext.cxx +++ b/vcl/unx/headless/svptext.cxx @@ -240,12 +240,15 @@ USHORT SvpSalGraphics::SetFont( ImplFontSelectData* pIFSD, int nFallbackLevel ) // --------------------------------------------------------------------------- -void SvpSalGraphics::GetFontMetric( ImplFontMetricData* pMetric ) +void SvpSalGraphics::GetFontMetric( ImplFontMetricData* pMetric, int nFallbackLevel ) { - if( m_pServerFont[0] != NULL ) + if( nFallbackLevel >= MAX_FALLBACK ) + return; + + if( m_pServerFont[nFallbackLevel] != NULL ) { long rDummyFactor; - m_pServerFont[0]->FetchFontMetric( *pMetric, rDummyFactor ); + m_pServerFont[nFallbackLevel]->FetchFontMetric( *pMetric, rDummyFactor ); } } diff --git a/vcl/unx/inc/pspgraphics.h b/vcl/unx/inc/pspgraphics.h index 2eae73cdaa86..e6c56e0208ce 100644 --- a/vcl/unx/inc/pspgraphics.h +++ b/vcl/unx/inc/pspgraphics.h @@ -102,7 +102,7 @@ public: virtual void SetTextColor( SalColor nSalColor ); virtual USHORT SetFont( ImplFontSelectData*, int nFallbackLevel ); - virtual void GetFontMetric( ImplFontMetricData* ); + virtual void GetFontMetric( ImplFontMetricData*, int nFallbackLevel ); virtual ULONG GetKernPairs( ULONG nMaxPairs, ImplKernPairData* ); virtual ImplFontCharMap* GetImplFontCharMap() const; virtual void GetDevFontList( ImplDevFontList* ); diff --git a/vcl/unx/inc/salgdi.h b/vcl/unx/inc/salgdi.h index da69f04b6f8f..0bb6cf6f327a 100644 --- a/vcl/unx/inc/salgdi.h +++ b/vcl/unx/inc/salgdi.h @@ -249,7 +249,7 @@ public: virtual void SetTextColor( SalColor nSalColor ); virtual USHORT SetFont( ImplFontSelectData*, int nFallbackLevel ); - virtual void GetFontMetric( ImplFontMetricData* ); + virtual void GetFontMetric( ImplFontMetricData*, int nFallbackLevel ); virtual ULONG GetKernPairs( ULONG nMaxPairs, ImplKernPairData* ); virtual ImplFontCharMap* GetImplFontCharMap() const; virtual void GetDevFontList( ImplDevFontList* ); diff --git a/vcl/unx/source/gdi/pspgraphics.cxx b/vcl/unx/source/gdi/pspgraphics.cxx index d599e09e71f2..5785ff1f6d7c 100644 --- a/vcl/unx/source/gdi/pspgraphics.cxx +++ b/vcl/unx/source/gdi/pspgraphics.cxx @@ -885,7 +885,7 @@ void PspGraphics::GetDevFontSubstList( OutputDevice* pOutDev ) } } -void PspGraphics::GetFontMetric( ImplFontMetricData *pMetric ) +void PspGraphics::GetFontMetric( ImplFontMetricData *pMetric, int ) { const psp::PrintFontManager& rMgr = psp::PrintFontManager::get(); psp::PrintFontInfo aInfo; diff --git a/vcl/unx/source/gdi/salgdi3.cxx b/vcl/unx/source/gdi/salgdi3.cxx index f00ee26c0d4d..9ddb6d99927e 100644 --- a/vcl/unx/source/gdi/salgdi3.cxx +++ b/vcl/unx/source/gdi/salgdi3.cxx @@ -1763,16 +1763,19 @@ bool GetFCFontOptions( const ImplFontAttributes& rFontAttributes, int nSize, // ---------------------------------------------------------------------------- void -X11SalGraphics::GetFontMetric( ImplFontMetricData *pMetric ) +X11SalGraphics::GetFontMetric( ImplFontMetricData *pMetric, int nFallbackLevel ) { - if( mpServerFont[0] != NULL ) + if( nFallbackLevel >= MAX_FALLBACK ) + return; + + if( mpServerFont[nFallbackLevel] != NULL ) { long rDummyFactor; - mpServerFont[0]->FetchFontMetric( *pMetric, rDummyFactor ); + mpServerFont[nFallbackLevel]->FetchFontMetric( *pMetric, rDummyFactor ); } - else if( mXFont[0] != NULL ) + else if( mXFont[nFallbackLevel] != NULL ) { - mXFont[0]->ToImplFontMetricData( pMetric ); + mXFont[nFallbackLevel]->ToImplFontMetricData( pMetric ); if ( bFontVertical_ ) pMetric->mnOrientation = 0; } -- cgit v1.2.3 From aa3a3bb0956d96f077466325cf95bd53767aa050 Mon Sep 17 00:00:00 2001 From: "Herbert Duerr [hdu]" Date: Wed, 16 Jun 2010 17:07:10 +0200 Subject: code-=dbg --- vcl/source/gdi/outdev3.cxx | 1 - 1 file changed, 1 deletion(-) diff --git a/vcl/source/gdi/outdev3.cxx b/vcl/source/gdi/outdev3.cxx index bed1a5b69985..50d2601f9d27 100644 --- a/vcl/source/gdi/outdev3.cxx +++ b/vcl/source/gdi/outdev3.cxx @@ -6118,7 +6118,6 @@ SalLayout* OutputDevice::ImplGlyphFallbackLayout( SalLayout* pSalLayout, ImplLay if( nSubstituteHeight > nOriginalHeight ) { const float fScale = nOriginalHeight / (float)nSubstituteHeight; -fprintf(stderr,"fScale=%5.3f\n",fScale);//######### const float fOrigHeight = aFontSelData.mfExactHeight; const int nOrigHeight = aFontSelData.mnHeight; aFontSelData.mfExactHeight *= fScale; -- cgit v1.2.3 From 07696680839a79c5520113df1512a7411bdd647f Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Wed, 16 Jun 2010 18:00:39 +0200 Subject: vcl113: #i89587# statusbar items should avoid resizer on lower right on the mac --- vcl/aqua/source/app/salinst.cxx | 1 + vcl/inc/vcl/svdata.hxx | 3 +++ vcl/source/window/status.cxx | 4 +++- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/vcl/aqua/source/app/salinst.cxx b/vcl/aqua/source/app/salinst.cxx index b8a2261ed9db..a90488b98b46 100644 --- a/vcl/aqua/source/app/salinst.cxx +++ b/vcl/aqua/source/app/salinst.cxx @@ -449,6 +449,7 @@ SalInstance* CreateSalInstance() ImplGetSVData()->maNWFData.mbCenteredTabs = true; ImplGetSVData()->maNWFData.mbProgressNeedsErase = true; ImplGetSVData()->maNWFData.mbCheckBoxNeedsErase = true; + ImplGetSVData()->maNWFData.mnStatusBarLowerRightOffset = 10; ImplGetSVData()->maGDIData.mbPrinterPullModel = true; ImplGetSVData()->maGDIData.mbNoXORClipping = true; ImplGetSVData()->maWinData.mbNoSaveBackground = true; diff --git a/vcl/inc/vcl/svdata.hxx b/vcl/inc/vcl/svdata.hxx index 5cc8f32d7ac9..fe69b0c0b4d4 100644 --- a/vcl/inc/vcl/svdata.hxx +++ b/vcl/inc/vcl/svdata.hxx @@ -318,6 +318,9 @@ struct ImplSVNWFData // window background before drawing the native // checkbox bool mbScrollbarJumpPage; // true for "jump to here" behavior + int mnStatusBarLowerRightOffset; // amount in pixel to avoid in the lower righthand corner + // used on the Mac where the system resizer paints over + // our window content }; diff --git a/vcl/source/window/status.cxx b/vcl/source/window/status.cxx index c139ae1ffb30..2b5a14494ada 100644 --- a/vcl/source/window/status.cxx +++ b/vcl/source/window/status.cxx @@ -320,6 +320,8 @@ void StatusBar::ImplFormat() nExtraWidth2 = 0; } nX = STATUSBAR_OFFSET_X; + if( ImplHasMirroredGraphics() && IsRTLEnabled() ) + nX += ImplGetSVData()->maNWFData.mnStatusBarLowerRightOffset; } pItem = mpItemList->First(); @@ -833,7 +835,7 @@ void StatusBar::Resize() { // Breite und Hoehe abfragen und merken Size aSize = GetOutputSizePixel(); - mnDX = aSize.Width(); + mnDX = aSize.Width() - ImplGetSVData()->maNWFData.mnStatusBarLowerRightOffset; mnDY = aSize.Height(); mnCalcHeight = mnDY; // subtract border -- cgit v1.2.3 From 689d55e9d9b2f45ee4ae03d099ef2f57cda795b5 Mon Sep 17 00:00:00 2001 From: "Herbert Duerr [hdu]" Date: Fri, 18 Jun 2010 11:30:30 +0200 Subject: #i112497# avoid compiler warnings --- vcl/source/glyphs/graphite_layout.cxx | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/vcl/source/glyphs/graphite_layout.cxx b/vcl/source/glyphs/graphite_layout.cxx index ff2fd8f306b1..202cad14db32 100644 --- a/vcl/source/glyphs/graphite_layout.cxx +++ b/vcl/source/glyphs/graphite_layout.cxx @@ -974,13 +974,13 @@ void GraphiteLayout::expandOrCondense(ImplLayoutArgs &rArgs) { if (mvGlyphs[i].IsClusterStart()) { - nOffset = fExtraPerCluster * nCluster; + nOffset = FRound( fExtraPerCluster * nCluster ); size_t nCharIndex = mvGlyph2Char[i]; mvCharDxs[nCharIndex] += nOffset; // adjust char dxs for rest of characters in cluster while (++nCharIndex < mvGlyph2Char.size()) { - int nChar2Base = (mvChar2BaseGlyph[nCharIndex] == -1)? -1 : mvChar2BaseGlyph[nCharIndex] & GLYPH_INDEX_MASK; + int nChar2Base = (mvChar2BaseGlyph[nCharIndex] == -1)? -1 : (int)(mvChar2BaseGlyph[nCharIndex] & GLYPH_INDEX_MASK); if (nChar2Base == -1 || nChar2Base == static_cast(i)) mvCharDxs[nCharIndex] += nOffset; } @@ -1003,12 +1003,12 @@ void GraphiteLayout::expandOrCondense(ImplLayoutArgs &rArgs) Glyphs::iterator iGlyph = mvGlyphs.begin(); while (iGlyph != iLastGlyph) { - iGlyph->maLinearPos.X() = static_cast(iGlyph->maLinearPos.X()) * fXFactor; + iGlyph->maLinearPos.X() = FRound( fXFactor * iGlyph->maLinearPos.X() ); ++iGlyph; } for (size_t i = 0; i < mvCharDxs.size(); i++) { - mvCharDxs[i] = fXFactor * static_cast(mvCharDxs[i]); + mvCharDxs[i] = FRound( fXFactor * mvCharDxs[i] ); } } } @@ -1033,7 +1033,7 @@ void GraphiteLayout::ApplyDXArray(ImplLayoutArgs &args, std::vector & rDelt int nPrevClusterLastChar = -1; for (size_t i = 0; i < nChars; i++) { - int nChar2Base = (mvChar2BaseGlyph[i] == -1)? -1 : mvChar2BaseGlyph[i] & GLYPH_INDEX_MASK; + int nChar2Base = (mvChar2BaseGlyph[i] == -1)? -1 : (int)(mvChar2BaseGlyph[i] & GLYPH_INDEX_MASK); if ((nChar2Base > -1) && (nChar2Base != nPrevClusterGlyph)) { assert((nChar2Base > -1) && (nChar2Base < (signed)mvGlyphs.size())); @@ -1047,11 +1047,11 @@ void GraphiteLayout::ApplyDXArray(ImplLayoutArgs &args, std::vector & rDelt int nLastGlyph = nChar2Base; for (; j < nChars; j++) { - int nChar2BaseJ = (mvChar2BaseGlyph[j] == -1)? -1 : mvChar2BaseGlyph[j] & GLYPH_INDEX_MASK; + int nChar2BaseJ = (mvChar2BaseGlyph[j] == -1)? -1 : (int)(mvChar2BaseGlyph[j] & GLYPH_INDEX_MASK); assert((nChar2BaseJ >= -1) && (nChar2BaseJ < (signed)mvGlyphs.size())); if (nChar2BaseJ != -1 && mvGlyphs[nChar2BaseJ].IsClusterStart()) { - nLastGlyph = nChar2BaseJ + ((bRtl)? 1 : -1); + nLastGlyph = nChar2BaseJ + ((bRtl)? +1 : -1); nLastChar = j - 1; break; } -- cgit v1.2.3 From 886532a78822b648c296d2862803fab38950e753 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Fri, 18 Jun 2010 12:21:57 +0200 Subject: unoawt2: don't assume URLs such as private:standardimage/... are relative --- toolkit/source/controls/dialogcontrol.cxx | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/toolkit/source/controls/dialogcontrol.cxx b/toolkit/source/controls/dialogcontrol.cxx index 405356c2b7ac..c54549baed5e 100644 --- a/toolkit/source/controls/dialogcontrol.cxx +++ b/toolkit/source/controls/dialogcontrol.cxx @@ -2116,9 +2116,14 @@ throw (RuntimeException) urlObj.removeSegment(); baseLocation = urlObj.GetMainURL( INetURLObject::NO_DECODE ); - ::rtl::OUString testAbsoluteURL; - if ( ::osl::FileBase::E_None == ::osl::FileBase::getAbsoluteFileURL( baseLocation, url, testAbsoluteURL ) ) - absoluteURL = testAbsoluteURL; + 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; -- cgit v1.2.3 From 45d85c7599ea0521e5d83de41ec31207a54ead16 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Fri, 18 Jun 2010 15:33:54 +0200 Subject: unoawt2: get rid of the ImageConsumer/Producer connection between image-rendering controls and their models - this channel doesn't correctly transport transparency. The connection via the 'Graphic' property works absolutely fine here. --- svtools/source/inc/unoiface.hxx | 5 +- svtools/source/uno/unoiface.cxx | 2 +- toolkit/inc/pch/precompiled_toolkit.hxx | 2 - toolkit/inc/toolkit/awt/vclxwindows.hxx | 30 ++--- toolkit/inc/toolkit/controls/roadmapcontrol.hxx | 21 +--- toolkit/inc/toolkit/controls/unocontrols.hxx | 91 +++++--------- toolkit/inc/toolkit/helper/servicenames.hxx | 5 - toolkit/source/awt/vclxwindows.cxx | 109 +++++----------- toolkit/source/controls/roadmapcontrol.cxx | 91 -------------- toolkit/source/controls/unocontrols.cxx | 160 +++--------------------- toolkit/source/helper/servicenames.cxx | 1 - toolkit/source/layout/core/import.cxx | 11 -- 12 files changed, 89 insertions(+), 439 deletions(-) diff --git a/svtools/source/inc/unoiface.hxx b/svtools/source/inc/unoiface.hxx index 5d34ea6f47ed..f15cb7c10d4c 100644 --- a/svtools/source/inc/unoiface.hxx +++ b/svtools/source/inc/unoiface.hxx @@ -39,7 +39,6 @@ #include #include #include -#include #include @@ -243,7 +242,7 @@ struct RMItemData ::rtl::OUString Label; }; -typedef ::cppu::ImplInheritanceHelper3 < VCLXImageConsumer +typedef ::cppu::ImplInheritanceHelper3 < VCLXGraphicControl , ::com::sun::star::container::XContainerListener , ::com::sun::star::beans::XPropertyChangeListener , ::com::sun::star::awt::XItemEventBroadcaster @@ -288,7 +287,7 @@ public: protected: - // VCLXImageConsumer overridables + // VCLXGraphicControl overridables virtual void ImplSetNewImage(); static void ImplGetPropertyIds( std::list< sal_uInt16 > &aIds ); diff --git a/svtools/source/uno/unoiface.cxx b/svtools/source/uno/unoiface.cxx index f2090be1655f..2d22d9cedb33 100644 --- a/svtools/source/uno/unoiface.cxx +++ b/svtools/source/uno/unoiface.cxx @@ -1664,7 +1664,7 @@ void SVTXRoadmap::ImplGetPropertyIds( std::list< sal_uInt16 > &rIds ) BASEPROPERTY_TEXT, 0); VCLXWindow::ImplGetPropertyIds( rIds, true ); - VCLXImageConsumer::ImplGetPropertyIds( rIds ); + VCLXGraphicControl::ImplGetPropertyIds( rIds ); } // ---------------------------------------------------- diff --git a/toolkit/inc/pch/precompiled_toolkit.hxx b/toolkit/inc/pch/precompiled_toolkit.hxx index 386bd6803ca4..affcf376b071 100644 --- a/toolkit/inc/pch/precompiled_toolkit.hxx +++ b/toolkit/inc/pch/precompiled_toolkit.hxx @@ -107,8 +107,6 @@ #include "com/sun/star/awt/XFont.hpp" #include "com/sun/star/awt/XGraphics.hpp" #include "com/sun/star/awt/XImageButton.hpp" -#include "com/sun/star/awt/XImageConsumer.hpp" -#include "com/sun/star/awt/XImageProducer.hpp" #include "com/sun/star/awt/XInfoPrinter.hpp" #include "com/sun/star/awt/XItemEventBroadcaster.hpp" #include "com/sun/star/awt/XItemListener.hpp" diff --git a/toolkit/inc/toolkit/awt/vclxwindows.hxx b/toolkit/inc/toolkit/awt/vclxwindows.hxx index ca3267bffb5e..75085020ca7b 100644 --- a/toolkit/inc/toolkit/awt/vclxwindows.hxx +++ b/toolkit/inc/toolkit/awt/vclxwindows.hxx @@ -82,7 +82,6 @@ #include #include #include -#include #include #include #include @@ -111,17 +110,14 @@ class VclSimpleEvent; class VclMenuEvent; // ---------------------------------------------------- -// class VCLXImageConsumer -// deriving from VCLXWindow and XImageConsumer +// class VCLXGraphicControl +// deriving from VCLXWindow, drawing the graphic which exists as "Graphic" at the model // ---------------------------------------------------- -typedef ::cppu::ImplInheritanceHelper1< VCLXWindow, ::com::sun::star::awt::XImageConsumer > VCLXImageConsumer_Base; -class TOOLKIT_DLLPUBLIC VCLXImageConsumer : public VCLXImageConsumer_Base +class TOOLKIT_DLLPUBLIC VCLXGraphicControl : public VCLXWindow { private: - /// implements our XImageConsumer functionality - ImageConsumer maImageConsumer; /// the image we currently display Image maImage; @@ -132,20 +128,10 @@ protected: // ::com::sun::star::awt::XWindow void SAL_CALL setPosSize( sal_Int32 X, sal_Int32 Y, sal_Int32 Width, sal_Int32 Height, sal_Int16 Flags ) throw(::com::sun::star::uno::RuntimeException); - // ::com::sun::star::awt::XImageConsumer - void SAL_CALL init( sal_Int32 Width, sal_Int32 Height ) throw(::com::sun::star::uno::RuntimeException); - void SAL_CALL setColorModel( sal_Int16 BitCount, const ::com::sun::star::uno::Sequence< sal_Int32 >& RGBAPal, sal_Int32 RedMask, sal_Int32 GreenMask, sal_Int32 BlueMask, sal_Int32 AlphaMask ) throw(::com::sun::star::uno::RuntimeException); - void SAL_CALL setPixelsByBytes( sal_Int32 nX, sal_Int32 nY, sal_Int32 nWidth, sal_Int32 nHeight, const ::com::sun::star::uno::Sequence< sal_Int8 >& aProducerData, sal_Int32 nOffset, sal_Int32 nScanSize ) throw(::com::sun::star::uno::RuntimeException); - void SAL_CALL setPixelsByLongs( sal_Int32 nX, sal_Int32 nY, sal_Int32 nWidth, sal_Int32 nHeight, const ::com::sun::star::uno::Sequence< sal_Int32 >& aProducerData, sal_Int32 nOffset, sal_Int32 nScanSize ) throw(::com::sun::star::uno::RuntimeException); - void SAL_CALL complete( sal_Int32 Status, const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XImageProducer >& xProducer ) throw(::com::sun::star::uno::RuntimeException); - // ::com::sun::star::awt::VclWindowPeer void SAL_CALL setProperty( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Any& Value ) throw(::com::sun::star::uno::RuntimeException); ::com::sun::star::uno::Any SAL_CALL getProperty( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::uno::RuntimeException); -protected: - void ImplUpdateImage( sal_Bool bGetNewImage ); - protected: /** forward our bitmap to our window @precond @@ -155,6 +141,7 @@ protected: @see GetBitmap */ virtual void ImplSetNewImage(); + public: static void ImplGetPropertyIds( std::list< sal_uInt16 > &aIds ); virtual void GetPropertyIds( std::list< sal_uInt16 > &aIds ) { return ImplGetPropertyIds( aIds ); } @@ -164,7 +151,7 @@ public: // ---------------------------------------------------- // class VCLXButton // ---------------------------------------------------- -typedef ::cppu::ImplInheritanceHelper2 < VCLXImageConsumer +typedef ::cppu::ImplInheritanceHelper2 < VCLXGraphicControl , ::com::sun::star::awt::XButton , ::com::sun::star::awt::XToggleButton > VCLXButton_Base; @@ -213,7 +200,7 @@ public: // ---------------------------------------------------- // class VCLXImageControl // ---------------------------------------------------- -class VCLXImageControl : public VCLXImageConsumer +class VCLXImageControl : public VCLXGraphicControl { public: VCLXImageControl(); @@ -230,6 +217,7 @@ public: static void ImplGetPropertyIds( std::list< sal_uInt16 > &aIds ); virtual void GetPropertyIds( std::list< sal_uInt16 > &aIds ) { return ImplGetPropertyIds( aIds ); } + protected: virtual void ImplSetNewImage(); }; @@ -239,7 +227,7 @@ protected: // ---------------------------------------------------- class VCLXCheckBox : public ::com::sun::star::awt::XCheckBox, public ::com::sun::star::awt::XButton, - public VCLXImageConsumer + public VCLXGraphicControl { private: ActionListenerMultiplexer maActionListeners; @@ -297,7 +285,7 @@ public: // ---------------------------------------------------- class VCLXRadioButton : public ::com::sun::star::awt::XRadioButton, public ::com::sun::star::awt::XButton, - public VCLXImageConsumer + public VCLXGraphicControl { private: ItemListenerMultiplexer maItemListeners; diff --git a/toolkit/inc/toolkit/controls/roadmapcontrol.hxx b/toolkit/inc/toolkit/controls/roadmapcontrol.hxx index 46f31947b276..219231b02ad2 100644 --- a/toolkit/inc/toolkit/controls/roadmapcontrol.hxx +++ b/toolkit/inc/toolkit/controls/roadmapcontrol.hxx @@ -40,13 +40,9 @@ #include #include #include -#include -#include #include - -#ifndef _CPPUHELPER_IMPLBASE5_HXX_ +#include #include -#endif @@ -55,10 +51,9 @@ typedef UnoControlModel UnoControlRoadmapModel_Base; -typedef ::cppu::ImplHelper4 < ::com::sun::star::lang::XSingleServiceFactory +typedef ::cppu::ImplHelper3 < ::com::sun::star::lang::XSingleServiceFactory , ::com::sun::star::container::XContainer , ::com::sun::star::container::XIndexContainer - , ::com::sun::star::awt::XImageProducer > UnoControlRoadmapModel_IBase; @@ -100,8 +95,6 @@ namespace toolkit{ typedef ::std::vector< Reference< XInterface > > RoadmapItemHolderList; - std::list< ::com::sun::star::uno::Reference< ::com::sun::star::awt::XImageConsumer > > maImageListeners; - ContainerListenerMultiplexer maContainerListeners; RoadmapItemHolderList maRoadmapItems; @@ -151,12 +144,6 @@ namespace toolkit{ void SAL_CALL release() throw() { UnoControlModel::release(); } - // ::com::sun::star::awt::XImageProducer - void SAL_CALL addConsumer( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XImageConsumer >& xConsumer ) throw (::com::sun::star::uno::RuntimeException); - void SAL_CALL removeConsumer( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XImageConsumer >& xConsumer ) throw (::com::sun::star::uno::RuntimeException); - void SAL_CALL startProduction( ) throw (::com::sun::star::uno::RuntimeException); - - // ::com::sun::star::beans::XPropertySet virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw (::com::sun::star::uno::RuntimeException); @@ -190,8 +177,6 @@ namespace toolkit{ 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 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); - void SAL_CALL elementInserted( const ::com::sun::star::container::ContainerEvent& rEvent )throw(::com::sun::star::uno::RuntimeException); void SAL_CALL elementRemoved( const ::com::sun::star::container::ContainerEvent& rEvent )throw(::com::sun::star::uno::RuntimeException); void SAL_CALL elementReplaced( const ::com::sun::star::container::ContainerEvent& rEvent )throw(::com::sun::star::uno::RuntimeException); @@ -204,8 +189,6 @@ namespace toolkit{ virtual void SAL_CALL propertyChange( const ::com::sun::star::beans::PropertyChangeEvent& evt ) throw (::com::sun::star::uno::RuntimeException); - void ImplSetPeerProperty( const ::rtl::OUString& rPropName, const ::com::sun::star::uno::Any& rVal ); - // XTypeProvider DECLARE_XTYPEPROVIDER( ) DECLARE_XINTERFACE() diff --git a/toolkit/inc/toolkit/controls/unocontrols.hxx b/toolkit/inc/toolkit/controls/unocontrols.hxx index 88449418c70a..fd775cd568c1 100644 --- a/toolkit/inc/toolkit/controls/unocontrols.hxx +++ b/toolkit/inc/toolkit/controls/unocontrols.hxx @@ -35,8 +35,6 @@ #include #include #include -#include -#include #include #include #include @@ -217,31 +215,20 @@ public: }; // ---------------------------------------------------- -// class ImageProducerControlModel +// class GraphicControlModel // ---------------------------------------------------- -class ImageProducerControlModel : public ::com::sun::star::awt::XImageProducer, - public UnoControlModel +class GraphicControlModel : public UnoControlModel { private: - std::list< ::com::sun::star::uno::Reference< ::com::sun::star::awt::XImageConsumer > > maListeners; bool mbAdjustingImagePosition; 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: - ImageProducerControlModel() : mbAdjustingImagePosition( false ), mbAdjustingGraphic( false ) { } - ImageProducerControlModel( const ImageProducerControlModel& _rSource ) : com::sun::star::awt::XImageProducer(), UnoControlModel( _rSource ), mbAdjustingImagePosition( false ), mbAdjustingGraphic( false ) { } - - ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException); - ::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(); - void SAL_CALL release() throw(); - // ::com::sun::star::awt::XImageProducer - void SAL_CALL addConsumer( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XImageConsumer >& xConsumer ) throw (::com::sun::star::uno::RuntimeException); - void SAL_CALL removeConsumer( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XImageConsumer >& xConsumer ) throw (::com::sun::star::uno::RuntimeException); - void SAL_CALL startProduction( ) throw (::com::sun::star::uno::RuntimeException); +protected: + GraphicControlModel() : mbAdjustingImagePosition( false ), mbAdjustingGraphic( false ) { } + GraphicControlModel( const GraphicControlModel& _rSource ) : UnoControlModel( _rSource ), mbAdjustingImagePosition( false ), mbAdjustingGraphic( false ) { } // ::cppu::OPropertySetHelper void SAL_CALL setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, const ::com::sun::star::uno::Any& rValue ) throw (::com::sun::star::uno::Exception); @@ -250,35 +237,13 @@ protected: ::com::sun::star::uno::Any ImplGetDefaultValue( sal_uInt16 nPropId ) const; private: - ImageProducerControlModel& operator=( const ImageProducerControlModel& ); // never implemented -}; - -// ---------------------------------------------------- -// class ImageConsumerControl -// ---------------------------------------------------- -class ImageConsumerControl : public UnoControlBase -{ -protected: - ImageConsumerControl() { } - - void ImplSetPeerProperty( const ::rtl::OUString& rPropName, const ::com::sun::star::uno::Any& rVal ); - - // 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 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); - - void SAL_CALL dispose( ) throw(::com::sun::star::uno::RuntimeException); - -private: - ImageConsumerControl( const ImageConsumerControl& ); // never implemented - ImageConsumerControl& operator=( const ImageConsumerControl& ); // never implemented + GraphicControlModel& operator=( const GraphicControlModel& ); // never implemented }; // ---------------------------------------------------- // class UnoControlButtonModel // ---------------------------------------------------- -class UnoControlButtonModel : public ImageProducerControlModel +class UnoControlButtonModel : public GraphicControlModel { protected: ::com::sun::star::uno::Any ImplGetDefaultValue( sal_uInt16 nPropId ) const; @@ -286,7 +251,7 @@ protected: public: UnoControlButtonModel(); - UnoControlButtonModel( const UnoControlButtonModel& rModel ) : ImageProducerControlModel( rModel ) {;} + UnoControlButtonModel( const UnoControlButtonModel& rModel ) : GraphicControlModel( rModel ) {;} UnoControlModel* Clone() const { return new UnoControlButtonModel( *this ); } @@ -297,13 +262,13 @@ public: ::rtl::OUString SAL_CALL getServiceName() throw(::com::sun::star::uno::RuntimeException); // ::com::sun::star::lang::XServiceInfo - DECLIMPL_SERVICEINFO_DERIVED( UnoControlButtonModel, ImageProducerControlModel, szServiceName2_UnoControlButtonModel ) + DECLIMPL_SERVICEINFO_DERIVED( UnoControlButtonModel, GraphicControlModel, szServiceName2_UnoControlButtonModel ) }; // ---------------------------------------------------- // class UnoButtonControl // ---------------------------------------------------- -typedef ::cppu::AggImplInheritanceHelper4 < ImageConsumerControl +typedef ::cppu::AggImplInheritanceHelper4 < UnoControlBase , ::com::sun::star::awt::XButton , ::com::sun::star::awt::XToggleButton , ::com::sun::star::awt::XLayoutConstrains @@ -347,13 +312,13 @@ public: ::com::sun::star::awt::Size SAL_CALL calcAdjustedSize( const ::com::sun::star::awt::Size& aNewSize ) throw(::com::sun::star::uno::RuntimeException); // ::com::sun::star::lang::XServiceInfo - DECLIMPL_SERVICEINFO_DERIVED( UnoButtonControl, ImageConsumerControl, szServiceName2_UnoControlButton ) + DECLIMPL_SERVICEINFO_DERIVED( UnoButtonControl, UnoControlBase, szServiceName2_UnoControlButton ) }; // ---------------------------------------------------- // class UnoControlImageControlModel // ---------------------------------------------------- -class UnoControlImageControlModel : public ImageProducerControlModel +class UnoControlImageControlModel : public GraphicControlModel { private: bool mbAdjustingImageScaleMode; @@ -364,7 +329,7 @@ protected: public: UnoControlImageControlModel(); - UnoControlImageControlModel( const UnoControlImageControlModel& rModel ) : ImageProducerControlModel( rModel ), mbAdjustingImageScaleMode( false ) { } + UnoControlImageControlModel( const UnoControlImageControlModel& rModel ) : GraphicControlModel( rModel ), mbAdjustingImageScaleMode( false ) { } UnoControlModel* Clone() const { return new UnoControlImageControlModel( *this ); } @@ -375,7 +340,7 @@ public: ::rtl::OUString SAL_CALL getServiceName() throw(::com::sun::star::uno::RuntimeException); // ::com::sun::star::lang::XServiceInfo - DECLIMPL_SERVICEINFO_DERIVED( UnoControlImageControlModel, ImageProducerControlModel, szServiceName2_UnoControlImageControlModel ) + DECLIMPL_SERVICEINFO_DERIVED( UnoControlImageControlModel, GraphicControlModel, szServiceName2_UnoControlImageControlModel ) // ::cppu::OPropertySetHelper void SAL_CALL setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, const ::com::sun::star::uno::Any& rValue ) throw (::com::sun::star::uno::Exception); @@ -384,7 +349,7 @@ public: // ---------------------------------------------------- // class UnoImageControlControl // ---------------------------------------------------- -typedef ::cppu::AggImplInheritanceHelper1 < ImageConsumerControl +typedef ::cppu::AggImplInheritanceHelper1 < UnoControlBase , ::com::sun::star::awt::XLayoutConstrains > UnoImageControlControl_Base; class UnoImageControlControl : public UnoImageControlControl_Base @@ -409,13 +374,13 @@ public: ::com::sun::star::awt::Size SAL_CALL calcAdjustedSize( const ::com::sun::star::awt::Size& aNewSize ) throw(::com::sun::star::uno::RuntimeException); // ::com::sun::star::lang::XServiceInfo - DECLIMPL_SERVICEINFO_DERIVED( UnoImageControlControl, ImageConsumerControl, szServiceName2_UnoControlImageControl ) + DECLIMPL_SERVICEINFO_DERIVED( UnoImageControlControl, UnoControlBase, szServiceName2_UnoControlImageControl ) }; // ---------------------------------------------------- // class UnoControlRadioButtonModel // ---------------------------------------------------- -class UnoControlRadioButtonModel : public ImageProducerControlModel +class UnoControlRadioButtonModel : public GraphicControlModel { protected: @@ -424,7 +389,7 @@ protected: public: UnoControlRadioButtonModel(); - UnoControlRadioButtonModel( const UnoControlRadioButtonModel& rModel ) : ImageProducerControlModel( rModel ) {;} + UnoControlRadioButtonModel( const UnoControlRadioButtonModel& rModel ) : GraphicControlModel( rModel ) {;} UnoControlModel* Clone() const { return new UnoControlRadioButtonModel( *this ); } @@ -435,14 +400,14 @@ public: ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException); // ::com::sun::star::lang::XServiceInfo - DECLIMPL_SERVICEINFO_DERIVED( UnoControlRadioButtonModel, ImageProducerControlModel, szServiceName2_UnoControlRadioButtonModel ) + DECLIMPL_SERVICEINFO_DERIVED( UnoControlRadioButtonModel, GraphicControlModel, szServiceName2_UnoControlRadioButtonModel ) }; // ---------------------------------------------------- // class UnoRadioButtonControl // ---------------------------------------------------- -typedef ::cppu::AggImplInheritanceHelper4 < ImageConsumerControl +typedef ::cppu::AggImplInheritanceHelper4 < UnoControlBase , ::com::sun::star::awt::XButton , ::com::sun::star::awt::XRadioButton , ::com::sun::star::awt::XItemListener @@ -462,7 +427,7 @@ public: 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); void SAL_CALL dispose( ) throw(::com::sun::star::uno::RuntimeException); - void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw(::com::sun::star::uno::RuntimeException) { ImageConsumerControl::disposing( Source ); } + void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw(::com::sun::star::uno::RuntimeException) { UnoControlBase::disposing( Source ); } // ::com::sun::star::awt::XControl sal_Bool SAL_CALL isTransparent( ) throw(::com::sun::star::uno::RuntimeException); @@ -488,14 +453,14 @@ public: ::com::sun::star::awt::Size SAL_CALL calcAdjustedSize( const ::com::sun::star::awt::Size& aNewSize ) throw(::com::sun::star::uno::RuntimeException); // ::com::sun::star::lang::XServiceInfo - DECLIMPL_SERVICEINFO_DERIVED( UnoRadioButtonControl, ImageConsumerControl, szServiceName2_UnoControlRadioButton ) + DECLIMPL_SERVICEINFO_DERIVED( UnoRadioButtonControl, UnoControlBase, szServiceName2_UnoControlRadioButton ) }; // ---------------------------------------------------- // class UnoControlCheckBoxModel // ---------------------------------------------------- -class UnoControlCheckBoxModel : public ImageProducerControlModel +class UnoControlCheckBoxModel : public GraphicControlModel { protected: ::com::sun::star::uno::Any ImplGetDefaultValue( sal_uInt16 nPropId ) const; @@ -503,7 +468,7 @@ protected: public: UnoControlCheckBoxModel(); - UnoControlCheckBoxModel( const UnoControlCheckBoxModel& rModel ) : ImageProducerControlModel( rModel ) {;} + UnoControlCheckBoxModel( const UnoControlCheckBoxModel& rModel ) : GraphicControlModel( rModel ) {;} UnoControlModel* Clone() const { return new UnoControlCheckBoxModel( *this ); } @@ -514,13 +479,13 @@ public: ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException); // ::com::sun::star::lang::XServiceInfo - DECLIMPL_SERVICEINFO_DERIVED( UnoControlCheckBoxModel, ImageProducerControlModel, szServiceName2_UnoControlCheckBoxModel ) + DECLIMPL_SERVICEINFO_DERIVED( UnoControlCheckBoxModel, GraphicControlModel, szServiceName2_UnoControlCheckBoxModel ) }; // ---------------------------------------------------- // class UnoCheckBoxControl // ---------------------------------------------------- -typedef ::cppu::AggImplInheritanceHelper4 < ImageConsumerControl +typedef ::cppu::AggImplInheritanceHelper4 < UnoControlBase , ::com::sun::star::awt::XButton , ::com::sun::star::awt::XCheckBox , ::com::sun::star::awt::XItemListener @@ -541,7 +506,7 @@ public: 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); void SAL_CALL dispose( ) throw(::com::sun::star::uno::RuntimeException); - void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw(::com::sun::star::uno::RuntimeException) { ImageConsumerControl::disposing( Source ); } + void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw(::com::sun::star::uno::RuntimeException) { UnoControlBase::disposing( Source ); } // ::com::sun::star::awt::XControl sal_Bool SAL_CALL isTransparent( ) throw(::com::sun::star::uno::RuntimeException); @@ -569,7 +534,7 @@ public: ::com::sun::star::awt::Size SAL_CALL calcAdjustedSize( const ::com::sun::star::awt::Size& aNewSize ) throw(::com::sun::star::uno::RuntimeException); // ::com::sun::star::lang::XServiceInfo - DECLIMPL_SERVICEINFO_DERIVED( UnoCheckBoxControl, ImageConsumerControl, szServiceName2_UnoControlCheckBox ) + DECLIMPL_SERVICEINFO_DERIVED( UnoCheckBoxControl, UnoControlBase, szServiceName2_UnoControlCheckBox ) }; diff --git a/toolkit/inc/toolkit/helper/servicenames.hxx b/toolkit/inc/toolkit/helper/servicenames.hxx index 96d9d5810cc0..2d1df79b733b 100644 --- a/toolkit/inc/toolkit/helper/servicenames.hxx +++ b/toolkit/inc/toolkit/helper/servicenames.hxx @@ -104,10 +104,5 @@ extern const sal_Char __FAR_DATA szServiceName_UnoThrobberControl[], szServiceNa extern const sal_Char __FAR_DATA szServiceName_UnoThrobberControlModel[], szServiceName2_UnoThrobberControlModel[]; extern const sal_Char __FAR_DATA szServiceName_UnoControlFixedHyperlink[], szServiceName_UnoControlFixedHyperlinkModel[]; -// ExtUnoWrapper: -extern const char __FAR_DATA szServiceName_ImageProducer[], szServiceName2_ImageProducer[]; - - - #endif // _TOOLKIT_HELPER_SERVICENAMES_HXX_ diff --git a/toolkit/source/awt/vclxwindows.cxx b/toolkit/source/awt/vclxwindows.cxx index 08e3ed286dd9..b79fee56e3d8 100644 --- a/toolkit/source/awt/vclxwindows.cxx +++ b/toolkit/source/awt/vclxwindows.cxx @@ -206,33 +206,22 @@ namespace toolkit } // ---------------------------------------------------- -// class VCLXImageConsumer +// class VCLXGraphicControl // ---------------------------------------------------- -void VCLXImageConsumer::ImplGetPropertyIds( std::list< sal_uInt16 > &rIds ) +void VCLXGraphicControl::ImplGetPropertyIds( std::list< sal_uInt16 > &rIds ) { VCLXWindow::ImplGetPropertyIds( rIds ); } -void VCLXImageConsumer::ImplSetNewImage() +void VCLXGraphicControl::ImplSetNewImage() { - OSL_PRECOND( GetWindow(), "VCLXImageConsumer::ImplSetNewImage: window is required to be not-NULL!" ); + OSL_PRECOND( GetWindow(), "VCLXGraphicControl::ImplSetNewImage: window is required to be not-NULL!" ); Button* pButton = static_cast< Button* >( GetWindow() ); pButton->SetModeBitmap( GetBitmap() ); } -void VCLXImageConsumer::ImplUpdateImage( sal_Bool bGetNewImage ) -{ - if ( !GetWindow() ) - return; - - if ( bGetNewImage && !maImageConsumer.GetData( maImage ) ) - return; - - ImplSetNewImage(); -} - -void VCLXImageConsumer::setPosSize( sal_Int32 X, sal_Int32 Y, sal_Int32 Width, sal_Int32 Height, short Flags ) throw(::com::sun::star::uno::RuntimeException) +void VCLXGraphicControl::setPosSize( sal_Int32 X, sal_Int32 Y, sal_Int32 Width, sal_Int32 Height, short Flags ) throw(::com::sun::star::uno::RuntimeException) { ::vos::OGuard aGuard( GetMutex() ); @@ -241,49 +230,11 @@ void VCLXImageConsumer::setPosSize( sal_Int32 X, sal_Int32 Y, sal_Int32 Width, s Size aOldSize = GetWindow()->GetSizePixel(); VCLXWindow::setPosSize( X, Y, Width, Height, Flags ); if ( ( aOldSize.Width() != Width ) || ( aOldSize.Height() != Height ) ) - ImplUpdateImage( sal_False ); + ImplSetNewImage(); } } -void VCLXImageConsumer::init( sal_Int32 Width, sal_Int32 Height ) throw(::com::sun::star::uno::RuntimeException) -{ - ::vos::OGuard aGuard( GetMutex() ); - - maImageConsumer.Init( Width, Height ); -} - -void VCLXImageConsumer::setColorModel( sal_Int16 BitCount, const ::com::sun::star::uno::Sequence< sal_Int32 >& RGBAPal, sal_Int32 RedMask, sal_Int32 GreenMask, sal_Int32 BlueMask, sal_Int32 AlphaMask ) throw(::com::sun::star::uno::RuntimeException) -{ - ::vos::OGuard aGuard( GetMutex() ); - - maImageConsumer.SetColorModel( BitCount, RGBAPal.getLength(), (const sal_uInt32*) RGBAPal.getConstArray(), RedMask, GreenMask, BlueMask, AlphaMask ); -} - -void VCLXImageConsumer::setPixelsByBytes( sal_Int32 X, sal_Int32 Y, sal_Int32 Width, sal_Int32 Height, const ::com::sun::star::uno::Sequence< sal_Int8 >& ProducerData, sal_Int32 Offset, sal_Int32 Scansize ) throw(::com::sun::star::uno::RuntimeException) -{ - ::vos::OGuard aGuard( GetMutex() ); - - maImageConsumer.SetPixelsByBytes( X, Y, Width, Height, (sal_uInt8*)ProducerData.getConstArray(), Offset, Scansize ); - ImplUpdateImage( sal_True ); -} - -void VCLXImageConsumer::setPixelsByLongs( sal_Int32 X, sal_Int32 Y, sal_Int32 Width, sal_Int32 Height, const ::com::sun::star::uno::Sequence< sal_Int32 >& ProducerData, sal_Int32 Offset, sal_Int32 Scansize ) throw(::com::sun::star::uno::RuntimeException) -{ - ::vos::OGuard aGuard( GetMutex() ); - - maImageConsumer.SetPixelsByLongs( X, Y, Width, Height, (const sal_uInt32*) ProducerData.getConstArray(), Offset, Scansize ); - ImplUpdateImage( sal_True ); -} - -void VCLXImageConsumer::complete( sal_Int32 Status, const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XImageProducer > & ) throw(::com::sun::star::uno::RuntimeException) -{ - ::vos::OGuard aGuard( GetMutex() ); - - maImageConsumer.Completed( Status ); - ImplUpdateImage( sal_True ); -} - -void VCLXImageConsumer::setProperty( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Any& Value) throw(::com::sun::star::uno::RuntimeException) +void VCLXGraphicControl::setProperty( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Any& Value) throw(::com::sun::star::uno::RuntimeException) { ::vos::OGuard aGuard( GetMutex() ); @@ -336,7 +287,7 @@ void VCLXImageConsumer::setProperty( const ::rtl::OUString& PropertyName, const } } -::com::sun::star::uno::Any VCLXImageConsumer::getProperty( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::uno::RuntimeException) +::com::sun::star::uno::Any VCLXGraphicControl::getProperty( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::uno::RuntimeException) { ::vos::OGuard aGuard( GetMutex() ); @@ -418,7 +369,7 @@ void VCLXButton::ImplGetPropertyIds( std::list< sal_uInt16 > &rIds ) BASEPROPERTY_CONTEXT_WRITING_MODE, BASEPROPERTY_REFERENCE_DEVICE, 0); - VCLXImageConsumer::ImplGetPropertyIds( rIds ); + VCLXGraphicControl::ImplGetPropertyIds( rIds ); } VCLXButton::VCLXButton() @@ -444,7 +395,7 @@ void VCLXButton::dispose() throw(::com::sun::star::uno::RuntimeException) aObj.Source = (::cppu::OWeakObject*)this; maActionListeners.disposeAndClear( aObj ); maItemListeners.disposeAndClear( aObj ); - VCLXImageConsumer::dispose(); + VCLXGraphicControl::dispose(); } void VCLXButton::addActionListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XActionListener > & l )throw(::com::sun::star::uno::RuntimeException) @@ -573,7 +524,7 @@ void VCLXButton::setProperty( const ::rtl::OUString& PropertyName, const ::com:: break; default: { - VCLXImageConsumer::setProperty( PropertyName, Value ); + VCLXGraphicControl::setProperty( PropertyName, Value ); } } } @@ -613,7 +564,7 @@ void VCLXButton::setProperty( const ::rtl::OUString& PropertyName, const ::com:: break; default: { - aProp <<= VCLXImageConsumer::getProperty( PropertyName ); + aProp <<= VCLXGraphicControl::getProperty( PropertyName ); } } } @@ -664,7 +615,7 @@ void VCLXButton::ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent ) break; default: - VCLXImageConsumer::ProcessWindowEvent( rVclWindowEvent ); + VCLXGraphicControl::ProcessWindowEvent( rVclWindowEvent ); break; } } @@ -693,7 +644,7 @@ void VCLXImageControl::ImplGetPropertyIds( std::list< sal_uInt16 > &rIds ) BASEPROPERTY_WRITING_MODE, BASEPROPERTY_CONTEXT_WRITING_MODE, 0); - VCLXImageConsumer::ImplGetPropertyIds( rIds ); + VCLXGraphicControl::ImplGetPropertyIds( rIds ); } VCLXImageControl::VCLXImageControl() @@ -770,7 +721,7 @@ void VCLXImageControl::setProperty( const ::rtl::OUString& PropertyName, const : break; default: - VCLXImageConsumer::setProperty( PropertyName, Value ); + VCLXGraphicControl::setProperty( PropertyName, Value ); break; } } @@ -794,7 +745,7 @@ void VCLXImageControl::setProperty( const ::rtl::OUString& PropertyName, const : break; default: - aProp = VCLXImageConsumer::getProperty( PropertyName ); + aProp = VCLXGraphicControl::getProperty( PropertyName ); break; } return aProp; @@ -831,7 +782,7 @@ void VCLXCheckBox::ImplGetPropertyIds( std::list< sal_uInt16 > &rIds ) BASEPROPERTY_CONTEXT_WRITING_MODE, BASEPROPERTY_REFERENCE_DEVICE, 0); - VCLXImageConsumer::ImplGetPropertyIds( rIds ); + VCLXGraphicControl::ImplGetPropertyIds( rIds ); } VCLXCheckBox::VCLXCheckBox() : maActionListeners( *this ), maItemListeners( *this ) @@ -844,14 +795,14 @@ VCLXCheckBox::VCLXCheckBox() : maActionListeners( *this ), maItemListeners( *th ::com::sun::star::uno::Any aRet = ::cppu::queryInterface( rType, SAL_STATIC_CAST( ::com::sun::star::awt::XButton*, this ), SAL_STATIC_CAST( ::com::sun::star::awt::XCheckBox*, this ) ); - return (aRet.hasValue() ? aRet : VCLXImageConsumer::queryInterface( rType )); + return (aRet.hasValue() ? aRet : VCLXGraphicControl::queryInterface( rType )); } // ::com::sun::star::lang::XTypeProvider IMPL_XTYPEPROVIDER_START( VCLXCheckBox ) getCppuType( ( ::com::sun::star::uno::Reference< ::com::sun::star::awt::XButton>* ) NULL ), getCppuType( ( ::com::sun::star::uno::Reference< ::com::sun::star::awt::XCheckBox>* ) NULL ), - VCLXImageConsumer::getTypes() + VCLXGraphicControl::getTypes() IMPL_XTYPEPROVIDER_END ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleContext > VCLXCheckBox::CreateAccessibleContext() @@ -866,7 +817,7 @@ void VCLXCheckBox::dispose() throw(::com::sun::star::uno::RuntimeException) ::com::sun::star::lang::EventObject aObj; aObj.Source = (::cppu::OWeakObject*)this; maItemListeners.disposeAndClear( aObj ); - VCLXImageConsumer::dispose(); + VCLXGraphicControl::dispose(); } void VCLXCheckBox::addItemListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XItemListener > & l ) throw(::com::sun::star::uno::RuntimeException) @@ -1028,7 +979,7 @@ void VCLXCheckBox::setProperty( const ::rtl::OUString& PropertyName, const ::com break; default: { - VCLXImageConsumer::setProperty( PropertyName, Value ); + VCLXGraphicControl::setProperty( PropertyName, Value ); } } } @@ -1056,7 +1007,7 @@ void VCLXCheckBox::setProperty( const ::rtl::OUString& PropertyName, const ::com break; default: { - aProp <<= VCLXImageConsumer::getProperty( PropertyName ); + aProp <<= VCLXGraphicControl::getProperty( PropertyName ); } } } @@ -1098,7 +1049,7 @@ void VCLXCheckBox::ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent ) break; default: - VCLXImageConsumer::ProcessWindowEvent( rVclWindowEvent ); + VCLXGraphicControl::ProcessWindowEvent( rVclWindowEvent ); break; } } @@ -1131,7 +1082,7 @@ void VCLXRadioButton::ImplGetPropertyIds( std::list< sal_uInt16 > &rIds ) BASEPROPERTY_CONTEXT_WRITING_MODE, BASEPROPERTY_REFERENCE_DEVICE, 0); - VCLXImageConsumer::ImplGetPropertyIds( rIds ); + VCLXGraphicControl::ImplGetPropertyIds( rIds ); } @@ -1145,14 +1096,14 @@ VCLXRadioButton::VCLXRadioButton() : maItemListeners( *this ), maActionListeners ::com::sun::star::uno::Any aRet = ::cppu::queryInterface( rType, SAL_STATIC_CAST( ::com::sun::star::awt::XRadioButton*, this ), SAL_STATIC_CAST( ::com::sun::star::awt::XButton*, this ) ); - return (aRet.hasValue() ? aRet : VCLXImageConsumer::queryInterface( rType )); + return (aRet.hasValue() ? aRet : VCLXGraphicControl::queryInterface( rType )); } // ::com::sun::star::lang::XTypeProvider IMPL_XTYPEPROVIDER_START( VCLXRadioButton ) getCppuType( ( ::com::sun::star::uno::Reference< ::com::sun::star::awt::XRadioButton>* ) NULL ), getCppuType( ( ::com::sun::star::uno::Reference< ::com::sun::star::awt::XButton>* ) NULL ), - VCLXImageConsumer::getTypes() + VCLXGraphicControl::getTypes() IMPL_XTYPEPROVIDER_END ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleContext > VCLXRadioButton::CreateAccessibleContext() @@ -1167,7 +1118,7 @@ void VCLXRadioButton::dispose() throw(::com::sun::star::uno::RuntimeException) ::com::sun::star::lang::EventObject aObj; aObj.Source = (::cppu::OWeakObject*)this; maItemListeners.disposeAndClear( aObj ); - VCLXImageConsumer::dispose(); + VCLXGraphicControl::dispose(); } void VCLXRadioButton::setProperty( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Any& Value) throw(::com::sun::star::uno::RuntimeException) @@ -1206,7 +1157,7 @@ void VCLXRadioButton::setProperty( const ::rtl::OUString& PropertyName, const :: break; default: { - VCLXImageConsumer::setProperty( PropertyName, Value ); + VCLXGraphicControl::setProperty( PropertyName, Value ); } } } @@ -1234,7 +1185,7 @@ void VCLXRadioButton::setProperty( const ::rtl::OUString& PropertyName, const :: break; default: { - aProp <<= VCLXImageConsumer::getProperty( PropertyName ); + aProp <<= VCLXGraphicControl::getProperty( PropertyName ); } } } @@ -1366,7 +1317,7 @@ void VCLXRadioButton::ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent break; default: - VCLXImageConsumer::ProcessWindowEvent( rVclWindowEvent ); + VCLXGraphicControl::ProcessWindowEvent( rVclWindowEvent ); break; } } diff --git a/toolkit/source/controls/roadmapcontrol.cxx b/toolkit/source/controls/roadmapcontrol.cxx index acfbee0c5bb6..08e7898ac661 100644 --- a/toolkit/source/controls/roadmapcontrol.cxx +++ b/toolkit/source/controls/roadmapcontrol.cxx @@ -52,27 +52,6 @@ namespace toolkit // helper // ---------------------------------------------------- - static void lcl_knitImageComponents( const Reference< XControlModel >& _rxModel, - const Reference< XWindowPeer >& _rxPeer, - bool _bAdd ) - { - Reference< XImageProducer > xProducer( _rxModel, UNO_QUERY ); - if ( xProducer.is() ) - { - Reference< XImageConsumer > xConsumer( _rxPeer, UNO_QUERY ); - if ( xConsumer.is() ) - { - if ( _bAdd ) - { - xProducer->addConsumer( xConsumer ); - xProducer->startProduction(); - } - else - xProducer->removeConsumer( xConsumer ); - } - } - } - static void lcl_throwIllegalArgumentException( ) { // throwing is expensive (in terms of code size), thus we hope the compiler does not inline this .... throw IllegalArgumentException(); @@ -384,40 +363,6 @@ static void lcl_throwIndexOutOfBoundsException( ) maContainerListeners.removeInterface( xListener ); } - - void UnoControlRoadmapModel::addConsumer( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XImageConsumer >& xConsumer ) throw (::com::sun::star::uno::RuntimeException) - { - maImageListeners.push_back( xConsumer ); - } - - - void UnoControlRoadmapModel::removeConsumer( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XImageConsumer >& xConsumer ) throw (::com::sun::star::uno::RuntimeException) - { - maImageListeners.remove( xConsumer ); - } - - - void UnoControlRoadmapModel::startProduction( ) throw (::com::sun::star::uno::RuntimeException) - { - Sequence aArgs(1); - aArgs.getArray()[0] = getPropertyValue( GetPropertyName( BASEPROPERTY_IMAGEURL ) ); - Reference< XMultiServiceFactory > xMSF = ::comphelper::getProcessServiceFactory(); - Reference< XImageProducer > xImageProducer( xMSF->createInstanceWithArguments( ::rtl::OUString::createFromAscii( "com.sun.star.awt.ImageProducer" ), aArgs ), UNO_QUERY ); - if ( xImageProducer.is() ) - { - std::list< Reference< XImageConsumer > >::iterator aIter( maImageListeners.begin() ); - while ( aIter != maImageListeners.end() ) - { - xImageProducer->addConsumer( *aIter ); - aIter++; - } - xImageProducer->startProduction(); - } - } - - - - // =================================================================== // = UnoRoadmapControl // =================================================================== @@ -434,9 +379,6 @@ sal_Bool SAL_CALL UnoRoadmapControl::setModel(const Reference< XControlModel >& { - // remove the peer as image consumer from the model - lcl_knitImageComponents( getModel(), getPeer(), false ); - Reference< XContainer > xC( getModel(), UNO_QUERY ); if ( xC.is() ) xC->removeContainerListener( this ); @@ -447,9 +389,6 @@ sal_Bool SAL_CALL UnoRoadmapControl::setModel(const Reference< XControlModel >& if ( xC.is() ) xC->addContainerListener( this ); - // add the peer as image consumer to the model - lcl_knitImageComponents( getModel(), getPeer(), true ); - return bReturn; } @@ -462,18 +401,6 @@ sal_Bool SAL_CALL UnoRoadmapControl::setModel(const Reference< XControlModel >& - void SAL_CALL UnoRoadmapControl::createPeer( const Reference & rxToolkit, const Reference< XWindowPeer > & rParentPeer ) throw(RuntimeException) - { - // remove the peer as image consumer from the model - lcl_knitImageComponents( getModel(), getPeer(), false ); - - UnoControl::createPeer( rxToolkit, rParentPeer ); - - lcl_knitImageComponents( getModel(), getPeer(), true ); - - } - - void UnoRoadmapControl::dispose() throw(RuntimeException) { EventObject aEvt; @@ -484,24 +411,6 @@ sal_Bool SAL_CALL UnoRoadmapControl::setModel(const Reference< XControlModel >& -void UnoRoadmapControl::ImplSetPeerProperty( const ::rtl::OUString& rPropName, const Any& rVal ) -{ - sal_uInt16 nType = GetPropertyId( rPropName ); - if ( getPeer().is() && ( nType == BASEPROPERTY_IMAGEURL ) ) - { - Reference < XImageProducer > xImgProd( getModel(), UNO_QUERY ); - Reference < XImageConsumer > xImgCons( getPeer(), UNO_QUERY ); - - if ( xImgProd.is() && xImgCons.is() ) - { - xImgProd->startProduction(); - } - } - else - UnoControlBase::ImplSetPeerProperty( rPropName, rVal ); -} - - void UnoRoadmapControl::elementInserted( const ContainerEvent& rEvent )throw(RuntimeException) { Reference< XInterface > xRoadmapItem; diff --git a/toolkit/source/controls/unocontrols.cxx b/toolkit/source/controls/unocontrols.cxx index cfb71111e3dc..92a8a21a6c08 100644 --- a/toolkit/source/controls/unocontrols.cxx +++ b/toolkit/source/controls/unocontrols.cxx @@ -80,32 +80,6 @@ using ::com::sun::star::graphic::XGraphic; using ::com::sun::star::uno::Reference; using namespace ::toolkit; - -// ---------------------------------------------------- -// helper -// ---------------------------------------------------- - -static void lcl_knitImageComponents( const uno::Reference< awt::XControlModel >& _rxModel, - const uno::Reference< awt::XWindowPeer >& _rxPeer, - bool _bAdd ) -{ - uno::Reference< awt::XImageProducer > xProducer( _rxModel, uno::UNO_QUERY ); - if ( xProducer.is() ) - { - uno::Reference< awt::XImageConsumer > xConsumer( _rxPeer, uno::UNO_QUERY ); - if ( xConsumer.is() ) - { - if ( _bAdd ) - { - xProducer->addConsumer( xConsumer ); - xProducer->startProduction(); - } - else - xProducer->removeConsumer( xConsumer ); - } - } -} - // ---------------------------------------------------- // class UnoControlEditModel // ---------------------------------------------------- @@ -543,37 +517,16 @@ UnoFileControl::UnoFileControl() } // ---------------------------------------------------- -// class ImageProducerControlModel +// class GraphicControlModel // ---------------------------------------------------- -uno::Any SAL_CALL ImageProducerControlModel::queryInterface( const uno::Type & rType ) throw(uno::RuntimeException) -{ - return UnoControlModel::queryInterface( rType ); -} - -uno::Any SAL_CALL ImageProducerControlModel::queryAggregation( const uno::Type & rType ) throw(uno::RuntimeException) -{ - uno::Any aRet = ::cppu::queryInterface( rType, SAL_STATIC_CAST( awt::XImageProducer*, this ) ); - return (aRet.hasValue() ? aRet : UnoControlModel::queryAggregation( rType )); -} - -void SAL_CALL ImageProducerControlModel::acquire() throw() -{ - UnoControlModel::acquire(); -} - -void SAL_CALL ImageProducerControlModel::release() throw() -{ - UnoControlModel::release(); -} - -uno::Any ImageProducerControlModel::ImplGetDefaultValue( sal_uInt16 nPropId ) const +uno::Any GraphicControlModel::ImplGetDefaultValue( sal_uInt16 nPropId ) const { if ( nPropId == BASEPROPERTY_GRAPHIC ) return uno::makeAny( uno::Reference< graphic::XGraphic >() ); return UnoControlModel::ImplGetDefaultValue( nPropId ); } - uno::Reference< graphic::XGraphic > ImageProducerControlModel::getGraphicFromURL_nothrow( const ::rtl::OUString& _rURL ) + uno::Reference< graphic::XGraphic > GraphicControlModel::getGraphicFromURL_nothrow( const ::rtl::OUString& _rURL ) { uno::Reference< graphic::XGraphic > xGraphic; @@ -611,7 +564,7 @@ uno::Any ImageProducerControlModel::ImplGetDefaultValue( sal_uInt16 nPropId ) co return xGraphic; } -void SAL_CALL ImageProducerControlModel::setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, const ::com::sun::star::uno::Any& rValue ) throw (::com::sun::star::uno::Exception) +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 ); @@ -665,90 +618,11 @@ void SAL_CALL ImageProducerControlModel::setFastPropertyValue_NoBroadcast( sal_I } catch( const ::com::sun::star::uno::Exception& ) { - OSL_ENSURE( sal_False, "ImageProducerControlModel::setFastPropertyValue_NoBroadcast: caught an exception while aligning the ImagePosition/ImageAlign properties!" ); + OSL_ENSURE( sal_False, "GraphicControlModel::setFastPropertyValue_NoBroadcast: caught an exception while aligning the ImagePosition/ImageAlign properties!" ); mbAdjustingImagePosition = sal_False; } } -void ImageProducerControlModel::addConsumer( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XImageConsumer >& xConsumer ) throw (::com::sun::star::uno::RuntimeException) -{ - maListeners.push_back( xConsumer ); -} - -void ImageProducerControlModel::removeConsumer( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XImageConsumer >& xConsumer ) throw (::com::sun::star::uno::RuntimeException) -{ - maListeners.remove( xConsumer ); -} - -void ImageProducerControlModel::startProduction( ) throw (::com::sun::star::uno::RuntimeException) -{ - uno::Sequence aArgs(1); - aArgs.getArray()[0] = getPropertyValue( GetPropertyName( BASEPROPERTY_IMAGEURL ) ); - uno::Reference< lang::XMultiServiceFactory > xMSF = ::comphelper::getProcessServiceFactory(); - uno::Reference< awt::XImageProducer > xImageProducer( xMSF->createInstanceWithArguments( ::rtl::OUString::createFromAscii( "com.sun.star.awt.ImageProducer" ), aArgs ), uno::UNO_QUERY ); - if ( xImageProducer.is() ) - { - std::list< uno::Reference< awt::XImageConsumer > >::iterator aIter( maListeners.begin() ); - while ( aIter != maListeners.end() ) - { - xImageProducer->addConsumer( *aIter ); - aIter++; - } - xImageProducer->startProduction(); - } -} - -// ---------------------------------------------------- -// class ImageConsumerControl -// ---------------------------------------------------- - -sal_Bool SAL_CALL ImageConsumerControl::setModel(const uno::Reference< awt::XControlModel >& _rModel) throw ( uno::RuntimeException ) -{ - // remove the peer as image consumer from the model - lcl_knitImageComponents( getModel(), getPeer(), false ); - - sal_Bool bReturn = UnoControlBase::setModel( _rModel ); - - // add the peer as image consumer to the model - lcl_knitImageComponents( getModel(), getPeer(), true ); - - return bReturn; -} - -void SAL_CALL ImageConsumerControl::createPeer( const uno::Reference< awt::XToolkit >& rxToolkit, const uno::Reference< awt::XWindowPeer >& rParentPeer ) throw(uno::RuntimeException) -{ - // remove the peer as image consumer from the model - lcl_knitImageComponents( getModel(), getPeer(), false ); - - UnoControlBase::createPeer( rxToolkit, rParentPeer ); - - // add the peer as image consumer to the model - lcl_knitImageComponents( getModel(), getPeer(), true ); -} - -void SAL_CALL ImageConsumerControl::dispose( ) throw(::com::sun::star::uno::RuntimeException) -{ - // remove the peer as image consumer from the model - lcl_knitImageComponents( getModel(), getPeer(), false ); - - UnoControlBase::dispose(); -} - -void ImageConsumerControl::ImplSetPeerProperty( const ::rtl::OUString& rPropName, const uno::Any& rVal ) -{ - sal_uInt16 nType = GetPropertyId( rPropName ); - if ( nType == BASEPROPERTY_IMAGEURL ) - { - uno::Reference < awt::XImageProducer > xImgProd( getModel(), uno::UNO_QUERY ); - uno::Reference < awt::XImageConsumer > xImgCons( getPeer(), uno::UNO_QUERY ); - - if ( xImgProd.is() && xImgCons.is() ) - xImgProd->startProduction(); - } - else - UnoControlBase::ImplSetPeerProperty( rPropName, rVal ); -} - // ---------------------------------------------------- // class UnoControlButtonModel // ---------------------------------------------------- @@ -784,7 +658,7 @@ uno::Any UnoControlButtonModel::ImplGetDefaultValue( sal_uInt16 nPropId ) const return uno::makeAny( (sal_Bool)sal_True ); } - return ImageProducerControlModel::ImplGetDefaultValue( nPropId ); + return GraphicControlModel::ImplGetDefaultValue( nPropId ); } ::cppu::IPropertyArrayHelper& UnoControlButtonModel::getInfoHelper() @@ -847,12 +721,12 @@ void UnoButtonControl::dispose() throw(uno::RuntimeException) aEvt.Source = (::cppu::OWeakObject*)this; maActionListeners.disposeAndClear( aEvt ); maItemListeners.disposeAndClear( aEvt ); - ImageConsumerControl::dispose(); + UnoControlBase::dispose(); } void UnoButtonControl::createPeer( const uno::Reference< awt::XToolkit > & rxToolkit, const uno::Reference< awt::XWindowPeer > & rParentPeer ) throw(uno::RuntimeException) { - ImageConsumerControl::createPeer( rxToolkit, rParentPeer ); + UnoControlBase::createPeer( rxToolkit, rParentPeer ); uno::Reference < awt::XButton > xButton( getPeer(), uno::UNO_QUERY ); xButton->setActionCommand( maActionCommand ); @@ -896,7 +770,7 @@ void UnoButtonControl::removeItemListener(const uno::Reference< awt::XItemListen void SAL_CALL UnoButtonControl::disposing( const lang::EventObject& Source ) throw (uno::RuntimeException) { - ImageConsumerControl::disposing( Source ); + UnoControlBase::disposing( Source ); } void SAL_CALL UnoButtonControl::itemStateChanged( const awt::ItemEvent& rEvent ) throw (uno::RuntimeException) @@ -966,7 +840,7 @@ uno::Any UnoControlImageControlModel::ImplGetDefaultValue( sal_uInt16 nPropId ) if ( nPropId == BASEPROPERTY_IMAGE_SCALE_MODE ) return makeAny( awt::ImageScaleMode::Anisotropic ); - return ImageProducerControlModel::ImplGetDefaultValue( nPropId ); + return GraphicControlModel::ImplGetDefaultValue( nPropId ); } ::cppu::IPropertyArrayHelper& UnoControlImageControlModel::getInfoHelper() @@ -989,7 +863,7 @@ uno::Reference< beans::XPropertySetInfo > UnoControlImageControlModel::getProper void SAL_CALL UnoControlImageControlModel::setFastPropertyValue_NoBroadcast( sal_Int32 _nHandle, const ::com::sun::star::uno::Any& _rValue ) throw (::com::sun::star::uno::Exception) { - ImageProducerControlModel::setFastPropertyValue_NoBroadcast( _nHandle, _rValue ); + GraphicControlModel::setFastPropertyValue_NoBroadcast( _nHandle, _rValue ); // ScaleImage is an older (and less powerful) version of ScaleMode, but keep both in sync as far as possible try @@ -1093,7 +967,7 @@ uno::Any UnoControlRadioButtonModel::ImplGetDefaultValue( sal_uInt16 nPropId ) c return uno::makeAny( (sal_Int16)awt::VisualEffect::LOOK3D ); } - return ImageProducerControlModel::ImplGetDefaultValue( nPropId ); + return GraphicControlModel::ImplGetDefaultValue( nPropId ); } ::cppu::IPropertyArrayHelper& UnoControlRadioButtonModel::getInfoHelper() @@ -1136,7 +1010,7 @@ void UnoRadioButtonControl::dispose() throw(uno::RuntimeException) lang::EventObject aEvt; aEvt.Source = (::cppu::OWeakObject*)this; maItemListeners.disposeAndClear( aEvt ); - ImageConsumerControl::dispose(); + UnoControlBase::dispose(); } @@ -1147,7 +1021,7 @@ sal_Bool UnoRadioButtonControl::isTransparent() throw(uno::RuntimeException) void UnoRadioButtonControl::createPeer( const uno::Reference< awt::XToolkit > & rxToolkit, const uno::Reference< awt::XWindowPeer > & rParentPeer ) throw(uno::RuntimeException) { - ImageConsumerControl::createPeer( rxToolkit, rParentPeer ); + UnoControlBase::createPeer( rxToolkit, rParentPeer ); uno::Reference < awt::XRadioButton > xRadioButton( getPeer(), uno::UNO_QUERY ); xRadioButton->addItemListener( this ); @@ -1300,7 +1174,7 @@ uno::Any UnoControlCheckBoxModel::ImplGetDefaultValue( sal_uInt16 nPropId ) cons return uno::makeAny( (sal_Int16)awt::VisualEffect::LOOK3D ); } - return ImageProducerControlModel::ImplGetDefaultValue( nPropId ); + return GraphicControlModel::ImplGetDefaultValue( nPropId ); } ::cppu::IPropertyArrayHelper& UnoControlCheckBoxModel::getInfoHelper() @@ -1343,7 +1217,7 @@ void UnoCheckBoxControl::dispose() throw(uno::RuntimeException) lang::EventObject aEvt; aEvt.Source = (::cppu::OWeakObject*)this; maItemListeners.disposeAndClear( aEvt ); - ImageConsumerControl::dispose(); + UnoControlBase::dispose(); } sal_Bool UnoCheckBoxControl::isTransparent() throw(uno::RuntimeException) @@ -1353,7 +1227,7 @@ sal_Bool UnoCheckBoxControl::isTransparent() throw(uno::RuntimeException) void UnoCheckBoxControl::createPeer( const uno::Reference< awt::XToolkit > & rxToolkit, const uno::Reference< awt::XWindowPeer > & rParentPeer ) throw(uno::RuntimeException) { - ImageConsumerControl::createPeer( rxToolkit, rParentPeer ); + UnoControlBase::createPeer( rxToolkit, rParentPeer ); uno::Reference < awt::XCheckBox > xCheckBox( getPeer(), uno::UNO_QUERY ); xCheckBox->addItemListener( this ); diff --git a/toolkit/source/helper/servicenames.cxx b/toolkit/source/helper/servicenames.cxx index 6a376391f46d..f57f52f13e57 100644 --- a/toolkit/source/helper/servicenames.cxx +++ b/toolkit/source/helper/servicenames.cxx @@ -77,7 +77,6 @@ const sal_Char __FAR_DATA szServiceName_UnoControlPatternFieldModel[] = "stardiv const sal_Char __FAR_DATA szServiceName_UnoControlFormattedField[] = "stardiv.vcl.control.FormattedField", szServiceName2_UnoControlFormattedField[] = "com.sun.star.awt.UnoControlFormattedField"; const sal_Char __FAR_DATA szServiceName_UnoControlFormattedFieldModel[] = "stardiv.vcl.controlmodel.FormattedField", szServiceName2_UnoControlFormattedFieldModel[] = "com.sun.star.awt.UnoControlFormattedFieldModel"; const sal_Char __FAR_DATA szServiceName_MVCIntrospection[] = "stardiv.vcl.MVCIntrospection", szServiceName2_MVCIntrospection[] = "com.sun.star.awt.MVCIntrospection"; -const sal_Char __FAR_DATA szServiceName_ImageProducer[] = "stardiv.vcl.ImageProducer", szServiceName2_ImageProducer[] = "com.sun.star.awt.ImageProducer"; const sal_Char __FAR_DATA szServiceName_PrinterServer[] = "stardiv.vcl.PrinterServer", szServiceName2_PrinterServer[] = "com.sun.star.awt.PrinterServer"; const sal_Char __FAR_DATA szServiceName_UnoControlProgressBar[] = "stardiv.vcl.control.ProgressBar", szServiceName2_UnoControlProgressBar[] = "com.sun.star.awt.UnoControlProgressBar"; const sal_Char __FAR_DATA szServiceName_UnoControlProgressBarModel[] = "stardiv.vcl.controlmodel.ProgressBar", szServiceName2_UnoControlProgressBarModel[] = "com.sun.star.awt.UnoControlProgressBarModel"; diff --git a/toolkit/source/layout/core/import.cxx b/toolkit/source/layout/core/import.cxx index daaa8c239f50..6d161cf1b07e 100644 --- a/toolkit/source/layout/core/import.cxx +++ b/toolkit/source/layout/core/import.cxx @@ -109,17 +109,6 @@ SAL_THROW (()) DBG_ERROR( "Fatal error: top node isn't a dialog" ); } -#if 0 - // Hack moved to proplist.cxx - OUString aGraphic; - if ( findAndRemove( "graphic", aProps, aGraphic ) ) - //if ( layout::FixedImage *i = dynamic_cast ( mpWidget->getPeer().get() ) ) - // FIXME: huh? XImageProducer::complete( XImageConsumer ) - //i->setImage( Image( loadGraphic( OUSTRING_CSTR( aGraphic ) ) ) ); - mpWidget->setProperty( OUString::createFromAscii( "graphic" ), - loadGraphic( OUSTRING_CSTR( aGraphic ) ) ); -#endif - OUString aOrdering; if ( findAndRemove( "ordering", aProps, aOrdering ) ) if ( DialogButtonHBox *b = dynamic_cast ( mpWidget->getPeer().get() ) ) -- cgit v1.2.3 From 8a6b7bad0288723d443c5597b9a7201594bb2c25 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Fri, 18 Jun 2010 15:44:36 +0200 Subject: unoawt2: get rid of the ImageConsumer class - it has no clients anymore --- toolkit/inc/pch/precompiled_toolkit.hxx | 1 - toolkit/inc/toolkit/awt/vclxwindows.hxx | 1 - toolkit/inc/toolkit/controls/unocontrols.hxx | 1 - vcl/inc/vcl/imgcons.hxx | 105 ----- vcl/prj/d.lst | 3 +- vcl/source/gdi/imgcons.cxx | 574 --------------------------- 6 files changed, 1 insertion(+), 684 deletions(-) delete mode 100644 vcl/inc/vcl/imgcons.hxx delete mode 100644 vcl/source/gdi/imgcons.cxx diff --git a/toolkit/inc/pch/precompiled_toolkit.hxx b/toolkit/inc/pch/precompiled_toolkit.hxx index affcf376b071..d0baff3b8343 100644 --- a/toolkit/inc/pch/precompiled_toolkit.hxx +++ b/toolkit/inc/pch/precompiled_toolkit.hxx @@ -326,7 +326,6 @@ #include "vcl/font.hxx" #include "vcl/gradient.hxx" #include "vcl/image.hxx" -#include "vcl/imgcons.hxx" #include "vcl/jobset.hxx" #include "vcl/mapunit.hxx" #include "vcl/menu.hxx" diff --git a/toolkit/inc/toolkit/awt/vclxwindows.hxx b/toolkit/inc/toolkit/awt/vclxwindows.hxx index 75085020ca7b..80e3a37279d3 100644 --- a/toolkit/inc/toolkit/awt/vclxwindows.hxx +++ b/toolkit/inc/toolkit/awt/vclxwindows.hxx @@ -92,7 +92,6 @@ #include #include -#include #include class Button; diff --git a/toolkit/inc/toolkit/controls/unocontrols.hxx b/toolkit/inc/toolkit/controls/unocontrols.hxx index fd775cd568c1..a0d34b0f8741 100644 --- a/toolkit/inc/toolkit/controls/unocontrols.hxx +++ b/toolkit/inc/toolkit/controls/unocontrols.hxx @@ -55,7 +55,6 @@ #include #include #include -#include #include #include #include diff --git a/vcl/inc/vcl/imgcons.hxx b/vcl/inc/vcl/imgcons.hxx deleted file mode 100644 index 2f582fec15c3..000000000000 --- a/vcl/inc/vcl/imgcons.hxx +++ /dev/null @@ -1,105 +0,0 @@ -/************************************************************************* - * - * 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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#ifndef _IMGCONS_HXX -#define _IMGCONS_HXX - -#include - -#include - -// ----------------- -// - ImageConsumer - -// ----------------- - -class ImageProducer; -class ImplColorMapper; -class BitmapEx; -class Image; - -#define IMAGEERROR 1 -#define SINGLEFRAMEDONE 2 -#define STATICIMAGEDONE 3 -#define IMAGEABORTED 4 - -class VCL_DLLPUBLIC ImageConsumer -{ -private: - - Bitmap maBitmap; - Bitmap maMask; - Rectangle maChangedRect; - Size maSize; - ImplColorMapper* mpMapper; - Color* mpPal; - Link maChgLink; - Link maDoneLink; - sal_uInt32 mnFormat; - sal_uInt32 mnStatus; - BOOL mbTrans; - -protected: - - virtual void DataChanged(); - -public: - - ImageConsumer(); - virtual ~ImageConsumer(); - - BOOL GetData( BitmapEx& rBmpEx ) const; - BOOL GetData( Image& rImage ) const; - const Rectangle& GetChangedRect() const { return maChangedRect; } - sal_uInt32 GetStatus() const; - - void SetDataChangedLink( const Link& rLink ) { maChgLink = rLink; } - const Link& GetDataChangedLink() const { return maChgLink; } - - void SetDoneLink( const Link& rLink ) { maDoneLink = rLink; } - const Link& GetDoneLink() const { return maDoneLink; } - -public: - - virtual void Init( sal_uInt32 nWidth, sal_uInt32 nHeight ); - - virtual void SetColorModel( USHORT nBitCount, - sal_uInt32 nPalEntries, const sal_uInt32* pRGBAPal, - sal_uInt32 nRMask, sal_uInt32 nGMask, sal_uInt32 nBMask, sal_uInt32 nAMask ); - - virtual void SetPixelsByBytes( sal_uInt32 nConsX, sal_uInt32 nConsY, - sal_uInt32 nConsWidth, sal_uInt32 nConsHeight, - const BYTE* pProducerData, sal_uInt32 nOffset, sal_uInt32 nScanSize ); - - virtual void SetPixelsByLongs( sal_uInt32 nConsX, sal_uInt32 nConsY, - sal_uInt32 nConsWidth, sal_uInt32 nConsHeight, - const sal_uInt32* pProducerData, sal_uInt32 nOffset, sal_uInt32 nScanSize ); - - virtual void Completed( sal_uInt32 nStatus ); -// virtual void Completed( sal_uInt32 nStatus, ImageProducer& rProducer ); -}; - -#endif // _IMGCONS_HXX diff --git a/vcl/prj/d.lst b/vcl/prj/d.lst index 8345b155ce58..c1d649ab0c7c 100644 --- a/vcl/prj/d.lst +++ b/vcl/prj/d.lst @@ -1,4 +1,4 @@ -mkdir: %COMMON_DEST%\bin%_EXT%\hid +kdir: %COMMON_DEST%\bin%_EXT%\hid mkdir: %_DEST%\inc%_EXT%\vcl ..\%COMMON_OUTDIR%\bin\*.zip %COMMON_DEST%\bin%_EXT%\*.zip @@ -56,7 +56,6 @@ mkdir: %_DEST%\inc%_EXT%\vcl ..\inc\vcl\help.hxx %_DEST%\inc%_EXT%\vcl\help.hxx ..\inc\vcl\image.hxx %_DEST%\inc%_EXT%\vcl\image.hxx ..\inc\vcl\imagerepository.hxx %_DEST%\inc%_EXT%\vcl\imagerepository.hxx -..\inc\vcl\imgcons.hxx %_DEST%\inc%_EXT%\vcl\imgcons.hxx ..\inc\vcl\imgctrl.hxx %_DEST%\inc%_EXT%\vcl\imgctrl.hxx ..\inc\vcl\impdel.hxx %_DEST%\inc%_EXT%\vcl\impdel.hxx ..\inc\vcl\inputctx.hxx %_DEST%\inc%_EXT%\vcl\inputctx.hxx diff --git a/vcl/source/gdi/imgcons.cxx b/vcl/source/gdi/imgcons.cxx deleted file mode 100644 index 0826c5f2310b..000000000000 --- a/vcl/source/gdi/imgcons.cxx +++ /dev/null @@ -1,574 +0,0 @@ -/************************************************************************* - * - * 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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_vcl.hxx" - -#include -#include -#include -#include -#include - -// ------------------- -// - ImplColorMapper - -// ------------------- - -class ImplColorMapper -{ - Color maCol; - ULONG mnR; - ULONG mnG; - ULONG mnB; - ULONG mnT; - ULONG mnRShift; - ULONG mnGShift; - ULONG mnBShift; - ULONG mnTShift; - - ULONG ImplCalcMaskShift( ULONG nVal ); - -public: - - ImplColorMapper( ULONG nRMask, ULONG nGMask, ULONG nBMask, ULONG nTMask ); - ~ImplColorMapper(); - - const Color& ImplGetColor( ULONG nColor ) - { - maCol.SetRed( (UINT8) ( ( nColor & mnR ) >> mnRShift ) ); - maCol.SetGreen( (UINT8) ( ( nColor & mnG ) >> mnGShift ) ); - maCol.SetBlue( (UINT8) ( ( nColor & mnB ) >> mnBShift ) ); - maCol.SetTransparency( (UINT8) ( ( nColor & mnT ) >> mnTShift ) ); - return maCol; - } -}; - -// ----------------------------------------------------------------------------- - -ImplColorMapper::ImplColorMapper( ULONG nRMask, ULONG nGMask, ULONG nBMask, ULONG nTMask ) : - mnR( nRMask ), - mnG( nGMask ), - mnB( nBMask ), - mnT( nTMask ) -{ - mnRShift = ImplCalcMaskShift( mnR ); - mnGShift = ImplCalcMaskShift( mnG ); - mnBShift = ImplCalcMaskShift( mnB ); - mnTShift = ImplCalcMaskShift( mnT ); -} - -// ----------------------------------------------------------------------------- - -ImplColorMapper::~ImplColorMapper() -{ -} - -// ----------------------------------------------------------------------------- - -ULONG ImplColorMapper::ImplCalcMaskShift( ULONG nVal ) -{ - DBG_ASSERT( nVal > 0, "Mask has no value!" ); - - ULONG nRet = 0UL; - - for( ULONG i = 0UL; i < 32; i++ ) - { - if( nVal & ( 1UL << i ) ) - { - nRet = i; - break; - } - } - - return nRet; -} - -// ----------------- -// - ImageConsumer - -// ----------------- - -ImageConsumer::ImageConsumer() : - mpMapper( NULL ), - mpPal ( NULL ), - mnStatus( 0UL ), - mbTrans ( FALSE ) -{ -} - -// ----------------------------------------------------------------------------- - -ImageConsumer::~ImageConsumer() -{ - delete[] mpPal; - delete mpMapper; -} - -// ----------------------------------------------------------------------------- - -void ImageConsumer::Init( sal_uInt32 nWidth, sal_uInt32 nHeight ) -{ - maSize = Size( nWidth, nHeight ); - maBitmap = maMask = Bitmap(); - mnStatus = 0UL; - mbTrans = FALSE; -} - -// ----------------------------------------------------------------------------- - -void ImageConsumer::SetColorModel( USHORT nBitCount, - sal_uInt32 nPalEntries, const sal_uInt32* pRGBAPal, - sal_uInt32 nRMask, sal_uInt32 nGMask, sal_uInt32 nBMask, sal_uInt32 nAMask ) -{ - DBG_ASSERT( maSize.Width() && maSize.Height(), "Missing call to ImageConsumer::Init(...)!" ); - - BitmapPalette aPal( Min( (USHORT) nPalEntries, (USHORT) 256 ) ); - - if( nPalEntries ) - { - BitmapColor aCol; - const sal_Int32* pTmp = (sal_Int32*) pRGBAPal; - - delete mpMapper; - mpMapper = NULL; - - delete[] mpPal; - mpPal = new Color[ nPalEntries ]; - - for( ULONG i = 0; i < nPalEntries; i++, pTmp++ ) - { - Color& rCol = mpPal[ i ]; - BYTE cVal; - - cVal = (BYTE) ( ( *pTmp & 0xff000000UL ) >> 24L ); - rCol.SetRed( cVal ); - - if( i < (ULONG) aPal.GetEntryCount() ) - aPal[ (USHORT) i ].SetRed( cVal ); - - cVal = (BYTE) ( ( *pTmp & 0x00ff0000UL ) >> 16L ); - rCol.SetGreen( cVal ); - - if( i < (ULONG) aPal.GetEntryCount() ) - aPal[ (USHORT) i ].SetGreen( cVal ); - - cVal = (BYTE) ( ( *pTmp & 0x0000ff00UL ) >> 8L ); - rCol.SetBlue( cVal ); - - if( i < (ULONG) aPal.GetEntryCount() ) - aPal[ (USHORT) i ].SetBlue( cVal ); - - rCol.SetTransparency( (BYTE) ( ( *pTmp & 0x000000ffL ) ) ); - } - - if( nBitCount <= 1 ) - nBitCount = 1; - else if( nBitCount <= 4 ) - nBitCount = 4; - else if( nBitCount <= 8 ) - nBitCount = 8; - else - nBitCount = 24; - } - else - { - delete mpMapper; - mpMapper = new ImplColorMapper( nRMask, nGMask, nBMask, nAMask ); - - delete[] mpPal; - mpPal = NULL; - - nBitCount = 24; - } - - if( !maBitmap ) - { - - maBitmap = Bitmap( maSize, nBitCount, &aPal ); - maMask = Bitmap( maSize, 1 ); - maMask.Erase( COL_BLACK ); - mbTrans = FALSE; - } -} - -// ----------------------------------------------------------------------------- - -void ImageConsumer::SetPixelsByBytes( sal_uInt32 nConsX, sal_uInt32 nConsY, - sal_uInt32 nConsWidth, sal_uInt32 nConsHeight, - const BYTE* pData, sal_uInt32 nOffset, sal_uInt32 nScanSize ) -{ - DBG_ASSERT( !!maBitmap && !!maMask, "Missing call to ImageConsumer::SetColorModel(...)!" ); - - BitmapWriteAccess* pBmpAcc = maBitmap.AcquireWriteAccess(); - BitmapWriteAccess* pMskAcc = maMask.AcquireWriteAccess(); - sal_Bool bDataChanged = sal_False; - - if( pBmpAcc && pMskAcc ) - { - const long nWidth = pBmpAcc->Width(); - const long nHeight = pBmpAcc->Height(); - - maChangedRect = Rectangle( Point(), Size( nWidth, nHeight ) ); - maChangedRect.Intersection( Rectangle( Point( nConsX, nConsY ), Size( nConsWidth, nConsHeight ) ) ); - - if( !maChangedRect.IsEmpty() ) - { - const long nStartX = maChangedRect.Left(); - const long nEndX = maChangedRect.Right(); - const long nStartY = maChangedRect.Top(); - const long nEndY = maChangedRect.Bottom(); - - if( mpMapper && ( pBmpAcc->GetBitCount() > 8 ) ) - { - BitmapColor aCol; - BitmapColor aMskWhite( pMskAcc->GetBestMatchingColor( Color( COL_WHITE ) ) ); - - for( long nY = nStartY; nY <= nEndY; nY++ ) - { - const BYTE* pTmp = pData + ( nY - nStartY ) * nScanSize + nOffset; - - for( long nX = nStartX; nX <= nEndX; nX++ ) - { - const Color& rCol = mpMapper->ImplGetColor( *pTmp++ ); - - // 0: Transparent; >0: Non-Transparent - if( !rCol.GetTransparency() ) - { - pMskAcc->SetPixel( nY, nX, aMskWhite ); - mbTrans = TRUE; - } - else - { - aCol.SetRed( rCol.GetRed() ); - aCol.SetGreen( rCol.GetGreen() ); - aCol.SetBlue( rCol.GetBlue() ); - pBmpAcc->SetPixel( nY, nX, aCol ); - } - } - } - - bDataChanged = sal_True; - } - else if( mpPal && ( pBmpAcc->GetBitCount() <= 8 ) ) - { - BitmapColor aIndex( (BYTE) 0 ); - BitmapColor aMskWhite( pMskAcc->GetBestMatchingColor( Color( COL_WHITE ) ) ); - - for( long nY = nStartY; nY <= nEndY; nY++ ) - { - const BYTE* pTmp = pData + ( nY - nStartY ) * nScanSize + nOffset; - - for( long nX = nStartX; nX <= nEndX; nX++ ) - { - const BYTE cIndex = *pTmp++; - const Color& rCol = mpPal[ cIndex ]; - - // 0: Transparent; >0: Non-Transparent - if( !rCol.GetTransparency() ) - { - pMskAcc->SetPixel( nY, nX, aMskWhite ); - mbTrans = TRUE; - } - else - { - aIndex.SetIndex( cIndex ); - pBmpAcc->SetPixel( nY, nX, aIndex ); - } - } - } - - bDataChanged = sal_True; - } - else if( mpPal && ( pBmpAcc->GetBitCount() > 8 ) ) - { - BitmapColor aCol; - BitmapColor aMskWhite( pMskAcc->GetBestMatchingColor( Color( COL_WHITE ) ) ); - - for( long nY = nStartY; nY <= nEndY; nY++ ) - { - const BYTE* pTmp = pData + ( nY - nStartY ) * nScanSize + nOffset; - - for( long nX = nStartX; nX <= nEndX; nX++ ) - { - const BYTE cIndex = *pTmp++; - const Color& rCol = mpPal[ cIndex ]; - - // 0: Transparent; >0: Non-Transparent - if( !rCol.GetTransparency() ) - { - pMskAcc->SetPixel( nY, nX, aMskWhite ); - mbTrans = TRUE; - } - else - { - aCol.SetRed( rCol.GetRed() ); - aCol.SetGreen( rCol.GetGreen() ); - aCol.SetBlue( rCol.GetBlue() ); - pBmpAcc->SetPixel( nY, nX, aCol ); - } - } - } - - bDataChanged = sal_True; - } - else - { - DBG_ERROR( "Producer format error!" ); - maChangedRect.SetEmpty(); - } - } - } - else - maChangedRect.SetEmpty(); - - maBitmap.ReleaseAccess( pBmpAcc ); - maMask.ReleaseAccess( pMskAcc ); - - if( bDataChanged ) - DataChanged(); -} - -// ----------------------------------------------------------------------------- - -void ImageConsumer::SetPixelsByLongs( sal_uInt32 nConsX, sal_uInt32 nConsY, - sal_uInt32 nConsWidth, sal_uInt32 nConsHeight, - const sal_uInt32* pData, sal_uInt32 nOffset, sal_uInt32 nScanSize ) -{ - DBG_ASSERT( !!maBitmap && !!maMask, "Missing call to ImageConsumer::SetColorModel(...)!" ); - - BitmapWriteAccess* pBmpAcc = maBitmap.AcquireWriteAccess(); - BitmapWriteAccess* pMskAcc = maMask.AcquireWriteAccess(); - sal_Bool bDataChanged = sal_False; - - if( pBmpAcc && pMskAcc ) - { - const long nWidth = pBmpAcc->Width(); - const long nHeight = pBmpAcc->Height(); - - maChangedRect = Rectangle( Point(), Size( nWidth, nHeight ) ); - maChangedRect.Intersection( Rectangle( Point( nConsX, nConsY ), Size( nConsWidth, nConsHeight ) ) ); - - if( !maChangedRect.IsEmpty() ) - { - const long nStartX = maChangedRect.Left(); - const long nEndX = maChangedRect.Right(); - const long nStartY = maChangedRect.Top(); - const long nEndY = maChangedRect.Bottom(); - - if( mpMapper && ( pBmpAcc->GetBitCount() > 8 ) ) - { - BitmapColor aCol; - BitmapColor aMskWhite( pMskAcc->GetBestMatchingColor( Color( COL_WHITE ) ) ); - - for( long nY = nStartY; nY <= nEndY; nY++ ) - { - const sal_Int32* pTmp = (sal_Int32*) pData + ( nY - nStartY ) * nScanSize + nOffset; - - for( long nX = nStartX; nX <= nEndX; nX++ ) - { - const Color& rCol = mpMapper->ImplGetColor( *pTmp++ ); - - // 0: Transparent; >0: Non-Transparent - if( !rCol.GetTransparency() ) - { - pMskAcc->SetPixel( nY, nX, aMskWhite ); - mbTrans = TRUE; - } - else - { - aCol.SetRed( rCol.GetRed() ); - aCol.SetGreen( rCol.GetGreen() ); - aCol.SetBlue( rCol.GetBlue() ); - pBmpAcc->SetPixel( nY, nX, aCol ); - } - } - } - - bDataChanged = sal_True; - } - else if( mpPal && ( pBmpAcc->GetBitCount() <= 8 ) ) - { - BitmapColor aIndex( (BYTE) 0 ); - BitmapColor aMskWhite( pMskAcc->GetBestMatchingColor( Color( COL_WHITE ) ) ); - - for( long nY = nStartY; nY <= nEndY; nY++ ) - { - const sal_Int32* pTmp = (sal_Int32*) pData + ( nY - nStartY ) * nScanSize + nOffset; - - for( long nX = nStartX; nX <= nEndX; nX++ ) - { - const sal_Int32 nIndex = *pTmp++; - const Color& rCol = mpPal[ nIndex ]; - - // 0: Transparent; >0: Non-Transparent - if( !rCol.GetTransparency() ) - { - pMskAcc->SetPixel( nY, nX, aMskWhite ); - mbTrans = TRUE; - } - else - { - aIndex.SetIndex( (BYTE) nIndex ); - pBmpAcc->SetPixel( nY, nX, aIndex ); - } - } - } - - bDataChanged = sal_True; - } - else if( mpPal && ( pBmpAcc->GetBitCount() > 8 ) ) - { - BitmapColor aCol; - BitmapColor aMskWhite( pMskAcc->GetBestMatchingColor( Color( COL_WHITE ) ) ); - - for( long nY = nStartY; nY <= nEndY; nY++ ) - { - const sal_Int32* pTmp = (sal_Int32*) pData + ( nY - nStartY ) * nScanSize + nOffset; - - for( long nX = nStartX; nX <= nEndX; nX++ ) - { - const sal_Int32 nIndex = *pTmp++; - const Color& rCol = mpPal[ nIndex ]; - - // 0: Transparent; >0: Non-Transparent - if( !rCol.GetTransparency() ) - { - pMskAcc->SetPixel( nY, nX, aMskWhite ); - mbTrans = TRUE; - } - else - { - aCol.SetRed( rCol.GetRed() ); - aCol.SetGreen( rCol.GetGreen() ); - aCol.SetBlue( rCol.GetBlue() ); - pBmpAcc->SetPixel( nY, nX, aCol ); - } - } - } - - bDataChanged = sal_True; - } - else - { - DBG_ERROR( "Producer format error!" ); - maChangedRect.SetEmpty(); - } - } - } - else - maChangedRect.SetEmpty(); - - maBitmap.ReleaseAccess( pBmpAcc ); - maMask.ReleaseAccess( pMskAcc ); - - if( bDataChanged ) - DataChanged(); -} - -// ----------------------------------------------------------------------------- - -void ImageConsumer::Completed( sal_uInt32 nStatus /*, ImageProducer& rProducer */ ) -{ - delete mpMapper; - mpMapper = NULL; - delete[] mpPal; - mpPal = NULL; - maSize = Size(); - mnStatus = nStatus; - - switch( nStatus ) - { - case( SINGLEFRAMEDONE ): - case( STATICIMAGEDONE ): - { - if( !mbTrans ) - maMask = Bitmap(); - } - break; - - case( IMAGEERROR ): - case( IMAGEABORTED ): - maBitmap = maMask = Bitmap(); - break; - - default: - break; - } - -// rProducer.RemoveConsumer( *this ); - - if( maDoneLink.IsSet() ) - maDoneLink.Call( this ); -} - -// ----------------------------------------------------------------------------- - -void ImageConsumer::DataChanged() -{ - if( maChgLink.IsSet() ) - maChgLink.Call( this ); -} - -// ----------------------------------------------------------------------------- - -sal_uInt32 ImageConsumer::GetStatus() const -{ - return mnStatus; -} - -// ----------------------------------------------------------------------------- - -BOOL ImageConsumer::GetData( BitmapEx& rBmpEx ) const -{ - const BOOL bRet = ( SINGLEFRAMEDONE == mnStatus || STATICIMAGEDONE == mnStatus ); - - if( bRet ) - { - if( !!maMask ) - rBmpEx = BitmapEx( maBitmap, maMask ); - else - rBmpEx = BitmapEx( maBitmap ); - } - - return bRet; -} - -// ----------------------------------------------------------------------------- - -BOOL ImageConsumer::GetData( Image& rImage ) const -{ - const BOOL bRet = ( SINGLEFRAMEDONE == mnStatus || STATICIMAGEDONE == mnStatus ); - - if( bRet ) - { - if( !!maMask ) - rImage = Image( maBitmap, maMask ); - else - rImage = Image( maBitmap ); - } - - return bRet; -} -- cgit v1.2.3 From 9ed97b1ffd16353afabde7239684aec7b2d4026f Mon Sep 17 00:00:00 2001 From: "Herbert Duerr [hdu]" Date: Fri, 18 Jun 2010 16:10:27 +0200 Subject: #i112247# adjust AquaSalGraphics::GetFontMetric() signature --- vcl/aqua/inc/salgdi.h | 2 +- vcl/aqua/source/gdi/salgdi.cxx | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/vcl/aqua/inc/salgdi.h b/vcl/aqua/inc/salgdi.h index 247de1b95dec..13951253c637 100644 --- a/vcl/aqua/inc/salgdi.h +++ b/vcl/aqua/inc/salgdi.h @@ -276,7 +276,7 @@ public: // set the font virtual USHORT SetFont( ImplFontSelectData*, int nFallbackLevel ); // get the current font's etrics - virtual void GetFontMetric( ImplFontMetricData* ); + virtual void GetFontMetric( ImplFontMetricData*, int nFallbackLevel ); // get kernign pairs of the current font // return only PairCount if (pKernPairs == NULL) virtual ULONG GetKernPairs( ULONG nPairs, ImplKernPairData* pKernPairs ); diff --git a/vcl/aqua/source/gdi/salgdi.cxx b/vcl/aqua/source/gdi/salgdi.cxx index 1ef370f43a92..da6d74df1a78 100644 --- a/vcl/aqua/source/gdi/salgdi.cxx +++ b/vcl/aqua/source/gdi/salgdi.cxx @@ -1539,8 +1539,10 @@ void AquaSalGraphics::SetTextColor( SalColor nSalColor ) // ----------------------------------------------------------------------- -void AquaSalGraphics::GetFontMetric( ImplFontMetricData* pMetric ) +void AquaSalGraphics::GetFontMetric( ImplFontMetricData* pMetric, int nFallbackLevel ) { + (void)nFallbackLevel; // glyph-fallback on ATSU is done differently -> no fallback level + // get the ATSU font metrics (in point units) // of the font that has eventually been size-limited -- cgit v1.2.3 From e10f9a08b1b7baca7cbbde0f805a80e54feb8c5f Mon Sep 17 00:00:00 2001 From: "Herbert Duerr [hdu]" Date: Fri, 18 Jun 2010 16:23:48 +0200 Subject: #i112247# adjusted WinSalGraphics::GetFontMetric() to new semantic --- vcl/win/inc/salgdi.h | 2 +- vcl/win/source/gdi/salgdi3.cxx | 15 +++++++++++---- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/vcl/win/inc/salgdi.h b/vcl/win/inc/salgdi.h index 4b97eeb98c0b..6792e195f44f 100644 --- a/vcl/win/inc/salgdi.h +++ b/vcl/win/inc/salgdi.h @@ -282,7 +282,7 @@ public: // set the font virtual USHORT SetFont( ImplFontSelectData*, int nFallbackLevel ); // get the current font's etrics - virtual void GetFontMetric( ImplFontMetricData* ); + virtual void GetFontMetric( ImplFontMetricData*, int nFallbackLevel ); // get kernign pairs of the current font // return only PairCount if (pKernPairs == NULL) virtual ULONG GetKernPairs( ULONG nPairs, ImplKernPairData* pKernPairs ); diff --git a/vcl/win/source/gdi/salgdi3.cxx b/vcl/win/source/gdi/salgdi3.cxx index 1638c4e1bd36..86714f6d07c6 100644 --- a/vcl/win/source/gdi/salgdi3.cxx +++ b/vcl/win/source/gdi/salgdi3.cxx @@ -1751,8 +1751,11 @@ USHORT WinSalGraphics::SetFont( ImplFontSelectData* pFont, int nFallbackLevel ) // ----------------------------------------------------------------------- -void WinSalGraphics::GetFontMetric( ImplFontMetricData* pMetric ) +void WinSalGraphics::GetFontMetric( ImplFontMetricData* pMetric, int nFallbackLevel ) { + // temporarily change the HDC to the font in the fallback level + HFONT hOldFont = SelectFont( mhDC, mhFonts[i] ); + if ( aSalShlData.mbWNT ) { wchar_t aFaceName[LF_FACESIZE+60]; @@ -1766,8 +1769,12 @@ void WinSalGraphics::GetFontMetric( ImplFontMetricData* pMetric ) pMetric->maName = ImplSalGetUniString( aFaceName ); } + // get the font metric TEXTMETRICA aWinMetric; - if( !GetTextMetricsA( mhDC, &aWinMetric ) ) + const bool bOK = GetTextMetricsA( mhDC, &aWinMetric ); + // restore the HDC to the font in the base level + SelectFont( mhDC, hOldFont ); + if( !bOk ) return; // device independent font attributes @@ -1806,7 +1813,7 @@ void WinSalGraphics::GetFontMetric( ImplFontMetricData* pMetric ) // #107888# improved metric compatibility for Asian fonts... // TODO: assess workaround below for CWS >= extleading // TODO: evaluate use of aWinMetric.sTypo* members for CJK - if( mpWinFontData[0] && mpWinFontData[0]->SupportsCJK() ) + if( mpWinFontData[nFallbackLevel] && mpWinFontData[nFallbackLevel]->SupportsCJK() ) { pMetric->mnIntLeading += pMetric->mnExtLeading; @@ -1827,7 +1834,7 @@ void WinSalGraphics::GetFontMetric( ImplFontMetricData* pMetric ) // #109280# HACK korean only: increase descent for wavelines and impr if( !aSalShlData.mbWNT ) - if( mpWinFontData[0]->SupportsKorean() ) + if( mpWinFontData[nFallbackLevel]->SupportsKorean() ) pMetric->mnDescent += pMetric->mnExtLeading; } -- cgit v1.2.3 From afd9dd1a3e2a498245151a934b0906bb413c23d2 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Fri, 18 Jun 2010 23:41:14 +0200 Subject: unoawt2: spelling --- vcl/prj/d.lst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vcl/prj/d.lst b/vcl/prj/d.lst index c1d649ab0c7c..38c025b5a5af 100644 --- a/vcl/prj/d.lst +++ b/vcl/prj/d.lst @@ -1,4 +1,4 @@ -kdir: %COMMON_DEST%\bin%_EXT%\hid +mkdir: %COMMON_DEST%\bin%_EXT%\hid mkdir: %_DEST%\inc%_EXT%\vcl ..\%COMMON_OUTDIR%\bin\*.zip %COMMON_DEST%\bin%_EXT%\*.zip @@ -152,4 +152,4 @@ mkdir: %_DEST%\inc%_EXT%\vcl ..\inc\vcl\ppdparser.hxx %_DEST%\inc%_EXT%\vcl\ppdparser.hxx ..\inc\vcl\helper.hxx %_DEST%\inc%_EXT%\vcl\helper.hxx ..\inc\vcl\strhelper.hxx %_DEST%\inc%_EXT%\vcl\strhelper.hxx -..\inc\vcl\lazydelete.hxx %_DEST%\inc%_EXT%\vcl\lazydelete.hxx \ No newline at end of file +..\inc\vcl\lazydelete.hxx %_DEST%\inc%_EXT%\vcl\lazydelete.hxx -- cgit v1.2.3 From 00ce3f2859b6fc88402b2321e31e714f84a291ca Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Sat, 19 Jun 2010 00:33:50 +0200 Subject: unoawt: argh ... should remove the name of the removed file from makefile.mk, too --- vcl/source/gdi/makefile.mk | 1 - 1 file changed, 1 deletion(-) mode change 100644 => 100755 vcl/source/gdi/makefile.mk diff --git a/vcl/source/gdi/makefile.mk b/vcl/source/gdi/makefile.mk old mode 100644 new mode 100755 index f069828f25f9..430080643b95 --- a/vcl/source/gdi/makefile.mk +++ b/vcl/source/gdi/makefile.mk @@ -84,7 +84,6 @@ SLOFILES= $(EXCEPTIONSFILES) \ $(SLO)$/bitmap4.obj \ $(SLO)$/alpha.obj \ $(SLO)$/bitmapex.obj \ - $(SLO)$/imgcons.obj \ $(SLO)$/bmpacc.obj \ $(SLO)$/bmpacc2.obj \ $(SLO)$/bmpacc3.obj \ -- cgit v1.2.3 From e2a42387547baf3915907981f13e2d1ae6ecc8a8 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Mon, 21 Jun 2010 11:21:54 +0200 Subject: unoawt2: derive the RoadmapControlModel from the GraphicControlModel base class, benefiting from that classes new image handling this way --- toolkit/inc/toolkit/controls/roadmapcontrol.hxx | 10 +++++----- toolkit/source/controls/roadmapcontrol.cxx | 3 ++- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/toolkit/inc/toolkit/controls/roadmapcontrol.hxx b/toolkit/inc/toolkit/controls/roadmapcontrol.hxx index 219231b02ad2..1b86d277fde2 100644 --- a/toolkit/inc/toolkit/controls/roadmapcontrol.hxx +++ b/toolkit/inc/toolkit/controls/roadmapcontrol.hxx @@ -48,7 +48,7 @@ #include -typedef UnoControlModel UnoControlRoadmapModel_Base; +typedef GraphicControlModel UnoControlRoadmapModel_Base; typedef ::cppu::ImplHelper3 < ::com::sun::star::lang::XSingleServiceFactory @@ -126,7 +126,7 @@ namespace toolkit{ ::rtl::OUString SAL_CALL getServiceName() throw(::com::sun::star::uno::RuntimeException); // ::com::sun::star::lang::XServiceInfo - DECLIMPL_SERVICEINFO_DERIVED( UnoControlRoadmapModel, UnoControlModel, szServiceName2_UnoControlRoadmapModel ) + DECLIMPL_SERVICEINFO_DERIVED( UnoControlRoadmapModel, UnoControlRoadmapModel_Base, szServiceName2_UnoControlRoadmapModel ) sal_Int32 SAL_CALL getCount() throw (RuntimeException); virtual Any SAL_CALL getByIndex( sal_Int32 Index ) throw (IndexOutOfBoundsException, WrappedTargetException, RuntimeException ); @@ -138,10 +138,10 @@ namespace toolkit{ virtual void SAL_CALL addContainerListener( const Reference< XContainerListener >& xListener ) throw (RuntimeException); virtual void SAL_CALL removeContainerListener( const Reference< XContainerListener >& xListener ) throw (RuntimeException); - ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException) { return UnoControlModel::queryInterface(rType); } + ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException) { return UnoControlRoadmapModel_Base::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() { UnoControlModel::acquire(); } - void SAL_CALL release() throw() { UnoControlModel::release(); } + void SAL_CALL acquire() throw() { UnoControlRoadmapModel_Base::acquire(); } + void SAL_CALL release() throw() { UnoControlRoadmapModel_Base::release(); } // ::com::sun::star::beans::XPropertySet diff --git a/toolkit/source/controls/roadmapcontrol.cxx b/toolkit/source/controls/roadmapcontrol.cxx index 08e7898ac661..96f51b39dc72 100644 --- a/toolkit/source/controls/roadmapcontrol.cxx +++ b/toolkit/source/controls/roadmapcontrol.cxx @@ -76,6 +76,7 @@ static void lcl_throwIndexOutOfBoundsException( ) ImplRegisterProperty( BASEPROPERTY_HELPTEXT ); ImplRegisterProperty( BASEPROPERTY_HELPURL ); ImplRegisterProperty( BASEPROPERTY_IMAGEURL ); + ImplRegisterProperty( BASEPROPERTY_GRAPHIC ); ImplRegisterProperty( BASEPROPERTY_PRINTABLE ); ImplRegisterProperty( BASEPROPERTY_COMPLETE ); ImplRegisterProperty( BASEPROPERTY_ACTIVATED ); @@ -114,7 +115,7 @@ static void lcl_throwIndexOutOfBoundsException( ) case BASEPROPERTY_DEFAULTCONTROL: aReturn <<= ::rtl::OUString( ::rtl::OUString::createFromAscii( szServiceName_UnoControlRoadmap ) ); break; - default : aReturn = UnoControlModel::ImplGetDefaultValue( nPropId ); break; + default : aReturn = UnoControlRoadmapModel_Base::ImplGetDefaultValue( nPropId ); break; } return aReturn; -- cgit v1.2.3 From d058fdd11b3f1363be85f39a75a68144a46e67ec Mon Sep 17 00:00:00 2001 From: "Herbert Duerr [hdu]" Date: Mon, 21 Jun 2010 13:10:47 +0200 Subject: #i112567# disabled embeddedbitmaps honoured in cairo-case (thanks cmc!) --- vcl/source/glyphs/gcach_ftyp.cxx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/vcl/source/glyphs/gcach_ftyp.cxx b/vcl/source/glyphs/gcach_ftyp.cxx index ebdd59f517af..aeb928c46608 100644 --- a/vcl/source/glyphs/gcach_ftyp.cxx +++ b/vcl/source/glyphs/gcach_ftyp.cxx @@ -895,6 +895,9 @@ void FreetypeServerFont::SetFontOptions( const ImplFontOptions& rFontOptions) } } #endif + + if( mnPrioEmbedded <= 0 ) + mnLoadFlags |= FT_LOAD_NO_BITMAP; } // ----------------------------------------------------------------------- -- cgit v1.2.3 From 077b94b9d096c5bf0379346c5a34b68688c8337c Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Mon, 21 Jun 2010 16:56:59 +0200 Subject: vcl113: #i59236# fix completely dysfunctional ImplUpdateSeparators function --- vcl/source/control/field.cxx | 48 ++++++++++++++++++++++++++++++++++++-------- 1 file changed, 40 insertions(+), 8 deletions(-) diff --git a/vcl/source/control/field.cxx b/vcl/source/control/field.cxx index 090aa2a84163..6c2b06783984 100644 --- a/vcl/source/control/field.cxx +++ b/vcl/source/control/field.cxx @@ -224,6 +224,42 @@ static BOOL ImplNumericGetValue( const XubString& rStr, double& rValue, return TRUE; } +static void ImplUpdateSeparatorString( String& io_rText, + const String& rOldDecSep, const String& rNewDecSep, + const String& rOldThSep, const String& rNewThSep ) +{ + rtl::OUStringBuffer aBuf( io_rText.Len() ); + xub_StrLen nIndexDec = 0, nIndexTh = 0, nIndex = 0; + + const sal_Unicode* pBuffer = io_rText.GetBuffer(); + while( nIndex != STRING_NOTFOUND ) + { + nIndexDec = io_rText.Search( rOldDecSep, nIndex ); + nIndexTh = io_rText.Search( rOldThSep, nIndex ); + if( (nIndexTh != STRING_NOTFOUND && nIndexDec != STRING_NOTFOUND && nIndexTh < nIndexDec ) + || (nIndexTh != STRING_NOTFOUND && nIndexDec == STRING_NOTFOUND) + ) + { + aBuf.append( pBuffer + nIndex, nIndexTh - nIndex ); + aBuf.append( rNewThSep ); + nIndex = nIndexTh + rOldThSep.Len(); + } + else if( nIndexDec != STRING_NOTFOUND ) + { + aBuf.append( pBuffer + nIndex, nIndexDec - nIndex ); + aBuf.append( rNewDecSep ); + nIndex = nIndexDec + rOldDecSep.Len(); + } + else + { + aBuf.append( pBuffer + nIndex ); + nIndex = STRING_NOTFOUND; + } + } + + io_rText = aBuf.makeStringAndClear(); +} + static void ImplUpdateSeparators( const String& rOldDecSep, const String& rNewDecSep, const String& rOldThSep, const String& rNewThSep, Edit* pEdit ) @@ -236,10 +272,7 @@ static void ImplUpdateSeparators( const String& rOldDecSep, const String& rNewDe BOOL bUpdateMode = pEdit->IsUpdateMode(); pEdit->SetUpdateMode( FALSE ); String aText = pEdit->GetText(); - if( bChangeDec ) - aText.SearchAndReplaceAll( rNewDecSep, rOldDecSep ); - if( bChangeTh ) - aText.SearchAndReplaceAll( rNewThSep, rOldThSep ); + ImplUpdateSeparatorString( aText, rOldDecSep, rNewDecSep, rOldThSep, rNewThSep ); pEdit->SetText( aText ); ComboBox* pCombo = dynamic_cast(pEdit); @@ -250,12 +283,11 @@ static void ImplUpdateSeparators( const String& rOldDecSep, const String& rNewDe for ( USHORT i=0; i < nEntryCount; i++ ) { aText = pCombo->GetEntry( i ); - if( bChangeDec ) - aText.SearchAndReplaceAll( rNewDecSep, rOldDecSep ); - if( bChangeTh ) - aText.SearchAndReplaceAll( rNewThSep, rOldThSep ); + void* pEntryData = pCombo->GetEntryData( i ); + ImplUpdateSeparatorString( aText, rOldDecSep, rNewDecSep, rOldThSep, rNewThSep ); pCombo->RemoveEntry( i ); pCombo->InsertEntry( aText, i ); + pCombo->SetEntryData( i, pEntryData ); } } if( bUpdateMode ) -- cgit v1.2.3 From 92e466460bd66156679acd32a4eec2697a013559 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Tue, 22 Jun 2010 17:27:55 +0200 Subject: unoawt2: ImplBlendWithAlpha: properly calculate the destination color value --- vcl/source/gdi/outdev2.cxx | 71 ++++++++++++++++++---------------------------- 1 file changed, 28 insertions(+), 43 deletions(-) diff --git a/vcl/source/gdi/outdev2.cxx b/vcl/source/gdi/outdev2.cxx index 3826a3dbc7b0..bea307a4c38d 100644 --- a/vcl/source/gdi/outdev2.cxx +++ b/vcl/source/gdi/outdev2.cxx @@ -1614,6 +1614,18 @@ void OutputDevice::DrawPixel( const Polygon& rPts, const Color& rColor ) // ------------------------------------------------------------------------ +namespace +{ + BYTE lcl_calcColor( const BYTE nSourceColor, const BYTE nSourceOpaq, const BYTE nDestColor ) + { + int c = ( (int)nDestColor * ( 255 - nSourceOpaq ) ) + + (int)nSourceOpaq * (int)nSourceColor; + return BYTE( c / 255 ); + } +} + +// ------------------------------------------------------------------------ + Bitmap OutputDevice::ImplBlendWithAlpha( Bitmap aBmp, BitmapReadAccess* pP, BitmapReadAccess* pA, @@ -1626,7 +1638,6 @@ Bitmap OutputDevice::ImplBlendWithAlpha( Bitmap aBmp, const long* pMapY ) { BitmapColor aDstCol,aSrcCol; - BYTE nSrcAlpha, nDstAlpha; Bitmap res; int nX, nOutX, nY, nOutY; @@ -1660,36 +1671,23 @@ Bitmap OutputDevice::ImplBlendWithAlpha( Bitmap aBmp, aSrcCol = pP->GetColor( nMapY, nMapX ); aDstCol = pB->GetColor( nY, nX ); - nSrcAlpha = 255 - pA->GetPixel( nMapY, nMapX ).GetBlueOrIndex(); - nDstAlpha = 255 - pAlphaW->GetPixel( nY, nX ).GetBlueOrIndex(); + const BYTE nSrcOpaq = 255 - pA->GetPixel( nMapY, nMapX ).GetBlueOrIndex(); + const BYTE nDstOpaq = 255 - pAlphaW->GetPixel( nY, nX ).GetBlueOrIndex(); - if( nSrcAlpha + nDstAlpha == 0 ) - { - // #i70653# zero alpha -> zero color values - aIndex.SetIndex( (BYTE) ( nVCLRLut[ ( nVCLLut[ 0 ] + nD ) >> 16UL ] + - nVCLGLut[ ( nVCLLut[ 0 ] + nD ) >> 16UL ] + - nVCLBLut[ ( nVCLLut[ 0 ] + nD ) >> 16UL ] ) ); - } - else - { - aDstCol.SetRed( (BYTE)(((int)(aSrcCol.GetRed())*nSrcAlpha + (int)(aDstCol.GetRed())*nDstAlpha) / - (nSrcAlpha+nDstAlpha)) ); - aDstCol.SetGreen( (BYTE)(((int)(aSrcCol.GetGreen())*nSrcAlpha + (int)(aDstCol.GetGreen())*nDstAlpha) / - (nSrcAlpha+nDstAlpha)) ); - aDstCol.SetBlue( (BYTE)(((int)(aSrcCol.GetBlue())*nSrcAlpha + (int)(aDstCol.GetBlue())*nDstAlpha) / - (nSrcAlpha+nDstAlpha)) ); - - aIndex.SetIndex( (BYTE) ( nVCLRLut[ ( nVCLLut[ aDstCol.GetRed() ] + nD ) >> 16UL ] + - nVCLGLut[ ( nVCLLut[ aDstCol.GetGreen() ] + nD ) >> 16UL ] + - nVCLBLut[ ( nVCLLut[ aDstCol.GetBlue() ] + nD ) >> 16UL ] ) ); - } + aDstCol.SetRed( lcl_calcColor( aSrcCol.GetRed(), nSrcOpaq, aDstCol.GetRed() ) ); + aDstCol.SetBlue( lcl_calcColor( aSrcCol.GetBlue(), nSrcOpaq, aDstCol.GetBlue() ) ); + aDstCol.SetGreen( lcl_calcColor( aSrcCol.GetGreen(), nSrcOpaq, aDstCol.GetGreen() ) ); + + aIndex.SetIndex( (BYTE) ( nVCLRLut[ ( nVCLLut[ aDstCol.GetRed() ] + nD ) >> 16UL ] + + nVCLGLut[ ( nVCLLut[ aDstCol.GetGreen() ] + nD ) >> 16UL ] + + nVCLBLut[ ( nVCLLut[ aDstCol.GetBlue() ] + nD ) >> 16UL ] ) ); pW->SetPixel( nY, nX, aIndex ); // Have to perform the compositing 'algebra' in // the inverse alpha space (with 255 meaning // opaque), otherwise, transitivity is not // achieved. - nSrcAlpha = 255-COLOR_CHANNEL_MERGE( 255, (BYTE)nDstAlpha, nSrcAlpha ); + const BYTE nSrcAlpha = 255-COLOR_CHANNEL_MERGE( 255, (BYTE)nDstOpaq, nSrcOpaq ); aIndex.SetIndex( (BYTE) ( nVCLRLut[ ( nVCLLut[ nSrcAlpha ] + nD ) >> 16UL ] + nVCLGLut[ ( nVCLLut[ nSrcAlpha ] + nD ) >> 16UL ] + @@ -1718,25 +1716,12 @@ Bitmap OutputDevice::ImplBlendWithAlpha( Bitmap aBmp, aSrcCol = pP->GetColor( nMapY, nMapX ); aDstCol = pB->GetColor( nY, nX ); - nSrcAlpha = 255 - pA->GetPixel( nMapY, nMapX ).GetBlueOrIndex(); - nDstAlpha = 255 - pAlphaW->GetPixel( nY, nX ).GetBlueOrIndex(); + const BYTE nSrcOpaq = 255 - pA->GetPixel( nMapY, nMapX ).GetBlueOrIndex(); + const BYTE nDstOpaq = 255 - pAlphaW->GetPixel( nY, nX ).GetBlueOrIndex(); - if( nSrcAlpha + nDstAlpha == 0 ) - { - // #i70653# zero alpha -> zero color values - aDstCol.SetRed(0); - aDstCol.SetGreen(0); - aDstCol.SetBlue(0); - } - else - { - aDstCol.SetRed( (BYTE)(((int)(aSrcCol.GetRed())*nSrcAlpha + (int)(aDstCol.GetRed())*nDstAlpha) / - (nSrcAlpha+nDstAlpha)) ); - aDstCol.SetGreen( (BYTE)(((int)(aSrcCol.GetGreen())*nSrcAlpha + (int)(aDstCol.GetGreen())*nDstAlpha) / - (nSrcAlpha+nDstAlpha)) ); - aDstCol.SetBlue( (BYTE)(((int)(aSrcCol.GetBlue())*nSrcAlpha + (int)(aDstCol.GetBlue())*nDstAlpha) / - (nSrcAlpha+nDstAlpha)) ); - } + aDstCol.SetRed( lcl_calcColor( aSrcCol.GetRed(), nSrcOpaq, aDstCol.GetRed() ) ); + aDstCol.SetBlue( lcl_calcColor( aSrcCol.GetBlue(), nSrcOpaq, aDstCol.GetBlue() ) ); + aDstCol.SetGreen( lcl_calcColor( aSrcCol.GetGreen(), nSrcOpaq, aDstCol.GetGreen() ) ); pB->SetPixel( nY, nX, aDstCol ); @@ -1744,7 +1729,7 @@ Bitmap OutputDevice::ImplBlendWithAlpha( Bitmap aBmp, // the inverse alpha space (with 255 meaning // opaque), otherwise, transitivity is not // achieved. - nSrcAlpha = 255-COLOR_CHANNEL_MERGE( 255, (BYTE)nDstAlpha, nSrcAlpha ); + const BYTE nSrcAlpha = 255-COLOR_CHANNEL_MERGE( 255, (BYTE)nDstOpaq, nSrcOpaq ); pAlphaW->SetPixel( nY, nX, Color(nSrcAlpha, nSrcAlpha, nSrcAlpha) ); } -- cgit v1.2.3 From c8f97e15f69814ea2a236df3fc1919d647c771bd Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Wed, 23 Jun 2010 11:45:28 +0200 Subject: vcl113: #i25982# do not highlight disabled items --- vcl/source/window/toolbox.cxx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/vcl/source/window/toolbox.cxx b/vcl/source/window/toolbox.cxx index 9ad0b8734437..97dfcb7eccd9 100644 --- a/vcl/source/window/toolbox.cxx +++ b/vcl/source/window/toolbox.cxx @@ -3454,6 +3454,8 @@ void ToolBox::ImplDrawItem( USHORT nPos, BOOL bHighlight, BOOL bPaint, BOOL bLay MetricVector* pVector = bLayout ? &mpData->m_pLayoutData->m_aUnicodeBoundRects : NULL; String* pDisplayText = bLayout ? &mpData->m_pLayoutData->m_aDisplayText : NULL; + bHighlight = bHighlight && pItem->mbEnabled; + // Falls Rechteck ausserhalb des sichbaren Bereichs liegt if ( pItem->maRect.IsEmpty() ) return; -- cgit v1.2.3 From 34554c0d154809e172b9a2de44f226fe44b16978 Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Wed, 23 Jun 2010 15:19:12 +0200 Subject: vcl113: #i3909# issue a warning if no printer config is writable --- padmin/source/padialog.cxx | 14 ++++++++++++++ padmin/source/padialog.src | 5 +++++ 2 files changed, 19 insertions(+) diff --git a/padmin/source/padialog.cxx b/padmin/source/padialog.cxx index 583e14c06caa..d91ebea0c73d 100644 --- a/padmin/source/padialog.cxx +++ b/padmin/source/padialog.cxx @@ -152,6 +152,20 @@ void PADialog::Init() m_aFontsPB.Enable( FALSE ); m_aFontsPB.Show( FALSE ); } + + // at this point no actual changes will be written + // but the write will have checked whether any writeable config exists + if( ! m_rPIManager.writePrinterConfig() ) + { + m_aAddPB.Enable( FALSE ); + m_aRemPB.Enable( FALSE ); + m_aConfPB.Enable( FALSE ); + m_aRenamePB.Enable( FALSE ); + m_aStdPB.Enable( FALSE ); + m_aCUPSCB.Enable( FALSE ); + ErrorBox aBox( GetParent(), WB_OK | WB_DEF_OK, String( PaResId( RID_ERR_NOWRITE ) ) ); + aBox.Execute(); + } } PADialog::~PADialog() diff --git a/padmin/source/padialog.src b/padmin/source/padialog.src index 8834bba3226c..ab09d9155d1b 100644 --- a/padmin/source/padialog.src +++ b/padmin/source/padialog.src @@ -340,6 +340,11 @@ String RID_PA_TXT_TESTPAGE_PRINTED Text [ en-US ] = "The test page was printed succesfully. Please check the result."; }; +String RID_ERR_NOWRITE +{ + Text [en-US] = "No printers can be installed, because the file system is read-only.\nPlease contact your system administrator."; +}; + String RID_QRY_PRTNAME { Text [ en-US ] = "~New printer name"; -- cgit v1.2.3 From 5965bb52435916c06d1b5a63df4959203b7cf018 Mon Sep 17 00:00:00 2001 From: Malte Timmermann Date: Fri, 25 Jun 2010 13:15:03 +0200 Subject: codecleanup02: #i112685# Removed ifdefs and code for WIN,W30,W31 --- canvas/source/tools/elapsedtime.cxx | 4 +- rsc/source/parser/erscerr.cxx | 2 - rsc/source/parser/rscyacc.cxx | 4 - rsc/source/rsc/rsc.cxx | 4 +- rsc/source/tools/rsctools.cxx | 6 +- sot/source/sdstor/stgstrms.cxx | 8 +- svl/source/numbers/nbdll.cxx | 79 ------------------- svl/source/svdde/ddedata.cxx | 10 +-- svl/source/svdde/ddedll.cxx | 64 ---------------- svl/source/svdde/ddestrg.cxx | 4 - svtools/inc/fltdefs.hxx | 18 +---- svtools/inc/svtools/svxbox.hxx | 4 - svtools/source/contnr/ctrdll.cxx | 79 ------------------- svtools/source/contnr/svicnvw.cxx | 3 - svtools/source/contnr/svimpicn.cxx | 15 ++-- svtools/source/contnr/treelist.cxx | 10 --- svtools/source/control/ctrldll.cxx | 78 ------------------- .../filter.vcl/filter/SvFilterOptionsDialog.cxx | 2 +- svtools/source/filter.vcl/filter/filter.cxx | 2 +- svtools/source/filter.vcl/filter/fldll.cxx | 76 ------------------- svtools/source/filter.vcl/filter/sgfbram.cxx | 4 - svtools/source/filter.vcl/filter/sgvmain.cxx | 13 ---- svtools/source/filter.vcl/filter/sgvspln.cxx | 5 -- svtools/source/filter.vcl/filter/sgvtext.cxx | 10 +-- svtools/source/filter.vcl/jpeg/jpeg.h | 4 - svtools/source/misc/imap.cxx | 10 --- svtools/source/misc/imap2.cxx | 6 -- toolkit/source/awt/vclxwindow1.cxx | 2 +- tools/inc/poly.h | 7 -- tools/inc/tools/fsys.hxx | 13 +--- tools/inc/tools/pstm.hxx | 3 - tools/inc/tools/solar.h | 2 +- tools/source/fsys/fstat.cxx | 5 -- tools/win/inc/dll.hxx | 25 ------ tools/win/inc/toolsdll.hxx | 88 ---------------------- tools/win/source/dll/toolsdll.cxx | 1 - vcl/source/gdi/impimage.cxx | 4 +- 37 files changed, 24 insertions(+), 650 deletions(-) delete mode 100644 svl/source/numbers/nbdll.cxx delete mode 100644 svl/source/svdde/ddedll.cxx delete mode 100644 svtools/source/contnr/ctrdll.cxx delete mode 100644 svtools/source/control/ctrldll.cxx delete mode 100644 svtools/source/filter.vcl/filter/fldll.cxx delete mode 100644 tools/win/inc/toolsdll.hxx diff --git a/canvas/source/tools/elapsedtime.cxx b/canvas/source/tools/elapsedtime.cxx index 6ca58a2bf1ee..6c3d3284cb82 100644 --- a/canvas/source/tools/elapsedtime.cxx +++ b/canvas/source/tools/elapsedtime.cxx @@ -32,7 +32,7 @@ #include "osl/diagnose.h" #include "canvas/elapsedtime.hxx" -#if defined(WIN) || defined(WNT) +#if defined(WNT) #if defined _MSC_VER #pragma warning(push,1) @@ -58,7 +58,7 @@ namespace canvas { namespace tools { -#if defined(WIN) || defined(WNT) +#if defined(WNT) // TODO(Q2): is 0 okay for the failure case here? double ElapsedTime::getSystemTime() { diff --git a/rsc/source/parser/erscerr.cxx b/rsc/source/parser/erscerr.cxx index 158aea21b6e3..ed63510737aa 100644 --- a/rsc/source/parser/erscerr.cxx +++ b/rsc/source/parser/erscerr.cxx @@ -88,10 +88,8 @@ void RscError::StdOut( const char * pStr, const RscVerbosity _verbosityLevel ) *************************************************************************/ void RscError::StdErr( const char * pStr ) { -#ifndef WIN if( pStr ) fprintf( stderr, "%s", pStr ); -#endif } /************************************************************************* diff --git a/rsc/source/parser/rscyacc.cxx b/rsc/source/parser/rscyacc.cxx index 89891581d9ba..0d5cc8faef0e 100644 --- a/rsc/source/parser/rscyacc.cxx +++ b/rsc/source/parser/rscyacc.cxx @@ -253,12 +253,8 @@ RSCINST GetFirstTupelEle( const RSCINST & rTop ) #ifdef UNX #define YYMAXDEPTH 2000 #else -#ifdef W30 -#define YYMAXDEPTH 300 -#else #define YYMAXDEPTH 800 #endif -#endif #if defined _MSC_VER #pragma warning(push, 1) diff --git a/rsc/source/rsc/rsc.cxx b/rsc/source/rsc/rsc.cxx index 40d589aea359..15d26318875b 100644 --- a/rsc/source/rsc/rsc.cxx +++ b/rsc/source/rsc/rsc.cxx @@ -474,10 +474,8 @@ ERRTYPE RscCompiler::Start() if( PRINTSYNTAX_FLAG & pCL->nCommands ) { -#ifndef W30 pTC->WriteSyntax( stdout ); -printf( "khg\n" ); -#endif + printf( "khg\n" ); return ERR_OK; } diff --git a/rsc/source/tools/rsctools.cxx b/rsc/source/tools/rsctools.cxx index 9904cd20d4e7..a8f17b7f8137 100644 --- a/rsc/source/tools/rsctools.cxx +++ b/rsc/source/tools/rsctools.cxx @@ -32,7 +32,7 @@ // C and C++ Includes. #include #include -#if defined ( DOS ) || defined ( WIN ) || defined (WNT ) +#if defined ( DOS ) || defined (WNT ) #include #endif #if defined ( OS2 ) && !defined ( GCC ) @@ -51,10 +51,6 @@ #include #include -#if defined (WIN) -#define ONLY_NEW -#endif - using namespace rtl; /****************** C o d e **********************************************/ diff --git a/sot/source/sdstor/stgstrms.cxx b/sot/source/sdstor/stgstrms.cxx index 07711133bf4b..dd6ba6202bbe 100644 --- a/sot/source/sdstor/stgstrms.cxx +++ b/sot/source/sdstor/stgstrms.cxx @@ -41,13 +41,7 @@ #include "stgdir.hxx" #include "stgio.hxx" -#if defined(W31) - #include - #define memcpy hmemcpy - #define __HUGE _huge -#else - #define __HUGE -#endif +#define __HUGE ///////////////////////////// class StgFAT /////////////////////////////// diff --git a/svl/source/numbers/nbdll.cxx b/svl/source/numbers/nbdll.cxx deleted file mode 100644 index b93eda3e7f37..000000000000 --- a/svl/source/numbers/nbdll.cxx +++ /dev/null @@ -1,79 +0,0 @@ -/************************************************************************* - * - * 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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_svl.hxx" - -#ifdef WIN -#include - -#ifndef _SYSDEP_HXX -#include -#endif - -// Statische DLL-Verwaltungs-Variablen -static HINSTANCE hDLLInst = 0; // HANDLE der DLL - - -/*************************************************************************** -|* -|* LibMain() -|* -|* Beschreibung Initialisierungsfunktion der DLL -|* Ersterstellung TH 05.05.93 -|* Letzte Aenderung TH 05.05.93 -|* -***************************************************************************/ - -extern "C" int CALLBACK LibMain( HINSTANCE hDLL, WORD, WORD nHeap, LPSTR ) -{ -#ifndef WNT - if ( nHeap ) - UnlockData( 0 ); -#endif - - hDLLInst = hDLL; - - return TRUE; -} - -/*************************************************************************** -|* -|* WEP() -|* -|* Beschreibung DLL-Deinitialisierung -|* Ersterstellung TH 05.05.93 -|* Letzte Aenderung TH 05.05.93 -|* -***************************************************************************/ - -extern "C" int CALLBACK WEP( int ) -{ - return 1; -} - -#endif diff --git a/svl/source/svdde/ddedata.cxx b/svl/source/svdde/ddedata.cxx index ba67d451be34..369306c22874 100644 --- a/svl/source/svdde/ddedata.cxx +++ b/svl/source/svdde/ddedata.cxx @@ -41,10 +41,6 @@ #include -#if defined( WIN ) && defined( MSC ) -#pragma code_seg( "SVDDE_MISC_CODE" ) -#endif - // --- DdeData::DdeData() ------------------------------------------ DdeData::DdeData() @@ -164,10 +160,10 @@ ULONG DdeData::GetExternalFormat( ULONG nFmt ) default: { -#if defined(WNT) || defined(WIN) || defined( PM2 ) +#if defined(WNT) || defined( PM2 ) String aName( SotExchange::GetFormatName( nFmt ) ); -#if defined(WNT) || defined(WIN) +#if defined(WNT) if( aName.Len() ) nFmt = RegisterClipboardFormat( reinterpret_cast(aName.GetBuffer()) ); @@ -203,7 +199,7 @@ ULONG DdeData::GetInternalFormat( ULONG nFmt ) break; default: -#if defined(WIN) || defined(WNT) +#if defined(WNT) if( nFmt >= CF_MAX ) { TCHAR szName[ 256 ]; diff --git a/svl/source/svdde/ddedll.cxx b/svl/source/svdde/ddedll.cxx deleted file mode 100644 index a71662dd5e63..000000000000 --- a/svl/source/svdde/ddedll.cxx +++ /dev/null @@ -1,64 +0,0 @@ -/************************************************************************* - * - * 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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_svl.hxx" -#ifdef WIN - - -#include // included svwin.h - -// Statische DLL-Verwaltungs-Variablen -static HINSTANCE hDLLInst = 0; // HANDLE der DLL - -/*************************************************************************** -|* LibMain() -|* Beschreibung Initialisierungsfunktion der DLL -***************************************************************************/ -extern "C" int CALLBACK LibMain( HINSTANCE hDLL, WORD, WORD nHeap, LPSTR ) -{ -#ifndef WNT - if ( nHeap ) - UnlockData( 0 ); -#endif - - hDLLInst = hDLL; - - return TRUE; -} - -/*************************************************************************** -|* WEP() -|* Beschreibung DLL-Deinitialisierung -***************************************************************************/ -extern "C" int CALLBACK WEP( int ) -{ - return 1; -} - -#endif - diff --git a/svl/source/svdde/ddestrg.cxx b/svl/source/svdde/ddestrg.cxx index 4f0e2464a276..007c9f56c544 100644 --- a/svl/source/svdde/ddestrg.cxx +++ b/svl/source/svdde/ddestrg.cxx @@ -33,10 +33,6 @@ #include "ddeimp.hxx" #include -#if defined( WIN ) && defined( MSC ) -#pragma code_seg( "SVDDE_MISC_CODE" ) -#endif - // --- DdeString::DdeString() -------------------------------------- DdeString::DdeString( DWORD hDdeInst, const sal_Unicode* p ) : diff --git a/svtools/inc/fltdefs.hxx b/svtools/inc/fltdefs.hxx index 8ef3f2ab3740..86462c2faa33 100644 --- a/svtools/inc/fltdefs.hxx +++ b/svtools/inc/fltdefs.hxx @@ -34,7 +34,7 @@ #define _FLTDEFS_HXX -#if defined ( WIN ) || defined ( WNT ) +#if defined ( WNT ) #define RGBQUAD RGBQUADWIN @@ -53,21 +53,6 @@ typedef struct RGBQUAD } RGBQUAD; -#ifdef WIN -typedef BYTE huge* PDIBBYTE; -#define MEMCPY hmemcpy -#define GLOBALALLOC(nSize) ((PDIBBYTE)GlobalLock(GlobalAlloc(GHND,(nSize)))) -#define GLOBALHANDLE(pPointer) ((HGLOBAL)GlobalHandle((*((size_t*)&(pPointer)+1)))) -#define GLOBALFREE(pPointer) (GlobalUnlock(GLOBALHANDLE((pPointer)))) -#define MEMSET( pDst, cByte, nCount ) \ -{ \ - PDIBBYTE pTmp = (PDIBBYTE) pDst; \ - for ( ULONG i = 0; i < nCount; i++ )\ - *pTmp++ = cByte; \ -} - -#else - typedef BYTE* PDIBBYTE; #define MEMCPY memcpy #define MEMSET memset @@ -75,7 +60,6 @@ typedef BYTE* PDIBBYTE; #define GLOBALFREE(pPointer) (GlobalFree((HGLOBAL)pPointer)) #define GLOBALHANDLE(pPointer) ((HGLOBAL)(pPointer)) -#endif #else typedef BYTE* PDIBBYTE; diff --git a/svtools/inc/svtools/svxbox.hxx b/svtools/inc/svtools/svxbox.hxx index 25deba4d091c..a4a920e692be 100644 --- a/svtools/inc/svtools/svxbox.hxx +++ b/svtools/inc/svtools/svxbox.hxx @@ -129,11 +129,7 @@ enum SvxComboBoxStyle SVX_CBS_LOWER = 0x02, SVX_CBS_ALL = 0x04, SVX_CBS_FILENAME = 0x08, -#ifdef WIN - SVX_CBS_SW_FILENAME = SVX_CBS_FILENAME | SVX_CBS_LOWER -#else SVX_CBS_SW_FILENAME = SVX_CBS_FILENAME -#endif }; // class SvxComboBox ----------------------------------------------------- diff --git a/svtools/source/contnr/ctrdll.cxx b/svtools/source/contnr/ctrdll.cxx deleted file mode 100644 index 463c6ccc8b35..000000000000 --- a/svtools/source/contnr/ctrdll.cxx +++ /dev/null @@ -1,79 +0,0 @@ -/************************************************************************* - * - * 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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_svtools.hxx" - -#ifdef WIN -#include - -#ifndef _SYSDEP_HXX -#include -#endif - -// Statische DLL-Verwaltungs-Variablen -static HINSTANCE hDLLInst = 0; // HANDLE der DLL - - -/*************************************************************************** -|* -|* LibMain() -|* -|* Beschreibung Initialisierungsfunktion der DLL -|* Ersterstellung TH 05.05.93 -|* Letzte Aenderung TH 05.05.93 -|* -***************************************************************************/ - -extern "C" int CALLBACK LibMain( HINSTANCE hDLL, WORD, WORD nHeap, LPSTR ) -{ -#ifndef WNT - if ( nHeap ) - UnlockData( 0 ); -#endif - - hDLLInst = hDLL; - - return TRUE; -} - -/*************************************************************************** -|* -|* WEP() -|* -|* Beschreibung DLL-Deinitialisierung -|* Ersterstellung TH 05.05.93 -|* Letzte Aenderung TH 05.05.93 -|* -***************************************************************************/ - -extern "C" int CALLBACK WEP( int ) -{ - return 1; -} - -#endif diff --git a/svtools/source/contnr/svicnvw.cxx b/svtools/source/contnr/svicnvw.cxx index 20bcfe0fe33a..b16cd67d12a5 100644 --- a/svtools/source/contnr/svicnvw.cxx +++ b/svtools/source/contnr/svicnvw.cxx @@ -550,9 +550,6 @@ void SvIconView::EditItemText( SvLBoxEntry* pEntry, SvLBoxItem* pItem, aRect.Bottom() += 2; // sieht huebscher aus -#ifdef WIN - aRect.Bottom() += 4; -#endif #ifdef OS2 #if OS2_SINGLE_LINE_EDIT diff --git a/svtools/source/contnr/svimpicn.cxx b/svtools/source/contnr/svimpicn.cxx index 2d4c9cf2df0e..d1e471953663 100644 --- a/svtools/source/contnr/svimpicn.cxx +++ b/svtools/source/contnr/svimpicn.cxx @@ -1702,11 +1702,6 @@ void SvImpIconView::PositionScrollBars( long nRealWidth, long nRealHeight ) Point aPos( 0, nRealHeight ); aPos.Y() -= nHorSBarHeight; -#ifdef WIN - // vom linken und unteren Rand ein Pixel abschneiden - aPos.Y()++; - aPos.X()--; -#endif #ifdef OS2 aPos.Y()++; #endif @@ -1717,7 +1712,7 @@ void SvImpIconView::PositionScrollBars( long nRealWidth, long nRealHeight ) aPos.X() = nRealWidth; aPos.Y() = 0; aPos.X() -= nVerSBarWidth; -#if defined(WIN) || defined(WNT) +#if defined(WNT) aPos.X()++; aPos.Y()--; #endif @@ -1809,7 +1804,7 @@ void SvImpIconView::AdjustScrollBars() // size ver scrollbar long nThumb = aVerSBar.GetThumbPos(); Size aSize( nVerSBarWidth, nRealHeight ); -#if defined(WIN) || defined(WNT) +#if defined(WNT) aSize.Height() += 2; #endif #ifdef OS2 @@ -1834,7 +1829,7 @@ void SvImpIconView::AdjustScrollBars() nThumb = aHorSBar.GetThumbPos(); aSize.Width() = nRealWidth; aSize.Height() = nHorSBarHeight; -#if defined(WIN) || defined(WNT) +#if defined(WNT) aSize.Width()++; #endif #ifdef OS2 @@ -1842,7 +1837,7 @@ void SvImpIconView::AdjustScrollBars() if( nResult & 0x0001 ) // vertikale Scrollbar ? aSize.Width()--; #endif -#if defined(WIN) || defined(WNT) +#if defined(WNT) if( nResult & 0x0001 ) // vertikale Scrollbar ? { aSize.Width()++; @@ -1868,7 +1863,7 @@ void SvImpIconView::AdjustScrollBars() nRealWidth++; #endif aOutputSize.Width() = nRealWidth; -#if defined(WIN) || defined(WNT) +#if defined(WNT) if( nResult & 0x0002 ) // hor scrollbar ? nRealHeight++; // weil unterer Rand geclippt wird #endif diff --git a/svtools/source/contnr/treelist.cxx b/svtools/source/contnr/treelist.cxx index 3395dffc28f5..1b96f1ac89e4 100644 --- a/svtools/source/contnr/treelist.cxx +++ b/svtools/source/contnr/treelist.cxx @@ -139,16 +139,6 @@ void SvTreeEntryList::DestroyAll() } - - -#if defined (WIN) && defined (MSC) -// siehe BugId 42896: Die Funktionen Prev, PrevVisible, Next, NextVisible -// (andere?) funktionieren nicht mit Optimierung. -#pragma optimize ("", off) -#endif - - - /************************************************************************* |* |* SvTreeList:: diff --git a/svtools/source/control/ctrldll.cxx b/svtools/source/control/ctrldll.cxx deleted file mode 100644 index 2f3ff037be31..000000000000 --- a/svtools/source/control/ctrldll.cxx +++ /dev/null @@ -1,78 +0,0 @@ -/************************************************************************* - * - * 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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_svtools.hxx" - -#ifdef WIN -#include - -#ifndef _SYSDEP_HXX -#include -#endif - -// Statische DLL-Verwaltungs-Variablen -static HINSTANCE hDLLInst = 0; // HANDLE der DLL - -/*************************************************************************** -|* -|* LibMain() -|* -|* Beschreibung Initialisierungsfunktion der DLL -|* Ersterstellung TH 05.05.93 -|* Letzte Aenderung TH 05.05.93 -|* -***************************************************************************/ - -extern "C" int CALLBACK LibMain( HINSTANCE hDLL, WORD, WORD nHeap, LPSTR ) -{ -#ifndef WNT - if ( nHeap ) - UnlockData( 0 ); -#endif - - hDLLInst = hDLL; - - return TRUE; -} - -/*************************************************************************** -|* -|* WEP() -|* -|* Beschreibung DLL-Deinitialisierung -|* Ersterstellung TH 05.05.93 -|* Letzte Aenderung TH 05.05.93 -|* -***************************************************************************/ - -extern "C" int CALLBACK WEP( int ) -{ - return 1; -} - -#endif diff --git a/svtools/source/filter.vcl/filter/SvFilterOptionsDialog.cxx b/svtools/source/filter.vcl/filter/SvFilterOptionsDialog.cxx index 038930ef80ee..8ca6ba2b124e 100644 --- a/svtools/source/filter.vcl/filter/SvFilterOptionsDialog.cxx +++ b/svtools/source/filter.vcl/filter/SvFilterOptionsDialog.cxx @@ -49,7 +49,7 @@ #include #include "vcl/svapp.hxx" -#if defined WIN || (defined OS2 && !defined ICC) +#if (defined OS2 && !defined ICC) #define EXPDLG_FUNCTION_NAME "_DoExportDialog" #else #define EXPDLG_FUNCTION_NAME "DoExportDialog" diff --git a/svtools/source/filter.vcl/filter/filter.cxx b/svtools/source/filter.vcl/filter/filter.cxx index c8a79d3a35cd..db1f4c11cf94 100644 --- a/svtools/source/filter.vcl/filter/filter.cxx +++ b/svtools/source/filter.vcl/filter/filter.cxx @@ -79,7 +79,7 @@ #define PMGCHUNG_msOG 0x6d734f47 // Microsoft Office Animated GIF -#if defined WIN || (defined OS2 && !defined ICC) +#if (defined OS2 && !defined ICC) #define IMPORT_FUNCTION_NAME "_GraphicImport" #define EXPORT_FUNCTION_NAME "_GraphicExport" diff --git a/svtools/source/filter.vcl/filter/fldll.cxx b/svtools/source/filter.vcl/filter/fldll.cxx deleted file mode 100644 index b44e08835f34..000000000000 --- a/svtools/source/filter.vcl/filter/fldll.cxx +++ /dev/null @@ -1,76 +0,0 @@ -/************************************************************************* - * - * 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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_svtools.hxx" - -#ifdef WIN -#include - -// Statische DLL-Verwaltungs-Variablen -static HINSTANCE hDLLInst = 0; // HANDLE der DLL - - -/*************************************************************************** -|* -|* LibMain() -|* -|* Beschreibung Initialisierungsfunktion der DLL -|* Ersterstellung TH 05.05.93 -|* Letzte Aenderung TH 05.05.93 -|* -***************************************************************************/ - -extern "C" int CALLBACK LibMain( HINSTANCE hDLL, WORD, WORD nHeap, LPSTR ) -{ -#ifndef WNT - if ( nHeap ) - UnlockData( 0 ); -#endif - - hDLLInst = hDLL; - - return TRUE; -} - -/*************************************************************************** -|* -|* WEP() -|* -|* Beschreibung DLL-Deinitialisierung -|* Ersterstellung TH 05.05.93 -|* Letzte Aenderung TH 05.05.93 -|* -***************************************************************************/ - -extern "C" int CALLBACK WEP( int ) -{ - return 1; -} - -#endif - diff --git a/svtools/source/filter.vcl/filter/sgfbram.cxx b/svtools/source/filter.vcl/filter/sgfbram.cxx index 43cf0fbbacd3..3d1a71f5a2db 100644 --- a/svtools/source/filter.vcl/filter/sgfbram.cxx +++ b/svtools/source/filter.vcl/filter/sgfbram.cxx @@ -37,10 +37,6 @@ #include "sgffilt.hxx" #include "sgfbram.hxx" -#if defined( WIN ) && defined( MSC ) -#pragma code_seg( "SVTOOLS_FILTER4", "SVTOOLS_CODE" ) -#endif - /************************************************************************* |* |* operator>>( SvStream&, SgfHeader& ) diff --git a/svtools/source/filter.vcl/filter/sgvmain.cxx b/svtools/source/filter.vcl/filter/sgvmain.cxx index e175380244b3..293c6dab7964 100644 --- a/svtools/source/filter.vcl/filter/sgvmain.cxx +++ b/svtools/source/filter.vcl/filter/sgvmain.cxx @@ -110,20 +110,11 @@ // //////////////////////////////////////////////////////////////////////////////////////////////////// -#if defined( WIN ) && defined( MSC ) -#pragma code_seg( "svtools", "AUTO_CODE" ) -#endif - //////////////////////////////////////////////////////////////////////////////////////////////////// // Fuer Fontuebersetzung /////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////// SgfFontLst* pSgfFonts = 0; -#if defined( WIN ) && defined( MSC ) -#pragma code_seg( "SVTOOLS_FILTER3", "SVTOOLS_CODE" ) -static void AntiMscBug() {} -#endif - //////////////////////////////////////////////////////////////////////////////////////////////////// // Fuer Kreisunterarten, Text und gedrehte Rechtecke /////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////// @@ -1137,7 +1128,3 @@ for n:=0 to 63 do end; */ -#if defined( WIN ) && defined( MSC ) -#pragma code_seg( "svtools", "AUTO_CODE" ) -#endif - diff --git a/svtools/source/filter.vcl/filter/sgvspln.cxx b/svtools/source/filter.vcl/filter/sgvspln.cxx index 7a23e85f4dbe..d695e171a194 100644 --- a/svtools/source/filter.vcl/filter/sgvspln.cxx +++ b/svtools/source/filter.vcl/filter/sgvspln.cxx @@ -33,11 +33,6 @@ #include -#if defined( WIN ) && defined( MSC ) -#pragma code_seg( "SVTOOLS_FILTER2", "SVTOOLS_CODE" ) -#pragma optimize( "", off ) -#endif - #if defined( PM2 ) && defined( __BORLANDC__ ) #pragma option -Od #endif diff --git a/svtools/source/filter.vcl/filter/sgvtext.cxx b/svtools/source/filter.vcl/filter/sgvtext.cxx index 4a0be80b55be..9a82cd486599 100644 --- a/svtools/source/filter.vcl/filter/sgvtext.cxx +++ b/svtools/source/filter.vcl/filter/sgvtext.cxx @@ -38,10 +38,6 @@ extern SgfFontLst* pSgfFonts; -#if defined( WIN ) && defined( MSC ) -#pragma code_seg( "SVTOOLS_FILTER1", "SVTOOLS_CODE" ) -#endif - #ifndef abs #define abs(x) ((x)<0 ? -(x) : (x)) #endif @@ -621,7 +617,7 @@ USHORT SetTextContext(OutputDevice& rOut, ObjTextType& Atr, BOOL Kapt, USHORT Dr switch (Atr.GetFont()) { case 92500: case 92501: case 92504: case 92505: { -#if defined(WIN) || defined(WNT) || defined(PM2) +#if defined(WNT) || defined(PM2) FNam=String::CreateFromAscii( "Times New Roman" ); // CG Times ist unter Windows und OS/2 Times New Roman #else FNam=String::CreateFromAscii( "Times" ); // ansonsten ist das einfach Times @@ -630,7 +626,7 @@ USHORT SetTextContext(OutputDevice& rOut, ObjTextType& Atr, BOOL Kapt, USHORT Dr aFont.SetFamily(FAMILY_ROMAN); } break; case 94021: case 94022: case 94023: case 94024: { -#if defined(WIN) || defined(WNT) +#if defined(WNT) FNam=String::CreateFromAscii( "Arial", 5 ); // Univers ist unter Windows Arial #else FNam=String::CreateFromAscii( "Helvetica" ); // und ansonsten Helvetica @@ -639,7 +635,7 @@ USHORT SetTextContext(OutputDevice& rOut, ObjTextType& Atr, BOOL Kapt, USHORT Dr StdBrei=47; } break; case 93950: case 93951: case 93952: case 93953: { -#if defined(WIN) || defined(WNT) +#if defined(WNT) FNam=String::CreateFromAscii( "Courier New" ); // Der Vector-Courierfont unter Windows heisst Courier New #else FNam=String::CreateFromAscii( "Courier" ); // ansonsten ist und bleibt Courier immer Courier diff --git a/svtools/source/filter.vcl/jpeg/jpeg.h b/svtools/source/filter.vcl/jpeg/jpeg.h index deb06600474c..82a2f80a838c 100644 --- a/svtools/source/filter.vcl/jpeg/jpeg.h +++ b/svtools/source/filter.vcl/jpeg/jpeg.h @@ -51,11 +51,7 @@ struct JPEGCreateBitmapParam typedef struct my_error_mgr* my_error_ptr; typedef unsigned char BYTE; -#ifdef WIN -typedef unsigned char _huge* HPBYTE; -#else typedef unsigned char* HPBYTE; -#endif void* JPEGMalloc( size_t size ); void JPEGFree( void *ptr ); diff --git a/svtools/source/misc/imap.cxx b/svtools/source/misc/imap.cxx index 25f23e2ef00b..4378e0acd234 100644 --- a/svtools/source/misc/imap.cxx +++ b/svtools/source/misc/imap.cxx @@ -57,10 +57,6 @@ UINT16 IMapObject::nActualTextEncoding = (UINT16) RTL_TEXTENCODING_DONTKNOW; /******************************************************************************/ -#ifdef WIN -#pragma optimize ( "", off ) -#endif - IMapObject::IMapObject() : bActive( false ) , nReadVersion( 0 ) @@ -1224,9 +1220,3 @@ void ImageMap::Read( SvStream& rIStm, const String& rBaseURL ) rIStm.SetNumberFormatInt( nOldFormat ); } - -#ifdef WIN -#pragma optimize ( "", on ) -#endif - - diff --git a/svtools/source/misc/imap2.cxx b/svtools/source/misc/imap2.cxx index 9834fe0fcb76..587a31d4f098 100644 --- a/svtools/source/misc/imap2.cxx +++ b/svtools/source/misc/imap2.cxx @@ -28,9 +28,6 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_svtools.hxx" -#ifdef WIN -#include -#endif #include // #include #include @@ -48,9 +45,6 @@ #include #include -#ifdef WIN -#include -#endif #include #include diff --git a/toolkit/source/awt/vclxwindow1.cxx b/toolkit/source/awt/vclxwindow1.cxx index daea557d241a..3572607772dc 100644 --- a/toolkit/source/awt/vclxwindow1.cxx +++ b/toolkit/source/awt/vclxwindow1.cxx @@ -93,7 +93,7 @@ void VCLXWindow::SetSystemParent_Impl( const com::sun::star::uno::Any& rHandle ) // create system parent data SystemParentData aSysParentData; aSysParentData.nSize = sizeof ( SystemParentData ); -#if defined( WIN ) || defined( WNT ) || defined ( OS2 ) +#if defined( WNT ) || defined ( OS2 ) aSysParentData.hWnd = (HWND) nHandle; #elif defined( QUARTZ ) aSysParentData.pView = reinterpret_cast(nHandle); diff --git a/tools/inc/poly.h b/tools/inc/poly.h index e6678e071f28..9228715b8da7 100644 --- a/tools/inc/poly.h +++ b/tools/inc/poly.h @@ -39,15 +39,8 @@ class ImplPolygonData { public: -#ifdef WIN - Point huge* mpPointAry; - BYTE* mpFlagAry; - GLOBALHANDLE mhPoints; -#else Point* mpPointAry; BYTE* mpFlagAry; -#endif - USHORT mnPoints; ULONG mnRefCount; }; diff --git a/tools/inc/tools/fsys.hxx b/tools/inc/tools/fsys.hxx index 880768c89d8c..5ef51803734b 100644 --- a/tools/inc/tools/fsys.hxx +++ b/tools/inc/tools/fsys.hxx @@ -159,21 +159,10 @@ enum FSysExact // - Char-Set - // ------------ -#if defined(WIN) || defined(W30) - -// MS-Windows has different char-sets for file-system and user-interface -String Gui2FSys( const String& rStr ); -String FSys2Gui( const String& rStr ); -#define GUI2FSYS(s) Gui2FSys( s ) -#define FSYS2GUI(s) FSys2Gui( s ) - -#else - -// all other OS have the same char-set for both +// Was different for WIN, no longer needed... #define GUI2FSYS(s) s #define FSYS2GUI(s) s -#endif // ------------ // - FileStat - diff --git a/tools/inc/tools/pstm.hxx b/tools/inc/tools/pstm.hxx index 0d14385e5f08..8c0e0ea924aa 100644 --- a/tools/inc/tools/pstm.hxx +++ b/tools/inc/tools/pstm.hxx @@ -62,9 +62,6 @@ public: /************************** S v R t t i B a s e **************************/ /* #if defined (DOS) && defined (STC) -#ifdef WIN -#error Fuer Win muss der Kram virtual sein (MM/MH) -#endif class SvRttiBase : public SvRefBase #else class SvRttiBase : virtual public SvRefBase diff --git a/tools/inc/tools/solar.h b/tools/inc/tools/solar.h index 096d34d05b9e..0633ae6813bf 100644 --- a/tools/inc/tools/solar.h +++ b/tools/inc/tools/solar.h @@ -409,7 +409,7 @@ template inline T Abs(T a) { return (a>=0?a:-a); } #define LIBRARY_CONCAT4( s1, s2, s3, s4 ) \ s1 s2 s3 s4 -#if defined WIN || defined WNT || defined OS2 +#if defined WNT || defined OS2 #define SVLIBRARY( Base ) \ LIBRARY_CONCAT3( Base, __DLLEXTENSION, ".DLL" ) #define SVLIBRARYLANG( Base, Lang ) \ diff --git a/tools/source/fsys/fstat.cxx b/tools/source/fsys/fstat.cxx index acdbe6bae510..a55c56b6efbb 100644 --- a/tools/source/fsys/fstat.cxx +++ b/tools/source/fsys/fstat.cxx @@ -28,11 +28,6 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_tools.hxx" -#if defined( WIN) -#include -#include -#endif - #ifdef UNX #include #endif diff --git a/tools/win/inc/dll.hxx b/tools/win/inc/dll.hxx index 2a91aefc0fa9..f28b07974c61 100644 --- a/tools/win/inc/dll.hxx +++ b/tools/win/inc/dll.hxx @@ -28,31 +28,6 @@ #ifndef _DLL_HXX #define _DLL_HXX -#ifdef WIN - -#include - -// ---------------------- -// - Zugriffsfunktionen - -// ---------------------- - -struct SVDATA; - -extern "C" -{ -// IN APPDATA.ASM -SVDATA* FAR PASCAL GetSVData(); -} - -// IN TOOLSDLL.CXX -void SetSVData( SVDATA* pSVData ); - -#endif - -// ------------------------------- -// - Sonstige Funktionen fuer SV - -// ------------------------------- - // Um Resourcen wieder freizugeben inline void ImpDeInitWinTools() {} diff --git a/tools/win/inc/toolsdll.hxx b/tools/win/inc/toolsdll.hxx deleted file mode 100644 index a6b1546763bc..000000000000 --- a/tools/win/inc/toolsdll.hxx +++ /dev/null @@ -1,88 +0,0 @@ -/************************************************************************* - * - * 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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#ifndef _TOOLSDLL_HXX -#define _TOOLSDLL_HXX - -#ifdef WIN - -#ifndef _STRING_H -#include -#endif -#include -#include -#include - -// ---------------- -// - MemMgr-Daten - -// ---------------- - -// Anzahl Freispeicherlisten -#define MEM_FREELIST_COUNT 15 - - -// -------------- -// - Tools-Data - -// -------------- - -struct SVDATA; -struct FreeBlock; - -struct MemData -{ - FreeBlock* pFirstBlocks[MEM_FREELIST_COUNT]; // Erste Bloecke in Freispeicherlisten - void* pNewHandler; // New-Handler - int nMultiThread; // MultiThread an/aus -}; - -struct ToolsData -{ - // !!! SVDATA muss in jedem Fall ganz vorne in der Struktur stehen !!! - SVDATA* pSVData; // Pointer auf StarView-Daten - HANDLE hMem; // Handler der Tools-Daten - MemData aMemD; // Daten der Speicherverwaltung - void* aAppData[SHL_COUNT]; // Daten fuer andere Shared Libs -}; - - -// ---------------------- -// - Zugriffsfunktionen - -// ---------------------- - -// IN APPDATA.ASM -extern "C" -{ -ToolsData* FAR PASCAL ImpGetAppData(); -void FAR PASCAL ImpSetAppData( ToolsData* pData ); -} - -// IN TOOLSDLL.CXX -ToolsData* ImpGetToolsData(); - -#endif - -#endif // _DLL_HXX diff --git a/tools/win/source/dll/toolsdll.cxx b/tools/win/source/dll/toolsdll.cxx index 8fc9888021bb..3d934edfe71d 100644 --- a/tools/win/source/dll/toolsdll.cxx +++ b/tools/win/source/dll/toolsdll.cxx @@ -29,7 +29,6 @@ #include "precompiled_tools.hxx" #include #include -#include #include // ======================================================================= diff --git a/vcl/source/gdi/impimage.cxx b/vcl/source/gdi/impimage.cxx index 476ac3ca44a9..3105850c4fbf 100644 --- a/vcl/source/gdi/impimage.cxx +++ b/vcl/source/gdi/impimage.cxx @@ -553,14 +553,14 @@ void ImplImageBmp::Draw( USHORT nPos, OutputDevice* pOutDev, // ----------------------------------------------------------------------- void ImplImageBmp::ImplUpdateDisplayBmp( OutputDevice* -#if defined WIN || defined WNT +#if defined WNT pOutDev #endif ) { if( !mpDisplayBmp && !maBmpEx.IsEmpty() ) { -#if defined WIN || defined WNT +#if defined WNT if( maBmpEx.IsAlpha() ) mpDisplayBmp = new BitmapEx( maBmpEx ); else -- cgit v1.2.3 From bc9a2076300859ea109ec02329bfde4ea2920ecc Mon Sep 17 00:00:00 2001 From: "Ocke Janssen [oj]" Date: Fri, 25 Jun 2010 14:39:46 +0200 Subject: unoawt2: #i112683 localize string list --- toolkit/source/awt/vclxwindows.cxx | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/toolkit/source/awt/vclxwindows.cxx b/toolkit/source/awt/vclxwindows.cxx index b79fee56e3d8..625ae4e4616b 100644 --- a/toolkit/source/awt/vclxwindows.cxx +++ b/toolkit/source/awt/vclxwindows.cxx @@ -42,6 +42,7 @@ #include #include #include +#include #include #include #include @@ -2163,11 +2164,29 @@ void SAL_CALL VCLXListBox::itemListChanged( const EventObject& i_rEvent ) throw pListBox->Clear(); + uno::Reference< beans::XPropertySet > xPropSet( i_rEvent.Source, uno::UNO_QUERY_THROW ); + uno::Reference< beans::XPropertySetInfo > xPSI( xPropSet->getPropertySetInfo(), uno::UNO_QUERY_THROW ); + bool localize = xPSI->hasPropertyByName( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ResourceResolver" ) ) ); + uno::Reference< resource::XStringResourceResolver > xStringResourceResolver; + if ( xPSI->hasPropertyByName( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ResourceResolver" ) ) ) ) + { + xStringResourceResolver.set( + xPropSet->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ResourceResolver" ) ) ), + uno::UNO_QUERY + ); + } + + Reference< XItemList > xItemList( i_rEvent.Source, uno::UNO_QUERY_THROW ); uno::Sequence< beans::Pair< ::rtl::OUString, ::rtl::OUString > > aItems = xItemList->getAllItems(); for ( sal_Int32 i=0; iInsertEntry( aItems[i].First, lcl_getImageFromURL( aItems[i].Second ) ); + ::rtl::OUString aLocalizationKey( aItems[i].First ); + if ( xStringResourceResolver.is() && aLocalizationKey.getLength() != 0 && aLocalizationKey[0] == '&' ) + { + aLocalizationKey = xStringResourceResolver->resolveString(aLocalizationKey.copy( 1 )); + } + pListBox->InsertEntry( aLocalizationKey, lcl_getImageFromURL( aItems[i].Second ) ); } } -- cgit v1.2.3 From 04421ec5afe024feb9caf0d9a10c532ffe777fe2 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Fri, 25 Jun 2010 15:09:38 +0200 Subject: unoawt2: #i112684# let UNO Controls implement the (newly introduced) XStyleSettingsSupplier, giving access to their style, in particular, to the HC flag --- toolkit/inc/toolkit/awt/vclxwindow.hxx | 9 +- toolkit/inc/toolkit/controls/unocontrol.hxx | 9 +- toolkit/source/awt/makefile.mk | 1 + toolkit/source/awt/stylesettings.cxx | 987 ++++++++++++++++++++++++++++ toolkit/source/awt/stylesettings.hxx | 188 ++++++ toolkit/source/awt/vclxwindow.cxx | 41 +- toolkit/source/controls/unocontrol.cxx | 12 + 7 files changed, 1232 insertions(+), 15 deletions(-) create mode 100644 toolkit/source/awt/stylesettings.cxx create mode 100644 toolkit/source/awt/stylesettings.hxx diff --git a/toolkit/inc/toolkit/awt/vclxwindow.hxx b/toolkit/inc/toolkit/awt/vclxwindow.hxx index 6ad3c3ab6076..565691b97f09 100644 --- a/toolkit/inc/toolkit/awt/vclxwindow.hxx +++ b/toolkit/inc/toolkit/awt/vclxwindow.hxx @@ -41,9 +41,10 @@ #include #include #include +#include #include -#include +#include #include #include // Size @@ -71,7 +72,7 @@ namespace toolkit class UnoPropertyArrayHelper; class VCLXWindowImpl; -typedef ::cppu::ImplInheritanceHelper8 < VCLXDevice +typedef ::cppu::ImplInheritanceHelper9 < VCLXDevice , ::com::sun::star::awt::XWindow2 , ::com::sun::star::awt::XVclWindowPeer , ::com::sun::star::awt::XLayoutConstrains @@ -80,6 +81,7 @@ typedef ::cppu::ImplInheritanceHelper8 < VCLXDevice , ::com::sun::star::accessibility::XAccessible , ::com::sun::star::lang::XEventListener , ::com::sun::star::beans::XPropertySetInfo + , ::com::sun::star::awt::XStyleSettingsSupplier > VCLXWindow_Base; class TOOLKIT_DLLPUBLIC VCLXWindow : public VCLXWindow_Base @@ -232,6 +234,9 @@ public: ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property > SAL_CALL getProperties( ) throw (::com::sun::star::uno::RuntimeException); ::com::sun::star::beans::Property SAL_CALL getPropertyByName( const ::rtl::OUString& aName ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException); ::sal_Bool SAL_CALL hasPropertyByName( const ::rtl::OUString& Name ) throw (::com::sun::star::uno::RuntimeException); + + // XStyleSettingsSupplier + virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::XStyleSettings > SAL_CALL getStyleSettings() throw (::com::sun::star::uno::RuntimeException); }; #endif // _TOOLKIT_AWT_VCLXWINDOW_HXX_ diff --git a/toolkit/inc/toolkit/controls/unocontrol.hxx b/toolkit/inc/toolkit/controls/unocontrol.hxx index 0515abe27128..6bcfa519ed3d 100644 --- a/toolkit/inc/toolkit/controls/unocontrol.hxx +++ b/toolkit/inc/toolkit/controls/unocontrol.hxx @@ -39,6 +39,7 @@ #include #include #include +#include #include #include #include @@ -47,7 +48,7 @@ #include #include #include -#include +#include #include #include @@ -74,7 +75,7 @@ struct UnoControl_Data; // ---------------------------------------------------- // class UnoControl // ---------------------------------------------------- -typedef ::cppu::WeakAggImplHelper8 < ::com::sun::star::awt::XControl +typedef ::cppu::WeakAggImplHelper9 < ::com::sun::star::awt::XControl , ::com::sun::star::awt::XWindow2 , ::com::sun::star::awt::XView , ::com::sun::star::beans::XPropertiesChangeListener @@ -82,6 +83,7 @@ typedef ::cppu::WeakAggImplHelper8 < ::com::sun::star::awt::XControl , ::com::sun::star::accessibility::XAccessible , ::com::sun::star::util::XModeChangeBroadcaster , ::com::sun::star::awt::XUnitConversion + , ::com::sun::star::awt::XStyleSettingsSupplier > UnoControl_Base; class TOOLKIT_DLLPUBLIC UnoControl : public UnoControl_Base @@ -228,6 +230,9 @@ public: virtual ::com::sun::star::awt::Size SAL_CALL convertSizeToLogic( const ::com::sun::star::awt::Size& aSize, ::sal_Int16 TargetUnit ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); virtual ::com::sun::star::awt::Size SAL_CALL convertSizeToPixel( const ::com::sun::star::awt::Size& aSize, ::sal_Int16 SourceUnit ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); + // XStyleSettingsSupplier + virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::XStyleSettings > SAL_CALL getStyleSettings() throw (::com::sun::star::uno::RuntimeException); + private: // ::com::sun::star::beans::XPropertiesChangeListener void SAL_CALL propertiesChange( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyChangeEvent >& evt ) throw(::com::sun::star::uno::RuntimeException); diff --git a/toolkit/source/awt/makefile.mk b/toolkit/source/awt/makefile.mk index a53e9e22ba2d..88b40a597410 100644 --- a/toolkit/source/awt/makefile.mk +++ b/toolkit/source/awt/makefile.mk @@ -44,6 +44,7 @@ CFLAGSCXX+=$(OBJCXXFLAGS) .ENDIF # "$(GUIBASE)"=="aqua" SLOFILES= \ + $(SLO)$/stylesettings.obj \ $(SLO)$/vclxaccessiblecomponent.obj \ $(SLO)$/vclxbitmap.obj \ $(SLO)$/vclxcontainer.obj \ diff --git a/toolkit/source/awt/stylesettings.cxx b/toolkit/source/awt/stylesettings.cxx new file mode 100644 index 000000000000..fc3ec241101c --- /dev/null +++ b/toolkit/source/awt/stylesettings.cxx @@ -0,0 +1,987 @@ +/************************************************************************* + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include "precompiled_toolkit.hxx" + +#include "stylesettings.hxx" +#include +#include + +/** === begin UNO includes === **/ +#include +/** === end UNO includes === **/ + +#include +#include +#include +#include +#include + +//...................................................................................................................... +namespace toolkit +{ +//...................................................................................................................... + + /** === begin UNO using === **/ + using ::com::sun::star::uno::Reference; + using ::com::sun::star::uno::XInterface; + using ::com::sun::star::uno::UNO_QUERY; + using ::com::sun::star::uno::UNO_QUERY_THROW; + using ::com::sun::star::uno::UNO_SET_THROW; + using ::com::sun::star::uno::Exception; + using ::com::sun::star::uno::RuntimeException; + using ::com::sun::star::uno::Any; + using ::com::sun::star::uno::makeAny; + using ::com::sun::star::uno::Sequence; + using ::com::sun::star::uno::Type; + using ::com::sun::star::lang::DisposedException; + using ::com::sun::star::lang::EventObject; + using ::com::sun::star::awt::FontDescriptor; + using ::com::sun::star::awt::XStyleChangeListener; + using ::com::sun::star::awt::FontDescriptor; + /** === end UNO using === **/ + + //================================================================================================================== + //= WindowStyleSettings_Data + //================================================================================================================== + struct WindowStyleSettings_Data + { + ::vos::IMutex& rMutex; + VCLXWindow* pOwningWindow; + ::cppu::OInterfaceContainerHelper aStyleChangeListeners; + + WindowStyleSettings_Data( ::vos::IMutex& i_rWindowMutex, ::osl::Mutex& i_rListenerMutex, VCLXWindow& i_rOwningWindow ) + :rMutex( i_rWindowMutex ) + ,pOwningWindow( &i_rOwningWindow ) + ,aStyleChangeListeners( i_rListenerMutex ) + { + } + + DECL_LINK( OnWindowEvent, const VclWindowEvent* ); + }; + + //------------------------------------------------------------------------------------------------------------------ + IMPL_LINK( WindowStyleSettings_Data, OnWindowEvent, const VclWindowEvent*, i_pEvent ) + { + if ( !i_pEvent || ( i_pEvent->GetId() != VCLEVENT_WINDOW_DATACHANGED ) ) + return 0L; + const DataChangedEvent* pDataChangedEvent = static_cast< const DataChangedEvent* >( i_pEvent->GetData() ); + if ( !pDataChangedEvent || ( pDataChangedEvent->GetType() != DATACHANGED_SETTINGS ) ) + return 0L; + if ( ( pDataChangedEvent->GetFlags() & SETTINGS_STYLE ) == 0 ) + return 0L; + + EventObject aEvent( *pOwningWindow ); + aStyleChangeListeners.notifyEach( &XStyleChangeListener::styleSettingsChanged, aEvent ); + return 1L; + } + + //================================================================================================================== + //= StyleMethodGuard + //================================================================================================================== + class StyleMethodGuard + { + public: + StyleMethodGuard( WindowStyleSettings_Data& i_rData ) + :m_aGuard( i_rData.rMutex ) + { + if ( i_rData.pOwningWindow == NULL ) + throw DisposedException(); + } + + ~StyleMethodGuard() + { + } + + private: + ::vos::OGuard m_aGuard; + }; + + //================================================================================================================== + //= WindowStyleSettings + //================================================================================================================== + //------------------------------------------------------------------------------------------------------------------ + WindowStyleSettings::WindowStyleSettings( ::vos::IMutex& i_rWindowMutex, ::osl::Mutex& i_rListenerMutex, VCLXWindow& i_rOwningWindow ) + :m_pData( new WindowStyleSettings_Data( i_rWindowMutex, i_rListenerMutex, i_rOwningWindow ) ) + { + Window* pWindow = i_rOwningWindow.GetWindow(); + if ( !pWindow ) + throw new RuntimeException(); + pWindow->AddEventListener( LINK( m_pData.get(), WindowStyleSettings_Data, OnWindowEvent ) ); + } + + //------------------------------------------------------------------------------------------------------------------ + WindowStyleSettings::~WindowStyleSettings() + { + } + + //------------------------------------------------------------------------------------------------------------------ + void WindowStyleSettings::dispose() + { + StyleMethodGuard aGuard( *m_pData ); + + Window* pWindow = m_pData->pOwningWindow->GetWindow(); + OSL_ENSURE( pWindow, "WindowStyleSettings::dispose: window has been reset before we could revoke the listener!" ); + if ( pWindow ) + pWindow->RemoveEventListener( LINK( m_pData.get(), WindowStyleSettings_Data, OnWindowEvent ) ); + + EventObject aEvent( *this ); + m_pData->aStyleChangeListeners.disposeAndClear( aEvent ); + + m_pData->pOwningWindow = NULL; + } + + //------------------------------------------------------------------------------------------------------------------ + namespace + { + sal_Int32 lcl_getStyleColor( WindowStyleSettings_Data& i_rData, Color const & (StyleSettings::*i_pGetter)() const ) + { + const Window* pWindow = i_rData.pOwningWindow->GetWindow(); + const AllSettings aAllSettings = pWindow->GetSettings(); + const StyleSettings aStyleSettings = aAllSettings.GetStyleSettings(); + return (aStyleSettings.*i_pGetter)().GetColor(); + } + + void lcl_setStyleColor( WindowStyleSettings_Data& i_rData, void (StyleSettings::*i_pSetter)( Color const & ), const sal_Int32 i_nColor ) + { + Window* pWindow = i_rData.pOwningWindow->GetWindow(); + AllSettings aAllSettings = pWindow->GetSettings(); + StyleSettings aStyleSettings = aAllSettings.GetStyleSettings(); + (aStyleSettings.*i_pSetter)( Color( i_nColor ) ); + aAllSettings.SetStyleSettings( aStyleSettings ); + pWindow->SetSettings( aAllSettings ); + } + + FontDescriptor lcl_getStyleFont( WindowStyleSettings_Data& i_rData, Font const & (StyleSettings::*i_pGetter)() const ) + { + const Window* pWindow = i_rData.pOwningWindow->GetWindow(); + const AllSettings aAllSettings = pWindow->GetSettings(); + const StyleSettings aStyleSettings = aAllSettings.GetStyleSettings(); + return VCLUnoHelper::CreateFontDescriptor( (aStyleSettings.*i_pGetter)() ); + } + + void lcl_setStyleFont( WindowStyleSettings_Data& i_rData, void (StyleSettings::*i_pSetter)( Font const &), + Font const & (StyleSettings::*i_pGetter)() const, const FontDescriptor& i_rFont ) + { + Window* pWindow = i_rData.pOwningWindow->GetWindow(); + AllSettings aAllSettings = pWindow->GetSettings(); + StyleSettings aStyleSettings = aAllSettings.GetStyleSettings(); + const Font aNewFont = VCLUnoHelper::CreateFont( i_rFont, (aStyleSettings.*i_pGetter)() ); + (aStyleSettings.*i_pSetter)( aNewFont ); + aAllSettings.SetStyleSettings( aStyleSettings ); + pWindow->SetSettings( aAllSettings ); + } + } + + //------------------------------------------------------------------------------------------------------------------ + ::sal_Int32 SAL_CALL WindowStyleSettings::getActiveBorderColor() throw (RuntimeException) + { + StyleMethodGuard aGuard( *m_pData ); + return lcl_getStyleColor( *m_pData, &StyleSettings::GetActiveBorderColor ); + } + + //------------------------------------------------------------------------------------------------------------------ + void SAL_CALL WindowStyleSettings::setActiveBorderColor( ::sal_Int32 _activebordercolor ) throw (RuntimeException) + { + StyleMethodGuard aGuard( *m_pData ); + lcl_setStyleColor( *m_pData, &StyleSettings::SetActiveBorderColor, _activebordercolor ); + } + + //------------------------------------------------------------------------------------------------------------------ + ::sal_Int32 SAL_CALL WindowStyleSettings::getActiveColor() throw (RuntimeException) + { + StyleMethodGuard aGuard( *m_pData ); + return lcl_getStyleColor( *m_pData, &StyleSettings::GetActiveColor ); + } + + //------------------------------------------------------------------------------------------------------------------ + void SAL_CALL WindowStyleSettings::setActiveColor( ::sal_Int32 _activecolor ) throw (RuntimeException) + { + StyleMethodGuard aGuard( *m_pData ); + lcl_setStyleColor( *m_pData, &StyleSettings::SetActiveColor, _activecolor ); + } + + //------------------------------------------------------------------------------------------------------------------ + ::sal_Int32 SAL_CALL WindowStyleSettings::getActiveTabColor() throw (RuntimeException) + { + StyleMethodGuard aGuard( *m_pData ); + return lcl_getStyleColor( *m_pData, &StyleSettings::GetActiveTabColor ); + } + + //------------------------------------------------------------------------------------------------------------------ + void SAL_CALL WindowStyleSettings::setActiveTabColor( ::sal_Int32 _activetabcolor ) throw (RuntimeException) + { + StyleMethodGuard aGuard( *m_pData ); + lcl_setStyleColor( *m_pData, &StyleSettings::SetActiveTabColor, _activetabcolor ); + } + + //------------------------------------------------------------------------------------------------------------------ + ::sal_Int32 SAL_CALL WindowStyleSettings::getActiveTextColor() throw (RuntimeException) + { + StyleMethodGuard aGuard( *m_pData ); + return lcl_getStyleColor( *m_pData, &StyleSettings::GetActiveTextColor ); + } + + //------------------------------------------------------------------------------------------------------------------ + void SAL_CALL WindowStyleSettings::setActiveTextColor( ::sal_Int32 _activetextcolor ) throw (RuntimeException) + { + StyleMethodGuard aGuard( *m_pData ); + lcl_setStyleColor( *m_pData, &StyleSettings::SetActiveTextColor, _activetextcolor ); + } + + //------------------------------------------------------------------------------------------------------------------ + ::sal_Int32 SAL_CALL WindowStyleSettings::getButtonRolloverTextColor() throw (RuntimeException) + { + StyleMethodGuard aGuard( *m_pData ); + return lcl_getStyleColor( *m_pData, &StyleSettings::GetButtonRolloverTextColor ); + } + + //------------------------------------------------------------------------------------------------------------------ + void SAL_CALL WindowStyleSettings::setButtonRolloverTextColor( ::sal_Int32 _buttonrollovertextcolor ) throw (RuntimeException) + { + StyleMethodGuard aGuard( *m_pData ); + lcl_setStyleColor( *m_pData, &StyleSettings::SetButtonRolloverTextColor, _buttonrollovertextcolor ); + } + + //------------------------------------------------------------------------------------------------------------------ + ::sal_Int32 SAL_CALL WindowStyleSettings::getButtonTextColor() throw (RuntimeException) + { + StyleMethodGuard aGuard( *m_pData ); + return lcl_getStyleColor( *m_pData, &StyleSettings::GetButtonTextColor ); + } + + //------------------------------------------------------------------------------------------------------------------ + void SAL_CALL WindowStyleSettings::setButtonTextColor( ::sal_Int32 _buttontextcolor ) throw (RuntimeException) + { + StyleMethodGuard aGuard( *m_pData ); + lcl_setStyleColor( *m_pData, &StyleSettings::SetButtonTextColor, _buttontextcolor ); + } + + //------------------------------------------------------------------------------------------------------------------ + ::sal_Int32 SAL_CALL WindowStyleSettings::getCheckedColor() throw (RuntimeException) + { + StyleMethodGuard aGuard( *m_pData ); + return lcl_getStyleColor( *m_pData, &StyleSettings::GetCheckedColor ); + } + + //------------------------------------------------------------------------------------------------------------------ + void SAL_CALL WindowStyleSettings::setCheckedColor( ::sal_Int32 _checkedcolor ) throw (RuntimeException) + { + StyleMethodGuard aGuard( *m_pData ); + lcl_setStyleColor( *m_pData, &StyleSettings::SetCheckedColor, _checkedcolor ); + } + + //------------------------------------------------------------------------------------------------------------------ + ::sal_Int32 SAL_CALL WindowStyleSettings::getDarkShadowColor() throw (RuntimeException) + { + StyleMethodGuard aGuard( *m_pData ); + return lcl_getStyleColor( *m_pData, &StyleSettings::GetDarkShadowColor ); + } + + //------------------------------------------------------------------------------------------------------------------ + void SAL_CALL WindowStyleSettings::setDarkShadowColor( ::sal_Int32 _darkshadowcolor ) throw (RuntimeException) + { + StyleMethodGuard aGuard( *m_pData ); + lcl_setStyleColor( *m_pData, &StyleSettings::SetDarkShadowColor, _darkshadowcolor ); + } + + //------------------------------------------------------------------------------------------------------------------ + ::sal_Int32 SAL_CALL WindowStyleSettings::getDeactiveBorderColor() throw (RuntimeException) + { + StyleMethodGuard aGuard( *m_pData ); + return lcl_getStyleColor( *m_pData, &StyleSettings::GetDeactiveBorderColor ); + } + + //------------------------------------------------------------------------------------------------------------------ + void SAL_CALL WindowStyleSettings::setDeactiveBorderColor( ::sal_Int32 _deactivebordercolor ) throw (RuntimeException) + { + StyleMethodGuard aGuard( *m_pData ); + lcl_setStyleColor( *m_pData, &StyleSettings::SetDeactiveBorderColor, _deactivebordercolor ); + } + + //------------------------------------------------------------------------------------------------------------------ + ::sal_Int32 SAL_CALL WindowStyleSettings::getDeactiveColor() throw (RuntimeException) + { + StyleMethodGuard aGuard( *m_pData ); + return lcl_getStyleColor( *m_pData, &StyleSettings::GetDeactiveColor ); + } + + //------------------------------------------------------------------------------------------------------------------ + void SAL_CALL WindowStyleSettings::setDeactiveColor( ::sal_Int32 _deactivecolor ) throw (RuntimeException) + { + StyleMethodGuard aGuard( *m_pData ); + lcl_setStyleColor( *m_pData, &StyleSettings::SetDeactiveColor, _deactivecolor ); + } + + //------------------------------------------------------------------------------------------------------------------ + ::sal_Int32 SAL_CALL WindowStyleSettings::getDeactiveTextColor() throw (RuntimeException) + { + StyleMethodGuard aGuard( *m_pData ); + return lcl_getStyleColor( *m_pData, &StyleSettings::GetDeactiveTextColor ); + } + + //------------------------------------------------------------------------------------------------------------------ + void SAL_CALL WindowStyleSettings::setDeactiveTextColor( ::sal_Int32 _deactivetextcolor ) throw (RuntimeException) + { + StyleMethodGuard aGuard( *m_pData ); + lcl_setStyleColor( *m_pData, &StyleSettings::SetDeactiveTextColor, _deactivetextcolor ); + } + + //------------------------------------------------------------------------------------------------------------------ + ::sal_Int32 SAL_CALL WindowStyleSettings::getDialogColor() throw (RuntimeException) + { + StyleMethodGuard aGuard( *m_pData ); + return lcl_getStyleColor( *m_pData, &StyleSettings::GetDialogColor ); + } + + //------------------------------------------------------------------------------------------------------------------ + void SAL_CALL WindowStyleSettings::setDialogColor( ::sal_Int32 _dialogcolor ) throw (RuntimeException) + { + StyleMethodGuard aGuard( *m_pData ); + lcl_setStyleColor( *m_pData, &StyleSettings::SetDialogColor, _dialogcolor ); + } + + //------------------------------------------------------------------------------------------------------------------ + ::sal_Int32 SAL_CALL WindowStyleSettings::getDialogTextColor() throw (RuntimeException) + { + StyleMethodGuard aGuard( *m_pData ); + return lcl_getStyleColor( *m_pData, &StyleSettings::GetDialogTextColor ); + } + + //------------------------------------------------------------------------------------------------------------------ + void SAL_CALL WindowStyleSettings::setDialogTextColor( ::sal_Int32 _dialogtextcolor ) throw (RuntimeException) + { + StyleMethodGuard aGuard( *m_pData ); + lcl_setStyleColor( *m_pData, &StyleSettings::SetDialogTextColor, _dialogtextcolor ); + } + + //------------------------------------------------------------------------------------------------------------------ + ::sal_Int32 SAL_CALL WindowStyleSettings::getDisableColor() throw (RuntimeException) + { + StyleMethodGuard aGuard( *m_pData ); + return lcl_getStyleColor( *m_pData, &StyleSettings::GetDisableColor ); + } + + //------------------------------------------------------------------------------------------------------------------ + void SAL_CALL WindowStyleSettings::setDisableColor( ::sal_Int32 _disablecolor ) throw (RuntimeException) + { + StyleMethodGuard aGuard( *m_pData ); + lcl_setStyleColor( *m_pData, &StyleSettings::SetDisableColor, _disablecolor ); + } + + //------------------------------------------------------------------------------------------------------------------ + ::sal_Int32 SAL_CALL WindowStyleSettings::getFaceColor() throw (RuntimeException) + { + StyleMethodGuard aGuard( *m_pData ); + return lcl_getStyleColor( *m_pData, &StyleSettings::GetFaceColor ); + } + + //------------------------------------------------------------------------------------------------------------------ + void SAL_CALL WindowStyleSettings::setFaceColor( ::sal_Int32 _facecolor ) throw (RuntimeException) + { + StyleMethodGuard aGuard( *m_pData ); + lcl_setStyleColor( *m_pData, &StyleSettings::SetFaceColor, _facecolor ); + } + + //------------------------------------------------------------------------------------------------------------------ + ::sal_Int32 SAL_CALL WindowStyleSettings::getFaceGradientColor() throw (RuntimeException) + { + StyleMethodGuard aGuard( *m_pData ); + const Window* pWindow = m_pData->pOwningWindow->GetWindow(); + const AllSettings aAllSettings = pWindow->GetSettings(); + const StyleSettings aStyleSettings = aAllSettings.GetStyleSettings(); + return aStyleSettings.GetFaceGradientColor().GetColor(); + } + + //------------------------------------------------------------------------------------------------------------------ + ::sal_Int32 SAL_CALL WindowStyleSettings::getFieldColor() throw (RuntimeException) + { + StyleMethodGuard aGuard( *m_pData ); + return lcl_getStyleColor( *m_pData, &StyleSettings::GetFieldColor ); + } + + //------------------------------------------------------------------------------------------------------------------ + void SAL_CALL WindowStyleSettings::setFieldColor( ::sal_Int32 _fieldcolor ) throw (RuntimeException) + { + StyleMethodGuard aGuard( *m_pData ); + lcl_setStyleColor( *m_pData, &StyleSettings::SetFieldColor, _fieldcolor ); + } + + //------------------------------------------------------------------------------------------------------------------ + ::sal_Int32 SAL_CALL WindowStyleSettings::getFieldRolloverTextColor() throw (RuntimeException) + { + StyleMethodGuard aGuard( *m_pData ); + return lcl_getStyleColor( *m_pData, &StyleSettings::GetFieldRolloverTextColor ); + } + + //------------------------------------------------------------------------------------------------------------------ + void SAL_CALL WindowStyleSettings::setFieldRolloverTextColor( ::sal_Int32 _fieldrollovertextcolor ) throw (RuntimeException) + { + StyleMethodGuard aGuard( *m_pData ); + lcl_setStyleColor( *m_pData, &StyleSettings::SetFieldRolloverTextColor, _fieldrollovertextcolor ); + } + + //------------------------------------------------------------------------------------------------------------------ + ::sal_Int32 SAL_CALL WindowStyleSettings::getFieldTextColor() throw (RuntimeException) + { + StyleMethodGuard aGuard( *m_pData ); + return lcl_getStyleColor( *m_pData, &StyleSettings::GetFieldTextColor ); + } + + //------------------------------------------------------------------------------------------------------------------ + void SAL_CALL WindowStyleSettings::setFieldTextColor( ::sal_Int32 _fieldtextcolor ) throw (RuntimeException) + { + StyleMethodGuard aGuard( *m_pData ); + lcl_setStyleColor( *m_pData, &StyleSettings::SetFieldTextColor, _fieldtextcolor ); + } + + //------------------------------------------------------------------------------------------------------------------ + ::sal_Int32 SAL_CALL WindowStyleSettings::getGroupTextColor() throw (RuntimeException) + { + StyleMethodGuard aGuard( *m_pData ); + return lcl_getStyleColor( *m_pData, &StyleSettings::GetGroupTextColor ); + } + + //------------------------------------------------------------------------------------------------------------------ + void SAL_CALL WindowStyleSettings::setGroupTextColor( ::sal_Int32 _grouptextcolor ) throw (RuntimeException) + { + StyleMethodGuard aGuard( *m_pData ); + lcl_setStyleColor( *m_pData, &StyleSettings::SetGroupTextColor, _grouptextcolor ); + } + + //------------------------------------------------------------------------------------------------------------------ + ::sal_Int32 SAL_CALL WindowStyleSettings::getHelpColor() throw (RuntimeException) + { + StyleMethodGuard aGuard( *m_pData ); + return lcl_getStyleColor( *m_pData, &StyleSettings::GetHelpColor ); + } + + //------------------------------------------------------------------------------------------------------------------ + void SAL_CALL WindowStyleSettings::setHelpColor( ::sal_Int32 _helpcolor ) throw (RuntimeException) + { + StyleMethodGuard aGuard( *m_pData ); + lcl_setStyleColor( *m_pData, &StyleSettings::SetHelpColor, _helpcolor ); + } + + //------------------------------------------------------------------------------------------------------------------ + ::sal_Int32 SAL_CALL WindowStyleSettings::getHelpTextColor() throw (RuntimeException) + { + StyleMethodGuard aGuard( *m_pData ); + return lcl_getStyleColor( *m_pData, &StyleSettings::GetHelpTextColor ); + } + + //------------------------------------------------------------------------------------------------------------------ + void SAL_CALL WindowStyleSettings::setHelpTextColor( ::sal_Int32 _helptextcolor ) throw (RuntimeException) + { + StyleMethodGuard aGuard( *m_pData ); + lcl_setStyleColor( *m_pData, &StyleSettings::SetHelpTextColor, _helptextcolor ); + } + + //------------------------------------------------------------------------------------------------------------------ + ::sal_Int32 SAL_CALL WindowStyleSettings::getHighlightColor() throw (RuntimeException) + { + StyleMethodGuard aGuard( *m_pData ); + return lcl_getStyleColor( *m_pData, &StyleSettings::GetHighlightColor ); + } + + //------------------------------------------------------------------------------------------------------------------ + void SAL_CALL WindowStyleSettings::setHighlightColor( ::sal_Int32 _highlightcolor ) throw (RuntimeException) + { + StyleMethodGuard aGuard( *m_pData ); + lcl_setStyleColor( *m_pData, &StyleSettings::SetHighlightColor, _highlightcolor ); + } + + //------------------------------------------------------------------------------------------------------------------ + ::sal_Int32 SAL_CALL WindowStyleSettings::getHighlightTextColor() throw (RuntimeException) + { + StyleMethodGuard aGuard( *m_pData ); + return lcl_getStyleColor( *m_pData, &StyleSettings::GetHighlightTextColor ); + } + + //------------------------------------------------------------------------------------------------------------------ + void SAL_CALL WindowStyleSettings::setHighlightTextColor( ::sal_Int32 _highlighttextcolor ) throw (RuntimeException) + { + StyleMethodGuard aGuard( *m_pData ); + lcl_setStyleColor( *m_pData, &StyleSettings::SetHighlightTextColor, _highlighttextcolor ); + } + + //------------------------------------------------------------------------------------------------------------------ + ::sal_Int32 SAL_CALL WindowStyleSettings::getInactiveTabColor() throw (RuntimeException) + { + StyleMethodGuard aGuard( *m_pData ); + return lcl_getStyleColor( *m_pData, &StyleSettings::GetInactiveTabColor ); + } + + //------------------------------------------------------------------------------------------------------------------ + void SAL_CALL WindowStyleSettings::setInactiveTabColor( ::sal_Int32 _inactivetabcolor ) throw (RuntimeException) + { + StyleMethodGuard aGuard( *m_pData ); + lcl_setStyleColor( *m_pData, &StyleSettings::SetInactiveTabColor, _inactivetabcolor ); + } + + //------------------------------------------------------------------------------------------------------------------ + ::sal_Int32 SAL_CALL WindowStyleSettings::getInfoTextColor() throw (RuntimeException) + { + StyleMethodGuard aGuard( *m_pData ); + return lcl_getStyleColor( *m_pData, &StyleSettings::GetInfoTextColor ); + } + + //------------------------------------------------------------------------------------------------------------------ + void SAL_CALL WindowStyleSettings::setInfoTextColor( ::sal_Int32 _infotextcolor ) throw (RuntimeException) + { + StyleMethodGuard aGuard( *m_pData ); + lcl_setStyleColor( *m_pData, &StyleSettings::SetInfoTextColor, _infotextcolor ); + } + + //------------------------------------------------------------------------------------------------------------------ + ::sal_Int32 SAL_CALL WindowStyleSettings::getLabelTextColor() throw (RuntimeException) + { + StyleMethodGuard aGuard( *m_pData ); + return lcl_getStyleColor( *m_pData, &StyleSettings::GetLabelTextColor ); + } + + //------------------------------------------------------------------------------------------------------------------ + void SAL_CALL WindowStyleSettings::setLabelTextColor( ::sal_Int32 _labeltextcolor ) throw (RuntimeException) + { + StyleMethodGuard aGuard( *m_pData ); + lcl_setStyleColor( *m_pData, &StyleSettings::SetLabelTextColor, _labeltextcolor ); + } + + //------------------------------------------------------------------------------------------------------------------ + ::sal_Int32 SAL_CALL WindowStyleSettings::getLightColor() throw (RuntimeException) + { + StyleMethodGuard aGuard( *m_pData ); + return lcl_getStyleColor( *m_pData, &StyleSettings::GetLightColor ); + } + + //------------------------------------------------------------------------------------------------------------------ + void SAL_CALL WindowStyleSettings::setLightColor( ::sal_Int32 _lightcolor ) throw (RuntimeException) + { + StyleMethodGuard aGuard( *m_pData ); + lcl_setStyleColor( *m_pData, &StyleSettings::SetLightColor, _lightcolor ); + } + + //------------------------------------------------------------------------------------------------------------------ + ::sal_Int32 SAL_CALL WindowStyleSettings::getMenuBarColor() throw (RuntimeException) + { + StyleMethodGuard aGuard( *m_pData ); + return lcl_getStyleColor( *m_pData, &StyleSettings::GetMenuBarColor ); + } + + //------------------------------------------------------------------------------------------------------------------ + void SAL_CALL WindowStyleSettings::setMenuBarColor( ::sal_Int32 _menubarcolor ) throw (RuntimeException) + { + StyleMethodGuard aGuard( *m_pData ); + lcl_setStyleColor( *m_pData, &StyleSettings::SetMenuBarColor, _menubarcolor ); + } + + //------------------------------------------------------------------------------------------------------------------ + ::sal_Int32 SAL_CALL WindowStyleSettings::getMenuBarTextColor() throw (RuntimeException) + { + StyleMethodGuard aGuard( *m_pData ); + return lcl_getStyleColor( *m_pData, &StyleSettings::GetMenuBarTextColor ); + } + + //------------------------------------------------------------------------------------------------------------------ + void SAL_CALL WindowStyleSettings::setMenuBarTextColor( ::sal_Int32 _menubartextcolor ) throw (RuntimeException) + { + StyleMethodGuard aGuard( *m_pData ); + lcl_setStyleColor( *m_pData, &StyleSettings::SetMenuBarTextColor, _menubartextcolor ); + } + + //------------------------------------------------------------------------------------------------------------------ + ::sal_Int32 SAL_CALL WindowStyleSettings::getMenuBorderColor() throw (RuntimeException) + { + StyleMethodGuard aGuard( *m_pData ); + return lcl_getStyleColor( *m_pData, &StyleSettings::GetMenuBorderColor ); + } + + //------------------------------------------------------------------------------------------------------------------ + void SAL_CALL WindowStyleSettings::setMenuBorderColor( ::sal_Int32 _menubordercolor ) throw (RuntimeException) + { + StyleMethodGuard aGuard( *m_pData ); + lcl_setStyleColor( *m_pData, &StyleSettings::SetMenuBorderColor, _menubordercolor ); + } + + //------------------------------------------------------------------------------------------------------------------ + ::sal_Int32 SAL_CALL WindowStyleSettings::getMenuColor() throw (RuntimeException) + { + StyleMethodGuard aGuard( *m_pData ); + return lcl_getStyleColor( *m_pData, &StyleSettings::GetMenuColor ); + } + + //------------------------------------------------------------------------------------------------------------------ + void SAL_CALL WindowStyleSettings::setMenuColor( ::sal_Int32 _menucolor ) throw (RuntimeException) + { + StyleMethodGuard aGuard( *m_pData ); + lcl_setStyleColor( *m_pData, &StyleSettings::SetMenuColor, _menucolor ); + } + + //------------------------------------------------------------------------------------------------------------------ + ::sal_Int32 SAL_CALL WindowStyleSettings::getMenuHighlightColor() throw (RuntimeException) + { + StyleMethodGuard aGuard( *m_pData ); + return lcl_getStyleColor( *m_pData, &StyleSettings::GetMenuHighlightColor ); + } + + //------------------------------------------------------------------------------------------------------------------ + void SAL_CALL WindowStyleSettings::setMenuHighlightColor( ::sal_Int32 _menuhighlightcolor ) throw (RuntimeException) + { + StyleMethodGuard aGuard( *m_pData ); + lcl_setStyleColor( *m_pData, &StyleSettings::SetMenuHighlightColor, _menuhighlightcolor ); + } + + //------------------------------------------------------------------------------------------------------------------ + ::sal_Int32 SAL_CALL WindowStyleSettings::getMenuHighlightTextColor() throw (RuntimeException) + { + StyleMethodGuard aGuard( *m_pData ); + return lcl_getStyleColor( *m_pData, &StyleSettings::GetMenuHighlightTextColor ); + } + + //------------------------------------------------------------------------------------------------------------------ + void SAL_CALL WindowStyleSettings::setMenuHighlightTextColor( ::sal_Int32 _menuhighlighttextcolor ) throw (RuntimeException) + { + StyleMethodGuard aGuard( *m_pData ); + lcl_setStyleColor( *m_pData, &StyleSettings::SetMenuHighlightTextColor, _menuhighlighttextcolor ); + } + + //------------------------------------------------------------------------------------------------------------------ + ::sal_Int32 SAL_CALL WindowStyleSettings::getMenuTextColor() throw (RuntimeException) + { + StyleMethodGuard aGuard( *m_pData ); + return lcl_getStyleColor( *m_pData, &StyleSettings::GetMenuTextColor ); + } + + //------------------------------------------------------------------------------------------------------------------ + void SAL_CALL WindowStyleSettings::setMenuTextColor( ::sal_Int32 _menutextcolor ) throw (RuntimeException) + { + StyleMethodGuard aGuard( *m_pData ); + lcl_setStyleColor( *m_pData, &StyleSettings::SetMenuTextColor, _menutextcolor ); + } + + //------------------------------------------------------------------------------------------------------------------ + ::sal_Int32 SAL_CALL WindowStyleSettings::getMonoColor() throw (RuntimeException) + { + StyleMethodGuard aGuard( *m_pData ); + return lcl_getStyleColor( *m_pData, &StyleSettings::GetMonoColor ); + } + + //------------------------------------------------------------------------------------------------------------------ + void SAL_CALL WindowStyleSettings::setMonoColor( ::sal_Int32 _monocolor ) throw (RuntimeException) + { + StyleMethodGuard aGuard( *m_pData ); + lcl_setStyleColor( *m_pData, &StyleSettings::SetMonoColor, _monocolor ); + } + + //------------------------------------------------------------------------------------------------------------------ + ::sal_Int32 SAL_CALL WindowStyleSettings::getRadioCheckTextColor() throw (RuntimeException) + { + StyleMethodGuard aGuard( *m_pData ); + return lcl_getStyleColor( *m_pData, &StyleSettings::GetRadioCheckTextColor ); + } + + //------------------------------------------------------------------------------------------------------------------ + void SAL_CALL WindowStyleSettings::setRadioCheckTextColor( ::sal_Int32 _radiochecktextcolor ) throw (RuntimeException) + { + StyleMethodGuard aGuard( *m_pData ); + lcl_setStyleColor( *m_pData, &StyleSettings::SetRadioCheckTextColor, _radiochecktextcolor ); + } + + //------------------------------------------------------------------------------------------------------------------ + ::sal_Int32 SAL_CALL WindowStyleSettings::getSeparatorColor() throw (RuntimeException) + { + StyleMethodGuard aGuard( *m_pData ); + const Window* pWindow = m_pData->pOwningWindow->GetWindow(); + const AllSettings aAllSettings = pWindow->GetSettings(); + const StyleSettings aStyleSettings = aAllSettings.GetStyleSettings(); + return aStyleSettings.GetSeparatorColor().GetColor(); + } + + //------------------------------------------------------------------------------------------------------------------ + ::sal_Int32 SAL_CALL WindowStyleSettings::getShadowColor() throw (RuntimeException) + { + StyleMethodGuard aGuard( *m_pData ); + return lcl_getStyleColor( *m_pData, &StyleSettings::GetShadowColor ); + } + + //------------------------------------------------------------------------------------------------------------------ + void SAL_CALL WindowStyleSettings::setShadowColor( ::sal_Int32 _shadowcolor ) throw (RuntimeException) + { + StyleMethodGuard aGuard( *m_pData ); + lcl_setStyleColor( *m_pData, &StyleSettings::SetShadowColor, _shadowcolor ); + } + + //------------------------------------------------------------------------------------------------------------------ + ::sal_Int32 SAL_CALL WindowStyleSettings::getWindowColor() throw (RuntimeException) + { + StyleMethodGuard aGuard( *m_pData ); + return lcl_getStyleColor( *m_pData, &StyleSettings::GetWindowColor ); + } + + //------------------------------------------------------------------------------------------------------------------ + void SAL_CALL WindowStyleSettings::setWindowColor( ::sal_Int32 _windowcolor ) throw (RuntimeException) + { + StyleMethodGuard aGuard( *m_pData ); + lcl_setStyleColor( *m_pData, &StyleSettings::SetWindowColor, _windowcolor ); + } + + //------------------------------------------------------------------------------------------------------------------ + ::sal_Int32 SAL_CALL WindowStyleSettings::getWindowTextColor() throw (RuntimeException) + { + StyleMethodGuard aGuard( *m_pData ); + return lcl_getStyleColor( *m_pData, &StyleSettings::GetWindowTextColor ); + } + + //------------------------------------------------------------------------------------------------------------------ + void SAL_CALL WindowStyleSettings::setWindowTextColor( ::sal_Int32 _windowtextcolor ) throw (RuntimeException) + { + StyleMethodGuard aGuard( *m_pData ); + lcl_setStyleColor( *m_pData, &StyleSettings::SetWindowTextColor, _windowtextcolor ); + } + + //------------------------------------------------------------------------------------------------------------------ + ::sal_Int32 SAL_CALL WindowStyleSettings::getWorkspaceColor() throw (RuntimeException) + { + StyleMethodGuard aGuard( *m_pData ); + return lcl_getStyleColor( *m_pData, &StyleSettings::GetWorkspaceColor ); + } + + //------------------------------------------------------------------------------------------------------------------ + void SAL_CALL WindowStyleSettings::setWorkspaceColor( ::sal_Int32 _workspacecolor ) throw (RuntimeException) + { + StyleMethodGuard aGuard( *m_pData ); + lcl_setStyleColor( *m_pData, &StyleSettings::SetWorkspaceColor, _workspacecolor ); + } + + //------------------------------------------------------------------------------------------------------------------ + ::sal_Bool SAL_CALL WindowStyleSettings::getHighContrastMode() throw (RuntimeException) + { + StyleMethodGuard aGuard( *m_pData ); + const Window* pWindow = m_pData->pOwningWindow->GetWindow(); + const AllSettings aAllSettings = pWindow->GetSettings(); + const StyleSettings aStyleSettings = aAllSettings.GetStyleSettings(); + return aStyleSettings.GetHighContrastMode(); + } + + //------------------------------------------------------------------------------------------------------------------ + void SAL_CALL WindowStyleSettings::setHighContrastMode( ::sal_Bool _highcontrastmode ) throw (RuntimeException) + { + StyleMethodGuard aGuard( *m_pData ); + Window* pWindow = m_pData->pOwningWindow->GetWindow(); + AllSettings aAllSettings = pWindow->GetSettings(); + StyleSettings aStyleSettings = aAllSettings.GetStyleSettings(); + aStyleSettings.SetHighContrastMode( _highcontrastmode ); + aAllSettings.SetStyleSettings( aStyleSettings ); + pWindow->SetSettings( aAllSettings ); + } + + //------------------------------------------------------------------------------------------------------------------ + FontDescriptor SAL_CALL WindowStyleSettings::getApplicationFont() throw (RuntimeException) + { + StyleMethodGuard aGuard( *m_pData ); + return lcl_getStyleFont( *m_pData, &StyleSettings::GetAppFont ); + } + + //------------------------------------------------------------------------------------------------------------------ + void SAL_CALL WindowStyleSettings::setApplicationFont( const FontDescriptor& _applicationfont ) throw (RuntimeException) + { + StyleMethodGuard aGuard( *m_pData ); + lcl_setStyleFont( *m_pData, &StyleSettings::SetAppFont, &StyleSettings::GetAppFont, _applicationfont ); + } + + //------------------------------------------------------------------------------------------------------------------ + FontDescriptor SAL_CALL WindowStyleSettings::getHelpFont() throw (RuntimeException) + { + StyleMethodGuard aGuard( *m_pData ); + return lcl_getStyleFont( *m_pData, &StyleSettings::GetHelpFont ); + } + + //------------------------------------------------------------------------------------------------------------------ + void SAL_CALL WindowStyleSettings::setHelpFont( const FontDescriptor& _helpfont ) throw (RuntimeException) + { + StyleMethodGuard aGuard( *m_pData ); + lcl_setStyleFont( *m_pData, &StyleSettings::SetHelpFont, &StyleSettings::GetHelpFont, _helpfont ); + } + + //------------------------------------------------------------------------------------------------------------------ + FontDescriptor SAL_CALL WindowStyleSettings::getTitleFont() throw (RuntimeException) + { + StyleMethodGuard aGuard( *m_pData ); + return lcl_getStyleFont( *m_pData, &StyleSettings::GetTitleFont ); + } + + //------------------------------------------------------------------------------------------------------------------ + void SAL_CALL WindowStyleSettings::setTitleFont( const FontDescriptor& _titlefont ) throw (RuntimeException) + { + StyleMethodGuard aGuard( *m_pData ); + lcl_setStyleFont( *m_pData, &StyleSettings::SetTitleFont, &StyleSettings::GetTitleFont, _titlefont ); + } + + //------------------------------------------------------------------------------------------------------------------ + FontDescriptor SAL_CALL WindowStyleSettings::getFloatTitleFont() throw (RuntimeException) + { + StyleMethodGuard aGuard( *m_pData ); + return lcl_getStyleFont( *m_pData, &StyleSettings::GetFloatTitleFont ); + } + + //------------------------------------------------------------------------------------------------------------------ + void SAL_CALL WindowStyleSettings::setFloatTitleFont( const FontDescriptor& _floattitlefont ) throw (RuntimeException) + { + StyleMethodGuard aGuard( *m_pData ); + lcl_setStyleFont( *m_pData, &StyleSettings::SetFloatTitleFont, &StyleSettings::GetFloatTitleFont, _floattitlefont ); + } + + //------------------------------------------------------------------------------------------------------------------ + FontDescriptor SAL_CALL WindowStyleSettings::getMenuFont() throw (RuntimeException) + { + StyleMethodGuard aGuard( *m_pData ); + return lcl_getStyleFont( *m_pData, &StyleSettings::GetMenuFont ); + } + + //------------------------------------------------------------------------------------------------------------------ + void SAL_CALL WindowStyleSettings::setMenuFont( const FontDescriptor& _menufont ) throw (RuntimeException) + { + StyleMethodGuard aGuard( *m_pData ); + lcl_setStyleFont( *m_pData, &StyleSettings::SetMenuFont, &StyleSettings::GetMenuFont, _menufont ); + } + + //------------------------------------------------------------------------------------------------------------------ + FontDescriptor SAL_CALL WindowStyleSettings::getToolFont() throw (RuntimeException) + { + StyleMethodGuard aGuard( *m_pData ); + return lcl_getStyleFont( *m_pData, &StyleSettings::GetToolFont ); + } + + //------------------------------------------------------------------------------------------------------------------ + void SAL_CALL WindowStyleSettings::setToolFont( const FontDescriptor& _toolfont ) throw (RuntimeException) + { + StyleMethodGuard aGuard( *m_pData ); + lcl_setStyleFont( *m_pData, &StyleSettings::SetToolFont, &StyleSettings::GetToolFont, _toolfont ); + } + + //------------------------------------------------------------------------------------------------------------------ + FontDescriptor SAL_CALL WindowStyleSettings::getGroupFont() throw (RuntimeException) + { + StyleMethodGuard aGuard( *m_pData ); + return lcl_getStyleFont( *m_pData, &StyleSettings::GetGroupFont ); + } + + //------------------------------------------------------------------------------------------------------------------ + void SAL_CALL WindowStyleSettings::setGroupFont( const FontDescriptor& _groupfont ) throw (RuntimeException) + { + StyleMethodGuard aGuard( *m_pData ); + lcl_setStyleFont( *m_pData, &StyleSettings::SetGroupFont, &StyleSettings::GetGroupFont, _groupfont ); + } + + //------------------------------------------------------------------------------------------------------------------ + FontDescriptor SAL_CALL WindowStyleSettings::getLabelFont() throw (RuntimeException) + { + StyleMethodGuard aGuard( *m_pData ); + return lcl_getStyleFont( *m_pData, &StyleSettings::GetLabelFont ); + } + + //------------------------------------------------------------------------------------------------------------------ + void SAL_CALL WindowStyleSettings::setLabelFont( const FontDescriptor& _labelfont ) throw (RuntimeException) + { + StyleMethodGuard aGuard( *m_pData ); + lcl_setStyleFont( *m_pData, &StyleSettings::SetLabelFont, &StyleSettings::GetLabelFont, _labelfont ); + } + + //------------------------------------------------------------------------------------------------------------------ + FontDescriptor SAL_CALL WindowStyleSettings::getInfoFont() throw (RuntimeException) + { + StyleMethodGuard aGuard( *m_pData ); + return lcl_getStyleFont( *m_pData, &StyleSettings::GetInfoFont ); + } + + //------------------------------------------------------------------------------------------------------------------ + void SAL_CALL WindowStyleSettings::setInfoFont( const FontDescriptor& _infofont ) throw (RuntimeException) + { + StyleMethodGuard aGuard( *m_pData ); + lcl_setStyleFont( *m_pData, &StyleSettings::SetInfoFont, &StyleSettings::GetInfoFont, _infofont ); + } + + //------------------------------------------------------------------------------------------------------------------ + FontDescriptor SAL_CALL WindowStyleSettings::getRadioCheckFont() throw (RuntimeException) + { + StyleMethodGuard aGuard( *m_pData ); + return lcl_getStyleFont( *m_pData, &StyleSettings::GetRadioCheckFont ); + } + + //------------------------------------------------------------------------------------------------------------------ + void SAL_CALL WindowStyleSettings::setRadioCheckFont( const FontDescriptor& _radiocheckfont ) throw (RuntimeException) + { + StyleMethodGuard aGuard( *m_pData ); + lcl_setStyleFont( *m_pData, &StyleSettings::SetRadioCheckFont, &StyleSettings::GetRadioCheckFont, _radiocheckfont ); + } + + //------------------------------------------------------------------------------------------------------------------ + FontDescriptor SAL_CALL WindowStyleSettings::getPushButtonFont() throw (RuntimeException) + { + StyleMethodGuard aGuard( *m_pData ); + return lcl_getStyleFont( *m_pData, &StyleSettings::GetPushButtonFont ); + } + + //------------------------------------------------------------------------------------------------------------------ + void SAL_CALL WindowStyleSettings::setPushButtonFont( const FontDescriptor& _pushbuttonfont ) throw (RuntimeException) + { + StyleMethodGuard aGuard( *m_pData ); + lcl_setStyleFont( *m_pData, &StyleSettings::SetPushButtonFont, &StyleSettings::GetPushButtonFont, _pushbuttonfont ); + } + + //------------------------------------------------------------------------------------------------------------------ + FontDescriptor SAL_CALL WindowStyleSettings::getFieldFont() throw (RuntimeException) + { + StyleMethodGuard aGuard( *m_pData ); + return lcl_getStyleFont( *m_pData, &StyleSettings::GetFieldFont ); + } + + //------------------------------------------------------------------------------------------------------------------ + void SAL_CALL WindowStyleSettings::setFieldFont( const FontDescriptor& _fieldfont ) throw (RuntimeException) + { + StyleMethodGuard aGuard( *m_pData ); + lcl_setStyleFont( *m_pData, &StyleSettings::SetFieldFont, &StyleSettings::GetFieldFont, _fieldfont ); + } + + //------------------------------------------------------------------------------------------------------------------ + void SAL_CALL WindowStyleSettings::addStyleChangeListener( const Reference< XStyleChangeListener >& i_rListener ) throw (RuntimeException) + { + StyleMethodGuard aGuard( *m_pData ); + if ( i_rListener.is() ) + m_pData->aStyleChangeListeners.addInterface( i_rListener ); + } + + //------------------------------------------------------------------------------------------------------------------ + void SAL_CALL WindowStyleSettings::removeStyleChangeListener( const Reference< XStyleChangeListener >& i_rListener ) throw (RuntimeException) + { + StyleMethodGuard aGuard( *m_pData ); + if ( i_rListener.is() ) + m_pData->aStyleChangeListeners.removeInterface( i_rListener ); + } + +//...................................................................................................................... +} // namespace toolkit +//...................................................................................................................... diff --git a/toolkit/source/awt/stylesettings.hxx b/toolkit/source/awt/stylesettings.hxx new file mode 100644 index 000000000000..466e50bad1f1 --- /dev/null +++ b/toolkit/source/awt/stylesettings.hxx @@ -0,0 +1,188 @@ +/************************************************************************* + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef TOOLKIT_STYLESETTINGS_HXX +#define TOOLKIT_STYLESETTINGS_HXX + +/** === begin UNO includes === **/ +#include +/** === end UNO includes === **/ + +#include + +#include + +namespace vos +{ + class IMutex; +} +namespace osl +{ + class Mutex; +} + +class VCLXWindow; + +//...................................................................................................................... +namespace toolkit +{ +//...................................................................................................................... + + //================================================================================================================== + //= WindowStyleSettings + //================================================================================================================== + struct WindowStyleSettings_Data; + typedef ::cppu::WeakImplHelper1 < ::com::sun::star::awt::XStyleSettings + > WindowStyleSettings_Base; + class WindowStyleSettings : public WindowStyleSettings_Base + { + public: + WindowStyleSettings( ::vos::IMutex& i_rWindowMutex, ::osl::Mutex& i_rListenerMutex, VCLXWindow& i_rOwningWindow ); + ~WindowStyleSettings(); + + void dispose(); + + // XStyleSettings + virtual ::sal_Int32 SAL_CALL getActiveBorderColor() throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setActiveBorderColor( ::sal_Int32 _activebordercolor ) throw (::com::sun::star::uno::RuntimeException); + virtual ::sal_Int32 SAL_CALL getActiveColor() throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setActiveColor( ::sal_Int32 _activecolor ) throw (::com::sun::star::uno::RuntimeException); + virtual ::sal_Int32 SAL_CALL getActiveTabColor() throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setActiveTabColor( ::sal_Int32 _activetabcolor ) throw (::com::sun::star::uno::RuntimeException); + virtual ::sal_Int32 SAL_CALL getActiveTextColor() throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setActiveTextColor( ::sal_Int32 _activetextcolor ) throw (::com::sun::star::uno::RuntimeException); + virtual ::sal_Int32 SAL_CALL getButtonRolloverTextColor() throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setButtonRolloverTextColor( ::sal_Int32 _buttonrollovertextcolor ) throw (::com::sun::star::uno::RuntimeException); + virtual ::sal_Int32 SAL_CALL getButtonTextColor() throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setButtonTextColor( ::sal_Int32 _buttontextcolor ) throw (::com::sun::star::uno::RuntimeException); + virtual ::sal_Int32 SAL_CALL getCheckedColor() throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setCheckedColor( ::sal_Int32 _checkedcolor ) throw (::com::sun::star::uno::RuntimeException); + virtual ::sal_Int32 SAL_CALL getDarkShadowColor() throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setDarkShadowColor( ::sal_Int32 _darkshadowcolor ) throw (::com::sun::star::uno::RuntimeException); + virtual ::sal_Int32 SAL_CALL getDeactiveBorderColor() throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setDeactiveBorderColor( ::sal_Int32 _deactivebordercolor ) throw (::com::sun::star::uno::RuntimeException); + virtual ::sal_Int32 SAL_CALL getDeactiveColor() throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setDeactiveColor( ::sal_Int32 _deactivecolor ) throw (::com::sun::star::uno::RuntimeException); + virtual ::sal_Int32 SAL_CALL getDeactiveTextColor() throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setDeactiveTextColor( ::sal_Int32 _deactivetextcolor ) throw (::com::sun::star::uno::RuntimeException); + virtual ::sal_Int32 SAL_CALL getDialogColor() throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setDialogColor( ::sal_Int32 _dialogcolor ) throw (::com::sun::star::uno::RuntimeException); + virtual ::sal_Int32 SAL_CALL getDialogTextColor() throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setDialogTextColor( ::sal_Int32 _dialogtextcolor ) throw (::com::sun::star::uno::RuntimeException); + virtual ::sal_Int32 SAL_CALL getDisableColor() throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setDisableColor( ::sal_Int32 _disablecolor ) throw (::com::sun::star::uno::RuntimeException); + virtual ::sal_Int32 SAL_CALL getFaceColor() throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setFaceColor( ::sal_Int32 _facecolor ) throw (::com::sun::star::uno::RuntimeException); + virtual ::sal_Int32 SAL_CALL getFaceGradientColor() throw (::com::sun::star::uno::RuntimeException); + virtual ::sal_Int32 SAL_CALL getFieldColor() throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setFieldColor( ::sal_Int32 _fieldcolor ) throw (::com::sun::star::uno::RuntimeException); + virtual ::sal_Int32 SAL_CALL getFieldRolloverTextColor() throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setFieldRolloverTextColor( ::sal_Int32 _fieldrollovertextcolor ) throw (::com::sun::star::uno::RuntimeException); + virtual ::sal_Int32 SAL_CALL getFieldTextColor() throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setFieldTextColor( ::sal_Int32 _fieldtextcolor ) throw (::com::sun::star::uno::RuntimeException); + virtual ::sal_Int32 SAL_CALL getGroupTextColor() throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setGroupTextColor( ::sal_Int32 _grouptextcolor ) throw (::com::sun::star::uno::RuntimeException); + virtual ::sal_Int32 SAL_CALL getHelpColor() throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setHelpColor( ::sal_Int32 _helpcolor ) throw (::com::sun::star::uno::RuntimeException); + virtual ::sal_Int32 SAL_CALL getHelpTextColor() throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setHelpTextColor( ::sal_Int32 _helptextcolor ) throw (::com::sun::star::uno::RuntimeException); + virtual ::sal_Int32 SAL_CALL getHighlightColor() throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setHighlightColor( ::sal_Int32 _highlightcolor ) throw (::com::sun::star::uno::RuntimeException); + virtual ::sal_Int32 SAL_CALL getHighlightTextColor() throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setHighlightTextColor( ::sal_Int32 _highlighttextcolor ) throw (::com::sun::star::uno::RuntimeException); + virtual ::sal_Int32 SAL_CALL getInactiveTabColor() throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setInactiveTabColor( ::sal_Int32 _inactivetabcolor ) throw (::com::sun::star::uno::RuntimeException); + virtual ::sal_Int32 SAL_CALL getInfoTextColor() throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setInfoTextColor( ::sal_Int32 _infotextcolor ) throw (::com::sun::star::uno::RuntimeException); + virtual ::sal_Int32 SAL_CALL getLabelTextColor() throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setLabelTextColor( ::sal_Int32 _labeltextcolor ) throw (::com::sun::star::uno::RuntimeException); + virtual ::sal_Int32 SAL_CALL getLightColor() throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setLightColor( ::sal_Int32 _lightcolor ) throw (::com::sun::star::uno::RuntimeException); + virtual ::sal_Int32 SAL_CALL getMenuBarColor() throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setMenuBarColor( ::sal_Int32 _menubarcolor ) throw (::com::sun::star::uno::RuntimeException); + virtual ::sal_Int32 SAL_CALL getMenuBarTextColor() throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setMenuBarTextColor( ::sal_Int32 _menubartextcolor ) throw (::com::sun::star::uno::RuntimeException); + virtual ::sal_Int32 SAL_CALL getMenuBorderColor() throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setMenuBorderColor( ::sal_Int32 _menubordercolor ) throw (::com::sun::star::uno::RuntimeException); + virtual ::sal_Int32 SAL_CALL getMenuColor() throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setMenuColor( ::sal_Int32 _menucolor ) throw (::com::sun::star::uno::RuntimeException); + virtual ::sal_Int32 SAL_CALL getMenuHighlightColor() throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setMenuHighlightColor( ::sal_Int32 _menuhighlightcolor ) throw (::com::sun::star::uno::RuntimeException); + virtual ::sal_Int32 SAL_CALL getMenuHighlightTextColor() throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setMenuHighlightTextColor( ::sal_Int32 _menuhighlighttextcolor ) throw (::com::sun::star::uno::RuntimeException); + virtual ::sal_Int32 SAL_CALL getMenuTextColor() throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setMenuTextColor( ::sal_Int32 _menutextcolor ) throw (::com::sun::star::uno::RuntimeException); + virtual ::sal_Int32 SAL_CALL getMonoColor() throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setMonoColor( ::sal_Int32 _monocolor ) throw (::com::sun::star::uno::RuntimeException); + virtual ::sal_Int32 SAL_CALL getRadioCheckTextColor() throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setRadioCheckTextColor( ::sal_Int32 _radiochecktextcolor ) throw (::com::sun::star::uno::RuntimeException); + virtual ::sal_Int32 SAL_CALL getSeparatorColor() throw (::com::sun::star::uno::RuntimeException); + virtual ::sal_Int32 SAL_CALL getShadowColor() throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setShadowColor( ::sal_Int32 _shadowcolor ) throw (::com::sun::star::uno::RuntimeException); + virtual ::sal_Int32 SAL_CALL getWindowColor() throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setWindowColor( ::sal_Int32 _windowcolor ) throw (::com::sun::star::uno::RuntimeException); + virtual ::sal_Int32 SAL_CALL getWindowTextColor() throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setWindowTextColor( ::sal_Int32 _windowtextcolor ) throw (::com::sun::star::uno::RuntimeException); + virtual ::sal_Int32 SAL_CALL getWorkspaceColor() throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setWorkspaceColor( ::sal_Int32 _workspacecolor ) throw (::com::sun::star::uno::RuntimeException); + virtual ::sal_Bool SAL_CALL getHighContrastMode() throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setHighContrastMode( ::sal_Bool _highcontrastmode ) throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::awt::FontDescriptor SAL_CALL getApplicationFont() throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setApplicationFont( const ::com::sun::star::awt::FontDescriptor& _applicationfont ) throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::awt::FontDescriptor SAL_CALL getHelpFont() throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setHelpFont( const ::com::sun::star::awt::FontDescriptor& _helpfont ) throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::awt::FontDescriptor SAL_CALL getTitleFont() throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setTitleFont( const ::com::sun::star::awt::FontDescriptor& _titlefont ) throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::awt::FontDescriptor SAL_CALL getFloatTitleFont() throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setFloatTitleFont( const ::com::sun::star::awt::FontDescriptor& _floattitlefont ) throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::awt::FontDescriptor SAL_CALL getMenuFont() throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setMenuFont( const ::com::sun::star::awt::FontDescriptor& _menufont ) throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::awt::FontDescriptor SAL_CALL getToolFont() throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setToolFont( const ::com::sun::star::awt::FontDescriptor& _toolfont ) throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::awt::FontDescriptor SAL_CALL getGroupFont() throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setGroupFont( const ::com::sun::star::awt::FontDescriptor& _groupfont ) throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::awt::FontDescriptor SAL_CALL getLabelFont() throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setLabelFont( const ::com::sun::star::awt::FontDescriptor& _labelfont ) throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::awt::FontDescriptor SAL_CALL getInfoFont() throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setInfoFont( const ::com::sun::star::awt::FontDescriptor& _infofont ) throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::awt::FontDescriptor SAL_CALL getRadioCheckFont() throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setRadioCheckFont( const ::com::sun::star::awt::FontDescriptor& _radiocheckfont ) throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::awt::FontDescriptor SAL_CALL getPushButtonFont() throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setPushButtonFont( const ::com::sun::star::awt::FontDescriptor& _pushbuttonfont ) throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::awt::FontDescriptor SAL_CALL getFieldFont() throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setFieldFont( const ::com::sun::star::awt::FontDescriptor& _fieldfont ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL addStyleChangeListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XStyleChangeListener >& Listener ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeStyleChangeListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XStyleChangeListener >& Listener ) throw (::com::sun::star::uno::RuntimeException); + + private: + ::boost::scoped_ptr< WindowStyleSettings_Data > m_pData; + }; + +//...................................................................................................................... +} // namespace toolkit +//...................................................................................................................... + +#endif // TOOLKIT_STYLESETTINGS_HXX diff --git a/toolkit/source/awt/vclxwindow.cxx b/toolkit/source/awt/vclxwindow.cxx index dd4d56586b03..efc2c40c6baa 100644 --- a/toolkit/source/awt/vclxwindow.cxx +++ b/toolkit/source/awt/vclxwindow.cxx @@ -27,6 +27,7 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_toolkit.hxx" + #include #include #include @@ -41,6 +42,7 @@ #include #include #include +#include #include #include #include @@ -64,6 +66,7 @@ #include #include #include +#include "stylesettings.hxx" #include @@ -73,10 +76,13 @@ using namespace ::com::sun::star; using ::com::sun::star::uno::Reference; using ::com::sun::star::uno::UNO_QUERY; +using ::com::sun::star::uno::RuntimeException; using ::com::sun::star::lang::EventObject; using ::com::sun::star::awt::XWindowListener2; using ::com::sun::star::awt::XDockableWindowListener; using ::com::sun::star::awt::XDevice; +using ::com::sun::star::awt::XStyleSettings; +using ::com::sun::star::lang::DisposedException; using ::com::sun::star::style::VerticalAlignment; using ::com::sun::star::style::VerticalAlignment_TOP; using ::com::sun::star::style::VerticalAlignment_MIDDLE; @@ -164,6 +170,8 @@ public: mxAccessibleContext; ::com::sun::star::uno::Reference< ::com::sun::star::awt::XGraphics > mxViewGraphics; + ::com::sun::star::uno::Reference< ::com::sun::star::awt::XStyleSettings > + mxWindowStyleSettings; public: bool& getDrawingOntoParent_ref() { return mbDrawingOntoParent; } @@ -198,6 +206,8 @@ public: return maAccFactory; } + Reference< XStyleSettings > getStyleSettings(); + /** returns the container of registered XWindowListener2 listeners */ inline ::cppu::OInterfaceContainerHelper& getWindow2Listeners() { return maWindow2Listeners; } @@ -221,17 +231,6 @@ protected: private: DECL_LINK( OnProcessCallbacks, void* ); -private: -private: - /** determines whether the instance is already disposed - @precond - m_aMutex must be acquired - */ - inline bool impl_isDisposed() - { - return mbDisposed; - } - private: VCLXWindowImpl(); // never implemented VCLXWindowImpl( const VCLXWindowImpl& ); // never implemented @@ -298,6 +297,10 @@ void VCLXWindowImpl::disposing() maContainerListeners.disposeAndClear( aEvent ); maTopWindowListeners.disposeAndClear( aEvent ); + ::toolkit::WindowStyleSettings* pStyleSettings = static_cast< ::toolkit::WindowStyleSettings* >( mxWindowStyleSettings.get() ); + if ( pStyleSettings != NULL ) + pStyleSettings->dispose(); + mxWindowStyleSettings.clear(); } //-------------------------------------------------------------------- @@ -361,6 +364,17 @@ void SAL_CALL VCLXWindowImpl::release() mrAntiImpl.release(); } +//-------------------------------------------------------------------- +Reference< XStyleSettings > VCLXWindowImpl::getStyleSettings() +{ + ::vos::OGuard aGuard( mrMutex ); + if ( mbDisposed ) + throw DisposedException( ::rtl::OUString(), mrAntiImpl ); + if ( !mxWindowStyleSettings.is() ) + mxWindowStyleSettings = new ::toolkit::WindowStyleSettings( mrMutex, maListenerContainerMutex, mrAntiImpl ); + return mxWindowStyleSettings; +} + //==================================================================== //==================================================================== @@ -2651,3 +2665,8 @@ VCLXWindow::hasPropertyByName( const ::rtl::OUString& rName ) throw (::com::sun: { return GetPropHelper()->hasPropertyByName( rName ); } + +Reference< XStyleSettings > SAL_CALL VCLXWindow::getStyleSettings() throw (RuntimeException) +{ + return mpImpl->getStyleSettings(); +} diff --git a/toolkit/source/controls/unocontrol.cxx b/toolkit/source/controls/unocontrol.cxx index 9254819f0b42..eb45dd521d9a 100644 --- a/toolkit/source/controls/unocontrol.cxx +++ b/toolkit/source/controls/unocontrol.cxx @@ -1587,3 +1587,15 @@ awt::Size SAL_CALL UnoControl::convertSizeToPixel( const awt::Size& i_Size, ::sa return awt::Size( ); } +//---------------------------------------------------------------------------------------------------------------------- +uno::Reference< awt::XStyleSettings > SAL_CALL UnoControl::getStyleSettings() throw (RuntimeException) +{ + Reference< awt::XStyleSettingsSupplier > xPeerSupplier; + { + ::osl::MutexGuard aGuard( GetMutex() ); + xPeerSupplier = xPeerSupplier.query( getPeer() ); + } + if ( xPeerSupplier.is() ) + return xPeerSupplier->getStyleSettings(); + return NULL; +} -- cgit v1.2.3 From 012f5686a3fe76a8262f0849f9d2ed11335f20ba Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Fri, 25 Jun 2010 16:35:28 +0200 Subject: unoawt2: #i10000# removed unused local variable --- toolkit/source/awt/vclxwindows.cxx | 1 - 1 file changed, 1 deletion(-) diff --git a/toolkit/source/awt/vclxwindows.cxx b/toolkit/source/awt/vclxwindows.cxx index 625ae4e4616b..4a68b4c80e3f 100644 --- a/toolkit/source/awt/vclxwindows.cxx +++ b/toolkit/source/awt/vclxwindows.cxx @@ -2166,7 +2166,6 @@ void SAL_CALL VCLXListBox::itemListChanged( const EventObject& i_rEvent ) throw uno::Reference< beans::XPropertySet > xPropSet( i_rEvent.Source, uno::UNO_QUERY_THROW ); uno::Reference< beans::XPropertySetInfo > xPSI( xPropSet->getPropertySetInfo(), uno::UNO_QUERY_THROW ); - bool localize = xPSI->hasPropertyByName( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ResourceResolver" ) ) ); uno::Reference< resource::XStringResourceResolver > xStringResourceResolver; if ( xPSI->hasPropertyByName( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ResourceResolver" ) ) ) ) { -- cgit v1.2.3 From 676e5ebe14184c3953a700522f315e95cea45c05 Mon Sep 17 00:00:00 2001 From: Malte Timmermann Date: Mon, 28 Jun 2010 15:58:56 +0200 Subject: codecleanup02: #i112685# Removed ifdefs and code for DOS --- rsc/source/tools/rsctools.cxx | 2 +- tools/inc/tools/pstm.hxx | 8 +------- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/rsc/source/tools/rsctools.cxx b/rsc/source/tools/rsctools.cxx index a8f17b7f8137..93ecff2afe43 100644 --- a/rsc/source/tools/rsctools.cxx +++ b/rsc/source/tools/rsctools.cxx @@ -32,7 +32,7 @@ // C and C++ Includes. #include #include -#if defined ( DOS ) || defined (WNT ) +#if defined (WNT ) #include #endif #if defined ( OS2 ) && !defined ( GCC ) diff --git a/tools/inc/tools/pstm.hxx b/tools/inc/tools/pstm.hxx index 8c0e0ea924aa..2575ccae8f3e 100644 --- a/tools/inc/tools/pstm.hxx +++ b/tools/inc/tools/pstm.hxx @@ -60,13 +60,7 @@ public: }; /************************** S v R t t i B a s e **************************/ -/* -#if defined (DOS) && defined (STC) -class SvRttiBase : public SvRefBase -#else -class SvRttiBase : virtual public SvRefBase -#endif -*/ + class TOOLS_DLLPUBLIC SvRttiBase : public SvRefBase { public: -- cgit v1.2.3 From 722441b99292269a42db1c0de6bce9351e8de933 Mon Sep 17 00:00:00 2001 From: "Ocke Janssen [oj]" Date: Mon, 28 Jun 2010 16:40:40 +0200 Subject: unoawt2: add missing TOOLKIT_DLLPUBLIC to access classes --- toolkit/inc/toolkit/controls/unocontrolbase.hxx | 2 +- toolkit/inc/toolkit/controls/unocontrolmodel.hxx | 2 +- toolkit/inc/toolkit/controls/unocontrols.hxx | 7 +++++-- toolkit/inc/toolkit/helper/listenermultiplexer.hxx | 2 +- toolkit/inc/toolkit/helper/property.hxx | 2 +- toolkit/inc/toolkit/helper/unopropertyarrayhelper.hxx | 3 ++- toolkit/prj/d.lst | 1 + toolkit/source/controls/unocontrols.cxx | 13 +++++++++++-- 8 files changed, 23 insertions(+), 9 deletions(-) diff --git a/toolkit/inc/toolkit/controls/unocontrolbase.hxx b/toolkit/inc/toolkit/controls/unocontrolbase.hxx index 60dcc040e0e7..f12dd23a5c67 100644 --- a/toolkit/inc/toolkit/controls/unocontrolbase.hxx +++ b/toolkit/inc/toolkit/controls/unocontrolbase.hxx @@ -36,7 +36,7 @@ // class UnoControlBase // ---------------------------------------------------- -class UnoControlBase : public UnoControl +class TOOLKIT_DLLPUBLIC UnoControlBase : public UnoControl { protected: sal_Bool ImplHasProperty( sal_uInt16 nProp ); diff --git a/toolkit/inc/toolkit/controls/unocontrolmodel.hxx b/toolkit/inc/toolkit/controls/unocontrolmodel.hxx index a443cb4d2d6b..5ac3c33aa1c9 100644 --- a/toolkit/inc/toolkit/controls/unocontrolmodel.hxx +++ b/toolkit/inc/toolkit/controls/unocontrolmodel.hxx @@ -53,7 +53,7 @@ class ImplPropertyTable; // class UnoControlModel // ---------------------------------------------------- -class UnoControlModel : public ::com::sun::star::awt::XControlModel, +class TOOLKIT_DLLPUBLIC UnoControlModel : public ::com::sun::star::awt::XControlModel, public ::com::sun::star::beans::XPropertyState, public ::com::sun::star::io::XPersistObject, public ::com::sun::star::lang::XComponent, diff --git a/toolkit/inc/toolkit/controls/unocontrols.hxx b/toolkit/inc/toolkit/controls/unocontrols.hxx index a0d34b0f8741..6223e47a6871 100644 --- a/toolkit/inc/toolkit/controls/unocontrols.hxx +++ b/toolkit/inc/toolkit/controls/unocontrols.hxx @@ -725,11 +725,12 @@ struct UnoControlListBoxModel_Data; typedef ::cppu::AggImplInheritanceHelper1 < UnoControlModel , ::com::sun::star::awt::XItemList > UnoControlListBoxModel_Base; -class UnoControlListBoxModel :public UnoControlListBoxModel_Base +class TOOLKIT_DLLPUBLIC UnoControlListBoxModel :public UnoControlListBoxModel_Base { public: UnoControlListBoxModel(); UnoControlListBoxModel( const UnoControlListBoxModel& i_rSource ); + ~UnoControlListBoxModel(); UnoControlModel* Clone() const { return new UnoControlListBoxModel( *this ); } @@ -820,7 +821,7 @@ typedef ::cppu::AggImplInheritanceHelper5 < UnoControlBase , ::com::sun::star::awt::XTextLayoutConstrains , ::com::sun::star::awt::XItemListListener > UnoListBoxControl_Base; -class UnoListBoxControl : public UnoListBoxControl_Base +class TOOLKIT_DLLPUBLIC UnoListBoxControl : public UnoListBoxControl_Base { public: UnoListBoxControl(); @@ -884,6 +885,8 @@ protected: virtual void ImplSetPeerProperty( const ::rtl::OUString& rPropName, const ::com::sun::star::uno::Any& rVal ); virtual void updateFromModel(); + ActionListenerMultiplexer& getActionListeners(); + ItemListenerMultiplexer& getItemListeners(); private: ActionListenerMultiplexer maActionListeners; ItemListenerMultiplexer maItemListeners; diff --git a/toolkit/inc/toolkit/helper/listenermultiplexer.hxx b/toolkit/inc/toolkit/helper/listenermultiplexer.hxx index b9fb82c3d4bb..b4151fe0f35e 100644 --- a/toolkit/inc/toolkit/helper/listenermultiplexer.hxx +++ b/toolkit/inc/toolkit/helper/listenermultiplexer.hxx @@ -171,7 +171,7 @@ DECL_LISTENERMULTIPLEXER_END // ---------------------------------------------------- // class ActionListenerMultiplexer // ---------------------------------------------------- -DECL_LISTENERMULTIPLEXER_START( ActionListenerMultiplexer, ::com::sun::star::awt::XActionListener ) +DECL_LISTENERMULTIPLEXER_START_DLLPUB( ActionListenerMultiplexer, ::com::sun::star::awt::XActionListener ) void SAL_CALL actionPerformed( const ::com::sun::star::awt::ActionEvent& rEvent ) throw(::com::sun::star::uno::RuntimeException); DECL_LISTENERMULTIPLEXER_END diff --git a/toolkit/inc/toolkit/helper/property.hxx b/toolkit/inc/toolkit/helper/property.hxx index f8a1a703799c..837d283f4e8c 100644 --- a/toolkit/inc/toolkit/helper/property.hxx +++ b/toolkit/inc/toolkit/helper/property.hxx @@ -234,7 +234,7 @@ namespace rtl { TOOLKIT_DLLPUBLIC sal_uInt16 GetPropertyId( const ::rtl::OUString& rPropertyName ); const ::com::sun::star::uno::Type* GetPropertyType( sal_uInt16 nPropertyId ); -const ::rtl::OUString& GetPropertyName( sal_uInt16 nPropertyId ); +TOOLKIT_DLLPUBLIC const ::rtl::OUString& GetPropertyName( sal_uInt16 nPropertyId ); sal_Int16 GetPropertyAttribs( sal_uInt16 nPropertyId ); sal_uInt16 GetPropertyOrderNr( sal_uInt16 nPropertyId ); sal_Bool DoesDependOnOthers( sal_uInt16 nPropertyId ); diff --git a/toolkit/inc/toolkit/helper/unopropertyarrayhelper.hxx b/toolkit/inc/toolkit/helper/unopropertyarrayhelper.hxx index 2a42d05b72fd..77ba068943f1 100644 --- a/toolkit/inc/toolkit/helper/unopropertyarrayhelper.hxx +++ b/toolkit/inc/toolkit/helper/unopropertyarrayhelper.hxx @@ -33,11 +33,12 @@ #include #include +#include "toolkit/dllapi.h" // ---------------------------------------------------- // class UnoPropertyArrayHelper // ---------------------------------------------------- -class UnoPropertyArrayHelper : public ::cppu::IPropertyArrayHelper +class TOOLKIT_DLLPUBLIC UnoPropertyArrayHelper : public ::cppu::IPropertyArrayHelper { private: Table maIDs; diff --git a/toolkit/prj/d.lst b/toolkit/prj/d.lst index 0c62a083b330..fc6acef85b76 100644 --- a/toolkit/prj/d.lst +++ b/toolkit/prj/d.lst @@ -47,6 +47,7 @@ mkdir: %_DEST%\inc%_EXT%\toolkit\controls ..\inc\toolkit\helper\formpdfexport.hxx %_DEST%\inc%_EXT%\toolkit\helper/formpdfexport.hxx ..\inc\toolkit\helper\accessiblefactory.hxx %_DEST%\inc%_EXT%\toolkit\helper\accessiblefactory.hxx ..\inc\toolkit\helper\fixedhyperbase.hxx %_DEST%\inc%_EXT%\toolkit\helper\fixedhyperbase.hxx +..\inc\toolkit\helper\unopropertyarrayhelper.hxx %_DEST%\inc%_EXT%\toolkit\helper\unopropertyarrayhelper.hxx ..\inc\toolkit\helper\vclunohelper.hxx %_DEST%\inc%_EXT%\toolkit\unohlp.hxx ..\inc\toolkit\dllapi.h %_DEST%\inc%_EXT%\toolkit\dllapi.h diff --git a/toolkit/source/controls/unocontrols.cxx b/toolkit/source/controls/unocontrols.cxx index 92a8a21a6c08..6599b039600f 100644 --- a/toolkit/source/controls/unocontrols.cxx +++ b/toolkit/source/controls/unocontrols.cxx @@ -1834,7 +1834,9 @@ UnoControlListBoxModel::UnoControlListBoxModel( const UnoControlListBoxModel& i_ ,m_aItemListListeners( GetMutex() ) { } - +UnoControlListBoxModel::~UnoControlListBoxModel() +{ +} // --------------------------------------------------------------------------------------------------------------------- ::rtl::OUString UnoControlListBoxModel::getServiceName() throw(::com::sun::star::uno::RuntimeException) { @@ -2674,7 +2676,14 @@ void SAL_CALL UnoListBoxControl::itemListChanged( const lang::EventObject& i_rEv if ( xPeerListener.is() ) xPeerListener->itemListChanged( i_rEvent ); } - +ActionListenerMultiplexer& UnoListBoxControl::getActionListeners() +{ + return maActionListeners; +} +ItemListenerMultiplexer& UnoListBoxControl::getItemListeners() +{ + return maItemListeners; +} // ---------------------------------------------------- // class UnoControlComboBoxModel // ---------------------------------------------------- -- cgit v1.2.3 From 9b8213e2fadbc3c59f7e445098ae38cf266119cc Mon Sep 17 00:00:00 2001 From: Keith Stribley Date: Tue, 29 Jun 2010 14:14:34 +0630 Subject: graphite03: #i112730# updated graphite patch and improvements to glyph metric caching --- vcl/inc/vcl/graphite_adaptors.hxx | 4 +- vcl/inc/vcl/graphite_cache.hxx | 34 +++++++++++++---- vcl/inc/vcl/graphite_layout.hxx | 15 +++++++- vcl/source/glyphs/graphite_adaptors.cxx | 56 ++++++++++++++++----------- vcl/source/glyphs/graphite_cache.cxx | 2 +- vcl/source/glyphs/graphite_layout.cxx | 67 +++++++++++++++++++++++---------- vcl/source/glyphs/graphite_textsrc.hxx | 1 + vcl/win/source/gdi/winlayout.cxx | 2 +- 8 files changed, 127 insertions(+), 54 deletions(-) mode change 100644 => 100755 vcl/win/source/gdi/winlayout.cxx diff --git a/vcl/inc/vcl/graphite_adaptors.hxx b/vcl/inc/vcl/graphite_adaptors.hxx index 43c2e37a5fb2..e58881c9f463 100644 --- a/vcl/inc/vcl/graphite_adaptors.hxx +++ b/vcl/inc/vcl/graphite_adaptors.hxx @@ -86,8 +86,8 @@ namespace grutils // class VCL_DLLPUBLIC GraphiteFontAdaptor : public gr::Font { -typedef std::map > GlyphMetricMap; - + typedef std::map > GlyphMetricMap; + friend class GrFontHasher; public: static bool IsGraphiteEnabledFont(ServerFont &) throw(); diff --git a/vcl/inc/vcl/graphite_cache.hxx b/vcl/inc/vcl/graphite_cache.hxx index 5472b32dd62f..af1392ed4d4b 100644 --- a/vcl/inc/vcl/graphite_cache.hxx +++ b/vcl/inc/vcl/graphite_cache.hxx @@ -105,15 +105,16 @@ typedef std::pair GrRMEntr */ class GraphiteSegmentCache { +public: enum { // not really sure what good values are here, // bucket size should be >> cache size - SEG_BUCKET_SIZE = 4096, - SEG_CACHE_SIZE = 255 + SEG_BUCKET_FACTOR = 4, + SEG_DEFAULT_CACHE_SIZE = 2047 }; -public: - GraphiteSegmentCache() - : m_segMap(SEG_BUCKET_SIZE), + GraphiteSegmentCache(sal_uInt32 nSegCacheSize) + : m_segMap(nSegCacheSize * SEG_BUCKET_FACTOR), + m_nSegCacheSize(nSegCacheSize), m_oldestKey(NULL) {}; ~GraphiteSegmentCache() { @@ -224,6 +225,7 @@ public: private: GraphiteSegMap m_segMap; GraphiteRopeMap m_ropeMap; + sal_uInt32 m_nSegCacheSize; const xub_Unicode * m_oldestKey; const xub_Unicode * m_prevKey; }; @@ -236,7 +238,24 @@ typedef std::hash_map > GraphiteCach class GraphiteCacheHandler { public: - GraphiteCacheHandler() : m_cacheMap(255) {}; + GraphiteCacheHandler() : m_cacheMap(255) + { + const char * pEnvCache = getenv( "SAL_GRAPHITE_CACHE_SIZE" ); + if (pEnvCache != NULL) + { + int envCacheSize = atoi(pEnvCache); + if (envCacheSize <= 0) + m_nSegCacheSize = GraphiteSegmentCache::SEG_DEFAULT_CACHE_SIZE; + else + { + m_nSegCacheSize = envCacheSize; + } + } + else + { + m_nSegCacheSize = GraphiteSegmentCache::SEG_DEFAULT_CACHE_SIZE; + } + }; ~GraphiteCacheHandler() { GraphiteCacheMap::iterator i = m_cacheMap.begin(); @@ -257,12 +276,13 @@ public: { return m_cacheMap.find(fontHash)->second; } - GraphiteSegmentCache *pCache = new GraphiteSegmentCache(); + GraphiteSegmentCache *pCache = new GraphiteSegmentCache(m_nSegCacheSize); m_cacheMap[fontHash] = pCache; return pCache; } private: GraphiteCacheMap m_cacheMap; + sal_uInt32 m_nSegCacheSize; }; #endif diff --git a/vcl/inc/vcl/graphite_layout.hxx b/vcl/inc/vcl/graphite_layout.hxx index 520f4620cd90..765a154a9898 100644 --- a/vcl/inc/vcl/graphite_layout.hxx +++ b/vcl/inc/vcl/graphite_layout.hxx @@ -65,6 +65,19 @@ class GraphiteFontAdaptor; class GrSegRecord; // SAL/VCL types class ServerFont; + +#ifdef WNT +// The GraphiteWinFont is just a wrapper to enable GrFontHasher to be a friend +// so that UniqueCacheInfo can be called. +#include +class GraphiteWinFont : public gr::WinFont +{ + friend class GrFontHasher; +public: + GraphiteWinFont(HDC hdc) : gr::WinFont(hdc) {}; + virtual ~GraphiteWinFont() {}; +}; +#endif // Graphite types namespace gr { class Segment; class GlyphIterator; } namespace grutils { class GrFeatureParser; } @@ -98,7 +111,7 @@ public: iterator_pair_t neighbour_clusters(const_iterator) const; private: std::pair appendCluster(gr::Segment & rSeg, ImplLayoutArgs & rArgs, - bool bRtl, int nFirstCharInCluster, int nNextChar, + bool bRtl, float fSegmentAdvance, int nFirstCharInCluster, int nNextChar, int nFirstGlyphInCluster, int nNextGlyph, float fScaling, std::vector & rChar2Base, std::vector & rGlyph2Char, std::vector & rCharDxs, long & rDXOffset); diff --git a/vcl/source/glyphs/graphite_adaptors.cxx b/vcl/source/glyphs/graphite_adaptors.cxx index f66f5b48e39e..f82e3afe39c8 100644 --- a/vcl/source/glyphs/graphite_adaptors.cxx +++ b/vcl/source/glyphs/graphite_adaptors.cxx @@ -99,12 +99,18 @@ FontProperties::FontProperties(const FreetypeServerFont &font) throw() fItalic = false; } - // Get the font name. + // Get the font name, but prefix with file name hash in case + // there are 2 fonts on the system with the same face name + sal_Int32 nHashCode = font.GetFontFileName()->hashCode(); + ::rtl::OUStringBuffer nHashFaceName; + nHashFaceName.append(nHashCode, 16); const sal_Unicode * name = font.GetFontSelData().maName.GetBuffer(); - const size_t name_sz = std::min(sizeof szFaceName/sizeof(wchar_t)-1, - size_t(font.GetFontSelData().maName.Len())); + nHashFaceName.append(name); - std::copy(name, name + name_sz, szFaceName); + const size_t name_sz = std::min(sizeof szFaceName/sizeof(wchar_t)-1, + static_cast(nHashFaceName.getLength())); + + std::copy(nHashFaceName.getStr(), nHashFaceName.getStr() + name_sz, szFaceName); szFaceName[name_sz] = '\0'; } @@ -120,13 +126,13 @@ GraphiteFontAdaptor::GraphiteFontAdaptor(ServerFont & sfont, const sal_Int32 dpi mfEmUnits(static_cast(sfont).GetMetricsFT().y_ppem), mpFeatures(NULL) { - //std::wstring face_name(maFontProperties.szFaceName); const rtl::OString aLang = MsLangId::convertLanguageToIsoByteString( sfont.GetFontSelData().meLanguage ); -#ifdef DEBUG - printf("GraphiteFontAdaptor %lx\n", (long)this); -#endif rtl::OString name = rtl::OUStringToOString( sfont.GetFontSelData().maTargetName, RTL_TEXTENCODING_UTF8 ); +#ifdef DEBUG + printf("GraphiteFontAdaptor %lx %s italic=%u bold=%u\n", (long)this, name.getStr(), + maFontProperties.fItalic, maFontProperties.fBold); +#endif sal_Int32 nFeat = name.indexOf(grutils::GrFeatureParser::FEAT_PREFIX) + 1; if (nFeat > 0) { @@ -259,21 +265,24 @@ const void * GraphiteFontAdaptor::getTable(gr::fontTableId32 table_id, size_t * // Return the glyph's metrics in pixels. void GraphiteFontAdaptor::getGlyphMetrics(gr::gid16 nGlyphId, gr::Rect & aBounding, gr::Point & advances) { - // Graphite gets really confused if the glyphs have been transformed, so - // if orientation has been set we can't use the font's glyph cache - // unfortunately the font selection data, doesn't always have the orientation - // set, even if it was when the glyphs were cached, so we use our own cache. - -// const GlyphMetric & metric = mrFont.GetGlyphMetric(nGlyphId); -// -// aBounding.right = aBounding.left = metric.GetOffset().X(); -// aBounding.bottom = aBounding.top = -metric.GetOffset().Y(); -// aBounding.right += metric.GetSize().Width(); -// aBounding.bottom -= metric.GetSize().Height(); -// -// advances.x = metric.GetDelta().X(); -// advances.y = -metric.GetDelta().Y(); - + // There used to be problems when orientation was set however, this no + // longer seems to be the case and the Glyph Metric cache in + // FreetypeServerFont is more efficient since it lasts between calls to VCL +#if 1 + const GlyphMetric & metric = mrFont.GetGlyphMetric(nGlyphId); + + aBounding.right = aBounding.left = metric.GetOffset().X(); + aBounding.bottom = aBounding.top = -metric.GetOffset().Y(); + aBounding.right += metric.GetSize().Width(); + aBounding.bottom -= metric.GetSize().Height(); + + advances.x = metric.GetDelta().X(); + advances.y = -metric.GetDelta().Y(); + +#else + // The problem with the code below is that the cache only lasts + // as long as the life time of the GraphiteFontAdaptor, which + // is created once per call to X11SalGraphics::GetTextLayout GlyphMetricMap::const_iterator gm_itr = maGlyphMetricMap.find(nGlyphId); if (gm_itr != maGlyphMetricMap.end()) { @@ -321,6 +330,7 @@ void GraphiteFontAdaptor::getGlyphMetrics(gr::gid16 nGlyphId, gr::Rect & aBoundi // Now add an entry to our metrics map. maGlyphMetricMap[nGlyphId] = std::make_pair(aBounding, advances); } +#endif } #endif diff --git a/vcl/source/glyphs/graphite_cache.cxx b/vcl/source/glyphs/graphite_cache.cxx index 64bbb0a38d60..389accd631f0 100644 --- a/vcl/source/glyphs/graphite_cache.cxx +++ b/vcl/source/glyphs/graphite_cache.cxx @@ -105,7 +105,7 @@ GrSegRecord * GraphiteSegmentCache::cacheSegment(TextSourceAdaptor * adapter, gr // when the next key is added, the record for the prevKey's m_nextKey field // is updated to the newest key so that m_oldestKey can be updated to the // next oldest key when the record for m_oldestKey is deleted - if (m_segMap.size() > SEG_CACHE_SIZE) + if (m_segMap.size() > m_nSegCacheSize) { GraphiteSegMap::iterator oldestPair = m_segMap.find(reinterpret_cast(m_oldestKey)); // oldest record may no longer exist if a buffer was changed diff --git a/vcl/source/glyphs/graphite_layout.cxx b/vcl/source/glyphs/graphite_layout.cxx index ff2fd8f306b1..ae7ec8246e33 100644 --- a/vcl/source/glyphs/graphite_layout.cxx +++ b/vcl/source/glyphs/graphite_layout.cxx @@ -56,6 +56,10 @@ #include #endif +#ifdef UNX +#include +#endif + #include #include @@ -175,7 +179,8 @@ GraphiteLayout::Glyphs::fill_from(gr::Segment & rSegment, ImplLayoutArgs &rArgs, glyph_range_t iGlyphs = rSegment.glyphs(); int nGlyphs = iGlyphs.second - iGlyphs.first; gr::GlyphIterator prevBase = iGlyphs.second; - float fMinX = rSegment.advanceWidth(); + float fSegmentAdvance = rSegment.advanceWidth(); + float fMinX = fSegmentAdvance; float fMaxX = 0.0f; rGlyph2Char.assign(nGlyphs, -1); long nDxOffset = 0; @@ -222,7 +227,8 @@ GraphiteLayout::Glyphs::fill_from(gr::Segment & rSegment, ImplLayoutArgs &rArgs, nFirstGlyphInCluster != nGlyphIndex) { std::pair aBounds = - appendCluster(rSegment, rArgs, bRtl, nFirstCharInCluster, + appendCluster(rSegment, rArgs, bRtl, + fSegmentAdvance, nFirstCharInCluster, nNextChar, nFirstGlyphInCluster, nGlyphIndex, fScaling, rChar2Base, rGlyph2Char, rCharDxs, nDxOffset); fMinX = std::min(aBounds.first, fMinX); @@ -285,7 +291,8 @@ GraphiteLayout::Glyphs::fill_from(gr::Segment & rSegment, ImplLayoutArgs &rArgs, nFirstGlyphInCluster != nGlyphIndex) { std::pair aBounds = - appendCluster(rSegment, rArgs, bRtl, nFirstCharInCluster, nNextChar, + appendCluster(rSegment, rArgs, bRtl, fSegmentAdvance, + nFirstCharInCluster, nNextChar, nFirstGlyphInCluster, nGlyphIndex, fScaling, rChar2Base, rGlyph2Char, rCharDxs, nDxOffset); fMinX = std::min(aBounds.first, fMinX); @@ -334,11 +341,11 @@ GraphiteLayout::Glyphs::fill_from(gr::Segment & rSegment, ImplLayoutArgs &rArgs, } } -std::pair GraphiteLayout::Glyphs::appendCluster(gr::Segment & rSeg, - ImplLayoutArgs & rArgs, bool bRtl, int nFirstCharInCluster, int nNextChar, - int nFirstGlyphInCluster, int nNextGlyph, float fScaling, - std::vector & rChar2Base, std::vector & rGlyph2Char, - std::vector & rCharDxs, long & rDXOffset) +std::pair GraphiteLayout::Glyphs::appendCluster(gr::Segment& rSeg, + ImplLayoutArgs & rArgs, bool bRtl,float fSegmentAdvance, + int nFirstCharInCluster, int nNextChar, int nFirstGlyphInCluster, + int nNextGlyph, float fScaling, std::vector & rChar2Base, + std::vector & rGlyph2Char, std::vector & rCharDxs, long & rDXOffset) { glyph_range_t iGlyphs = rSeg.glyphs(); int nGlyphs = iGlyphs.second - iGlyphs.first; @@ -402,9 +409,9 @@ std::pair GraphiteLayout::Glyphs::appendCluster(gr::Segment & rSeg, gr::GlyphInfo aGlyph = *(iGlyphs.first + j); if (j + nDelta >= nGlyphs || j + nDelta < 0) // at rhs ltr,rtl { - fNextOrigin = rSeg.advanceWidth(); - nNextOrigin = round(rSeg.advanceWidth() * fScaling + rDXOffset); - aBounds.second = std::max(rSeg.advanceWidth(), aBounds.second); + fNextOrigin = fSegmentAdvance; + nNextOrigin = round(fSegmentAdvance * fScaling + rDXOffset); + aBounds.second = std::max(fSegmentAdvance, aBounds.second); } else { @@ -546,7 +553,7 @@ GraphiteLayout::GraphiteLayout(const gr::Font & font, const grutils::GrFeaturePa // If true, it can cause end of line spaces to be hidden e.g. Doulos SIL maLayout.setStartOfLine(false); maLayout.setEndOfLine(false); -// maLayout.setDumbFallback(false); + maLayout.setDumbFallback(true); // trailing ws doesn't seem to always take affect if end of line is true maLayout.setTrailingWs(gr::ktwshAll); #ifdef GRLAYOUT_DEBUG @@ -598,6 +605,8 @@ bool GraphiteLayout::LayoutText(ImplLayoutArgs & rArgs) else delete pSegment; #else gr::Segment * pSegment = CreateSegment(rArgs); + if (!pSegment) + return false; bool success = LayoutGlyphs(rArgs, pSegment); delete pSegment; #endif @@ -649,7 +658,19 @@ public: #endif return hash; }; - +protected: + virtual void UniqueCacheInfo(std::wstring & stuFace, bool & fBold, bool & fItalic) + { +#ifdef WIN32 + dynamic_cast(mrRealFont).UniqueCacheInfo(stuFace, fBold, fItalic); +#else +#ifdef UNX + dynamic_cast(mrRealFont).UniqueCacheInfo(stuFace, fBold, fItalic); +#else +#error Unknown base type for gr::Font::UniqueCacheInfo +#endif +#endif + } private: gr::Font & mrRealFont; }; @@ -738,6 +759,14 @@ gr::Segment * GraphiteLayout::CreateSegment(ImplLayoutArgs& rArgs) } else { +#ifdef GRLAYOUT_DEBUG + fprintf(grLog(), "Gr::LayoutText failed: "); + for (int i = mnMinCharPos; i < limit; i++) + { + fprintf(grLog(), "%04x ", rArgs.mpStr[i]); + } + fprintf(grLog(), "\n"); +#endif clear(); return NULL; } @@ -897,7 +926,7 @@ long GraphiteLayout::FillDXArray( sal_Int32* pDXArray ) const if (i > 0) pDXArray[i] -= mvCharDxs[i-1]; } #ifdef GRLAYOUT_DEBUG - fprintf(grLog(),"%d,%d,%ld ", (int)i, (int)mvCharDxs[i], pDXArray[i]); + fprintf(grLog(),"%d,%d,%d ", (int)i, (int)mvCharDxs[i], pDXArray[i]); #endif } //std::adjacent_difference(mvCharDxs.begin(), mvCharDxs.end(), pDXArray); @@ -1020,7 +1049,7 @@ void GraphiteLayout::ApplyDXArray(ImplLayoutArgs &args, std::vector & rDelt #ifdef GRLAYOUT_DEBUG for (size_t iDx = 0; iDx < mvCharDxs.size(); iDx++) - fprintf(grLog(),"%d,%d,%ld ", (int)iDx, (int)mvCharDxs[iDx], args.mpDXArray[iDx]); + fprintf(grLog(),"%d,%d,%d ", (int)iDx, (int)mvCharDxs[iDx], args.mpDXArray[iDx]); fprintf(grLog(),"ApplyDx\n"); #endif bool bRtl = mnLayoutFlags & SAL_LAYOUT_BIDI_RTL; @@ -1090,7 +1119,7 @@ void GraphiteLayout::ApplyDXArray(ImplLayoutArgs &args, std::vector & rDelt } long nDWidth = nNewClusterWidth - nOrigClusterWidth; #ifdef GRLAYOUT_DEBUG - fprintf(grLog(), "c%d last glyph %d/%d\n", i, nLastGlyph, mvGlyphs.size()); + fprintf(grLog(), "c%lu last glyph %d/%lu\n", i, nLastGlyph, mvGlyphs.size()); #endif assert((nLastGlyph > -1) && (nLastGlyph < (signed)mvGlyphs.size())); mvGlyphs[nLastGlyph].mnNewWidth += nDWidth; @@ -1128,7 +1157,7 @@ void GraphiteLayout::ApplyDXArray(ImplLayoutArgs &args, std::vector & rDelt std::copy(args.mpDXArray, args.mpDXArray + nChars, mvCharDxs.begin() + (args.mnMinCharPos - mnMinCharPos)); #ifdef GRLAYOUT_DEBUG - fprintf(grLog(),"ApplyDx %ld(%ld)\n", args.mpDXArray[nChars - 1], mnWidth); + fprintf(grLog(),"ApplyDx %d(%ld)\n", args.mpDXArray[nChars - 1], mnWidth); #endif mnWidth = args.mpDXArray[nChars - 1]; } @@ -1170,7 +1199,7 @@ void GraphiteLayout::kashidaJustify(std::vector& rDeltaWidths, sal_GlyphId } nKashidaCount = 1 + (nGapWidth / nKashidaWidth); #ifdef GRLAYOUT_DEBUG - printf("inserting %d kashidas at %ld\n", nKashidaCount, (*i).mnGlyphIndex); + printf("inserting %d kashidas at %u\n", nKashidaCount, (*i).mnGlyphIndex); #endif GlyphItem glyphItem = *i; Point aPos(0, 0); @@ -1309,7 +1338,7 @@ void GraphiteLayout::GetCaretPositions( int nArraySize, sal_Int32* pCaretXArray pCaretXArray[i] = pCaretXArray[i+1] = 0; } #ifdef GRLAYOUT_DEBUG - fprintf(grLog(),"%d,%ld-%ld\t", nCharSlot, pCaretXArray[i], pCaretXArray[i+1]); + fprintf(grLog(),"%d,%d-%d\t", nCharSlot, pCaretXArray[i], pCaretXArray[i+1]); #endif } #ifdef GRLAYOUT_DEBUG diff --git a/vcl/source/glyphs/graphite_textsrc.hxx b/vcl/source/glyphs/graphite_textsrc.hxx index 2b9c705a5ea7..3912977cc9be 100644 --- a/vcl/source/glyphs/graphite_textsrc.hxx +++ b/vcl/source/glyphs/graphite_textsrc.hxx @@ -93,6 +93,7 @@ public: virtual ext_std::pair propertyRange(gr::toffset ich); virtual size_t getFontFeatures(gr::toffset ich, gr::FeatureSetting * prgfset); virtual bool sameSegment(gr::toffset ich1, gr::toffset ich2); + virtual bool featureVariations() { return false; } operator ImplLayoutArgs & () throw(); void setFeatures(const grutils::GrFeatureParser * pFeatures); diff --git a/vcl/win/source/gdi/winlayout.cxx b/vcl/win/source/gdi/winlayout.cxx old mode 100644 new mode 100755 index ba19f2255646..6f0c98279e7b --- a/vcl/win/source/gdi/winlayout.cxx +++ b/vcl/win/source/gdi/winlayout.cxx @@ -2821,7 +2821,7 @@ sal_GlyphId GraphiteLayoutWinImpl::getKashidaGlyph(int & rWidth) class GraphiteWinLayout : public WinLayout { private: - mutable gr::WinFont mpFont; + mutable GraphiteWinFont mpFont; grutils::GrFeatureParser * mpFeatures; mutable GraphiteLayoutWinImpl maImpl; public: -- cgit v1.2.3 From 234ac49e0de37d01f777ca9f270d13e1858e6b8a Mon Sep 17 00:00:00 2001 From: Malte Timmermann Date: Wed, 30 Jun 2010 09:48:27 +0200 Subject: codecleanup02: #i112685# Removed ifdefs and code for MAC --- svtools/inc/rtfout.hxx | 2 +- svtools/inc/svtools/htmlout.hxx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/svtools/inc/rtfout.hxx b/svtools/inc/rtfout.hxx index 12a125635132..b9bfbc901848 100644 --- a/svtools/inc/rtfout.hxx +++ b/svtools/inc/rtfout.hxx @@ -41,7 +41,7 @@ class SvStream; class SVT_DLLPUBLIC RTFOutFuncs { public: -#if defined(MAC) || defined(UNX) +#if defined(UNX) static const sal_Char sNewLine; // nur \012 oder \015 #else static const sal_Char __FAR_DATA sNewLine[]; // \015\012 diff --git a/svtools/inc/svtools/htmlout.hxx b/svtools/inc/svtools/htmlout.hxx index 888286b231ee..1a21f1154602 100644 --- a/svtools/inc/svtools/htmlout.hxx +++ b/svtools/inc/svtools/htmlout.hxx @@ -60,7 +60,7 @@ struct SVT_DLLPUBLIC HTMLOutContext struct HTMLOutFuncs { -#if defined(MAC) || defined(UNX) +#if defined(UNX) static const sal_Char sNewLine; // nur \012 oder \015 #else static const sal_Char __FAR_DATA sNewLine[]; // \015\012 -- cgit v1.2.3 From a2d01d963c8f6a13cd70a0678dfd6c40a217cdbc Mon Sep 17 00:00:00 2001 From: Malte Timmermann Date: Wed, 30 Jun 2010 09:58:24 +0200 Subject: codecleanup02: #i112685# Removed old stuff: SvSharedMemoryStream --- tools/source/stream/strmos2.cxx | 104 ---------------------------------------- 1 file changed, 104 deletions(-) diff --git a/tools/source/stream/strmos2.cxx b/tools/source/stream/strmos2.cxx index d211d7790b08..a35fc7731767 100644 --- a/tools/source/stream/strmos2.cxx +++ b/tools/source/stream/strmos2.cxx @@ -757,108 +757,4 @@ void SvFileStream::SetSize( ULONG nSize ) } } -#if 0 -/************************************************************************* -|* -|* SvSharedMemoryStream::AllocateMemory() -|* -|* Beschreibung STREAM.SDW -|* Ersterstellung CL 05.05.95 -|* Letzte Aenderung CL 05.05.95 -|* -*************************************************************************/ - -sal_Bool SvSharedMemoryStream::AllocateMemory( ULONG nNewSize ) -{ - DBG_ASSERT(aHandle==0,"Keine Handles unter OS/2"); - DBG_ASSERT(nNewSize,"Cannot allocate zero Bytes"); - APIRET nRet = DosAllocSharedMem( (void**)&pBuf, (PSZ)NULL, nNewSize, - PAG_READ | PAG_WRITE | PAG_COMMIT | - OBJ_GIVEABLE | OBJ_GETTABLE | OBJ_ANY); - return( nRet == 0 ); -} - -/************************************************************************* -|* -|* SvSharedMemoryStream::ReAllocateMemory() (Bozo-Algorithmus) -|* -|* Beschreibung STREAM.SDW -|* Ersterstellung CL 05.05.95 -|* Letzte Aenderung CL 05.05.95 -|* -*************************************************************************/ - -sal_Bool SvSharedMemoryStream::ReAllocateMemory( long nDiff ) -{ - DBG_ASSERT(aHandle==0,"Keine Handles unter OS/2"); - sal_Bool bRetVal = FALSE; - ULONG nNewSize = nSize + nDiff; - if( nNewSize ) - { - // neuen Speicher nicht ueber AllocateMemory holen, da wir den - // alten Speicher behalten wollen, falls nicht genuegend Platz - // fuer den neuen Block da ist - char* pNewBuf; - APIRET nRet = DosAllocSharedMem( (void**)&pNewBuf,(PSZ)NULL,nNewSize, - PAG_READ | PAG_WRITE | PAG_COMMIT | - OBJ_GIVEABLE | OBJ_GETTABLE | OBJ_ANY); - DBG_ASSERT(!nRet,"DosAllocSharedMem failed"); - - if( !nRet ) - { - bRetVal = TRUE; // Success! - if( nNewSize < nSize ) // Verkleinern ? - { - memcpy( pNewBuf, pBuf, (size_t)nNewSize ); - if( nPos > nNewSize ) - nPos = 0L; - if( nEndOfData >= nNewSize ) - nEndOfData = nNewSize-1L; - } - else - memcpy( pNewBuf, pBuf, (size_t)nSize ); - - FreeMemory(); // den alten Block loeschen ... - // und den neuen Block in Dienst stellen - pBuf = (sal_uInt8*)pNewBuf; - nSize = nNewSize; - } - } - else - { - bRetVal = TRUE; - FreeMemory(); - pBuf = 0; - nSize = 0; - nEndOfData = 0; - } - return bRetVal; -} - -void SvSharedMemoryStream::FreeMemory() -{ - DBG_ASSERT(aHandle==0,"Keine Handles unter OS/2"); - DosFreeMem( pBuf ); -} - -/************************************************************************* -|* -|* SvSharedMemoryStream::SetHandle() -|* -|* Beschreibung STREAM.SDW -|* Ersterstellung OV 05.10.95 -|* Letzte Aenderung OV 05.10.95 -|* -*************************************************************************/ - -void* SvSharedMemoryStream::SetHandle( void* aNewHandle, sal_Size nSize, - sal_Bool bOwnsData, sal_Size nEOF ) -{ - DBG_ERROR("OS/2 does not support memory handles"); - // return SetBuffer(aNewHandle, nSize, bOwnsData, nEOF ); - return 0; -} - - -#endif // 0 -- cgit v1.2.3 From 3ca32863fcb9b10ad24fdc00303f387f6dbe799b Mon Sep 17 00:00:00 2001 From: Malte Timmermann Date: Wed, 30 Jun 2010 10:01:39 +0200 Subject: codecleanup02: #i112685# Removed old stuff: NOOLDSTRING --- tools/inc/tools/solar.h | 1 - tools/inc/tools/string.hxx | 8 -------- 2 files changed, 9 deletions(-) diff --git a/tools/inc/tools/solar.h b/tools/inc/tools/solar.h index 0633ae6813bf..780de0a8d974 100644 --- a/tools/inc/tools/solar.h +++ b/tools/inc/tools/solar.h @@ -383,7 +383,6 @@ template inline T Abs(T a) { return (a>=0?a:-a); } // ----------------------------------------------------------------------- -#define NOOLDSTRING #ifndef NOREPLACESTRING #define UniString String #define XubString String diff --git a/tools/inc/tools/string.hxx b/tools/inc/tools/string.hxx index 8b86a1835596..1e438a1296b6 100644 --- a/tools/inc/tools/string.hxx +++ b/tools/inc/tools/string.hxx @@ -441,14 +441,6 @@ typedef struct _UniStringData #pragma pack() #endif -// ------------------- -// - UniString-Types - -// ------------------- - -#ifndef NOOLDSTRING -#define WSTRING_MAXLEN STRING_MAXLEN -#endif - // ------------- // - UniString - // ------------- -- cgit v1.2.3 From 9b0e62544b3ef60377c04943f211f4543f2c3a7c Mon Sep 17 00:00:00 2001 From: "Herbert Duerr [hdu]" Date: Wed, 30 Jun 2010 13:26:06 +0200 Subject: #i112365# ignore missing fc_local.conf files but complain about parse error in them --- vcl/unx/source/fontmanager/fontconfig.cxx | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/vcl/unx/source/fontmanager/fontconfig.cxx b/vcl/unx/source/fontmanager/fontconfig.cxx index 816c8fb0b4c4..69c5330977bd 100644 --- a/vcl/unx/source/fontmanager/fontconfig.cxx +++ b/vcl/unx/source/fontmanager/fontconfig.cxx @@ -854,19 +854,22 @@ bool PrintFontManager::addFontconfigDir( const rtl::OString& rDirName ) fprintf( stderr, "FcConfigAppFontAddDir( \"%s\") => %d\n", pDirName, bRet ); #endif - if( bDirOk ) + if( !bDirOk ) + return false; + + // load dir-specific fc-config file too if available + const rtl::OString aConfFileName = rDirName + "/fc_local.conf"; + FILE* pCfgFile = fopen( aConfFileName.getStr(), "rb" ); + if( pCfgFile ) { - const rtl::OString aConfFileName = rDirName + "/fc_local.conf"; + fclose( pCfgFile); bool bCfgOk = rWrapper.FcConfigParseAndLoad( rWrapper.FcConfigGetCurrent(), - (FcChar8*)aConfFileName.getStr(), FcTrue ); - (void)bCfgOk; // silence compiler warning - -#if OSL_DEBUG_LEVEL > 1 - fprintf( stderr, "FcConfigParseAndLoad( \"%s\") => %d\n", aConfFileName.getStr(), bCfgOk ); -#endif + (FcChar8*)aConfFileName.getStr(), FcTrue ); + if( !bCfgOk ) + fprintf( stderr, "FcConfigParseAndLoad( \"%s\") => %d\n", aConfFileName.getStr(), bCfgOk ); } - return bDirOk; + return true; } static void addtopattern(FontCfgWrapper& rWrapper, FcPattern *pPattern, -- cgit v1.2.3 From 2f0ca461c5116a6072abdb08f41bdaecd8cc87d9 Mon Sep 17 00:00:00 2001 From: "Herbert Duerr [hdu]" Date: Wed, 30 Jun 2010 14:34:40 +0200 Subject: #i112815# fix ImplFontCharmap::GetDefaultMap (thanks cmc) --- vcl/source/gdi/metric.cxx | 46 ++++++++++++++++++++++++++++++++-------------- 1 file changed, 32 insertions(+), 14 deletions(-) diff --git a/vcl/source/gdi/metric.cxx b/vcl/source/gdi/metric.cxx index e5f54df41c9e..b3c06e5ae561 100644 --- a/vcl/source/gdi/metric.cxx +++ b/vcl/source/gdi/metric.cxx @@ -263,7 +263,8 @@ ImplFontCharMap::ImplFontCharMap( const CmapResult& rCR ) } } -static ImplFontCharMap* pDefaultImplFontCharMap = NULL; +static ImplFontCharMap* pDefaultUnicodeImplFontCharMap = NULL; +static ImplFontCharMap* pDefaultSymbolImplFontCharMap = NULL; static const sal_uInt32 aDefaultUnicodeRanges[] = {0x0020,0xD800, 0xE000,0xFFF0}; static const sal_uInt32 aDefaultSymbolRanges[] = {0x0020,0x0100, 0xF020,0xF100}; @@ -288,25 +289,42 @@ ImplFontCharMap::~ImplFontCharMap() // ----------------------------------------------------------------------- -ImplFontCharMap* ImplFontCharMap::GetDefaultMap( bool bSymbols) +namespace { - if( pDefaultImplFontCharMap ) - pDefaultImplFontCharMap->AddReference(); - else + ImplFontCharMap *GetDefaultUnicodeMap() { - const sal_uInt32* pRangeCodes = aDefaultUnicodeRanges; - int nCodesCount = sizeof(aDefaultUnicodeRanges) / sizeof(*pRangeCodes); - if( bSymbols ) + if( pDefaultUnicodeImplFontCharMap ) + pDefaultUnicodeImplFontCharMap->AddReference(); + else { - pRangeCodes = aDefaultSymbolRanges; - nCodesCount = sizeof(aDefaultSymbolRanges) / sizeof(*pRangeCodes); + const sal_uInt32* pRangeCodes = aDefaultUnicodeRanges; + int nCodesCount = sizeof(aDefaultUnicodeRanges) / sizeof(*pRangeCodes); + CmapResult aDefaultCR( false, pRangeCodes, nCodesCount/2 ); + pDefaultUnicodeImplFontCharMap = new ImplFontCharMap( aDefaultCR ); } - CmapResult aDefaultCR( bSymbols, pRangeCodes, nCodesCount/2 ); - pDefaultImplFontCharMap = new ImplFontCharMap( aDefaultCR ); + return pDefaultUnicodeImplFontCharMap; } - return pDefaultImplFontCharMap; + ImplFontCharMap *GetDefaultSymbolMap() + { + if( pDefaultSymbolImplFontCharMap ) + pDefaultSymbolImplFontCharMap->AddReference(); + else + { + const sal_uInt32* pRangeCodes = aDefaultSymbolRanges; + int nCodesCount = sizeof(aDefaultSymbolRanges) / sizeof(*pRangeCodes); + CmapResult aDefaultCR( true, pRangeCodes, nCodesCount/2 ); + pDefaultSymbolImplFontCharMap = new ImplFontCharMap( aDefaultCR ); + } + + return pDefaultSymbolImplFontCharMap; + } +} + +ImplFontCharMap* ImplFontCharMap::GetDefaultMap( bool bSymbols) +{ + return bSymbols ? GetDefaultSymbolMap() : GetDefaultUnicodeMap(); } // ----------------------------------------------------------------------- @@ -321,7 +339,7 @@ void ImplFontCharMap::AddReference() void ImplFontCharMap::DeReference() { if( --mnRefCount <= 0 ) - if( this != pDefaultImplFontCharMap ) + if( (this != pDefaultUnicodeImplFontCharMap) && (this != pDefaultSymbolImplFontCharMap) ) delete this; } -- cgit v1.2.3 From 2b871bd0fc25abc760bd71577ee5e59df6d1b18e Mon Sep 17 00:00:00 2001 From: Malte Timmermann Date: Thu, 1 Jul 2010 09:10:38 +0200 Subject: codecleanup02: #i112685# Removed old stuff: #define SYSTEM_PLATFROMANDCOMPILER --- tools/inc/tools/solar.h | 36 ------------------------------------ 1 file changed, 36 deletions(-) diff --git a/tools/inc/tools/solar.h b/tools/inc/tools/solar.h index 780de0a8d974..cc7c189fbf84 100644 --- a/tools/inc/tools/solar.h +++ b/tools/inc/tools/solar.h @@ -275,42 +275,6 @@ template inline T Abs(T a) { return (a>=0?a:-a); } /* dll file extensions *******************************************************/ -/* many of these platforms are historic */ -#define SYSTEM_WINMSCI 1 -#define SYSTEM_WNTMSCI 2 -#define SYSTEM_WNTMSCA 3 -#define SYSTEM_WNTMSCP 4 -#define SYSTEM_WNTMSCM 5 -#define SYSTEM_OS2BLCI 6 -#define SYSTEM_OS2ICCI 7 -#define SYSTEM_OS2ICCI3 8 -#define SYSTEM_UNXLNXI 9 -#define SYSTEM_UNXSOLS 10 -#define SYSTEM_UNXBSDI 11 -#define SYSTEM_UNXBSDA 12 -#define SYSTEM_UNXSCOI 13 -#define SYSTEM_UNXAIXP 14 -#define SYSTEM_UNXHPXR 15 -#define SYSTEM_UNXSNIM 16 -#define SYSTEM_UNXMVSG 17 -#define SYSTEM_UNXIRXM 18 -// #define SYSTEM_MACOSP 19 -#define SYSTEM_UNXFBSDI 20 -#define SYSTEM_UNXSOLI 21 -#define SYSTEM_WINBLCI 22 -#define SYSTEM_UNXMACXP 23 -#define SYSTEM_UNXLNXP 24 -#define SYSTEM_UNXBSDS 25 -#define SYSTEM_UNXLNXR 26 -#define SYSTEM_UNXLNX3 28 -#define SYSTEM_UNXLNXS 29 -#define SYSTEM_UNXLNXX 30 -#define SYSTEM_UNXSOGS 31 -#define SYSTEM_UNXSOGI 32 -#define SYSTEM_UNXMACXI 33 -#define SYSTEM_OS2GCCI 34 -#define SYSTEM_WNTGCCI 99 - #if defined WNT #if defined(__MINGW32__) #define __DLLEXTENSION "gi" -- cgit v1.2.3 From 839a386cb51ba43988142957c091140885a5d3f7 Mon Sep 17 00:00:00 2001 From: Malte Timmermann Date: Thu, 1 Jul 2010 09:13:15 +0200 Subject: codecleanup02: #i52551# Removed old stuff: VOS_NAMESPACE, use vos:: directly --- svtools/source/dialogs/filedlg2.cxx | 2 +- svtools/source/misc/ehdl.cxx | 6 ++-- toolkit/inc/toolkit/awt/vclxdevice.hxx | 4 +-- toolkit/inc/toolkit/awt/vclxgraphics.hxx | 4 +-- toolkit/inc/toolkit/helper/throbberimpl.hxx | 4 +-- toolkit/source/awt/vclxgraphics.cxx | 2 +- toolkit/source/awt/vclxtoolkit.cxx | 2 +- toolkit/source/controls/unocontrol.cxx | 2 +- tools/inc/bootstrp/prj.hxx | 2 +- tools/inc/tools/simplerm.hxx | 2 +- tools/source/fsys/dirent.cxx | 10 +++--- tools/source/rc/resmgr.cxx | 16 +++++----- tools/source/stream/strmunx.cxx | 6 ++-- tools/source/testtoolloader/testtoolloader.cxx | 8 ++--- vcl/aqua/source/app/salinst.cxx | 8 ++--- vcl/unx/gtk/app/gtkinst.cxx | 2 +- vcl/unx/headless/svpinst.cxx | 8 ++--- vcl/unx/headless/svpinst.hxx | 6 ++-- vcl/unx/inc/salinst.h | 6 ++-- vcl/unx/source/app/saldisp.cxx | 2 +- vcl/unx/source/app/salinst.cxx | 8 ++--- vos/inc/vos/execabl.hxx | 6 ++-- vos/inc/vos/macros.hxx | 3 -- vos/inc/vos/pipe.hxx | 16 +++++----- vos/inc/vos/process.hxx | 2 +- vos/inc/vos/refernce.hxx | 2 +- vos/inc/vos/signal.hxx | 2 +- vos/inc/vos/socket.hxx | 42 +++++++++++++------------- vos/inc/vos/stream.hxx | 6 ++-- vos/inc/vos/thread.hxx | 6 ++-- vos/source/pipe.cxx | 2 +- vos/source/process.cxx | 2 +- vos/source/signal.cxx | 2 +- vos/source/thread.cxx | 2 +- vos/source/timer.cxx | 22 +++++++------- 35 files changed, 111 insertions(+), 114 deletions(-) diff --git a/svtools/source/dialogs/filedlg2.cxx b/svtools/source/dialogs/filedlg2.cxx index b0e77d658931..798ff87e02ac 100644 --- a/svtools/source/dialogs/filedlg2.cxx +++ b/svtools/source/dialogs/filedlg2.cxx @@ -347,7 +347,7 @@ IMPL_LINK( ImpPathDialog, ClickHdl, Button*, pBtn ) if ( pBtn == pHomeBtn ) { ::rtl::OUString aHomeDir; - NAMESPACE_VOS( OSecurity ) aSecurity; + vos:: OSecurity aSecurity; if ( aSecurity.getHomeDir( aHomeDir ) ) { DirEntry aFile ( aHomeDir ); diff --git a/svtools/source/misc/ehdl.cxx b/svtools/source/misc/ehdl.cxx index bf9e87d33a74..8834f5497e5a 100644 --- a/svtools/source/misc/ehdl.cxx +++ b/svtools/source/misc/ehdl.cxx @@ -64,7 +64,7 @@ static USHORT aWndFunc( { - NAMESPACE_VOS( OGuard ) aGuard( Application::GetSolarMutex() ); + vos:: OGuard aGuard( Application::GetSolarMutex() ); // aus den Flags die benoetigten WinBits ermitteln WinBits eBits=0; @@ -377,7 +377,7 @@ BOOL SfxErrorHandler::GetErrorString( */ { - NAMESPACE_VOS( OGuard ) aGuard( Application::GetSolarMutex() ); + vos:: OGuard aGuard( Application::GetSolarMutex() ); BOOL bRet = FALSE; rStr=String(SvtResId(RID_ERRHDL_CLASS)); @@ -454,7 +454,7 @@ BOOL SfxErrorContext::GetString(ULONG nErrId, String &rStr) } if( pMgr ) { - NAMESPACE_VOS( OGuard ) aGuard( Application::GetSolarMutex() ); + vos:: OGuard aGuard( Application::GetSolarMutex() ); ResId aResId( nResId, *pMgr ); diff --git a/toolkit/inc/toolkit/awt/vclxdevice.hxx b/toolkit/inc/toolkit/awt/vclxdevice.hxx index 62753a36136d..bb1c35078055 100644 --- a/toolkit/inc/toolkit/awt/vclxdevice.hxx +++ b/toolkit/inc/toolkit/awt/vclxdevice.hxx @@ -58,7 +58,7 @@ class TOOLKIT_DLLPUBLIC VCLXDevice : public ::com::sun::star::awt::XDevice, friend class VCLXGraphics; private: - NAMESPACE_VOS(IMutex)& mrMutex; // Reference to SolarMutex + vos::IMutex& mrMutex; // Reference to SolarMutex OutputDevice* mpOutputDevice; public: @@ -66,7 +66,7 @@ public: sal_uInt32 nFlags; protected: - NAMESPACE_VOS(IMutex)& GetMutex() { return mrMutex; } + vos::IMutex& GetMutex() { return mrMutex; } void DestroyOutputDevice(); public: diff --git a/toolkit/inc/toolkit/awt/vclxgraphics.hxx b/toolkit/inc/toolkit/awt/vclxgraphics.hxx index 5fda9ac947ee..6a076a5339b8 100644 --- a/toolkit/inc/toolkit/awt/vclxgraphics.hxx +++ b/toolkit/inc/toolkit/awt/vclxgraphics.hxx @@ -60,7 +60,7 @@ class VCLXGraphics : public ::com::sun::star::awt::XGraphics, public ::cppu::OWeakObject { private: - NAMESPACE_VOS(IMutex)& mrMutex; // Reference to SolarMutex + vos::IMutex& mrMutex; // Reference to SolarMutex ::com::sun::star::uno::Reference< ::com::sun::star::awt::XDevice> mxDevice; // nur um bei getDevice() immer das gleiche zurueckzugeben OutputDevice* mpOutputDevice; @@ -73,7 +73,7 @@ private: Region* mpClipRegion; protected: - NAMESPACE_VOS(IMutex)& GetMutex() { return mrMutex; } + vos::IMutex& GetMutex() { return mrMutex; } public: VCLXGraphics(); diff --git a/toolkit/inc/toolkit/helper/throbberimpl.hxx b/toolkit/inc/toolkit/helper/throbberimpl.hxx index 5ca6ec83d330..b944a74b65d2 100644 --- a/toolkit/inc/toolkit/helper/throbberimpl.hxx +++ b/toolkit/inc/toolkit/helper/throbberimpl.hxx @@ -43,7 +43,7 @@ namespace toolkit class Throbber_Impl { private: - NAMESPACE_VOS(IMutex)& mrMutex; // Reference to SolarMutex + vos::IMutex& mrMutex; // Reference to SolarMutex ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::graphic::XGraphic > > maImageList; ::com::sun::star::uno::Reference< VCLXWindow > mxParent; @@ -55,7 +55,7 @@ namespace toolkit DECL_LINK( TimeOutHdl, Throbber_Impl* ); - NAMESPACE_VOS(IMutex)& GetMutex() { return mrMutex; } + vos::IMutex& GetMutex() { return mrMutex; } public: Throbber_Impl( ::com::sun::star::uno::Reference< VCLXWindow > xParent, diff --git a/toolkit/source/awt/vclxgraphics.cxx b/toolkit/source/awt/vclxgraphics.cxx index bfbdb531e8d2..edaf64799d43 100644 --- a/toolkit/source/awt/vclxgraphics.cxx +++ b/toolkit/source/awt/vclxgraphics.cxx @@ -109,7 +109,7 @@ void VCLXGraphics::InitOutputDevice( sal_uInt16 nFlags ) { if(mpOutputDevice) { - NAMESPACE_VOS(OGuard) aVclGuard( Application::GetSolarMutex() ); + vos::OGuard aVclGuard( Application::GetSolarMutex() ); if ( nFlags & INITOUTDEV_FONT ) { diff --git a/toolkit/source/awt/vclxtoolkit.cxx b/toolkit/source/awt/vclxtoolkit.cxx index f85e29c21099..1af422bf7f00 100644 --- a/toolkit/source/awt/vclxtoolkit.cxx +++ b/toolkit/source/awt/vclxtoolkit.cxx @@ -659,7 +659,7 @@ Window* VCLXToolkit::ImplCreateWindow( VCLXWindow** ppNewComp, if ( nType ) { - NAMESPACE_VOS(OGuard) aVclGuard( Application::GetSolarMutex() ); + vos::OGuard aVclGuard( Application::GetSolarMutex() ); switch ( (WindowType)nType ) { case WINDOW_CANCELBUTTON: diff --git a/toolkit/source/controls/unocontrol.cxx b/toolkit/source/controls/unocontrol.cxx index d91077823495..6849d588aca2 100644 --- a/toolkit/source/controls/unocontrol.cxx +++ b/toolkit/source/controls/unocontrol.cxx @@ -653,7 +653,7 @@ void UnoControl::ImplModelPropertiesChanged( const Sequence< PropertyChangeEvent // #82300# - 2000-12-21 - fs@openoffice.org if (bNeedNewPeer && xParent.is()) { - NAMESPACE_VOS(OGuard) aVclGuard( Application::GetSolarMutex() ); + vos::OGuard aVclGuard( Application::GetSolarMutex() ); // and now this is the final withdrawal: // With 83561, I have no other idea than locking the SolarMutex here .... // I really hate the fact that VCL is not theadsafe .... diff --git a/tools/inc/bootstrp/prj.hxx b/tools/inc/bootstrp/prj.hxx index 2d7664b8b69f..994418bae4b5 100644 --- a/tools/inc/bootstrp/prj.hxx +++ b/tools/inc/bootstrp/prj.hxx @@ -264,7 +264,7 @@ private: static Link aDBNotFoundHdl; protected: - NAMESPACE_VOS( OMutex ) aMutex; + vos:: OMutex aMutex; USHORT nStarMode; SolarFileList aFileList; diff --git a/tools/inc/tools/simplerm.hxx b/tools/inc/tools/simplerm.hxx index c16fe41abc0b..6b8f31147f96 100644 --- a/tools/inc/tools/simplerm.hxx +++ b/tools/inc/tools/simplerm.hxx @@ -46,7 +46,7 @@ class InternalResMgr; class TOOLS_DLLPUBLIC SimpleResMgr { protected: - NAMESPACE_VOS(OMutex) m_aAccessSafety; + vos::OMutex m_aAccessSafety; InternalResMgr* m_pResImpl; public: diff --git a/tools/source/fsys/dirent.cxx b/tools/source/fsys/dirent.cxx index 1bd43bffc4e7..74a2142db692 100644 --- a/tools/source/fsys/dirent.cxx +++ b/tools/source/fsys/dirent.cxx @@ -136,13 +136,13 @@ BOOL bInRedirection = TRUE; #else BOOL bInRedirection = FALSE; #endif -static NAMESPACE_VOS( OMutex )* pRedirectMutex = 0; +static vos:: OMutex * pRedirectMutex = 0; //------------------------------------------------------------------------ void FSysRedirector::Register( FSysRedirector *pRedirector ) { if ( pRedirector ) - pRedirectMutex = new NAMESPACE_VOS( OMutex ); + pRedirectMutex = new vos:: OMutex ; else DELETEZ( pRedirectMutex ); _pRedirector = pRedirector; @@ -165,7 +165,7 @@ void FSysRedirector::DoRedirect( String &rPath ) // Redirection is acessible only by one thread per time // dont move the guard behind the bInRedirection check!!! // think of nested calls (when called from callback) - NAMESPACE_VOS( OGuard ) aGuard( pRedirectMutex ); + vos:: OGuard aGuard( pRedirectMutex ); // if already in redirection, dont redirect if ( bInRedirection ) @@ -1040,8 +1040,8 @@ DirEntry* DirEntry::ImpChangeParent( DirEntry* pNewParent, BOOL bNormalize ) BOOL DirEntry::Exists( FSysAccess nAccess ) const { #ifndef BOOTSTRAP - static NAMESPACE_VOS(OMutex) aLocalMutex; - NAMESPACE_VOS(OGuard) aGuard( aLocalMutex ); + static vos::OMutex aLocalMutex; + vos::OGuard aGuard( aLocalMutex ); #endif if ( !IsValid() ) return FALSE; diff --git a/tools/source/rc/resmgr.cxx b/tools/source/rc/resmgr.cxx index daeaf8e4c3a5..d05fcac331f2 100644 --- a/tools/source/rc/resmgr.cxx +++ b/tools/source/rc/resmgr.cxx @@ -837,18 +837,18 @@ void ResMgr::RscError_Impl( const sal_Char* pMessage, ResMgr* pResMgr, static void RscException_Impl() { - switch ( NAMESPACE_VOS(OSignalHandler)::raise( OSL_SIGNAL_USER_RESOURCEFAILURE, (void*)"" ) ) + switch ( vos::OSignalHandler::raise( OSL_SIGNAL_USER_RESOURCEFAILURE, (void*)"" ) ) { - case NAMESPACE_VOS(OSignalHandler)::TAction_CallNextHandler: + case vos::OSignalHandler::TAction_CallNextHandler: abort(); - case NAMESPACE_VOS(OSignalHandler)::TAction_Ignore: + case vos::OSignalHandler::TAction_Ignore: return; - case NAMESPACE_VOS(OSignalHandler)::TAction_AbortApplication: + case vos::OSignalHandler::TAction_AbortApplication: abort(); - case NAMESPACE_VOS(OSignalHandler)::TAction_KillApplication: + case vos::OSignalHandler::TAction_KillApplication: exit(-1); } } @@ -1919,7 +1919,7 @@ SimpleResMgr* SimpleResMgr::Create( const sal_Char* pPrefixName, com::sun::star: // ----------------------------------------------------------------------- bool SimpleResMgr::IsAvailable( RESOURCE_TYPE _resourceType, sal_uInt32 _resourceId ) { - NAMESPACE_VOS(OGuard) aGuard(m_aAccessSafety); + vos::OGuard aGuard(m_aAccessSafety); if ( ( RSC_STRING != _resourceType ) && ( RSC_RESOURCE != _resourceType ) ) return false; @@ -1931,7 +1931,7 @@ bool SimpleResMgr::IsAvailable( RESOURCE_TYPE _resourceType, sal_uInt32 _resourc // ----------------------------------------------------------------------- UniString SimpleResMgr::ReadString( sal_uInt32 nId ) { - NAMESPACE_VOS(OGuard) aGuard(m_aAccessSafety); + vos::OGuard aGuard(m_aAccessSafety); DBG_ASSERT( m_pResImpl, "SimpleResMgr::ReadString : have no impl class !" ); // perhaps constructed with an invalid filename ? @@ -2002,7 +2002,7 @@ const ::com::sun::star::lang::Locale& SimpleResMgr::GetLocale() const sal_uInt32 SimpleResMgr::ReadBlob( sal_uInt32 nId, void** pBuffer ) { - NAMESPACE_VOS(OGuard) aGuard(m_aAccessSafety); + vos::OGuard aGuard(m_aAccessSafety); DBG_ASSERT( m_pResImpl, "SimpleResMgr::ReadBlob : have no impl class !" ); diff --git a/tools/source/stream/strmunx.cxx b/tools/source/stream/strmunx.cxx index 88ccb2113e0d..f3c5d642ed6e 100644 --- a/tools/source/stream/strmunx.cxx +++ b/tools/source/stream/strmunx.cxx @@ -60,7 +60,7 @@ DECLARE_LIST( InternalStreamLockList, InternalStreamLock* ) namespace { struct LockList : public rtl::Static< InternalStreamLockList, LockList > {}; } #ifndef BOOTSTRAP -namespace { struct LockMutex : public rtl::Static< NAMESPACE_VOS(OMutex), LockMutex > {}; } +namespace { struct LockMutex : public rtl::Static< vos::OMutex, LockMutex > {}; } #endif class InternalStreamLock @@ -111,7 +111,7 @@ InternalStreamLock::~InternalStreamLock() sal_Bool InternalStreamLock::LockFile( sal_Size nStart, sal_Size nEnd, SvFileStream* pStream ) { #ifndef BOOTSTRAP - NAMESPACE_VOS( OGuard ) aGuard( LockMutex::get() ); + vos:: OGuard aGuard( LockMutex::get() ); #endif ByteString aFileName(pStream->GetFileName(), osl_getThreadTextEncoding()); struct stat aStat; @@ -161,7 +161,7 @@ sal_Bool InternalStreamLock::LockFile( sal_Size nStart, sal_Size nEnd, SvFileStr void InternalStreamLock::UnlockFile( sal_Size nStart, sal_Size nEnd, SvFileStream* pStream ) { #ifndef BOOTSTRAP - NAMESPACE_VOS( OGuard ) aGuard( LockMutex::get() ); + vos:: OGuard aGuard( LockMutex::get() ); #endif InternalStreamLock* pLock = NULL; InternalStreamLockList &rLockList = LockList::get(); diff --git a/tools/source/testtoolloader/testtoolloader.cxx b/tools/source/testtoolloader/testtoolloader.cxx index ca269ef6eea2..21a1a715dc08 100644 --- a/tools/source/testtoolloader/testtoolloader.cxx +++ b/tools/source/testtoolloader/testtoolloader.cxx @@ -56,16 +56,16 @@ static bool bLoggerStarted = false; sal_uInt32 GetCommandLineParamCount() { - NAMESPACE_VOS( OStartupInfo ) aStartInfo; + vos:: OStartupInfo aStartInfo; return aStartInfo.getCommandArgCount(); } String GetCommandLineParam( sal_uInt32 nParam ) { - NAMESPACE_VOS( OStartupInfo ) aStartInfo; + vos:: OStartupInfo aStartInfo; ::rtl::OUString aParam; - NAMESPACE_VOS( OStartupInfo )::TStartupError eError = aStartInfo.getCommandArg( nParam, aParam ); - if ( eError == NAMESPACE_VOS( OStartupInfo )::E_None ) + vos:: OStartupInfo ::TStartupError eError = aStartInfo.getCommandArg( nParam, aParam ); + if ( eError == vos:: OStartupInfo ::E_None ) return String( aParam ); else { diff --git a/vcl/aqua/source/app/salinst.cxx b/vcl/aqua/source/app/salinst.cxx index b8a2261ed9db..6eb5bcd1390e 100644 --- a/vcl/aqua/source/app/salinst.cxx +++ b/vcl/aqua/source/app/salinst.cxx @@ -371,13 +371,13 @@ SalYieldMutex::SalYieldMutex() void SalYieldMutex::acquire() { OMutex::acquire(); - mnThreadId = NAMESPACE_VOS(OThread)::getCurrentIdentifier(); + mnThreadId = vos::OThread::getCurrentIdentifier(); mnCount++; } void SalYieldMutex::release() { - if ( mnThreadId == NAMESPACE_VOS(OThread)::getCurrentIdentifier() ) + if ( mnThreadId == vos::OThread::getCurrentIdentifier() ) { if ( mnCount == 1 ) mnThreadId = 0; @@ -390,7 +390,7 @@ sal_Bool SalYieldMutex::tryToAcquire() { if ( OMutex::tryToAcquire() ) { - mnThreadId = NAMESPACE_VOS(OThread)::getCurrentIdentifier(); + mnThreadId = vos::OThread::getCurrentIdentifier(); mnCount++; return sal_True; } @@ -536,7 +536,7 @@ ULONG AquaSalInstance::ReleaseYieldMutex() { SalYieldMutex* pYieldMutex = mpSalYieldMutex; if ( pYieldMutex->GetThreadId() == - NAMESPACE_VOS(OThread)::getCurrentIdentifier() ) + vos::OThread::getCurrentIdentifier() ) { ULONG nCount = pYieldMutex->GetAcquireCount(); ULONG n = nCount; diff --git a/vcl/unx/gtk/app/gtkinst.cxx b/vcl/unx/gtk/app/gtkinst.cxx index 68617c8c16be..faedc7e5e600 100644 --- a/vcl/unx/gtk/app/gtkinst.cxx +++ b/vcl/unx/gtk/app/gtkinst.cxx @@ -76,7 +76,7 @@ void GtkHookedYieldMutex::ThreadsLeave() #if OSL_DEBUG_LEVEL > 1 if( mnThreadId && - mnThreadId != NAMESPACE_VOS(OThread)::getCurrentIdentifier()) + mnThreadId != vos::OThread::getCurrentIdentifier()) fprintf( stderr, "\n\n--- A different thread owns the mutex ...---\n\n\n"); #endif diff --git a/vcl/unx/headless/svpinst.cxx b/vcl/unx/headless/svpinst.cxx index 466b56868900..5c3be54f9ddc 100644 --- a/vcl/unx/headless/svpinst.cxx +++ b/vcl/unx/headless/svpinst.cxx @@ -302,7 +302,7 @@ vos::IMutex* SvpSalInstance::GetYieldMutex() ULONG SvpSalInstance::ReleaseYieldMutex() { if ( m_aYieldMutex.GetThreadId() == - NAMESPACE_VOS(OThread)::getCurrentIdentifier() ) + vos::OThread::getCurrentIdentifier() ) { ULONG nCount = m_aYieldMutex.GetAcquireCount(); ULONG n = nCount; @@ -464,13 +464,13 @@ SvpSalYieldMutex::SvpSalYieldMutex() void SvpSalYieldMutex::acquire() { OMutex::acquire(); - mnThreadId = NAMESPACE_VOS(OThread)::getCurrentIdentifier(); + mnThreadId = vos::OThread::getCurrentIdentifier(); mnCount++; } void SvpSalYieldMutex::release() { - if ( mnThreadId == NAMESPACE_VOS(OThread)::getCurrentIdentifier() ) + if ( mnThreadId == vos::OThread::getCurrentIdentifier() ) { if ( mnCount == 1 ) mnThreadId = 0; @@ -483,7 +483,7 @@ sal_Bool SvpSalYieldMutex::tryToAcquire() { if ( OMutex::tryToAcquire() ) { - mnThreadId = NAMESPACE_VOS(OThread)::getCurrentIdentifier(); + mnThreadId = vos::OThread::getCurrentIdentifier(); mnCount++; return sal_True; } diff --git a/vcl/unx/headless/svpinst.hxx b/vcl/unx/headless/svpinst.hxx index 284a2d11cd82..d931a2735ff9 100644 --- a/vcl/unx/headless/svpinst.hxx +++ b/vcl/unx/headless/svpinst.hxx @@ -46,11 +46,11 @@ // SalYieldMutex // ------------------------------------------------------------------------- -class SvpSalYieldMutex : public NAMESPACE_VOS(OMutex) +class SvpSalYieldMutex : public vos::OMutex { protected: ULONG mnCount; - NAMESPACE_VOS(OThread)::TThreadIdentifier mnThreadId; + vos::OThread::TThreadIdentifier mnThreadId; public: SvpSalYieldMutex(); @@ -60,7 +60,7 @@ public: virtual sal_Bool tryToAcquire(); ULONG GetAcquireCount() const { return mnCount; } - NAMESPACE_VOS(OThread)::TThreadIdentifier GetThreadId() const { return mnThreadId; } + vos::OThread::TThreadIdentifier GetThreadId() const { return mnThreadId; } }; // --------------- diff --git a/vcl/unx/inc/salinst.h b/vcl/unx/inc/salinst.h index d73d67f81425..8f4719f098f0 100644 --- a/vcl/unx/inc/salinst.h +++ b/vcl/unx/inc/salinst.h @@ -39,11 +39,11 @@ #include #include -class VCL_DLLPUBLIC SalYieldMutex : public NAMESPACE_VOS(OMutex) +class VCL_DLLPUBLIC SalYieldMutex : public vos::OMutex { protected: ULONG mnCount; - NAMESPACE_VOS(OThread)::TThreadIdentifier mnThreadId; + vos::OThread::TThreadIdentifier mnThreadId; public: SalYieldMutex(); @@ -53,7 +53,7 @@ public: virtual sal_Bool tryToAcquire(); ULONG GetAcquireCount() const { return mnCount; } - NAMESPACE_VOS(OThread)::TThreadIdentifier GetThreadId() const { return mnThreadId; } + vos::OThread::TThreadIdentifier GetThreadId() const { return mnThreadId; } }; // -=-= SalInstanceData =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= diff --git a/vcl/unx/source/app/saldisp.cxx b/vcl/unx/source/app/saldisp.cxx index aa2afab93657..71e2975abc8a 100644 --- a/vcl/unx/source/app/saldisp.cxx +++ b/vcl/unx/source/app/saldisp.cxx @@ -2257,7 +2257,7 @@ void SalX11Display::Yield() XEvent aEvent; DBG_ASSERT( static_cast(GetSalData()->m_pInstance->GetYieldMutex())->GetThreadId() == - NAMESPACE_VOS(OThread)::getCurrentIdentifier(), + vos::OThread::getCurrentIdentifier(), "will crash soon since solar mutex not locked in SalDisplay::Yield" ); XNextEvent( pDisp_, &aEvent ); diff --git a/vcl/unx/source/app/salinst.cxx b/vcl/unx/source/app/salinst.cxx index 8a8db44cefcd..49a9cceb8617 100644 --- a/vcl/unx/source/app/salinst.cxx +++ b/vcl/unx/source/app/salinst.cxx @@ -66,13 +66,13 @@ SalYieldMutex::SalYieldMutex() void SalYieldMutex::acquire() { OMutex::acquire(); - mnThreadId = NAMESPACE_VOS(OThread)::getCurrentIdentifier(); + mnThreadId = vos::OThread::getCurrentIdentifier(); mnCount++; } void SalYieldMutex::release() { - if ( mnThreadId == NAMESPACE_VOS(OThread)::getCurrentIdentifier() ) + if ( mnThreadId == vos::OThread::getCurrentIdentifier() ) { if ( mnCount == 1 ) mnThreadId = 0; @@ -85,7 +85,7 @@ sal_Bool SalYieldMutex::tryToAcquire() { if ( OMutex::tryToAcquire() ) { - mnThreadId = NAMESPACE_VOS(OThread)::getCurrentIdentifier(); + mnThreadId = vos::OThread::getCurrentIdentifier(); mnCount++; return True; } @@ -231,7 +231,7 @@ ULONG X11SalInstance::ReleaseYieldMutex() { SalYieldMutex* pYieldMutex = mpSalYieldMutex; if ( pYieldMutex->GetThreadId() == - NAMESPACE_VOS(OThread)::getCurrentIdentifier() ) + vos::OThread::getCurrentIdentifier() ) { ULONG nCount = pYieldMutex->GetAcquireCount(); ULONG n = nCount; diff --git a/vos/inc/vos/execabl.hxx b/vos/inc/vos/execabl.hxx index 04e0ef837b02..5788fb598662 100644 --- a/vos/inc/vos/execabl.hxx +++ b/vos/inc/vos/execabl.hxx @@ -50,7 +50,7 @@ namespace vos @version 0.1 */ -class IExecutable : public NAMESPACE_VOS(IReference) +class IExecutable : public vos::IReference { public: @@ -82,8 +82,8 @@ public: /** OExecutable added default impl. of IReferenceCounter */ -class OExecutable : public NAMESPACE_VOS(IExecutable), - public NAMESPACE_VOS(OReference) +class OExecutable : public vos::IExecutable, + public vos::OReference { public: diff --git a/vos/inc/vos/macros.hxx b/vos/inc/vos/macros.hxx index ca1b750d67f4..be91b6d00aa2 100644 --- a/vos/inc/vos/macros.hxx +++ b/vos/inc/vos/macros.hxx @@ -149,9 +149,6 @@ // def. for arbitrary namespace #define VOS_NAMESPACE(class_name, name_space) name_space::class_name -// sal_Int16 def. for namespace vos -#define NAMESPACE_VOS(class_name) vos::class_name - // sal_Int16 def. for namespace std #define NAMESPACE_STD(class_name) std::class_name diff --git a/vos/inc/vos/pipe.hxx b/vos/inc/vos/pipe.hxx index e9b1145a36ee..ce378272c9b9 100644 --- a/vos/inc/vos/pipe.hxx +++ b/vos/inc/vos/pipe.hxx @@ -48,10 +48,10 @@ class OStreamPipe; /** Represents a pipe. */ -class OPipe : public NAMESPACE_VOS(OReference), - public NAMESPACE_VOS(OObject) +class OPipe : public vos::OReference, + public vos::OObject { - VOS_DECLARE_CLASSINFO(NAMESPACE_VOS(OPipe)); + VOS_DECLARE_CLASSINFO(vos::OPipe); public: /* @@ -101,7 +101,7 @@ public: @param Security */ OPipe(const ::rtl::OUString& strName, TPipeOption Options, - const NAMESPACE_VOS(OSecurity)& rSecurity); + const vos::OSecurity& rSecurity); /** Copy constructor. */ @@ -132,7 +132,7 @@ public: @return True if socket was successfully created. */ sal_Bool SAL_CALL create(const ::rtl::OUString& strName, TPipeOption Options, - const NAMESPACE_VOS(OSecurity)& rSecurity); + const vos::OSecurity& rSecurity); /** Assignment operator. If pipe was already created, the old one will be discarded. @@ -191,10 +191,10 @@ public: /** A pipe to send or receive a stream of data. */ -class OStreamPipe : public NAMESPACE_VOS(OPipe), - public NAMESPACE_VOS(IStream) +class OStreamPipe : public vos::OPipe, + public vos::IStream { - VOS_DECLARE_CLASSINFO(NAMESPACE_VOS(OStreamPipe)); + VOS_DECLARE_CLASSINFO(vos::OStreamPipe); public: /** Creates an unattached pipe. You must attach the pipe to an oslPipe diff --git a/vos/inc/vos/process.hxx b/vos/inc/vos/process.hxx index e41a050acaa0..0b98278d117e 100644 --- a/vos/inc/vos/process.hxx +++ b/vos/inc/vos/process.hxx @@ -284,7 +284,7 @@ class OExtCommandLineImpl; class OExtCommandLine : public OObject { VOS_DECLARE_CLASSINFO(VOS_NAMESPACE(OExtCommandLine, vos)); - static NAMESPACE_VOS(OExtCommandLineImpl)* pExtImpl; + static vos::OExtCommandLineImpl* pExtImpl; public: diff --git a/vos/inc/vos/refernce.hxx b/vos/inc/vos/refernce.hxx index 25f0f39eb0f3..8f5a0ec799fb 100644 --- a/vos/inc/vos/refernce.hxx +++ b/vos/inc/vos/refernce.hxx @@ -82,7 +82,7 @@ private: ORefCount& SAL_CALL operator= (const ORefCount&); }; -class OReference : public NAMESPACE_VOS(IReference) +class OReference : public vos::IReference { public: OReference(); diff --git a/vos/inc/vos/signal.hxx b/vos/inc/vos/signal.hxx index ea9db4850490..f2bff35998ec 100644 --- a/vos/inc/vos/signal.hxx +++ b/vos/inc/vos/signal.hxx @@ -46,7 +46,7 @@ SignalHandlerFunction_impl signalHandlerFunction_impl; @version 1.0 */ -class OSignalHandler : public NAMESPACE_VOS(OObject) +class OSignalHandler : public vos::OObject { VOS_DECLARE_CLASSINFO(VOS_NAMESPACE(OSignalHandler, vos)); diff --git a/vos/inc/vos/socket.hxx b/vos/inc/vos/socket.hxx index cfd51fbb069b..f803a455129c 100644 --- a/vos/inc/vos/socket.hxx +++ b/vos/inc/vos/socket.hxx @@ -189,7 +189,7 @@ public: /** Base class for socket addresses. */ -class ISocketAddr : public NAMESPACE_VOS(ISocketTypes) +class ISocketAddr : public vos::ISocketTypes { public: virtual ~ISocketAddr() { } @@ -202,11 +202,11 @@ public: virtual sal_Bool SAL_CALL operator== (oslSocketAddr Addr)= 0; }; -class OSocketAddr : public NAMESPACE_VOS(ISocketAddr), - public NAMESPACE_VOS(OObject) +class OSocketAddr : public vos::ISocketAddr, + public vos::OObject { - VOS_DECLARE_CLASSINFO(NAMESPACE_VOS(OSocketAddr)); + VOS_DECLARE_CLASSINFO(vos::OSocketAddr); public: /** Creates socket address of unknown type. @@ -274,9 +274,9 @@ protected: /** Represents an internet-address. */ -class OInetSocketAddr : public NAMESPACE_VOS(OSocketAddr) +class OInetSocketAddr : public vos::OSocketAddr { - VOS_DECLARE_CLASSINFO(NAMESPACE_VOS(OInetSocketAddr)); + VOS_DECLARE_CLASSINFO(vos::OInetSocketAddr); public: /** Creates an empty internet-address (INADDR_ANY). @@ -359,9 +359,9 @@ public: /** Represents an IPX/SPX address. */ -class OIpxSocketAddr : public NAMESPACE_VOS(OSocketAddr) +class OIpxSocketAddr : public vos::OSocketAddr { - VOS_DECLARE_CLASSINFO(NAMESPACE_VOS(OIpxSocketAddr)); + VOS_DECLARE_CLASSINFO(vos::OIpxSocketAddr); public: typedef oslSocketIpxNetNumber TIpxNetNumber; @@ -430,11 +430,11 @@ public: /** Represents a socket. */ -class OSocket : public NAMESPACE_VOS(ISocketTypes), - public NAMESPACE_VOS(OReference), - public NAMESPACE_VOS(OObject) +class OSocket : public vos::ISocketTypes, + public vos::OReference, + public vos::OObject { - VOS_DECLARE_CLASSINFO(NAMESPACE_VOS(OSocket)); + VOS_DECLARE_CLASSINFO(vos::OSocket); protected: typedef ORefObj SockRef; @@ -809,10 +809,10 @@ public: /** A socket to send or receive a stream of data. */ -class OStreamSocket : public NAMESPACE_VOS(OSocket), - public NAMESPACE_VOS(IStream) +class OStreamSocket : public vos::OSocket, + public vos::IStream { - VOS_DECLARE_CLASSINFO(NAMESPACE_VOS(OStreamSocket)); + VOS_DECLARE_CLASSINFO(vos::OStreamSocket); public: /** Creates an unattached socket. You must attach the socket to an oslSocket @@ -952,9 +952,9 @@ protected: /** A socket to accept incoming connections. */ -class OAcceptorSocket : public NAMESPACE_VOS(OSocket) +class OAcceptorSocket : public vos::OSocket { - VOS_DECLARE_CLASSINFO(NAMESPACE_VOS(OAcceptorSocket)); + VOS_DECLARE_CLASSINFO(vos::OAcceptorSocket); public: /** Creates a socket that can accept connections. @@ -1014,9 +1014,9 @@ public: /** A socket to initiate a conenction. */ -class OConnectorSocket : public NAMESPACE_VOS(OStreamSocket) +class OConnectorSocket : public vos::OStreamSocket { - VOS_DECLARE_CLASSINFO(NAMESPACE_VOS(OConnectorSocket)); + VOS_DECLARE_CLASSINFO(vos::OConnectorSocket); public: /** Creates a socket that can accept connections. @@ -1050,9 +1050,9 @@ public: /** A connectionless socket to send and receive datagrams. */ -class ODatagramSocket : public NAMESPACE_VOS(OSocket) +class ODatagramSocket : public vos::OSocket { - VOS_DECLARE_CLASSINFO(NAMESPACE_VOS(ODatagramSocket)); + VOS_DECLARE_CLASSINFO(vos::ODatagramSocket); public: /** Creates a datagram socket. diff --git a/vos/inc/vos/stream.hxx b/vos/inc/vos/stream.hxx index 5e25aa1d103a..6df13d5ddb28 100644 --- a/vos/inc/vos/stream.hxx +++ b/vos/inc/vos/stream.hxx @@ -37,7 +37,7 @@ namespace vos /** Adds seeking capabilities to IStream */ -class IPositionableStream : public NAMESPACE_VOS(IStream) +class IPositionableStream : public vos::IStream { public: @@ -75,8 +75,8 @@ protected: /** Implements IPositionableStream */ -class OStream : public NAMESPACE_VOS(OObject), - public NAMESPACE_VOS(IPositionableStream) +class OStream : public vos::OObject, + public vos::IPositionableStream { VOS_DECLARE_CLASSINFO(VOS_NAMESPACE(OStream, vos)); diff --git a/vos/inc/vos/thread.hxx b/vos/inc/vos/thread.hxx index 16f64c0e0812..d84fdfdadccc 100644 --- a/vos/inc/vos/thread.hxx +++ b/vos/inc/vos/thread.hxx @@ -53,8 +53,8 @@ ThreadWorkerFunction_impl threadWorkerFunction_impl; @version 1.0 */ -class OThread : public NAMESPACE_VOS(IRunnable), - public NAMESPACE_VOS(OObject) +class OThread : public vos::IRunnable, + public vos::OObject { VOS_DECLARE_CLASSINFO(VOS_NAMESPACE(OThread, vos)); @@ -203,7 +203,7 @@ protected: friend void threadWorkerFunction_impl(void *); }; -class OThreadData : public NAMESPACE_VOS(OObject) +class OThreadData : public vos::OObject { VOS_DECLARE_CLASSINFO(VOS_NAMESPACE(OThreadData, vos)); diff --git a/vos/source/pipe.cxx b/vos/source/pipe.cxx index a7d8e655414d..777d1a76b36b 100644 --- a/vos/source/pipe.cxx +++ b/vos/source/pipe.cxx @@ -138,7 +138,7 @@ sal_Bool OPipe::create( const rtl::OUString& strName, TPipeOption Options ) /*****************************************************************************/ sal_Bool OPipe::create( const rtl::OUString& strName, TPipeOption Options, - const NAMESPACE_VOS(OSecurity)& rSecurity ) + const vos::OSecurity& rSecurity ) { // if this was a valid pipe, decrease reference if ((m_pPipeRef) && (m_pPipeRef->release() == 0)) diff --git a/vos/source/process.cxx b/vos/source/process.cxx index 71c8729d9023..59b1af3223d4 100644 --- a/vos/source/process.cxx +++ b/vos/source/process.cxx @@ -485,7 +485,7 @@ void OExtCommandLineImpl::init() namespace { - struct lclMutex : public rtl::Static< NAMESPACE_VOS(OMutex), lclMutex > {}; + struct lclMutex : public rtl::Static< vos::OMutex, lclMutex > {}; } OExtCommandLineImpl* OExtCommandLine::pExtImpl=0; diff --git a/vos/source/signal.cxx b/vos/source/signal.cxx index 1f879f8b225c..eb1b65191918 100644 --- a/vos/source/signal.cxx +++ b/vos/source/signal.cxx @@ -35,7 +35,7 @@ using namespace vos; oslSignalAction vos::signalHandlerFunction_impl( void * pthis, oslSignalInfo * pInfo) { - NAMESPACE_VOS(OSignalHandler)* pThis= (NAMESPACE_VOS(OSignalHandler)*)pthis; + vos::OSignalHandler* pThis= (vos::OSignalHandler*)pthis; return ((oslSignalAction)pThis->signal(pInfo)); } diff --git a/vos/source/thread.cxx b/vos/source/thread.cxx index 8b2c8826b753..94cdfbdf970b 100644 --- a/vos/source/thread.cxx +++ b/vos/source/thread.cxx @@ -34,7 +34,7 @@ using namespace vos; void vos::threadWorkerFunction_impl(void * pthis) { - NAMESPACE_VOS(OThread)* pThis= (NAMESPACE_VOS(OThread)*)pthis; + vos::OThread* pThis= (vos::OThread*)pthis; // call Handler-Function of OThread-derived class pThis->run(); diff --git a/vos/source/timer.cxx b/vos/source/timer.cxx index 1c1e2385b60c..a365415672e9 100644 --- a/vos/source/timer.cxx +++ b/vos/source/timer.cxx @@ -41,7 +41,7 @@ class OTimerManagerCleanup; -class NAMESPACE_VOS(OTimerManager) : public NAMESPACE_VOS(OThread) +class vos::OTimerManager : public vos::OThread { public: @@ -53,13 +53,13 @@ public: ~OTimerManager(); /// register timer - sal_Bool SAL_CALL registerTimer(NAMESPACE_VOS(OTimer)* pTimer); + sal_Bool SAL_CALL registerTimer(vos::OTimer* pTimer); /// unregister timer - sal_Bool SAL_CALL unregisterTimer(NAMESPACE_VOS(OTimer)* pTimer); + sal_Bool SAL_CALL unregisterTimer(vos::OTimer* pTimer); /// lookup timer - sal_Bool SAL_CALL lookupTimer(const NAMESPACE_VOS(OTimer)* pTimer); + sal_Bool SAL_CALL lookupTimer(const vos::OTimer* pTimer); /// retrieves the "Singleton" TimerManager Instance static OTimerManager* SAL_CALL getTimerManager(); @@ -77,17 +77,17 @@ protected: virtual void SAL_CALL onTerminated(); // sorted-queue data - NAMESPACE_VOS(OTimer)* m_pHead; + vos::OTimer* m_pHead; // List Protection - NAMESPACE_VOS(OMutex) m_Lock; + vos::OMutex m_Lock; // Signal the insertion of a timer - NAMESPACE_VOS(OCondition) m_notEmpty; + vos::OCondition m_notEmpty; // Synchronize access to OTimerManager - static NAMESPACE_VOS(OMutex) m_Access; + static vos::OMutex m_Access; // "Singleton Pattern" - static NAMESPACE_VOS(OTimerManager)* m_pManager; + static vos::OTimerManager* m_pManager; friend class OTimerManagerCleanup; @@ -267,8 +267,8 @@ TTimeValue OTimer::getRemainingTime() const // Timer manager // -OMutex NAMESPACE_VOS(OTimerManager)::m_Access; -OTimerManager* NAMESPACE_VOS(OTimerManager)::m_pManager=0; +OMutex vos::OTimerManager::m_Access; +OTimerManager* vos::OTimerManager::m_pManager=0; OTimerManager::OTimerManager() { -- cgit v1.2.3 From b2d41aee0de65be4cc2e906316f6fb590a6921a1 Mon Sep 17 00:00:00 2001 From: "Ocke Janssen [oj]" Date: Thu, 1 Jul 2010 11:46:35 +0200 Subject: unoawt2: add missing GetEntryImage, same as listbox --- vcl/inc/vcl/combobox.hxx | 1 + vcl/source/control/combobox.cxx | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/vcl/inc/vcl/combobox.hxx b/vcl/inc/vcl/combobox.hxx index e35474a84d53..640c70e7116f 100644 --- a/vcl/inc/vcl/combobox.hxx +++ b/vcl/inc/vcl/combobox.hxx @@ -138,6 +138,7 @@ public: USHORT GetEntryPos( const XubString& rStr ) const; USHORT GetEntryPos( const void* pData ) const; + Image GetEntryImage( USHORT nPos ) const; XubString GetEntry( USHORT nPos ) const; USHORT GetEntryCount() const; diff --git a/vcl/source/control/combobox.cxx b/vcl/source/control/combobox.cxx index f5c04b7c3cfa..ebdfeae0f1d9 100644 --- a/vcl/source/control/combobox.cxx +++ b/vcl/source/control/combobox.cxx @@ -1011,6 +1011,14 @@ void ComboBox::Clear() mpImplLB->Clear(); CallEventListeners( VCLEVENT_COMBOBOX_ITEMREMOVED, (void*) sal_IntPtr(-1) ); } +// ----------------------------------------------------------------------- + +Image ComboBox::GetEntryImage( USHORT nPos ) const +{ + if ( mpImplLB->GetEntryList()->HasEntryImage( nPos ) ) + return mpImplLB->GetEntryList()->GetEntryImage( nPos ); + return Image(); +} // ----------------------------------------------------------------------- -- cgit v1.2.3 From 297f3ea4c0b7772cd6b0e4720ea4ee751a932605 Mon Sep 17 00:00:00 2001 From: "Ocke Janssen [oj]" Date: Thu, 1 Jul 2010 11:50:54 +0200 Subject: unoawt2: add XItemList to combobox as well, the sma eas for listbox --- toolkit/inc/toolkit/awt/vclxwindows.hxx | 24 +-- toolkit/inc/toolkit/controls/unocontrols.hxx | 41 +++++- toolkit/source/awt/vclxwindows.cxx | 128 +++++++++++++--- toolkit/source/controls/unocontrols.cxx | 209 +++++++++++++++++++++++---- 4 files changed, 331 insertions(+), 71 deletions(-) diff --git a/toolkit/inc/toolkit/awt/vclxwindows.hxx b/toolkit/inc/toolkit/awt/vclxwindows.hxx index 80e3a37279d3..fb110cb74391 100644 --- a/toolkit/inc/toolkit/awt/vclxwindows.hxx +++ b/toolkit/inc/toolkit/awt/vclxwindows.hxx @@ -747,8 +747,10 @@ public: // ---------------------------------------------------- // class VCLXComboBox // ---------------------------------------------------- -class VCLXComboBox : public ::com::sun::star::awt::XComboBox, - public VCLXEdit +typedef ::cppu::ImplInheritanceHelper2 < VCLXEdit + , ::com::sun::star::awt::XComboBox + , ::com::sun::star::awt::XItemListListener > VCLXComboBox_Base; +class VCLXComboBox : public VCLXComboBox_Base { private: ActionListenerMultiplexer maActionListeners; @@ -763,15 +765,6 @@ public: VCLXComboBox(); ~VCLXComboBox(); - // ::com::sun::star::uno::XInterface - ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException); - void SAL_CALL acquire() throw() { OWeakObject::acquire(); } - void SAL_CALL release() throw() { OWeakObject::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); - // ::com::sun::star::lang::XComponent void SAL_CALL dispose( ) throw(::com::sun::star::uno::RuntimeException); @@ -802,6 +795,15 @@ public: void SAL_CALL setProperty( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Any& Value ) throw(::com::sun::star::uno::RuntimeException); ::com::sun::star::uno::Any SAL_CALL getProperty( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::uno::RuntimeException); + // XItemListListener + virtual void SAL_CALL listItemInserted( const ::com::sun::star::awt::ItemListEvent& Event ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL listItemRemoved( const ::com::sun::star::awt::ItemListEvent& Event ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL listItemModified( const ::com::sun::star::awt::ItemListEvent& Event ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL allItemsRemoved( const ::com::sun::star::lang::EventObject& Event ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL itemListChanged( const ::com::sun::star::lang::EventObject& Event ) throw (::com::sun::star::uno::RuntimeException); + // XEventListener + virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& i_rEvent ) throw (::com::sun::star::uno::RuntimeException); + static void ImplGetPropertyIds( std::list< sal_uInt16 > &aIds ); virtual void GetPropertyIds( std::list< sal_uInt16 > &aIds ) { return ImplGetPropertyIds( aIds ); } }; diff --git a/toolkit/inc/toolkit/controls/unocontrols.hxx b/toolkit/inc/toolkit/controls/unocontrols.hxx index 6223e47a6871..1bcbfec7a556 100644 --- a/toolkit/inc/toolkit/controls/unocontrols.hxx +++ b/toolkit/inc/toolkit/controls/unocontrols.hxx @@ -727,6 +727,8 @@ typedef ::cppu::AggImplInheritanceHelper1 < UnoControlModel > UnoControlListBoxModel_Base; class TOOLKIT_DLLPUBLIC UnoControlListBoxModel :public UnoControlListBoxModel_Base { +protected: + UnoControlListBoxModel(bool asComboBox); public: UnoControlListBoxModel(); UnoControlListBoxModel( const UnoControlListBoxModel& i_rSource ); @@ -806,7 +808,7 @@ private: void impl_getStringItemList( ::std::vector< ::rtl::OUString >& o_rStringItems ) const; void impl_setStringItemList_nolck( const ::std::vector< ::rtl::OUString >& i_rStringItems ); -private: +protected: ::boost::scoped_ptr< UnoControlListBoxModel_Data > m_pData; ::cppu::OInterfaceContainerHelper m_aItemListListeners; }; @@ -895,7 +897,7 @@ private: // ---------------------------------------------------- // class UnoControlComboBoxModel // ---------------------------------------------------- -class UnoControlComboBoxModel : public UnoControlModel +class UnoControlComboBoxModel : public UnoControlListBoxModel { protected: ::com::sun::star::uno::Any ImplGetDefaultValue( sal_uInt16 nPropId ) const; @@ -903,7 +905,7 @@ protected: public: UnoControlComboBoxModel(); - UnoControlComboBoxModel( const UnoControlComboBoxModel& rModel ) : UnoControlModel( rModel ) {;} + UnoControlComboBoxModel( const UnoControlComboBoxModel& rModel ) : UnoControlListBoxModel( rModel ) {;} UnoControlModel* Clone() const { return new UnoControlComboBoxModel( *this ); } @@ -912,6 +914,8 @@ public: // ::com::sun::star::beans::XMultiPropertySet ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException); + // OPropertySetHelper + void SAL_CALL setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, const ::com::sun::star::uno::Any& rValue ) throw (::com::sun::star::uno::Exception); // ::com::sun::star::lang::XServiceInfo DECLIMPL_SERVICEINFO_DERIVED( UnoControlComboBoxModel, UnoControlModel, szServiceName2_UnoControlComboBoxModel ) @@ -921,8 +925,10 @@ public: // ---------------------------------------------------- // class UnoComboBoxControl // ---------------------------------------------------- -class UnoComboBoxControl : public UnoEditControl, - public ::com::sun::star::awt::XComboBox +class UnoComboBoxControl : public UnoEditControl + , public ::com::sun::star::awt::XComboBox + , public ::com::sun::star::awt::XItemListener + , public ::com::sun::star::awt::XItemListListener { private: ActionListenerMultiplexer maActionListeners; @@ -933,12 +939,15 @@ public: UnoComboBoxControl(); ::rtl::OUString GetComponentServiceName(); + 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); + void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw(::com::sun::star::uno::RuntimeException) { UnoEditControl::disposing( Source ); } + void SAL_CALL dispose( ) throw(::com::sun::star::uno::RuntimeException); + ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException) { return UnoEditControl::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 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); - void SAL_CALL dispose( ) 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); @@ -958,8 +967,26 @@ public: sal_Int16 SAL_CALL getDropDownLineCount( ) throw(::com::sun::star::uno::RuntimeException); void SAL_CALL setDropDownLineCount( sal_Int16 nLines ) throw(::com::sun::star::uno::RuntimeException); + // XUnoControl + virtual sal_Bool SAL_CALL setModel(const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel >& Model) throw ( ::com::sun::star::uno::RuntimeException ); + + // XItemListListener + virtual void SAL_CALL listItemInserted( const ::com::sun::star::awt::ItemListEvent& Event ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL listItemRemoved( const ::com::sun::star::awt::ItemListEvent& Event ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL listItemModified( const ::com::sun::star::awt::ItemListEvent& Event ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL allItemsRemoved( const ::com::sun::star::lang::EventObject& Event ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL itemListChanged( const ::com::sun::star::lang::EventObject& Event ) throw (::com::sun::star::uno::RuntimeException); + + // XItemListener + virtual void SAL_CALL itemStateChanged( const ::com::sun::star::awt::ItemEvent& rEvent ) throw (::com::sun::star::uno::RuntimeException); + // ::com::sun::star::lang::XServiceInfo DECLIMPL_SERVICEINFO_DERIVED( UnoComboBoxControl, UnoEditControl, szServiceName2_UnoControlComboBox ) +protected: + virtual void ImplSetPeerProperty( const ::rtl::OUString& rPropName, const ::com::sun::star::uno::Any& rVal ); + virtual void updateFromModel(); + ActionListenerMultiplexer& getActionListeners(); + ItemListenerMultiplexer& getItemListeners(); }; diff --git a/toolkit/source/awt/vclxwindows.cxx b/toolkit/source/awt/vclxwindows.cxx index 4a68b4c80e3f..8b00cd450ab6 100644 --- a/toolkit/source/awt/vclxwindows.cxx +++ b/toolkit/source/awt/vclxwindows.cxx @@ -3896,20 +3896,6 @@ VCLXComboBox::~VCLXComboBox() #endif } -// ::com::sun::star::uno::XInterface -::com::sun::star::uno::Any VCLXComboBox::queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException) -{ - ::com::sun::star::uno::Any aRet = ::cppu::queryInterface( rType, - SAL_STATIC_CAST( ::com::sun::star::awt::XComboBox*, this ) ); - return (aRet.hasValue() ? aRet : VCLXEdit::queryInterface( rType )); -} - -// ::com::sun::star::lang::XTypeProvider -IMPL_XTYPEPROVIDER_START( VCLXComboBox ) - getCppuType( ( ::com::sun::star::uno::Reference< ::com::sun::star::awt::XComboBox>* ) NULL ), - VCLXEdit::getTypes() -IMPL_XTYPEPROVIDER_END - ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleContext > VCLXComboBox::CreateAccessibleContext() { ::vos::OGuard aGuard( GetMutex() ); @@ -3973,8 +3959,12 @@ void VCLXComboBox::addItems( const ::com::sun::star::uno::Sequence< ::rtl::OUStr for ( sal_uInt16 n = 0; n < aItems.getLength(); n++ ) { pBox->InsertEntry( aItems.getConstArray()[n], nP ); - if ( (sal_uInt16)nPos < 0xFFFF ) // Nicht wenn 0xFFFF, weil LIST_APPEND - nP++; + if ( nP == 0xFFFF ) + { + OSL_ENSURE( false, "VCLXComboBox::addItems: too many entries!" ); + // skip remaining entries, list cannot hold them, anyway + break; + } } } } @@ -4078,14 +4068,8 @@ void VCLXComboBox::setProperty( const ::rtl::OUString& PropertyName, const ::com ::com::sun::star::uno::Sequence< ::rtl::OUString> aItems; if ( Value >>= aItems ) { - sal_Bool bUpdate = pComboBox->IsUpdateMode(); - pComboBox->SetUpdateMode( sal_False ); pComboBox->Clear(); - const ::rtl::OUString* pStrings = aItems.getConstArray(); - sal_Int32 nItems = aItems.getLength(); - for ( sal_Int32 n = 0; n < nItems; n++ ) - pComboBox->InsertEntry( pStrings[n], LISTBOX_APPEND ); - pComboBox->SetUpdateMode( bUpdate ); + addItems( aItems, 0 ); } } break; @@ -4255,6 +4239,104 @@ void VCLXComboBox::getColumnsAndLines( sal_Int16& nCols, sal_Int16& nLines ) thr nLines = nL; } } +void SAL_CALL VCLXComboBox::listItemInserted( const ItemListEvent& i_rEvent ) throw (RuntimeException) +{ + ::vos::OGuard aGuard( GetMutex() ); + + ComboBox* pComboBox = dynamic_cast< ComboBox* >( GetWindow() ); + + ENSURE_OR_RETURN_VOID( pComboBox, "VCLXComboBox::listItemInserted: no ComboBox?!" ); + ENSURE_OR_RETURN_VOID( ( i_rEvent.ItemPosition >= 0 ) && ( i_rEvent.ItemPosition <= sal_Int32( pComboBox->GetEntryCount() ) ), + "VCLXComboBox::listItemInserted: illegal (inconsistent) item position!" ); + pComboBox->InsertEntry( + i_rEvent.ItemText.IsPresent ? i_rEvent.ItemText.Value : ::rtl::OUString(), + i_rEvent.ItemImageURL.IsPresent ? lcl_getImageFromURL( i_rEvent.ItemImageURL.Value ) : Image(), + i_rEvent.ItemPosition ); +} + +void SAL_CALL VCLXComboBox::listItemRemoved( const ItemListEvent& i_rEvent ) throw (RuntimeException) +{ + ::vos::OGuard aGuard( GetMutex() ); + + ComboBox* pComboBox = dynamic_cast< ComboBox* >( GetWindow() ); + + ENSURE_OR_RETURN_VOID( pComboBox, "VCLXComboBox::listItemRemoved: no ComboBox?!" ); + ENSURE_OR_RETURN_VOID( ( i_rEvent.ItemPosition >= 0 ) && ( i_rEvent.ItemPosition < sal_Int32( pComboBox->GetEntryCount() ) ), + "VCLXComboBox::listItemRemoved: illegal (inconsistent) item position!" ); + + pComboBox->RemoveEntry( i_rEvent.ItemPosition ); +} + +void SAL_CALL VCLXComboBox::listItemModified( const ItemListEvent& i_rEvent ) throw (RuntimeException) +{ + ::vos::OGuard aGuard( GetMutex() ); + + ComboBox* pComboBox = dynamic_cast< ComboBox* >( GetWindow() ); + + ENSURE_OR_RETURN_VOID( pComboBox, "VCLXComboBox::listItemModified: no ComboBox?!" ); + ENSURE_OR_RETURN_VOID( ( i_rEvent.ItemPosition >= 0 ) && ( i_rEvent.ItemPosition < sal_Int32( pComboBox->GetEntryCount() ) ), + "VCLXComboBox::listItemModified: illegal (inconsistent) item position!" ); + + // VCL's ComboBox does not support changing an entry's text or image, so remove and re-insert + + const ::rtl::OUString sNewText = i_rEvent.ItemText.IsPresent ? i_rEvent.ItemText.Value : ::rtl::OUString( pComboBox->GetEntry( i_rEvent.ItemPosition ) ); + const Image aNewImage( i_rEvent.ItemImageURL.IsPresent ? lcl_getImageFromURL( i_rEvent.ItemImageURL.Value ) : pComboBox->GetEntryImage( i_rEvent.ItemPosition ) ); + + pComboBox->RemoveEntry( i_rEvent.ItemPosition ); + pComboBox->InsertEntry( sNewText, aNewImage, i_rEvent.ItemPosition ); +} + +void SAL_CALL VCLXComboBox::allItemsRemoved( const EventObject& i_rEvent ) throw (RuntimeException) +{ + ::vos::OGuard aGuard( GetMutex() ); + + ComboBox* pComboBox = dynamic_cast< ComboBox* >( GetWindow() ); + ENSURE_OR_RETURN_VOID( pComboBox, "VCLXComboBox::listItemModified: no ComboBox?!" ); + + pComboBox->Clear(); + + (void)i_rEvent; +} + +void SAL_CALL VCLXComboBox::itemListChanged( const EventObject& i_rEvent ) throw (RuntimeException) +{ + ::vos::OGuard aGuard( GetMutex() ); + + ComboBox* pComboBox = dynamic_cast< ComboBox* >( GetWindow() ); + ENSURE_OR_RETURN_VOID( pComboBox, "VCLXComboBox::listItemModified: no ComboBox?!" ); + + pComboBox->Clear(); + + uno::Reference< beans::XPropertySet > xPropSet( i_rEvent.Source, uno::UNO_QUERY_THROW ); + uno::Reference< beans::XPropertySetInfo > xPSI( xPropSet->getPropertySetInfo(), uno::UNO_QUERY_THROW ); + // bool localize = xPSI->hasPropertyByName( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ResourceResolver" ) ) ); + uno::Reference< resource::XStringResourceResolver > xStringResourceResolver; + if ( xPSI->hasPropertyByName( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ResourceResolver" ) ) ) ) + { + xStringResourceResolver.set( + xPropSet->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ResourceResolver" ) ) ), + uno::UNO_QUERY + ); + } + + + Reference< XItemList > xItemList( i_rEvent.Source, uno::UNO_QUERY_THROW ); + uno::Sequence< beans::Pair< ::rtl::OUString, ::rtl::OUString > > aItems = xItemList->getAllItems(); + for ( sal_Int32 i=0; iresolveString(aLocalizationKey.copy( 1 )); + } + pComboBox->InsertEntry( aLocalizationKey, lcl_getImageFromURL( aItems[i].Second ) ); + } +} +void SAL_CALL VCLXComboBox::disposing( const EventObject& i_rEvent ) throw (RuntimeException) +{ + // just disambiguate + VCLXEdit::disposing( i_rEvent ); +} // ---------------------------------------------------- // class VCLXFormattedSpinField diff --git a/toolkit/source/controls/unocontrols.cxx b/toolkit/source/controls/unocontrols.cxx index 6599b039600f..b6f654a02145 100644 --- a/toolkit/source/controls/unocontrols.cxx +++ b/toolkit/source/controls/unocontrols.cxx @@ -1826,6 +1826,13 @@ UnoControlListBoxModel::UnoControlListBoxModel() { UNO_CONTROL_MODEL_REGISTER_PROPERTIES( VCLXListBox ); } +// --------------------------------------------------------------------------------------------------------------------- +UnoControlListBoxModel::UnoControlListBoxModel(bool) + :UnoControlListBoxModel_Base() + ,m_pData( new UnoControlListBoxModel_Data( *this ) ) + ,m_aItemListListeners( GetMutex() ) +{ +} // --------------------------------------------------------------------------------------------------------------------- UnoControlListBoxModel::UnoControlListBoxModel( const UnoControlListBoxModel& i_rSource ) @@ -1842,7 +1849,6 @@ UnoControlListBoxModel::~UnoControlListBoxModel() { return ::rtl::OUString::createFromAscii( szServiceName_UnoControlListBoxModel ); } - // --------------------------------------------------------------------------------------------------------------------- uno::Any UnoControlListBoxModel::ImplGetDefaultValue( sal_uInt16 nPropId ) const { @@ -2687,28 +2693,16 @@ ItemListenerMultiplexer& UnoListBoxControl::getItemListeners() // ---------------------------------------------------- // class UnoControlComboBoxModel // ---------------------------------------------------- -UnoControlComboBoxModel::UnoControlComboBoxModel() +UnoControlComboBoxModel::UnoControlComboBoxModel() : UnoControlListBoxModel(true) { UNO_CONTROL_MODEL_REGISTER_PROPERTIES( VCLXComboBox ); } - -::rtl::OUString UnoControlComboBoxModel::getServiceName() throw(::com::sun::star::uno::RuntimeException) -{ - return ::rtl::OUString::createFromAscii( szServiceName_UnoControlComboBoxModel ); -} - -uno::Any UnoControlComboBoxModel::ImplGetDefaultValue( sal_uInt16 nPropId ) const +uno::Reference< beans::XPropertySetInfo > UnoControlComboBoxModel::getPropertySetInfo( ) throw(uno::RuntimeException) { - if ( nPropId == BASEPROPERTY_DEFAULTCONTROL ) - { - uno::Any aAny; - aAny <<= ::rtl::OUString::createFromAscii( szServiceName_UnoControlComboBox ); - return aAny; - } - return UnoControlModel::ImplGetDefaultValue( nPropId ); + static uno::Reference< beans::XPropertySetInfo > xInfo( createPropertySetInfo( getInfoHelper() ) ); + return xInfo; } - - +// --------------------------------------------------------------------------------------------------------------------- ::cppu::IPropertyArrayHelper& UnoControlComboBoxModel::getInfoHelper() { static UnoPropertyArrayHelper* pHelper = NULL; @@ -2720,14 +2714,53 @@ uno::Any UnoControlComboBoxModel::ImplGetDefaultValue( sal_uInt16 nPropId ) cons return *pHelper; } -// beans::XMultiPropertySet -uno::Reference< beans::XPropertySetInfo > UnoControlComboBoxModel::getPropertySetInfo( ) throw(uno::RuntimeException) + +::rtl::OUString UnoControlComboBoxModel::getServiceName() throw(::com::sun::star::uno::RuntimeException) { - static uno::Reference< beans::XPropertySetInfo > xInfo( createPropertySetInfo( getInfoHelper() ) ); - return xInfo; + return ::rtl::OUString::createFromAscii( szServiceName_UnoControlComboBoxModel ); } +void SAL_CALL UnoControlComboBoxModel::setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, const uno::Any& rValue ) throw (uno::Exception) +{ + UnoControlModel::setFastPropertyValue_NoBroadcast( nHandle, rValue ); + if ( nHandle == BASEPROPERTY_STRINGITEMLIST && !m_pData->m_bSettingLegacyProperty) + { + // synchronize the legacy StringItemList property with our list items + Sequence< ::rtl::OUString > aStringItemList; + Any aPropValue; + getFastPropertyValue( aPropValue, BASEPROPERTY_STRINGITEMLIST ); + OSL_VERIFY( aPropValue >>= aStringItemList ); + + ::std::vector< ListItem > aItems( aStringItemList.getLength() ); + ::std::transform( + aStringItemList.getConstArray(), + aStringItemList.getConstArray() + aStringItemList.getLength(), + aItems.begin(), + CreateListItem() + ); + m_pData->setAllItems( aItems ); + + // since an XItemListListener does not have a "all items modified" or some such method, + // we simulate this by notifying removal of all items, followed by insertion of all new + // items + lang::EventObject aEvent; + aEvent.Source = *this; + m_aItemListListeners.notifyEach( &XItemListListener::itemListChanged, aEvent ); + // TODO: OPropertySetHelper calls into this method with the mutex locked ... + // which is wrong for the above notifications ... + } +} +uno::Any UnoControlComboBoxModel::ImplGetDefaultValue( sal_uInt16 nPropId ) const +{ + if ( nPropId == BASEPROPERTY_DEFAULTCONTROL ) + { + uno::Any aAny; + aAny <<= ::rtl::OUString::createFromAscii( szServiceName_UnoControlComboBox ); + return aAny; + } + return UnoControlModel::ImplGetDefaultValue( nPropId ); +} // ---------------------------------------------------- // class UnoComboBoxControl @@ -2745,29 +2778,58 @@ UnoComboBoxControl::UnoComboBoxControl() return ::rtl::OUString::createFromAscii( "combobox" ); } -// uno::XInterface +void UnoComboBoxControl::dispose() throw(uno::RuntimeException) +{ + lang::EventObject aEvt; + aEvt.Source = (::cppu::OWeakObject*)this; + maActionListeners.disposeAndClear( aEvt ); + maItemListeners.disposeAndClear( aEvt ); + UnoControl::dispose(); +} uno::Any UnoComboBoxControl::queryAggregation( const uno::Type & rType ) throw(uno::RuntimeException) { uno::Any aRet = ::cppu::queryInterface( rType, SAL_STATIC_CAST( awt::XComboBox*, this ) ); + if ( !aRet.hasValue() ) + { + aRet = ::cppu::queryInterface( rType, + SAL_STATIC_CAST( awt::XItemListener*, this ) ); + if ( !aRet.hasValue() ) + { + aRet = ::cppu::queryInterface( rType, + SAL_STATIC_CAST( awt::XItemListListener*, this ) ); + } + } return (aRet.hasValue() ? aRet : UnoEditControl::queryAggregation( rType )); } - // lang::XTypeProvider IMPL_XTYPEPROVIDER_START( UnoComboBoxControl ) getCppuType( ( uno::Reference< awt::XComboBox>* ) NULL ), + getCppuType( ( uno::Reference< awt::XItemListener>* ) NULL ), + getCppuType( ( uno::Reference< awt::XItemListListener>* ) NULL ), UnoEditControl::getTypes() IMPL_XTYPEPROVIDER_END -void UnoComboBoxControl::dispose() throw(uno::RuntimeException) +void UnoComboBoxControl::updateFromModel() { - lang::EventObject aEvt; - aEvt.Source = (::cppu::OWeakObject*)this; - maActionListeners.disposeAndClear( aEvt ); - maItemListeners.disposeAndClear( aEvt ); - UnoControl::dispose(); + UnoEditControl::updateFromModel(); + + Reference< XItemListListener > xItemListListener( getPeer(), UNO_QUERY ); + ENSURE_OR_RETURN_VOID( xItemListListener.is(), "UnoComboBoxControl::updateFromModel: a peer which is no ItemListListener?!" ); + + EventObject aEvent( getModel() ); + xItemListListener->itemListChanged( aEvent ); } +void UnoComboBoxControl::ImplSetPeerProperty( const ::rtl::OUString& rPropName, const uno::Any& rVal ) +{ + if ( rPropName == GetPropertyName( BASEPROPERTY_STRINGITEMLIST ) ) + // do not forward this to our peer. We are a XItemListListener at our model, and changes in the string item + // list (which is a legacy property) will, later, arrive as changes in the ItemList. Those latter changes + // will be forwarded to the peer, which will update itself accordingly. + return; + UnoEditControl::ImplSetPeerProperty( rPropName, rVal ); +} void UnoComboBoxControl::createPeer( const uno::Reference< awt::XToolkit > & rxToolkit, const uno::Reference< awt::XWindowPeer > & rParentPeer ) throw(uno::RuntimeException) { UnoEditControl::createPeer( rxToolkit, rParentPeer ); @@ -2818,6 +2880,93 @@ void UnoComboBoxControl::removeItemListener(const uno::Reference < awt::XItemLis } maItemListeners.removeInterface( l ); } +void UnoComboBoxControl::itemStateChanged( const awt::ItemEvent& rEvent ) throw(uno::RuntimeException) +{ + if ( maItemListeners.getLength() ) + { + try + { + maItemListeners.itemStateChanged( rEvent ); + } + catch( const Exception& e ) + { +#if OSL_DEBUG_LEVEL == 0 + (void) e; // suppress warning +#else + ::rtl::OString sMessage( "UnoComboBoxControl::itemStateChanged: caught an exception:\n" ); + sMessage += ::rtl::OString( e.Message.getStr(), e.Message.getLength(), RTL_TEXTENCODING_ASCII_US ); + OSL_ENSURE( sal_False, sMessage.getStr() ); +#endif + } + } +} +sal_Bool SAL_CALL UnoComboBoxControl::setModel( const uno::Reference< awt::XControlModel >& i_rModel ) throw ( uno::RuntimeException ) +{ + ::osl::MutexGuard aGuard( GetMutex() ); + + const Reference< XItemList > xOldItems( getModel(), UNO_QUERY ); + OSL_ENSURE( xOldItems.is() || !getModel().is(), "UnoComboBoxControl::setModel: illegal old model!" ); + const Reference< XItemList > xNewItems( i_rModel, UNO_QUERY ); + OSL_ENSURE( xNewItems.is() || !i_rModel.is(), "UnoComboBoxControl::setModel: illegal new model!" ); + + if ( !UnoEditControl::setModel( i_rModel ) ) + return sal_False; + + if ( xOldItems.is() ) + xOldItems->removeItemListListener( this ); + if ( xNewItems.is() ) + xNewItems->addItemListListener( this ); + + return sal_True; +} + +void SAL_CALL UnoComboBoxControl::listItemInserted( const awt::ItemListEvent& i_rEvent ) throw (uno::RuntimeException) +{ + const Reference< XItemListListener > xPeerListener( getPeer(), UNO_QUERY ); + OSL_ENSURE( xPeerListener.is() || !getPeer().is(), "UnoComboBoxControl::listItemInserted: invalid peer!" ); + if ( xPeerListener.is() ) + xPeerListener->listItemInserted( i_rEvent ); +} + +void SAL_CALL UnoComboBoxControl::listItemRemoved( const awt::ItemListEvent& i_rEvent ) throw (uno::RuntimeException) +{ + const Reference< XItemListListener > xPeerListener( getPeer(), UNO_QUERY ); + OSL_ENSURE( xPeerListener.is() || !getPeer().is(), "UnoComboBoxControl::listItemRemoved: invalid peer!" ); + if ( xPeerListener.is() ) + xPeerListener->listItemRemoved( i_rEvent ); +} + +void SAL_CALL UnoComboBoxControl::listItemModified( const awt::ItemListEvent& i_rEvent ) throw (uno::RuntimeException) +{ + const Reference< XItemListListener > xPeerListener( getPeer(), UNO_QUERY ); + OSL_ENSURE( xPeerListener.is() || !getPeer().is(), "UnoComboBoxControl::listItemModified: invalid peer!" ); + if ( xPeerListener.is() ) + xPeerListener->listItemModified( i_rEvent ); +} + +void SAL_CALL UnoComboBoxControl::allItemsRemoved( const lang::EventObject& i_rEvent ) throw (uno::RuntimeException) +{ + const Reference< XItemListListener > xPeerListener( getPeer(), UNO_QUERY ); + OSL_ENSURE( xPeerListener.is() || !getPeer().is(), "UnoComboBoxControl::allItemsRemoved: invalid peer!" ); + if ( xPeerListener.is() ) + xPeerListener->allItemsRemoved( i_rEvent ); +} + +void SAL_CALL UnoComboBoxControl::itemListChanged( const lang::EventObject& i_rEvent ) throw (uno::RuntimeException) +{ + const Reference< XItemListListener > xPeerListener( getPeer(), UNO_QUERY ); + OSL_ENSURE( xPeerListener.is() || !getPeer().is(), "UnoComboBoxControl::itemListChanged: invalid peer!" ); + if ( xPeerListener.is() ) + xPeerListener->itemListChanged( i_rEvent ); +} +ActionListenerMultiplexer& UnoComboBoxControl::getActionListeners() +{ + return maActionListeners; +} +ItemListenerMultiplexer& UnoComboBoxControl::getItemListeners() +{ + return maItemListeners; +} void UnoComboBoxControl::addItem( const ::rtl::OUString& aItem, sal_Int16 nPos ) throw(uno::RuntimeException) { -- cgit v1.2.3 From 1b191d8cb9c0412c17d00323fcca66552372e888 Mon Sep 17 00:00:00 2001 From: sb Date: Thu, 1 Jul 2010 13:01:22 +0200 Subject: jl154: #i112673# ensure that client-facing PID remains the same across internal OOo restart on Mac OS X --- comphelper/source/misc/officerestartmanager.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/comphelper/source/misc/officerestartmanager.cxx b/comphelper/source/misc/officerestartmanager.cxx index 974b8d65e7ae..1a98ddfce8da 100644 --- a/comphelper/source/misc/officerestartmanager.cxx +++ b/comphelper/source/misc/officerestartmanager.cxx @@ -87,9 +87,9 @@ void SAL_CALL OOfficeRestartManager::requestRestart( const uno::Reference< task: // if the restart already running there is no need to trigger it again if ( m_bRestartRequested ) return; -#ifndef MACOSX + m_bRestartRequested = sal_True; -#endif + // the office is still not initialized, no need to terminate, changing the state is enough if ( !m_bOfficeInitialized ) return; -- cgit v1.2.3 From f6708992a050b6b2b84d7783e52916161637dde8 Mon Sep 17 00:00:00 2001 From: Andre Fischer Date: Thu, 1 Jul 2010 14:05:39 +0200 Subject: impress193 #i112841# Prevent marquee text from crashing when too wide. --- canvas/source/tools/pagemanager.cxx | 42 +++++++++++++++++++++---------------- 1 file changed, 24 insertions(+), 18 deletions(-) diff --git a/canvas/source/tools/pagemanager.cxx b/canvas/source/tools/pagemanager.cxx index b867b432857c..b2a71bf86cd3 100644 --- a/canvas/source/tools/pagemanager.cxx +++ b/canvas/source/tools/pagemanager.cxx @@ -70,7 +70,8 @@ namespace canvas { maPages.push_back(pPage); FragmentSharedPtr pFragment(pPage->allocateSpace(rSize)); - maFragments.push_back(pFragment); + if (pFragment) + maFragments.push_back(pFragment); return pFragment; } @@ -124,34 +125,39 @@ namespace canvas FragmentContainer_t::const_iterator candidate(maFragments.begin()); while(candidate != aEnd) { - if(!((*candidate)->isNaked())) + if(*candidate && !((*candidate)->isNaked())) break; ++candidate; } - const ::basegfx::B2ISize& rSize((*candidate)->getSize()); - sal_uInt32 nMaxArea(rSize.getX()*rSize.getY()); - - FragmentContainer_t::const_iterator it(candidate); - while(it != aEnd) + if (candidate != aEnd) { - if(!((*it)->isNaked())) + const ::basegfx::B2ISize& rSize((*candidate)->getSize()); + sal_uInt32 nMaxArea(rSize.getX()*rSize.getY()); + + FragmentContainer_t::const_iterator it(candidate); + while(it != aEnd) { - const ::basegfx::B2ISize& rCandidateSize((*it)->getSize()); - const sal_uInt32 nArea(rCandidateSize.getX()*rCandidateSize.getY()); - if(nArea > nMaxArea) + if (*it && !((*it)->isNaked())) { - candidate=it; - nMaxArea=nArea; + const ::basegfx::B2ISize& rCandidateSize((*it)->getSize()); + const sal_uInt32 nArea(rCandidateSize.getX()*rCandidateSize.getY()); + if(nArea > nMaxArea) + { + candidate=it; + nMaxArea=nArea; + } } + + ++it; } - ++it; + // this does not erase the candidate, + // but makes it 'naked'... + (*candidate)->free(*candidate); } - - // this does not erase the candidate, - // but makes it 'naked'... - (*candidate)->free(*candidate); + else + break; } } -- cgit v1.2.3 From 29996eb2ffd0239accf1ea425cd737bf4ce78ccf Mon Sep 17 00:00:00 2001 From: "Ocke Janssen [oj]" Date: Thu, 1 Jul 2010 15:52:47 +0200 Subject: unoawt2: do not inline methods of exported classes --- toolkit/inc/toolkit/controls/unocontrols.hxx | 16 ++++++++++++---- toolkit/source/controls/unocontrols.cxx | 18 ++++++++++++++++++ 2 files changed, 30 insertions(+), 4 deletions(-) diff --git a/toolkit/inc/toolkit/controls/unocontrols.hxx b/toolkit/inc/toolkit/controls/unocontrols.hxx index 1bcbfec7a556..01ff047ee3de 100644 --- a/toolkit/inc/toolkit/controls/unocontrols.hxx +++ b/toolkit/inc/toolkit/controls/unocontrols.hxx @@ -750,7 +750,9 @@ public: ::rtl::OUString SAL_CALL getServiceName() throw(::com::sun::star::uno::RuntimeException); // ::com::sun::star::lang::XServiceInfo - DECLIMPL_SERVICEINFO_DERIVED( UnoControlListBoxModel, UnoControlModel, szServiceName2_UnoControlListBoxModel ) + //DECLIMPL_SERVICEINFO_DERIVED( UnoControlListBoxModel, UnoControlModel, szServiceName2_UnoControlListBoxModel ) + ::rtl::OUString SAL_CALL getImplementationName( ) throw(::com::sun::star::uno::RuntimeException); + ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException); // ::com::sun::star::awt::XItemList virtual ::sal_Int32 SAL_CALL getItemCount() throw (::com::sun::star::uno::RuntimeException); @@ -880,7 +882,9 @@ public: virtual void SAL_CALL itemListChanged( const ::com::sun::star::lang::EventObject& Event ) throw (::com::sun::star::uno::RuntimeException); // ::com::sun::star::lang::XServiceInfo - DECLIMPL_SERVICEINFO_DERIVED( UnoListBoxControl, UnoControlBase, szServiceName2_UnoControlListBox ) + // DECLIMPL_SERVICEINFO_DERIVED( UnoListBoxControl, UnoControlBase, szServiceName2_UnoControlListBox ) + ::rtl::OUString SAL_CALL getImplementationName( ) throw(::com::sun::star::uno::RuntimeException); + ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException); protected: void ImplUpdateSelectedItemsProperty(); @@ -918,7 +922,9 @@ public: void SAL_CALL setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, const ::com::sun::star::uno::Any& rValue ) throw (::com::sun::star::uno::Exception); // ::com::sun::star::lang::XServiceInfo - DECLIMPL_SERVICEINFO_DERIVED( UnoControlComboBoxModel, UnoControlModel, szServiceName2_UnoControlComboBoxModel ) + ::rtl::OUString SAL_CALL getImplementationName( ) throw(::com::sun::star::uno::RuntimeException); + ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException); + // DECLIMPL_SERVICEINFO_DERIVED( UnoControlComboBoxModel, UnoControlModel, szServiceName2_UnoControlComboBoxModel ) }; @@ -981,7 +987,9 @@ public: virtual void SAL_CALL itemStateChanged( const ::com::sun::star::awt::ItemEvent& rEvent ) throw (::com::sun::star::uno::RuntimeException); // ::com::sun::star::lang::XServiceInfo - DECLIMPL_SERVICEINFO_DERIVED( UnoComboBoxControl, UnoEditControl, szServiceName2_UnoControlComboBox ) + ::rtl::OUString SAL_CALL getImplementationName( ) throw(::com::sun::star::uno::RuntimeException); + ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException); + //DECLIMPL_SERVICEINFO_DERIVED( UnoComboBoxControl, UnoEditControl, szServiceName2_UnoControlComboBox ) protected: virtual void ImplSetPeerProperty( const ::rtl::OUString& rPropName, const ::com::sun::star::uno::Any& rVal ); virtual void updateFromModel(); diff --git a/toolkit/source/controls/unocontrols.cxx b/toolkit/source/controls/unocontrols.cxx index b6f654a02145..d0961188d06c 100644 --- a/toolkit/source/controls/unocontrols.cxx +++ b/toolkit/source/controls/unocontrols.cxx @@ -80,6 +80,18 @@ using ::com::sun::star::graphic::XGraphic; using ::com::sun::star::uno::Reference; using namespace ::toolkit; +#define IMPL_SERVICEINFO_DERIVED( ImplName, BaseClass, ServiceName ) \ + ::rtl::OUString SAL_CALL ImplName::getImplementationName( ) throw(::com::sun::star::uno::RuntimeException) { return ::rtl::OUString::createFromAscii( "stardiv.Toolkit." #ImplName ); } \ + ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL ImplName::getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException) \ + { \ + ::com::sun::star::uno::Sequence< ::rtl::OUString > aNames = BaseClass::getSupportedServiceNames( ); \ + aNames.realloc( aNames.getLength() + 1 ); \ + aNames[ aNames.getLength() - 1 ] = ::rtl::OUString::createFromAscii( ServiceName ); \ + return aNames; \ + } \ + + + // ---------------------------------------------------- // class UnoControlEditModel // ---------------------------------------------------- @@ -1844,6 +1856,7 @@ UnoControlListBoxModel::UnoControlListBoxModel( const UnoControlListBoxModel& i_ UnoControlListBoxModel::~UnoControlListBoxModel() { } +IMPL_SERVICEINFO_DERIVED( UnoControlListBoxModel, UnoControlModel, szServiceName2_UnoControlListBoxModel ) // --------------------------------------------------------------------------------------------------------------------- ::rtl::OUString UnoControlListBoxModel::getServiceName() throw(::com::sun::star::uno::RuntimeException) { @@ -2276,6 +2289,7 @@ UnoListBoxControl::UnoListBoxControl() { return ::rtl::OUString::createFromAscii( "listbox" ); } +IMPL_SERVICEINFO_DERIVED( UnoListBoxControl, UnoControlBase, szServiceName2_UnoControlListBox ) void UnoListBoxControl::dispose() throw(uno::RuntimeException) { @@ -2697,6 +2711,9 @@ UnoControlComboBoxModel::UnoControlComboBoxModel() : UnoControlListBoxModel(true { UNO_CONTROL_MODEL_REGISTER_PROPERTIES( VCLXComboBox ); } + +IMPL_SERVICEINFO_DERIVED( UnoControlComboBoxModel, UnoControlModel, szServiceName2_UnoControlComboBoxModel ) + uno::Reference< beans::XPropertySetInfo > UnoControlComboBoxModel::getPropertySetInfo( ) throw(uno::RuntimeException) { static uno::Reference< beans::XPropertySetInfo > xInfo( createPropertySetInfo( getInfoHelper() ) ); @@ -2772,6 +2789,7 @@ UnoComboBoxControl::UnoComboBoxControl() maComponentInfos.nWidth = 100; maComponentInfos.nHeight = 12; } +IMPL_SERVICEINFO_DERIVED( UnoComboBoxControl, UnoEditControl, szServiceName2_UnoControlComboBox ) ::rtl::OUString UnoComboBoxControl::GetComponentServiceName() { -- cgit v1.2.3 From 0fcfca6c6b5494370418d2c76862d0710fabb6c5 Mon Sep 17 00:00:00 2001 From: "Herbert Duerr [hdu]" Date: Thu, 1 Jul 2010 17:10:00 +0200 Subject: #i112731# use known fontsubst attributes for better font fallback --- vcl/source/gdi/outdev3.cxx | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/vcl/source/gdi/outdev3.cxx b/vcl/source/gdi/outdev3.cxx index 50d2601f9d27..c54d9acf5c52 100644 --- a/vcl/source/gdi/outdev3.cxx +++ b/vcl/source/gdi/outdev3.cxx @@ -1644,10 +1644,25 @@ ImplDevFontListData* ImplDevFontList::ImplFindBySubstFontAttr( const utl::FontNa pFoundData = ImplFindBySearchName( aSearchName ); if( pFoundData ) - break; + return pFoundData; } - return pFoundData; + // use known attributes from the configuration to find a matching substitute + const ULONG nSearchType = rFontAttr.Type; + if( nSearchType != 0 ) + { + const FontWeight eSearchWeight = rFontAttr.Weight; + const FontWidth eSearchWidth = rFontAttr.Width; + const FontItalic eSearchSlant = ITALIC_DONTKNOW; + const FontFamily eSearchFamily = FAMILY_DONTKNOW; + const String aSearchName; + pFoundData = ImplFindByAttributes( nSearchType, + eSearchWeight, eSearchWidth, eSearchFamily, eSearchSlant, aSearchName ); + if( pFoundData ) + return pFoundData; + } + + return NULL; } // ----------------------------------------------------------------------- -- cgit v1.2.3 From bd7beb161d6fc36c3b5d653f0710df49aa5ff7f7 Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Thu, 1 Jul 2010 17:18:09 +0200 Subject: vcl113: #i95420# when drawing native controls, also take their native sizes into account --- svtools/inc/svtools/svlbitm.hxx | 2 ++ svtools/source/contnr/svlbitm.cxx | 45 +++++++++++++++++++++++++++++++++++---- 2 files changed, 43 insertions(+), 4 deletions(-) diff --git a/svtools/inc/svtools/svlbitm.hxx b/svtools/inc/svtools/svlbitm.hxx index c28b8d5db10c..5158c38fbd87 100644 --- a/svtools/inc/svtools/svlbitm.hxx +++ b/svtools/inc/svtools/svlbitm.hxx @@ -176,6 +176,8 @@ class SVT_DLLPUBLIC SvLBoxButton : public SvLBoxItem USHORT nItemFlags; USHORT nImgArrOffs; USHORT nBaseOffs; + + void ImplAdjustBoxSize( Size& io_rCtrlSize, ControlType i_eType, Window* pParent ); public: // An SvLBoxButton can be of three different kinds: an // enabled checkbox (the normal kind), a disabled checkbox diff --git a/svtools/source/contnr/svlbitm.cxx b/svtools/source/contnr/svlbitm.cxx index 82321b53259e..bcdc21bfe9f7 100644 --- a/svtools/source/contnr/svlbitm.cxx +++ b/svtools/source/contnr/svlbitm.cxx @@ -406,7 +406,7 @@ BOOL SvLBoxButton::ClickHdl( SvLBox*, SvLBoxEntry* pEntry ) } void SvLBoxButton::Paint( const Point& rPos, SvLBox& rDev, USHORT /* nFlags */, - SvLBoxEntry* ) + SvLBoxEntry* pEntry ) { DBG_CHKTHIS(SvLBoxButton,0); USHORT nIndex = eKind == SvLBoxButtonKind_staticImage @@ -422,10 +422,13 @@ void SvLBoxButton::Paint( const Point& rPos, SvLBox& rDev, USHORT /* nFlags */, if( rDev.GetOutDevType() == OUTDEV_WINDOW ) pWin = (Window*) &rDev; - if ( nIndex != SV_BMP_STATICIMAGE && pWin && pWin->IsNativeControlSupported( (pData->IsRadio())? CTRL_RADIOBUTTON : CTRL_CHECKBOX, PART_ENTIRE_CONTROL) ) + ControlType eCtrlType = (pData->IsRadio())? CTRL_RADIOBUTTON : CTRL_CHECKBOX; + if ( nIndex != SV_BMP_STATICIMAGE && pWin && pWin->IsNativeControlSupported( eCtrlType, PART_ENTIRE_CONTROL) ) { + Size aSize(pData->Width(), pData->Height()); + ImplAdjustBoxSize( aSize, eCtrlType, pWin ); ImplControlValue aControlValue; - Region aCtrlRegion( Rectangle(rPos, Size(pData->Width(), pData->Height())) ); + Region aCtrlRegion( Rectangle( rPos, aSize ) ); ControlState nState = 0; //states CTRL_STATE_DEFAULT, CTRL_STATE_PRESSED and CTRL_STATE_ROLLOVER are not implemented @@ -459,13 +462,47 @@ void SvLBoxButton::Clone( SvLBoxItem* pSource ) pData = ((SvLBoxButton*)pSource)->pData; } +void SvLBoxButton::ImplAdjustBoxSize( Size& io_rSize, ControlType i_eType, Window* i_pParent ) +{ + if ( i_pParent->IsNativeControlSupported( i_eType, PART_ENTIRE_CONTROL) ) + { + ImplControlValue aControlValue; + Region aCtrlRegion( Rectangle( Point( 0, 0 ), io_rSize ) ); + ControlState nState = CTRL_STATE_ENABLED; + + aControlValue.setTristateVal( BUTTONVALUE_ON ); + + Region aNativeBounds, aNativeContent; + bool bNativeOK = i_pParent->GetNativeControlRegion( i_eType, + PART_ENTIRE_CONTROL, + aCtrlRegion, + nState, + aControlValue, + rtl::OUString(), + aNativeBounds, + aNativeContent ); + if( bNativeOK ) + { + Size aContentSize( aNativeContent.GetBoundRect().GetSize() ); + // leave a little space around the box image (looks better + if( aContentSize.Height() + 2 > io_rSize.Height() ) + io_rSize.Height() = aContentSize.Height() + 2; + } + } +} + void SvLBoxButton::InitViewData( SvLBox* pView,SvLBoxEntry* pEntry, SvViewDataItem* pViewData ) { DBG_CHKTHIS(SvLBoxButton,0); if( !pViewData ) pViewData = pView->GetViewDataItem( pEntry, this ); - pViewData->aSize = Size( pData->Width(), pData->Height() ); + Size aSize( pData->Width(), pData->Height() ); + + ControlType eCtrlType = (pData->IsRadio())? CTRL_RADIOBUTTON : CTRL_CHECKBOX; + if ( eKind != SvLBoxButtonKind_staticImage && pView ) + ImplAdjustBoxSize( aSize, eCtrlType, pView ); + pViewData->aSize = aSize; } bool SvLBoxButton::CheckModification() const -- cgit v1.2.3 From 959ca18eeb1d4b8f0b5ec5e2c0bd8558db4f18db Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Thu, 1 Jul 2010 20:17:02 +0200 Subject: vcl113: small cleanup --- svtools/source/contnr/svlbitm.cxx | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/svtools/source/contnr/svlbitm.cxx b/svtools/source/contnr/svlbitm.cxx index bcdc21bfe9f7..633cdc903ef6 100644 --- a/svtools/source/contnr/svlbitm.cxx +++ b/svtools/source/contnr/svlbitm.cxx @@ -418,15 +418,11 @@ void SvLBoxButton::Paint( const Point& rPos, SvLBox& rDev, USHORT /* nFlags */, //Native drawing /// BOOL bNativeOK = FALSE; - Window *pWin = NULL; - if( rDev.GetOutDevType() == OUTDEV_WINDOW ) - pWin = (Window*) &rDev; - ControlType eCtrlType = (pData->IsRadio())? CTRL_RADIOBUTTON : CTRL_CHECKBOX; - if ( nIndex != SV_BMP_STATICIMAGE && pWin && pWin->IsNativeControlSupported( eCtrlType, PART_ENTIRE_CONTROL) ) + if ( nIndex != SV_BMP_STATICIMAGE && rDev.IsNativeControlSupported( eCtrlType, PART_ENTIRE_CONTROL) ) { Size aSize(pData->Width(), pData->Height()); - ImplAdjustBoxSize( aSize, eCtrlType, pWin ); + ImplAdjustBoxSize( aSize, eCtrlType, &rDev ); ImplControlValue aControlValue; Region aCtrlRegion( Rectangle( rPos, aSize ) ); ControlState nState = 0; @@ -442,7 +438,7 @@ void SvLBoxButton::Paint( const Point& rPos, SvLBox& rDev, USHORT /* nFlags */, else if ( IsStateTristate() ) aControlValue.setTristateVal( BUTTONVALUE_MIXED ); - bNativeOK = pWin->DrawNativeControl( (pData->IsRadio())? CTRL_RADIOBUTTON : CTRL_CHECKBOX, PART_ENTIRE_CONTROL, + bNativeOK = rDev.DrawNativeControl( eCtrlType, PART_ENTIRE_CONTROL, aCtrlRegion, nState, aControlValue, rtl::OUString() ); } -- cgit v1.2.3 From 3ca307cc08b0039a33ccb879779d026e60957216 Mon Sep 17 00:00:00 2001 From: Malte Timmermann Date: Fri, 2 Jul 2010 09:43:38 +0200 Subject: codecleanup02: #i51441# Removed old classes and files --- tools/inc/tools/agapi.hxx | 67 ----- tools/inc/tools/agitem.hxx | 51 ---- tools/inc/tools/chapi.hxx | 68 ----- tools/inc/tools/download.hxx | 56 ---- tools/inc/tools/eacopier.hxx | 47 ---- tools/inc/tools/urlkeys.hxx | 77 ------ tools/prj/d.lst | 1 - tools/source/solar/makefile.mk | 63 ----- tools/source/solar/solar.c | 562 ----------------------------------------- 9 files changed, 992 deletions(-) delete mode 100644 tools/inc/tools/agapi.hxx delete mode 100644 tools/inc/tools/agitem.hxx delete mode 100644 tools/inc/tools/chapi.hxx delete mode 100644 tools/inc/tools/download.hxx delete mode 100644 tools/inc/tools/eacopier.hxx delete mode 100644 tools/inc/tools/urlkeys.hxx delete mode 100644 tools/source/solar/makefile.mk delete mode 100644 tools/source/solar/solar.c diff --git a/tools/inc/tools/agapi.hxx b/tools/inc/tools/agapi.hxx deleted file mode 100644 index 9c71bd35c6cc..000000000000 --- a/tools/inc/tools/agapi.hxx +++ /dev/null @@ -1,67 +0,0 @@ -/************************************************************************* - * - * 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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#ifndef _AGAPI_HXX -#define _AGAPI_HXX - -#include - -class INetURLObject; -class ChannelList; -class AgentItem; -class String; - -class AgentApi -{ -protected: - friend class ChannelList; - - AgentItem* pChannelAgent; - virtual BOOL StartAgent() = 0; - - AgentApi(AgentItem* pAgent) { pChannelAgent = pAgent; } - -public: - virtual ~AgentApi() {} - - virtual void InitAgent() = 0; - virtual void ShutDownAgent() = 0; - - virtual BOOL NewDataPermission(const String& rChannelName) = 0; - virtual void NewData(const String& rChannelName, - const INetURLObject& rURL) = 0; - virtual void NotifyChannelObjFile(const INetURLObject& rURL, - const String& rFileName) = 0; - virtual void NotifyChannelObjData(const INetURLObject& rURL, - void* pBuffer, long nOffset, long nLen, long nTotalLen) = 0; - - virtual void RegisterChannels() = 0; - virtual void RegisterUpdateTransmitter() = 0; -}; - -#endif //_AGAPI_HXX - diff --git a/tools/inc/tools/agitem.hxx b/tools/inc/tools/agitem.hxx deleted file mode 100644 index 3177bdffa0a8..000000000000 --- a/tools/inc/tools/agitem.hxx +++ /dev/null @@ -1,51 +0,0 @@ -/************************************************************************* - * - * 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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#ifndef _AGITEM_HXX -#define _AGITEM_HXX - -#include - -class String; -class INetURLObject; -class AgentApi; -class ChApi; - -class AgentItem -{ -public: - virtual const String& GetChAgentName() const = 0; - virtual const INetURLObject& GetLocation() const = 0; - virtual AgentApi* GetApi() const = 0; - virtual ChApi* GetChApi() const = 0; - - virtual void SetIsActive(BOOL bNew) = 0; - virtual BOOL IsActive() const = 0; -}; - -#endif //_AGITEM_HXX - diff --git a/tools/inc/tools/chapi.hxx b/tools/inc/tools/chapi.hxx deleted file mode 100644 index 0acfe4cb2ca5..000000000000 --- a/tools/inc/tools/chapi.hxx +++ /dev/null @@ -1,68 +0,0 @@ -/************************************************************************* - * - * 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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#ifndef _CHAPI_HXX -#define _CHAPI_HXX - -#include - -class ChannelAgentItem; -class INetURLObject; -class String; - -enum RequestType { - REQTYP_LOCAL_FILE = 1, - REQTYP_MEMORY = 2 -}; - -class ChApi -{ -public: - virtual ~ChApi() {} - - virtual void ShutDownAgent() = 0; - virtual void SetLastSuccUpd() = 0; - - virtual void GetChannelObject( const INetURLObject& rURL, RequestType eStreamType, - const String& rFileName ) = 0; - virtual void AddChannelItem( const String& aChName, const INetURLObject& aTransmitter, - const String& aChannel, USHORT nUpdPeriode, - const String& rChAgentName ) = 0; - virtual void DelChannelItem( const String& aChName ) = 0; - virtual void SetChTransmitter( const String& aChName, const String& rNewVal ) = 0; - virtual void SetChannel( const String& aChName, const String& rNewVal ) = 0; - virtual void SetChannelName( const String& aChName, const String& rNewVal ) = 0; - virtual void SetChUpdPeriode( const String& aChName, USHORT nUpdPeriode ) = 0; - virtual void SetChannelAgentName( const String& aChName, const String& rNewVal ) = 0; - - virtual void SetUpdateTransmitter(ChannelAgentItem* pAgent, const INetURLObject& rTransmitter) = 0; -}; - -//////////////////////////////////////////////////////////////////////////////// -// - -#endif //_CHAPI_HXX diff --git a/tools/inc/tools/download.hxx b/tools/inc/tools/download.hxx deleted file mode 100644 index b187433927cd..000000000000 --- a/tools/inc/tools/download.hxx +++ /dev/null @@ -1,56 +0,0 @@ -/************************************************************************* - * - * 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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#ifndef _DOWNLOAD_HXX -#define _DOWNLOAD_HXX - -// Forward declarations -class String; -class Link; - -#define DOWNLOAD_SUCCESS 0 -#define DOWNLOAD_CONNECT 1 -#define DOWNLOAD_LOCATION 2 -#define DOWNLOAD_ABORT 3 -#define DOWNLOAD_FILEACCESS 4 -#define DOWNLOAD_INSTALL 5 -#define DOWNLOAD_ERROR 6 - -class Downloader -/* *************************************************************************** -Purpose: Abstract base class for a file downloader -*************************************************************************** */ -{ -public: - Downloader() {}; - - virtual void Download(const String &rDestLocation, - const String &rSourceLocation, - const Link &rFinishedLink) = 0; -}; - -#endif diff --git a/tools/inc/tools/eacopier.hxx b/tools/inc/tools/eacopier.hxx deleted file mode 100644 index c80eeb0d35cc..000000000000 --- a/tools/inc/tools/eacopier.hxx +++ /dev/null @@ -1,47 +0,0 @@ -/************************************************************************* - * - * 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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -#ifndef _EACOPIER_HXX -#define _EACOPIER_HXX - -#include - -class SvFileStream; - -class EA_Copier -{ - static EA_Copier* _pCopier; - -public: - static void Register( EA_Copier* pCopier ); - static EA_Copier* Get(); - - virtual ~EA_Copier(); - virtual BOOL Copy( const SvFileStream& rFrom, const SvFileStream& rTo ) const = 0; -}; - -#endif - diff --git a/tools/inc/tools/urlkeys.hxx b/tools/inc/tools/urlkeys.hxx deleted file mode 100644 index 28122657b7d4..000000000000 --- a/tools/inc/tools/urlkeys.hxx +++ /dev/null @@ -1,77 +0,0 @@ -/************************************************************************* - * - * 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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#ifndef __URLKEYS_HXX -#define __URLKEYS_HXX - -// Defines for common keys in URL files - -// ANSI version - -#define A_URLSECTION_SHORTCUT "InternetShortcut" -#define A_URLKEY_URL "URL" -#define A_URLKEY_TITLE "Title" -#define A_URLKEY_TARGET "Target" -#define A_URLKEY_FRAME "Frame" -#define A_URLKEY_OPENAS "OpenAs" -#define A_URLKEY_SOICON "SOIcon" -#define A_URLKEY_WIN_ICONFILE "IconFile" -#define A_URLKEY_WIN_ICONINDEX "IconIndex" -#define A_URLKEY_WORKDIR "WorkingDirectory" -#define A_URLKEY_ARGUMENTS "Arguments" -#define A_URLKEY_INTERN_ORIGURL "[URL]" - -// Unicode version - -#define U_URLSECTION_SHORTCUT L"InternetShortcut" -#define U_URLKEY_URL L"URL" -#define U_URLKEY_TITLE L"Title" -#define U_URLKEY_TARGET L"Target" -#define U_URLKEY_FRAME L"Frame" -#define U_URLKEY_OPENAS L"OpenAs" -#define U_URLKEY_SOICON L"SOIcon" -#define U_URLKEY_WIN_ICONFILE L"IconFile" -#define U_URLKEY_WIN_ICONINDEX L"IconIndex" -#define U_URLKEY_WORKDIR L"WorkingDirectory" -#define U_URLKEY_ARGUMENTS L"Arguments" -#define U_URLKEY_INTERN_ORIGURL L"[URL]" - -# define URLSECTION_SHORTCUT U_URLSECTION_SHORTCUT -# define URLKEY_URL U_URLKEY_URL -# define URLKEY_TITLE U_URLKEY_TITLE -# define URLKEY_TARGET U_URLKEY_TARGET -# define URLKEY_FRAME U_URLKEY_FRAME -# define URLKEY_OPENAS U_URLKEY_OPENAS -# define URLKEY_SOICON U_URLKEY_SOICON -# define URLKEY_WIN_ICONFILE U_URLKEY_WIN_ICONFILE -# define URLKEY_WIN_ICONINDEX U_URLKEY_WIN_ICONINDEX -# define URLKEY_WORKDIR U_URLKEY_WORKDIR -# define URLKEY_ARGUMENTS U_URLKEY_ARGUMENTS -# define URLKEY_INTERN_ORIGURL U_URLKEY_INTERN_ORIGURL - -#endif // __URLKEYS_HXX - diff --git a/tools/prj/d.lst b/tools/prj/d.lst index 6b4a99a3a676..1f5cb33667d8 100644 --- a/tools/prj/d.lst +++ b/tools/prj/d.lst @@ -47,7 +47,6 @@ mkdir: %_DEST%\inc%_EXT%\bootstrp ..\inc\tools\appendunixshellword.hxx %_DEST%\inc%_EXT%\tools\appendunixshellword.hxx ..\inc\tools\bigint.hxx %_DEST%\inc%_EXT%\tools\bigint.hxx ..\inc\tools\cachestr.hxx %_DEST%\inc%_EXT%\tools\cachestr.hxx -..\inc\tools\chapi.hxx %_DEST%\inc%_EXT%\tools\chapi.hxx ..\inc\tools\color.hxx %_DEST%\inc%_EXT%\tools\color.hxx ..\inc\tools\contnr.hxx %_DEST%\inc%_EXT%\tools\contnr.hxx ..\inc\tools\date.hxx %_DEST%\inc%_EXT%\tools\date.hxx diff --git a/tools/source/solar/makefile.mk b/tools/source/solar/makefile.mk deleted file mode 100644 index 6f5dd85c608b..000000000000 --- a/tools/source/solar/makefile.mk +++ /dev/null @@ -1,63 +0,0 @@ -#************************************************************************* -# -# 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 -# -# for a copy of the LGPLv3 License. -# -#************************************************************************* - -PRJ=..$/.. - -PRJNAME=tools -TARGET=mksvconf -TARGETTYPE=CUI - -LIBSALCPPRT=$(0) - -# --- Settings ----------------------------------------------------- - -.INCLUDE : settings.mk -.INCLUDE : $(PRJ)$/util$/makefile.pmk - -# --- Files -------------------------------------------------------- - -CFILES= solar.c - -OBJFILES= $(OBJ)$/solar.obj - -APP1TARGET= $(TARGET) -APP1OBJS= $(OBJFILES) -APP1STDLIBS= -APP1DEPN= -APP1DEF= - -# --- Targets ------------------------------------------------------ - -.INCLUDE : target.mk - -.IF "$(L10N-framework)"=="" -ALLTAR : $(INCCOM)$/svconf.h -.ENDIF # "$(L10N-framework)"=="" - -$(INCCOM)$/svconf.h : $(BIN)$/$(TARGET) - $(BIN)$/$(TARGET) $@ - diff --git a/tools/source/solar/solar.c b/tools/source/solar/solar.c deleted file mode 100644 index 608f0baf5129..000000000000 --- a/tools/source/solar/solar.c +++ /dev/null @@ -1,562 +0,0 @@ -/************************************************************************* - * - * 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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -/* POSIX defines that a program is undefined after a SIG_SEGV. The - * code stopped working on Linux Kernel 2.6 so I have moved this back to - * use FORK. - * If at a later time the signals work correctly with the Linux Kernel 2.6 - * then this change may be reverted although not strictly posix safe. */ -#define USE_FORK_TO_CHECK 1 - -#include -#include -#include -#include - -#include -#include - -#define I_STDARG -#ifdef I_STDARG -#include -#else -#include -#endif - -#define NO_USE_FORK_TO_CHECK -#ifdef USE_FORK_TO_CHECK -#include -#else -#include -#include -#endif - -#define printTypeSize(Type,Name) printf( "sizeof(%s)\t= %d\n", Name, sizeof (Type) ) - -#define isSignedType(Type) (((Type)-1) < 0) -#define printTypeSign(Type,Name) printf( "%s\t= %s %s\n", Name, ( isSignedType(Type) ? "signed" : "unsigned" ), Name ) - - -/************************************************************************* -|* -|* IsBigEndian() -|* -|* Beschreibung True, wenn CPU BigEndian ist -|* -|* Ersterstellung EG 26.06.96 -|* Letzte Aenderung -|* -*************************************************************************/ -int IsBigEndian() -{ - long l = 1; - return ! *(char*)&l; -} - -/************************************************************************* -|* -|* IsStackGrowingDown() -|* -|* Beschreibung True, wenn der Stack nach unten waechst -|* -|* Ersterstellung EG 26.06.96 -|* Letzte Aenderung -|* -*************************************************************************/ -int IsStackGrowingDown_2( int * pI ) -{ - int i = 1; - return ((unsigned long)&i) < (unsigned long)pI; -} - -int IsStackGrowingDown() -{ - int i = 1; - return IsStackGrowingDown_2(&i); -} - -/************************************************************************* -|* -|* GetStackAlignment() -|* -|* Beschreibung Alignment von char Parametern, die (hoffentlich) -|* ueber den Stack uebergeben werden -|* -|* Ersterstellung EG 26.06.96 -|* Letzte Aenderung -|* -*************************************************************************/ -int GetStackAlignment_3( char*p, long l, int i, short s, char b, char c, ... ) -{ - if ( IsStackGrowingDown() ) - return &c - &b; - else - return &b - &c; -} - -int GetStackAlignment_2( char*p, long l, int i, short s, char b, char c ) -{ - if ( IsStackGrowingDown() ) - return &c - &b; - else - return &b - &c; -} - -int GetStackAlignment() -{ - int nStackAlignment = GetStackAlignment_3(0,1,2,3,4,5); - if ( nStackAlignment != GetStackAlignment_2(0,1,2,3,4,5) ) - printf( "Pascal calling convention\n" ); - return nStackAlignment; -} - - -/************************************************************************* -|* -|* Typdeclarations for memory access test functions -|* -*************************************************************************/ -typedef enum { t_char, t_short, t_int, t_long, t_double } Type; -typedef int (*TestFunc)( Type, void* ); - - -/************************************************************************* -|* -|* PrintArgs() -|* -|* Beschreibung Testfunktion fuer variable Parameter -|* -|* Ersterstellung EG 26.06.96 -|* Letzte Aenderung -|* -*************************************************************************/ -#ifdef I_STDARG -void PrintArgs( int p, ... ) -#else -void PrintArgs( p, va_alist ) -int p; -va_dcl -#endif -{ - int value; - va_list ap; - -#ifdef I_STDARG - va_start( ap, p ); -#else - va_start( ap ); -#endif - - printf( "value = %d", p ); - - while ( ( value = va_arg(ap, int) ) != 0 ) - printf( " %d", value ); - - printf( "\n" ); - va_end(ap); -} - -#ifndef USE_FORK_TO_CHECK -/************************************************************************* -|* -|* SignalHdl() -|* -|* Beschreibung faengt SIGBUS und SIGSEGV in check() ab -|* -|* Ersterstellung EG 26.06.96 -|* Letzte Aenderung -|* -*************************************************************************/ -static jmp_buf check_env; -static int bSignal; -void SignalHdl( int sig ) -{ - bSignal = 1; - - fprintf( stderr, "Signal %d caught\n", sig ); - signal( SIGSEGV, SIG_DFL ); - signal( SIGBUS, SIG_DFL ); - siglongjmp( check_env, sig ); -} -#endif - -/************************************************************************* -|* -|* check() -|* -|* Beschreibung Testet MemoryZugriff (read/write) -|* -|* Ersterstellung EG 26.06.96 -|* Letzte Aenderung -|* -*************************************************************************/ -int check( TestFunc func, Type eT, void* p ) -{ -#ifdef USE_FORK_TO_CHECK - pid_t nChild = fork(); - if ( nChild ) - { - int exitVal; - wait( &exitVal ); - if ( exitVal & 0xff ) - return -1; - else - return exitVal >> 8; - } - else - { - exit( func( eT, p ) ); - } -#else - int result; - - bSignal = 0; - - if ( !sigsetjmp( check_env, 1 ) ) - { - signal( SIGSEGV, SignalHdl ); - signal( SIGBUS, SignalHdl ); - result = func( eT, p ); - signal( SIGSEGV, SIG_DFL ); - signal( SIGBUS, SIG_DFL ); - } - - if ( bSignal ) - return -1; - else - return 0; -#endif -} - -/************************************************************************* -|* -|* GetAtAddress() -|* -|* Beschreibung memory read access -|* -|* Ersterstellung EG 26.06.96 -|* Letzte Aenderung -|* -*************************************************************************/ -int GetAtAddress( Type eT, void* p ) -{ - switch ( eT ) - { - case t_char: return *((char*)p); - case t_short: return *((short*)p); - case t_int: return *((int*)p); - case t_long: return *((long*)p); - case t_double: return *((double*)p); - } - abort(); -} - -/************************************************************************* -|* -|* SetAtAddress() -|* -|* Beschreibung memory write access -|* -|* Ersterstellung EG 26.06.96 -|* Letzte Aenderung -|* -*************************************************************************/ -int SetAtAddress( Type eT, void* p ) -{ - switch ( eT ) - { - case t_char: return *((char*)p) = 0; - case t_short: return *((short*)p) = 0; - case t_int: return *((int*)p) = 0; - case t_long: return *((long*)p) = 0; - case t_double: return *((double*)p)= 0; - } - abort(); -} - -char* TypeName( Type eT ) -{ - switch ( eT ) - { - case t_char: return "char"; - case t_short: return "short"; - case t_int: return "int"; - case t_long: return "long"; - case t_double: return "double"; - } - abort(); -} - -/************************************************************************* -|* -|* Check(Get|Set)Access() -|* -|* Beschreibung Testet MemoryZugriff (read/write) -|* Zugriffsverletzungen werden abgefangen -|* -|* Ersterstellung EG 26.06.96 -|* Letzte Aenderung -|* -*************************************************************************/ -int CheckGetAccess( Type eT, void* p ) -{ - int b; - b = -1 != check( (TestFunc)GetAtAddress, eT, p ); -#if OSL_DEBUG_LEVEL > 1 - fprintf( stderr, - "%s read %s at %p\n", - (b? "can" : "can not" ), TypeName(eT), p ); -#endif - return b; -} -int CheckSetAccess( Type eT, void* p ) -{ - int b; - - b = -1 != check( (TestFunc)SetAtAddress, eT, p ); -#if OSL_DEBUG_LEVEL > 1 - fprintf( stderr, - "%s write %s at %p\n", - (b? "can" : "can not" ), TypeName(eT), p ); -#endif - return b; -} - -/************************************************************************* -|* -|* GetAlignment() -|* -|* Beschreibung Bestimmt das Alignment verschiedener Typen -|* -|* Ersterstellung EG 26.06.96 -|* Letzte Aenderung -|* -*************************************************************************/ -int GetAlignment( Type eT ) -{ - char a[ 16*8 ]; - long p = (long)(void*)a; - int i; - - /* clear a[...] to set legal value for double access */ - for ( i = 0; i < 16*8; i++ ) - a[i] = 0; - - p = ( p + 0xF ) & ~0xF; - for ( i = 1; i < 16; i++ ) - if ( CheckGetAccess( eT, (void*)(p+i) ) ) - return i; - return 0; -} - -/************************************************************************* -|* -|* struct Description -|* -|* Beschreibung Beschreibt die Parameter der Architektur -|* -|* Ersterstellung EG 26.06.96 -|* Letzte Aenderung -|* -*************************************************************************/ -struct Description -{ - int bBigEndian; - int bStackGrowsDown; - int nStackAlignment; - int nAlignment[3]; /* 2,4,8 */ -}; - -/************************************************************************* -|* -|* Description_Ctor() -|* -|* Beschreibung Bestimmt die Parameter der Architektur -|* -|* Ersterstellung EG 26.06.96 -|* Letzte Aenderung -|* -*************************************************************************/ -void Description_Ctor( struct Description* pThis ) -{ - pThis->bBigEndian = IsBigEndian(); - pThis->bStackGrowsDown = IsStackGrowingDown(); - pThis->nStackAlignment = GetStackAlignment(); - - if ( sizeof(short) != 2 ) - abort(); - pThis->nAlignment[0] = GetAlignment( t_short ); - if ( sizeof(int) != 4 ) - abort(); - pThis->nAlignment[1] = GetAlignment( t_int ); - - if ( sizeof(long) == 8 ) - pThis->nAlignment[2] = GetAlignment( t_long ); - else if ( sizeof(double) == 8 ) - pThis->nAlignment[2] = GetAlignment( t_double ); - else - abort(); -} - -/************************************************************************* -|* -|* Description_Print() -|* -|* Beschreibung Schreibt die Parameter der Architektur als Header -|* -|* Ersterstellung EG 26.06.96 -|* Letzte Aenderung -|* -*************************************************************************/ -void Description_Print( struct Description* pThis, char* name ) -{ - int i; - FILE* f = fopen( name, "w" ); - if( ! f ) { - fprintf( stderr, "Unable to open file %s: %s\n", name, strerror( errno ) ); - exit( 99 ); - } - fprintf( f, "#define __%s\n", - pThis->bBigEndian ? "BIGENDIAN" : "LITTLEENDIAN" ); - for ( i = 0; i < 3; i++ ) - fprintf( f, "#define __ALIGNMENT%d\t%d\n", - 1 << (i+1), pThis->nAlignment[i] ); - fprintf( f, "/* Stack alignment is not used... */\n" ); - fprintf( f, "#define __STACKALIGNMENT\t%d\n", pThis->nStackAlignment ); - fprintf( f, "#define __STACKDIRECTION\t%d\n", - pThis->bStackGrowsDown ? -1 : 1 ); - fprintf( f, "#define __SIZEOFCHAR\t%d\n", sizeof( char ) ); - fprintf( f, "#define __SIZEOFSHORT\t%d\n", sizeof( short ) ); - fprintf( f, "#define __SIZEOFINT\t%d\n", sizeof( int ) ); - fprintf( f, "#define __SIZEOFLONG\t%d\n", sizeof( long ) ); - fprintf( f, "#define __SIZEOFPOINTER\t%d\n", sizeof( void* ) ); - fprintf( f, "#define __SIZEOFDOUBLE\t%d\n", sizeof( double ) ); - fprintf( f, "#define __IEEEDOUBLE\n" ); - fclose( f ); -} - -/************************************************************************* -|* -|* InfoMemoryAccess() -|* -|* Beschreibung Informeller Bytezugriffstest -|* -|* Ersterstellung EG 26.06.96 -|* Letzte Aenderung -|* -*************************************************************************/ -void InfoMemoryAccess( char* p ) -{ - if ( CheckGetAccess( t_char, p ) ) - printf( "can read address %p\n", p ); - else - printf( "can not read address %p\n", p ); - - if ( CheckSetAccess( t_char, p ) ) - printf( "can write address %p\n", p ); - else - printf( "can not write address %p\n", p ); -} - -/************************************************************************* -|* -|* InfoMemoryTypeAccess() -|* -|* Beschreibung Informeller Zugriffstest verschiedener Typen -|* -|* Ersterstellung EG 15.08.96 -|* Letzte Aenderung -|* -*************************************************************************/ -void InfoMemoryTypeAccess( Type eT ) -{ - char a[64]; - int i; - - /* clear a[...] to set legal value for double access */ - for ( i = 0; i < 64; i++ ) - a[i] = 0; - - for ( i = 56; i >= 7; i >>= 1 ) - { - printf( "Zugriff %s auf %i-Aligned Adresse : ", TypeName( eT ), i / 7 ); - printf( ( CheckGetAccess( eT, (long*)&a[i] ) ? "OK\n" : "ERROR\n" ) ); - } -} -/************************************************************************ - * - * Use C code to determine the characteristics of the building platform. - * - ************************************************************************/ -int main( int argc, char* argv[] ) -{ - printTypeSign( char, "char" ); - printTypeSign( short, "short" ); - printTypeSign( int, "int" ); - printTypeSign( long, "long" ); - - printTypeSize( char, "char" ); - printTypeSize( short, "short" ); - printTypeSize( int, "int" ); - printTypeSize( long, "long" ); - printTypeSize( float, "float" ); - printTypeSize( double, "double" ); - printTypeSize( void *, "void *" ); - - if ( IsBigEndian() ) - printf( "BIGENDIAN (Sparc, MC680x0, RS6000, IP22, IP32, g3)\n" ); - else - printf( "LITTLEENDIAN (Intel, VAX, PowerPC)\n" ); - - if( IsStackGrowingDown() ) - printf( "Stack waechst nach unten\n" ); - else - printf( "Stack waechst nach oben\n" ); - - printf( "STACKALIGNMENT : %d\n", GetStackAlignment() ); - - /* PrintArgs( 1, 2, 3, 4, 5, 6, 7, 8, 9, 0 ); */ - - if ( argc > 1 ) - { - struct Description description; - Description_Ctor( &description ); - Description_Print( &description, argv[1] ); - } - { - char* p = NULL; - InfoMemoryAccess( p ); - p = (char*)&p; - InfoMemoryAccess( p ); - InfoMemoryTypeAccess( t_short ); - InfoMemoryTypeAccess( t_int ); - InfoMemoryTypeAccess( t_long ); - InfoMemoryTypeAccess( t_double ); - } - - exit( 0 ); -} -- cgit v1.2.3 From be86ebfa2ec2df39cd441082ae244bab0c741386 Mon Sep 17 00:00:00 2001 From: "Herbert Duerr [hdu]" Date: Fri, 2 Jul 2010 12:31:38 +0200 Subject: #i112144# ignore trivial fontname substring matches --- vcl/source/gdi/outdev3.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/vcl/source/gdi/outdev3.cxx b/vcl/source/gdi/outdev3.cxx index c54d9acf5c52..69f43b1ed4fc 100644 --- a/vcl/source/gdi/outdev3.cxx +++ b/vcl/source/gdi/outdev3.cxx @@ -1903,7 +1903,8 @@ ImplDevFontListData* ImplDevFontList::ImplFindByAttributes( ULONG nSearchType, nTestMatch -= 1000000; // test font name substrings - if( (rSearchFamilyName.Len() && pData->maMatchFamilyName.Len()) + // TODO: calculate name matching score using e.g. Levenstein distance + if( (rSearchFamilyName.Len() >= 4) && (pData->maMatchFamilyName.Len() >= 4) && ((rSearchFamilyName.Search( pData->maMatchFamilyName ) != STRING_NOTFOUND) || (pData->maMatchFamilyName.Search( rSearchFamilyName ) != STRING_NOTFOUND)) ) nTestMatch += 100000*2; -- cgit v1.2.3 From 8bbb22ac9d6e0e6ca2915f9a403544bea193afbc Mon Sep 17 00:00:00 2001 From: "Herbert Duerr [hdu]" Date: Fri, 2 Jul 2010 14:37:01 +0200 Subject: #i112731# a searchname must fully contain the keyname to be considered a match --- unotools/source/config/fontcfg.cxx | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/unotools/source/config/fontcfg.cxx b/unotools/source/config/fontcfg.cxx index a1d287337bea..d1fb037347a2 100644 --- a/unotools/source/config/fontcfg.cxx +++ b/unotools/source/config/fontcfg.cxx @@ -1199,8 +1199,15 @@ const FontNameAttr* FontSubstConfiguration::getSubstInfo( const String& rFontNam // try to find an exact match // because the list is sorted this will also find fontnames of the form searchfontname* std::vector< FontNameAttr >::const_iterator it = ::std::lower_bound( lang->second.aSubstAttributes.begin(), lang->second.aSubstAttributes.end(), aSearchAttr, StrictStringSort() ); - if( it != lang->second.aSubstAttributes.end() && aSearchFont.CompareTo( it->Name, aSearchFont.Len() ) == COMPARE_EQUAL ) - return &(*it); + if( it != lang->second.aSubstAttributes.end()) + { + const FontNameAttr& rFoundAttr = *it; + // a search for "abcblack" may match with an entry for "abc" + // the reverse is not a good idea (e.g. #i112731# alba->albani) + if( rFoundAttr.Name.Len() < aSearchFont.Len() ) + if( aSearchFont.CompareTo( rFoundAttr.Name, aSearchFont.Len() ) == COMPARE_EQUAL ) + return &rFoundAttr; + } } // gradually become more unspecific if( aLocale.Variant.getLength() ) -- cgit v1.2.3 From 495b598673a964bdf0ceac1250d1f009e7b6ef7d Mon Sep 17 00:00:00 2001 From: "Herbert Duerr [hdu]" Date: Fri, 2 Jul 2010 14:42:06 +0200 Subject: #i112731# fix off-by-one --- unotools/source/config/fontcfg.cxx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/unotools/source/config/fontcfg.cxx b/unotools/source/config/fontcfg.cxx index d1fb037347a2..e8ae78d0aed2 100644 --- a/unotools/source/config/fontcfg.cxx +++ b/unotools/source/config/fontcfg.cxx @@ -1202,10 +1202,10 @@ const FontNameAttr* FontSubstConfiguration::getSubstInfo( const String& rFontNam if( it != lang->second.aSubstAttributes.end()) { const FontNameAttr& rFoundAttr = *it; - // a search for "abcblack" may match with an entry for "abc" - // the reverse is not a good idea (e.g. #i112731# alba->albani) - if( rFoundAttr.Name.Len() < aSearchFont.Len() ) - if( aSearchFont.CompareTo( rFoundAttr.Name, aSearchFont.Len() ) == COMPARE_EQUAL ) + // a search for "abcblack" may match with an entry for "abc" + // the reverse is not a good idea (e.g. #i112731# alba->albani) + if( rFoundAttr.Name.Len() <= aSearchFont.Len() ) + if( aSearchFont.CompareTo( rFoundAttr.Name, rFoundAttr.Name.Len() ) == COMPARE_EQUAL ) return &rFoundAttr; } } -- cgit v1.2.3 From e9391ae8eb3d0a4edf977f0159ee7e07a0a95859 Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Wed, 7 Jul 2010 19:01:58 +0200 Subject: vcl113: #i111834# support pasting HBITMAP --- dtrans/source/win32/dtobj/DOTransferable.cxx | 9 ++++++ dtrans/source/win32/dtobj/FmtFilter.cxx | 43 ++++++++++++++++++++++++++++ dtrans/source/win32/dtobj/FmtFilter.hxx | 6 ++++ dtrans/source/win32/ftransl/ftransl.cxx | 1 + 4 files changed, 59 insertions(+) mode change 100644 => 100755 dtrans/source/win32/dtobj/DOTransferable.cxx mode change 100644 => 100755 dtrans/source/win32/dtobj/FmtFilter.cxx mode change 100644 => 100755 dtrans/source/win32/dtobj/FmtFilter.hxx mode change 100644 => 100755 dtrans/source/win32/ftransl/ftransl.cxx diff --git a/dtrans/source/win32/dtobj/DOTransferable.cxx b/dtrans/source/win32/dtobj/DOTransferable.cxx old mode 100644 new mode 100755 index 951c3a69d291..c590bf0e6a80 --- a/dtrans/source/win32/dtobj/DOTransferable.cxx +++ b/dtrans/source/win32/dtobj/DOTransferable.cxx @@ -348,6 +348,15 @@ CDOTransferable::ByteSequence_t SAL_CALL CDOTransferable::getClipboardData( CFor byteStream = WinENHMFPictToOOMFPict( stgmedium.hEnhMetaFile ); else if (CF_HDROP == aFormatEtc.getClipformat()) byteStream = CF_HDROPToFileList(stgmedium.hGlobal); + else if ( CF_BITMAP == aFormatEtc.getClipformat() ) + { + byteStream = WinBITMAPToOOBMP(stgmedium.hBitmap); + if( aFormatEtc.getTymed() == TYMED_GDI && + ! stgmedium.pUnkForRelease ) + { + DeleteObject(stgmedium.hBitmap); + } + } else { clipDataToByteStream( aFormatEtc.getClipformat( ), stgmedium, byteStream ); diff --git a/dtrans/source/win32/dtobj/FmtFilter.cxx b/dtrans/source/win32/dtobj/FmtFilter.cxx old mode 100644 new mode 100755 index c8a8743647a9..c4f73977d92d --- a/dtrans/source/win32/dtobj/FmtFilter.cxx +++ b/dtrans/source/win32/dtobj/FmtFilter.cxx @@ -534,3 +534,46 @@ ByteSequence_t CF_HDROPToFileList(HGLOBAL hGlobal) return FileListToByteSequence(files); } +//------------------------------------------------------------------------ +// convert a windows bitmap handle into a openoffice bitmap +//------------------------------------------------------------------------ + +Sequence< sal_Int8 > SAL_CALL WinBITMAPToOOBMP( HBITMAP aHBMP ) +{ + Sequence< sal_Int8 > ooBmpStream; + + SIZE aBmpSize; + if( GetBitmapDimensionEx( aHBMP, &aBmpSize ) ) + { + // fill bitmap info header + size_t nDataBytes = 4 * aBmpSize.cy * aBmpSize.cy; + Sequence< sal_Int8 > aBitmapStream( + sizeof(BITMAPINFO) + + nDataBytes + ); + PBITMAPINFOHEADER pBmp = (PBITMAPINFOHEADER)aBitmapStream.getArray(); + pBmp->biSize = sizeof( BITMAPINFOHEADER ); + pBmp->biWidth = aBmpSize.cx; + pBmp->biHeight = aBmpSize.cy; + pBmp->biPlanes = 1; + pBmp->biBitCount = 32; + pBmp->biCompression = BI_RGB; + pBmp->biSizeImage = (DWORD)nDataBytes; + pBmp->biXPelsPerMeter = 1000; + pBmp->biYPelsPerMeter = 1000; + pBmp->biClrUsed = 0; + pBmp->biClrImportant = 0; + if( GetDIBits( 0, // DC, 0 is a default GC, basically that of the desktop + aHBMP, + 0, aBmpSize.cy, + aBitmapStream.getArray() + sizeof(BITMAPINFO), + (LPBITMAPINFO)pBmp, + DIB_RGB_COLORS ) ) + { + ooBmpStream = WinDIBToOOBMP( aBitmapStream ); + } + } + + return ooBmpStream; +} + diff --git a/dtrans/source/win32/dtobj/FmtFilter.hxx b/dtrans/source/win32/dtobj/FmtFilter.hxx old mode 100644 new mode 100755 index 3f433561a3b1..84f764c9769b --- a/dtrans/source/win32/dtobj/FmtFilter.hxx +++ b/dtrans/source/win32/dtobj/FmtFilter.hxx @@ -65,6 +65,12 @@ HENHMETAFILE SAL_CALL OOMFPictToWinENHMFPict( com::sun::star::uno::Sequence< sa ------------------------------------------------------------------------*/ com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL WinDIBToOOBMP( const com::sun::star::uno::Sequence< sal_Int8 >& aWinDIB ); +/*------------------------------------------------------------------------ + input: + aWinDIB - sequence of bytes containing a windows bitmap handle +------------------------------------------------------------------------*/ +com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL WinBITMAPToOOBMP( HBITMAP ); + /*------------------------------------------------------------------------ input: aOOBmp - sequence of bytes containing a openoffice bitmap diff --git a/dtrans/source/win32/ftransl/ftransl.cxx b/dtrans/source/win32/ftransl/ftransl.cxx old mode 100644 new mode 100755 index c0a8264a71b8..98c6625bb33e --- a/dtrans/source/win32/ftransl/ftransl.cxx +++ b/dtrans/source/win32/ftransl/ftransl.cxx @@ -281,6 +281,7 @@ void SAL_CALL CDataFormatTranslator::initTranslationTable() m_TranslTable.push_back(FormatEntry("application/x-openoffice-dif;windows_formatname=\"DIF\"", "DIF", "DIF", CF_DIF, CPPUTYPE_DEFAULT)); // SOT_FORMAT_BITMAP m_TranslTable.push_back(FormatEntry("application/x-openoffice-bitmap;windows_formatname=\"Bitmap\"", "Bitmap", "Bitmap", CF_DIB, CPPUTYPE_DEFAULT)); + m_TranslTable.push_back(FormatEntry("application/x-openoffice-bitmap;windows_formatname=\"Bitmap\"", "Bitmap", "Bitmap", CF_BITMAP, CPPUTYPE_DEFAULT)); // SOT_FORMAT_STRING m_TranslTable.push_back(FormatEntry("text/plain;charset=utf-16", "Unicode-Text", "", CF_UNICODETEXT, CppuType_String)); // Format Locale - for internal use -- cgit v1.2.3 From 90d4fea3c958e2404df4a3f4b01d6d8ef0134ac7 Mon Sep 17 00:00:00 2001 From: "Herbert Duerr [hdu]" Date: Mon, 5 Jul 2010 10:08:58 +0200 Subject: #i112731# incidential substring matching is not very valuable --- vcl/source/gdi/outdev3.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vcl/source/gdi/outdev3.cxx b/vcl/source/gdi/outdev3.cxx index 69f43b1ed4fc..0fc3caf0318a 100644 --- a/vcl/source/gdi/outdev3.cxx +++ b/vcl/source/gdi/outdev3.cxx @@ -1907,7 +1907,7 @@ ImplDevFontListData* ImplDevFontList::ImplFindByAttributes( ULONG nSearchType, if( (rSearchFamilyName.Len() >= 4) && (pData->maMatchFamilyName.Len() >= 4) && ((rSearchFamilyName.Search( pData->maMatchFamilyName ) != STRING_NOTFOUND) || (pData->maMatchFamilyName.Search( rSearchFamilyName ) != STRING_NOTFOUND)) ) - nTestMatch += 100000*2; + nTestMatch += 5000; // test SERIF attribute if( nSearchType & IMPL_FONT_ATTR_SERIF ) -- cgit v1.2.3 From 068a5d9293e092cbe73d8a707e4f45a623d99ccc Mon Sep 17 00:00:00 2001 From: Ivo Hinkelmann Date: Wed, 7 Jul 2010 15:29:56 +0200 Subject: txtl10n: #i113008# add support for xtx files --- l10ntools/source/localize.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/l10ntools/source/localize.cxx b/l10ntools/source/localize.cxx index 6cecb0972cb7..8e2fbee2bc85 100644 --- a/l10ntools/source/localize.cxx +++ b/l10ntools/source/localize.cxx @@ -56,7 +56,7 @@ const char *ExeTable[][5] = { //{ "src", "transex3", "-UTF8 -e", "negative", "noiso" }, //{ "hrc", "transex3", "-UTF8 -e", "positive", "noiso" }, - //{ "lng", "lngex", "-UTF8 -e", "negative", "noiso" }, + { "xtx", "xtxex", "", "negative", "noiso" }, { "ulf", "ulfex", " -e", "negative", "noiso" }, { "xrb", "xmlex", "-UTF8 -e", "negative", "iso" }, { "xxl", "xmlex", "-UTF8 -e", "negative", "iso" }, @@ -326,7 +326,7 @@ void SourceTreeLocalizer::WorkOnFile( } if( bQuiet2 ){ - sCommand +=" -QQ "; + //sCommand +=" -QQ "; } //printf("DBG: %s\n",sCommand.GetBuffer()); if (system(sCommand.GetBuffer()) == -1) -- cgit v1.2.3 From bb7dd792818f8404d6e756505469d17350eebd83 Mon Sep 17 00:00:00 2001 From: Ivo Hinkelmann Date: Wed, 7 Jul 2010 15:30:32 +0200 Subject: txtl10n: remove some noisy output / code cleanup --- l10ntools/source/cfglex.l | 16 +--------------- l10ntools/source/cfgmerge.cxx | 6 ++---- l10ntools/source/export.cxx | 1 - l10ntools/source/helpmerge.cxx | 11 ----------- l10ntools/source/lngex.cxx | 10 ---------- l10ntools/source/srclex.l | 6 ------ l10ntools/source/xrmlex.l | 5 ----- l10ntools/source/xrmmerge.cxx | 2 -- 8 files changed, 3 insertions(+), 54 deletions(-) diff --git a/l10ntools/source/cfglex.l b/l10ntools/source/cfglex.l index cc92632620be..d1b076d493b9 100644 --- a/l10ntools/source/cfglex.l +++ b/l10ntools/source/cfglex.l @@ -169,10 +169,6 @@ main( int argc, char* argv[]) FILE *pFile; pOutput = GetOutputFile( argc, argv ); - if( !isQuiet() ){ - fprintf( stdout, "\nCfgEx 0.9 Copyright 2000, 2010 Oracle and/or its affiliates. All Rights Reserved.\n" ); - fprintf( stdout, "===================================================================================\n" ); - } if ( !pOutput ) { fprintf( stdout, "Syntax: CFGEX[-p Prj][-r PrjRoot]-i FileIn [-o FileOut][-m DataBase][-e][-b][-u][-f][-d DoneFile][-g[:dtd] ][-L l1,l2,...]\n" ); @@ -213,20 +209,10 @@ main( int argc, char* argv[]) nRetValue = GetError(); EndCfgExport(); - if( !isQuiet() ){ - fprintf( stdout, "\n===================================\n\n" ); - } removeTempFile(); /* return error level */ return nRetValue; } -/*""]*"-->" { - bText = 0; - WorkOnTokenSet( COMMEND, yytext ); -}*/ -/*" { - bText = 0; - WorkOnTokenSet( CFG_TAG, yytext ); -}*/ + diff --git a/l10ntools/source/cfgmerge.cxx b/l10ntools/source/cfgmerge.cxx index 170c2922d9ce..3e421d2d1046 100644 --- a/l10ntools/source/cfgmerge.cxx +++ b/l10ntools/source/cfgmerge.cxx @@ -247,7 +247,7 @@ extern FILE *GetCfgFile() if ( !pFile ){ fprintf( stderr, "Error: Could not open file %s\n", sInputFileName.GetBuffer()); - exit( 13 ); + exit( -13 ); } else { // this is a valid file which can be opened, so @@ -264,8 +264,6 @@ extern FILE *GetCfgFile() // printf("sFullEntry = %s\n",sFullEntry.GetBuffer()); sActFileName = sFullEntry.Copy( sPrjEntry.Len() + 1 ); // printf("sActFileName = %s\n",sActFileName.GetBuffer()); - if( !bQuiet ) - fprintf( stdout, "\nProcessing File %s ...\n", sInputFileName.GetBuffer()); sActFileName.SearchAndReplaceAll( "/", "\\" ); @@ -615,7 +613,7 @@ CfgOutputParser::CfgOutputParser( const ByteString &rOutputFile ) Error( sError ); delete pOutputStream; pOutputStream = NULL; - exit( 13 ); + exit( -13 ); } } diff --git a/l10ntools/source/export.cxx b/l10ntools/source/export.cxx index 59f29525eda4..589c962c112c 100644 --- a/l10ntools/source/export.cxx +++ b/l10ntools/source/export.cxx @@ -282,7 +282,6 @@ extern FILE *GetNextFile() // (e.g.: source\ui\src\menue.src) sActFileName = sFullEntry.Copy( sPrjEntry.Len() + 1 ); - if( !bQuiet ) fprintf( stdout, "\nProcessing File %s ...\n", sOrigFile.GetBuffer()); sActFileName.SearchAndReplaceAll( "/", "\\" ); sFile = sActFileName; diff --git a/l10ntools/source/helpmerge.cxx b/l10ntools/source/helpmerge.cxx index 0ab7e6eb5c2e..15cb1e311002 100644 --- a/l10ntools/source/helpmerge.cxx +++ b/l10ntools/source/helpmerge.cxx @@ -181,17 +181,6 @@ bool HelpParser::CreateSDF( ByteString sActFileName = makeAbsolutePath( sHelpFile , rRoot_in ); -/* DirEntry aEntry( String( sHelpFile, RTL_TEXTENCODING_ASCII_US )); - aEntry.ToAbs(); - String sFullEntry = aEntry.GetFull(); - aEntry += DirEntry( String( "..", RTL_TEXTENCODING_ASCII_US )); - aEntry += DirEntry( rRoot_in ); - ByteString sPrjEntry( aEntry.GetFull(), gsl_getSystemTextEncoding()); - ByteString sActFileName( - sFullEntry.Copy( sPrjEntry.Len() + 1 ), gsl_getSystemTextEncoding()); - - sActFileName.SearchAndReplaceAll( "/", "\\" ); -*/ XMLHashMap* aXMLStrHM = file->GetStrings(); LangHashMap* pElem; XMLElement* pXMLElement = NULL; diff --git a/l10ntools/source/lngex.cxx b/l10ntools/source/lngex.cxx index c593b85d4932..27136dc8797f 100644 --- a/l10ntools/source/lngex.cxx +++ b/l10ntools/source/lngex.cxx @@ -170,7 +170,6 @@ BOOL ParseCommandLine( int argc, char* argv[]) void Help() /*****************************************************************************/ { - //fprintf( stdout, "Syntax:ULFEX[-p Prj][-r PrjRoot]-i FileIn -o FileOut[-m DataBase][-e][-b][-u][-NOUTF8][-ULF][-L l1,l2,...]\n" ); fprintf( stdout, "Syntax:ULFEX[-p Prj][-r PrjRoot]-i FileIn -o FileOut[-m DataBase][-L l1,l2,...]\n" ); fprintf( stdout, " Prj: Project\n" ); fprintf( stdout, " PrjRoot: Path to project root (..\\.. etc.)\n" ); @@ -199,15 +198,8 @@ int _cdecl main( int argc, char *argv[] ) Help(); return 1; } - if( !bQuiet ){ - fprintf( stdout, "\nUlfEx 1 Copyright 2000, 2010 Oracle and/or its affiliates. All Rights Reserved.\n" ); - fprintf( stdout, "=================================================================================\n" ); - fprintf( stdout, "\nProcessing File %s ...\n", sInputFile.GetBuffer()); - }else - { fprintf(stdout, "."); fflush( stdout ); - } if ( sOutputFile.Len()) { LngParser aParser( sInputFile, bUTF8, bULF , bQuiet ); @@ -217,7 +209,5 @@ int _cdecl main( int argc, char *argv[] ) aParser.CreateSDF( sOutputFile, sPrj, sPrjRoot ); } - if( !bQuiet ) fprintf( stdout, "\n=================================================\n\n" ); - return 0; } diff --git a/l10ntools/source/srclex.l b/l10ntools/source/srclex.l index 473da8b5d511..eb2b6af78b34 100644 --- a/l10ntools/source/srclex.l +++ b/l10ntools/source/srclex.l @@ -259,10 +259,6 @@ main( int argc, char* argv[]) FILE *pFile; pOutput = GetOutputFile( argc, argv ); - if( !isQuiet() ){ - fprintf( stdout, "\nTransEx 3.1 Copyright 2000, 2010 Oracle and/or its affiliates. All Rights Reserved.\n" ); - fprintf( stdout, "=====================================================================================\n" ); - } if ( !pOutput ) { fprintf( stdout, "Syntax:TRANSEX[-p Prj][-r PrjRoot]-i FileIn...[-o FileOut][-m DataBase][-e][-b][-u][-L l1,l2,...]\n" ); @@ -301,8 +297,6 @@ main( int argc, char* argv[]) nRetValue = GetError(); EndExport(); - if( !isQuiet() ) fprintf( stdout, "\n===================================\n\n" ); - /* return error level */ return nRetValue; } diff --git a/l10ntools/source/xrmlex.l b/l10ntools/source/xrmlex.l index 4770a851c741..6229525d7e84 100644 --- a/l10ntools/source/xrmlex.l +++ b/l10ntools/source/xrmlex.l @@ -180,10 +180,6 @@ main( int argc, char* argv[]) FILE *pFile; pOutput = GetOutputFile( argc, argv ); - if( !isQuiet() ){ - fprintf( stdout, "\nXrmEx 0.9 Copyright 2000, 2010 Oracle and/or its affiliates. All Rights Reserved.\n" ); - fprintf( stdout, "===================================================================================\n" ); - } if ( !pOutput ) { fprintf( stdout, "Syntax: XRMEX[-p Prj][-r PrjRoot]-i FileIn [-o FileOut][-m DataBase][-e][-b][-u][-NOUTF8][-L l1,l2,...]\n" ); @@ -222,7 +218,6 @@ main( int argc, char* argv[]) nRetValue = GetError(); EndXrmExport(); - if( !isQuiet() ) fprintf( stdout, "\n===================================\n\n" ); removeTempFile(); /* return error level */ return nRetValue; diff --git a/l10ntools/source/xrmmerge.cxx b/l10ntools/source/xrmmerge.cxx index b77f75ea04e5..dc3d2fe6a283 100644 --- a/l10ntools/source/xrmmerge.cxx +++ b/l10ntools/source/xrmmerge.cxx @@ -252,8 +252,6 @@ extern FILE *GetXrmFile() // (e.g.: source\ui\src\menue.src) sActFileName = sFullEntry.Copy( sPrjEntry.Len() + 1 ); - if( !bQuiet ) - fprintf( stdout, "\nProcessing File %s ...\n", sInputFileName.GetBuffer()); sActFileName.SearchAndReplaceAll( "/", "\\" ); -- cgit v1.2.3 From fb9f27fc9881ad5670bfe4d9f96438bf2322b24d Mon Sep 17 00:00:00 2001 From: Ivo Hinkelmann Date: Wed, 7 Jul 2010 15:35:17 +0200 Subject: l10ntxt: #i113008# add support for xtx files (single text files) --- l10ntools/scripts/const.py | 39 +++++++ l10ntools/scripts/l10ntool.py | 188 +++++++++++++++++++++++++++++++++ l10ntools/scripts/sdf.py | 240 ++++++++++++++++++++++++++++++++++++++++++ l10ntools/scripts/xtxex | 47 +++++++++ l10ntools/scripts/xtxex.py | 92 ++++++++++++++++ 5 files changed, 606 insertions(+) create mode 100644 l10ntools/scripts/const.py create mode 100644 l10ntools/scripts/l10ntool.py create mode 100644 l10ntools/scripts/sdf.py create mode 100755 l10ntools/scripts/xtxex create mode 100644 l10ntools/scripts/xtxex.py diff --git a/l10ntools/scripts/const.py b/l10ntools/scripts/const.py new file mode 100644 index 000000000000..2d514eabdab6 --- /dev/null +++ b/l10ntools/scripts/const.py @@ -0,0 +1,39 @@ +#************************************************************************* +# +# 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 +# +# for a copy of the LGPLv3 License. +# +#************************************************************************* + +# Pseudo const +class _const: + class ConstError(TypeError): pass + def __setattr__(self, name, value): + if self.__dict__.has_key(name): + raise self.ConstError, "Can't rebind const(%s)"%name + self.__dict__[name] = value + +import sys +sys.modules[__name__] = _const() + + diff --git a/l10ntools/scripts/l10ntool.py b/l10ntools/scripts/l10ntool.py new file mode 100644 index 000000000000..caa15b7efd17 --- /dev/null +++ b/l10ntools/scripts/l10ntool.py @@ -0,0 +1,188 @@ +#************************************************************************* +# +# 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 +# +# for a copy of the LGPLv3 License. +# +#************************************************************************* + +from optparse import OptionParser +from sdf import SdfData +import string , sys , os + +class abstractL10nTool: + _options = {} + _args = "" + _resource_type = "" + _source_language = "en-US" + + ##### Implement these abstract methods + + ##### Nameing scheme for the output files + def get_outputfile_format_str(self): + # filename,fileNoExt,language,extension,pathPrefix,pathPostFix,path + return "{path}/{fileNoExt}_{language}.{extension}" + + ################################# Merge single files ########################################### + + ##### Merge a single file + def merge_file(self, inputfilename, outputfilename, parsed_file_ref, lang, is_forced_lang, sdfdata): + pass + + ##### Helper for parse-once-use-often like parsing a xml file is needed implement it here + def parse_file(self, filename): + return None + + ################### Merge one big file containing all strings in all languages ################# + def merge_one_big_file(self, inputfile, outputfilename, parsed_file_ref, lang, sdfdata): + pass + + ################### Extract a single File ###################################################### + def extract_file(self, inputfile): + pass + + ################################################################################################ + + def format_outputfile(self, filename, language): + extension = filename[filename.rfind('.')+1:] + file = filename[:filename.rfind('.')] + return self.get_outputfile_format_str().format( + filename=filename, fileNoExt=file, language=language, extension=extension, path_prefix=self._options.path_prefix, + path_postfix=self._options.path_postfix, path=self.get_path()) + + def get_path(self): + if self._options.outputfile.find('/') == -1: + return "" + else: + return self._options.outputfile[:self._options.outputfile.rfind('/')] + + def merge(self, sdfdata): + langset,forcedset, foundset = set(), set() , set() + + if self._options.languages: langset = set(self._options.languages) + if self._options.forcedlanguages: forcedset = set(self._options.forcedlanguages) + if sdfdata.get_languages_found_in_sdf(): foundset = sdfdata.get_languages_found_in_sdf() + + if self.has_multi_inputfiles(): + filelist = self.read_inputfile_list() + else: + filelist = self._options.inputfile + + for inputfile in filelist: + ref = self.parse_file(inputfile) + # Don't write that files if there is no l10n present + if ((langset & foundset) - forcedset): # all langs given and found in sdf without enforced + [self.merge_file(inputfile,self.format_outputfile(inputfile, lang), ref, lang, False, sdfdata) for lang in ((langset & foundset) - forcedset)] + # Always write those files even if there is no l10n available + if forcedset: # all enforced langs + [self.merge_file(inputfile, self.format_outputfile(inputfile, lang), ref, lang, True, sdfdata) for lang in forcedset] + # In case a big file have to be written + if ((langset & foundset) | forcedset): # all langs given ,found in sdf and enforced ones + self.merge_one_big_file(inputfile, self.format_outputfile(inputfile, lang), ref, ((langset & foundset) | forcedset), sdfdata) + + def has_multi_inputfiles(self): + return self._options.inputfile[0] == '@' + + def extract(self): + try: + f = open(self._options.outputfile, "w+") + f.write(self.extract_file(self._options.inputfile)) + except IOError: + print "ERROR: Can not write file " + self._options.outputfile + else: + f.close() + + # Parse the common options + def parse_options(self): + parser = OptionParser() + parser.add_option("-i", "--inputfile", dest="inputfile", metavar="FILE", help="resource file to read" ) + parser.add_option("-o", "--outputfile", dest="outputfile", metavar="FILE", help="extracted sdf or merged file" ) + parser.add_option("-m", "--inputsdffile", dest="input_sdf_file", metavar="FILE", help="merge this sdf file" ) + parser.add_option("-x", "--pathprefix", dest="path_prefix", metavar="PATH", help="" ) + parser.add_option("-y", "--pathpostfix", dest="path_postfix", metavar="PATH", help="" ) + parser.add_option("-p", "--projectname", dest="project_name", metavar="NAME", help="" ) + parser.add_option("-r", "--projectroot", dest="project_root", metavar="PATH", help="" ) + parser.add_option("-f", "--forcedlanguages", dest="forcedlanguages", metavar="ISOCODE[,ISOCODE]", help="Always merge those langs even if no l10n is available for those langs" ) + parser.add_option("-l", "--languages", dest="languages", metavar="ISOCODE[,ISOCODE]", help="Merge those langs if l10n is found for each") + parser.add_option("-q", "--quiet", action="store_true", dest="quietmode", help="",default=False) + (self._options, self.args) = parser.parse_args() + + # -l "de,pr,pt-BR" => [ "de" , "pt" , "pt-BR" ] + parse_complex_arg = lambda arg: arg.split(",") + if self._options.forcedlanguages: self._options.forcedlanguages = parse_complex_arg(self._options.forcedlanguages) + if self._options.languages: self._options.languages = parse_complex_arg(self._options.languages) + self.test_options() + + def __init__(self): + self.parse_options() + if self._options.input_sdf_file != None and len(self._options.input_sdf_file): + sdfdata = SdfData(self._options.input_sdf_file) + sdfdata.read() + self.merge(sdfdata) + else: + self.extract() + + def make_dirs(self, filename): + dir = filename[:filename.rfind('/')] + if os.path.exists(dir): + if os.path.isfile(dir): + print "ERROR: There is a file '"+dir+"' where I want create a directory" + sys.exit(-1) + else: + return + else: + try: + print "DBG: make_dir " + str(dir) + os.makedirs(dir) + except IOError: + print "Error: Can not create dir " + dir + sys.exit(-1) + + def test_options(self): + opt = self._options + is_valid = lambda x: x != None and len(x) > 0 + return is_valid(opt.project_root) and is_valid(opt.project_name) and is_valid(opt.languages) and \ + ( is_valid(opt.inputfile) and (( is_valid(opt.path_prefix) and is_valid(opt.path_postfix) ) or is_valid(opt.outputfile)) and \ + ( ( is_valid(opt.input_sdf_file) and ( is_valid(opt.outputfile) or ( is_valid(opt.path_prefix) and is_valid(opt.path_postfix) ) or \ + ( is_valid(opt.inputfile) and is_valid(opt.outputFile)) )))) + print "Strange options ..." + sys.exit( -1 ) + + + def read_inputfile_list(self): + if self.has_multi_inputfiles(): + lines = [] + try: + f = open(self._options.inputfile[1:], "r") + lines = [line.strip('\n') for line in f.readlines()] + except IOError: + print "ERROR: Can not read file list " + self._options.inputfile[2:] + sys.exit(-1) + else: + f.close() + return lines + + def get_filename_string(self, inputfile): + absfile = os.path.realpath(os.path.abspath(inputfile)) + absroot = os.path.realpath(os.path.abspath(self._options.project_root)) + return absfile[len(absroot):].replace('/','\\') + diff --git a/l10ntools/scripts/sdf.py b/l10ntools/scripts/sdf.py new file mode 100644 index 000000000000..ce1077197622 --- /dev/null +++ b/l10ntools/scripts/sdf.py @@ -0,0 +1,240 @@ +#************************************************************************* +# +# 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 +# +# for a copy of the LGPLv3 License. +# +#************************************************************************* + +import string + +class MyOrderedDict(dict): + _keylist = [] + _valuelist = [] + + #correct?!? + def __init__(self, defaults={}): + dict.__init__(self) + for n,v in defaults.items(): + self[n] = v + #def __getitem__(self): + # pass + + def __setitem__(self, key, value): + self._keylist.append(key) + self._valuelist.append(value) + return dict.__setitem__(self, key, value) + + def __delattr__(self, key): + self._keylist.__delattr__(key) + self._valuelist.__delattr__(dict[key]) + return dict.__delattr__(self, key) + + def __delitem__(self, key): + self._keylist.__delitem__(key) + self._valuelist.__delitem__(dict[key]) + return dict.__delitem__(self, key) + + def __iter(self): + return zip(self._keylist, self._valuelist) + + def __iterkeys__(self): + return self._keylist + + def __iteritems__(self): + return self._valuelist + + def items(self): + return zip(self._keylist,self._valuelist) + + def keys(self): + return self._keylist + + def __keysattr__(self): + return self._keylist + + def pop(self, key): + self._keylist.pop(key) + self._valuelist.pop(key) + return dict.__pop__(self, key) + + def popitem(self): + raise NotImplementedError("popitem") + + def clear(self): + self._keylist.clear() + self._valuelist.clear() + return dict.clear() + + def copy(self): + # correct?!? + newobj = MyOrderedDict(self) + newobj._keylist = self._keylist + newobj._valuelist = self._valuelist + return newobj + +class SdfData: + _filename = ""; + _dict = MyOrderedDict() + #_dict = {} + _languages_found = []; + + def __init__ (self, filename=""): + self._filename = filename + + def __getitem__(self, key): + if self._dict.has_key(key): + return self._dict[key] + else: + return None + + def has_key(self, key): + return self._dict.has_key(key) + + def __setitem__(self, key, value): + self._dict[key] = value + + def get_languages_found_in_sdf(self): + return set(self._languages_found) + + def read(self): + try: + f = open(self._filename, "r") + lines = [line.rstrip('\n') for line in f.readlines()] + except IOError: + print "ERROR: Trying to read "+ self._filename + raise + else: + f.close() + for line in lines: + entity = SdfEntity() + entity.set_properties(line) + self._dict[entity.get_id()] = entity + self._languages_found.append(entity.langid) + + def write(self, filename): + try: + f = open(filename, "w+") + for value in self._dict.itervalues(): + #f.write( repr(value)+"\n" ) + f.write(value + "\n") + except IOError: + print "ERROR: Trying to write " + filename + raise + else: + f.close() + + + +import sys +class SdfEntity: + # Sdf format columns + project = "" + source_file = "" + dummy1 = "" + resource_type = "" + gid = "" + lid = "" + helpid = "" + platform = "" + dummy2 = "" + langid = "" + text = "" + helptext = "" + quickhelptext = "" + title = "" + date = "" + + import const + const._PROJECT_POS = 0 + const._SOURCE_FILE_POS = 1 + const._DUMMY1_POS = 2 + const._RESOURCE_TYPE_POS = 3 + const._GID_POS = 4 + const._LID_POS = 5 + const._HELPID_POS = 6 + const._PLATFORM_POS = 7 + const._DUMMY2_POS = 8 + const._LANGID_POS = 9 + const._TEXT_POS = 10 + const._HELPTEXT_POS = 11 + const._QUICKHELPTEXT_POS = 12 + const._TITLE_POS = 13 + const._DATE_POS = 14 + + + + def __init__(self, project="", source_file="", dummy1="", resource_type="", gid="", lid="", helpid="", platform="", dummy2="", langid="", + text="", helptext="", quickhelptext="", title="", date="2002-02-02 02:02:02"): + self.project = project; + self.source_file = source_file; + self.dummy1 = dummy1; + self.resource_type = resource_type; + self.gid = gid; + self.lid = lid; + self.helpid = helpid; + self.platform = platform; + self.dummy2 = dummy2; + self.langid = langid; + self.text = text; + self.helptext = helptext; + self.quickhelptext = quickhelptext; + self.title = title; + self.date = date; + + def set_properties(self, line): + splitted = line.split("\t") + if len(splitted) == 15: + self.project = splitted[ self.const._PROJECT_POS ] + self.source_file = splitted[ self.const._SOURCE_FILE_POS ] + self.dummy1 = splitted[ self.const._DUMMY1_POS ] + self.resource_type = splitted[ self.const._RESOURCE_TYPE_POS ] + self.gid = splitted[ self.const._GID_POS ] + self.lid = splitted[ self.const._LID_POS ] + self.helpid = splitted[ self.const._HELPID_POS ] + self.platform = splitted[ self.const._PLATFORM_POS ] + self.dummy2 = splitted[ self.const._DUMMY2_POS ] + self.langid = splitted[ self.const._LANGID_POS ] + self.text = splitted[ self.const._TEXT_POS ] + self.helptext = splitted[ self.const._HELPTEXT_POS ] + self.quickhelptext = splitted[ self.const._QUICKHELPTEXT_POS ] + self.title = splitted[ self.const._TITLE_POS ] + self.date = splitted[ self.const._DATE_POS ] + #else: + # print "Offending line '"+line+"'" + # print "ERROR: Something is broken here! Line has {0} tabs".format( len(splitted) ) + # sys.exit( -1 ) + + def get_file_id(self): + return self.project + "\\" + self.source_file + + def get_resource_path(self): + return self.source_file[0:self.source_file.rfind( "\\" )-1] + + #def __repr__(self): + def __str__(self): + return ''.join([self.project, "\t", self.source_file, "\t", self.dummy1, "\t", self.resource_type, "\t" , + self.gid, "\t", self.lid, "\t", self.helpid, "\t", self.platform, "\t", self.dummy2, "\t" , self.langid, + "\t", self.text, "\t", self.helptext, "\t", self.quickhelptext, "\t" , self.title, "\t", self.date ]) + + def get_id(self): + return ''.join([self.project, self.gid, self.lid, self.source_file, self.resource_type, self.platform, self.helpid, self.langid]) diff --git a/l10ntools/scripts/xtxex b/l10ntools/scripts/xtxex new file mode 100755 index 000000000000..cc9dac01fca2 --- /dev/null +++ b/l10ntools/scripts/xtxex @@ -0,0 +1,47 @@ +#!/bin/sh +#************************************************************************* +# +# 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 +# +# for a copy of the LGPLv3 License. +# +#************************************************************************* + +if [ x${SOLARENV}x = xx ]; then + echo No environment found, please use 'setsolar' +exit 1 +fi + +# localize.pl calls localize_sl in solver bin directory which depends on dynamic +# libraries in solver lib directory but has no correct RPATH (or equivalent): +if [ "${OS?}" = MACOSX ]; then + export DYLD_LIBRARY_PATH=${DYLD_LIBRARY_PATH+${DYLD_LIBRARY_PATH}:}${SOLARVERSION?}/${INPATH?}/lib${UPDMINOREXT} +else + export LD_LIBRARY_PATH=${LD_LIBRARY_PATH+${LD_LIBRARY_PATH}:}${SOLARVERSION?}/${INPATH?}/lib${UPDMINOREXT} +fi + +if [ x${SOLARVER}x = xx -o x${UPDMINOREXT}x = xx ]; then + exec python $SOLARVERSION/$INPATH/bin/xtxex.py "$@" +else + exec python $SOLARVERSION/$INPATH/bin$UPDMINOREXT/xtxex.py "$@" +fi + diff --git a/l10ntools/scripts/xtxex.py b/l10ntools/scripts/xtxex.py new file mode 100644 index 000000000000..98ec1e86b596 --- /dev/null +++ b/l10ntools/scripts/xtxex.py @@ -0,0 +1,92 @@ +#************************************************************************* +# +# 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 +# +# for a copy of the LGPLv3 License. +# +#************************************************************************* + +from l10ntool import abstractL10nTool +from sdf import SdfEntity +import sys +import shutil + +class xtxex(abstractL10nTool): + _resourceType = "xtx" + + def __init__(self): + abstractL10nTool.__init__(self) + + def merge_file(self, inputfilename, outputfilename, parsed_file_ref, lang,is_forced_lang, sdfdata): + print "merge_file lang " + lang +" file " + outputfilename + sdfline = self.prepare_sdf_line(inputfilename,lang) + if sdfdata.has_key(sdfline.get_id()): + line = sdfdata[sdfline.get_id()].text.replace("\\n", '\n') + self.make_dirs(outputfilename) + try: + f = open(outputfilename, "w+") + f.write(line) + except IOError: + print "ERROR: Can not write file " + outputfilename + sys.exit(-1) + else: + f.close() + return + if is_forced_lang: + try: + shutil.copy(inputfilename, outputfilename) + except IOError: + print "ERROR: Can not copy file '" + inputfilename + "' to " + "'" + outputfilename + "'" + sys.exit(-1) + + ##### Extract a single File + def extract_file(self, inputfile): + lines = [] + try: + f = open(inputfile, "r") + lines = f.readlines() + except IOError: + print "ERROR: Can not open file " + inputfile + sys.exit(-1) + else: + f.close() + # remove legal header + lines = [line for line in lines if len(line) > 0 and not line[0] == '#'] + # escape all returns + lines = [line.replace('\n', "\\n") for line in lines] + line = ''.join(lines) + sdf_entity = self.prepare_sdf_line(inputfile); + sdf_entity.text = line + return str(sdf_entity) + + ##### Nameing scheme for the output files + def get_outputfile_format_str(self): + # filename,fileNoExt,language,extension,pathPrefix,pathPostFix,path + return "{path}/{fileNoExt}_{language}.{extension}" + + def prepare_sdf_line(self, inputfile="", lang=""): + if lang == "": + lang = self._source_language + return SdfEntity(project=self._options.project_name, source_file=self.get_filename_string(inputfile), + resource_type=self._resource_type, gid="none", lid="none", langid=lang,text="") + +run = xtxex() -- cgit v1.2.3 From 71d0aa83c9a1330c27b47cc836f4754a007815ae Mon Sep 17 00:00:00 2001 From: Ivo Hinkelmann Date: Wed, 7 Jul 2010 15:36:02 +0200 Subject: l10ntxt: #i113008# add support for xtx files (single text files) --- l10ntools/prj/d.lst | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/l10ntools/prj/d.lst b/l10ntools/prj/d.lst index 0b6a43444613..e20114a1ed0d 100644 --- a/l10ntools/prj/d.lst +++ b/l10ntools/prj/d.lst @@ -47,6 +47,11 @@ mkdir: %_DEST%\bin%_EXT%\help\com\sun\star\help ..\scripts\localize %_DEST%\bin%_EXT%\localize ..\scripts\fast_merge.pl %_DEST%\bin%_EXT%\fast_merge.pl ..\scripts\keyidGen.pl %_DEST%\bin%_EXT%\keyidGen.pl +..\scripts\const.py %_DEST%\bin%_EXT%\const.py +..\scripts\l10ntool.py %_DEST%\bin%_EXT%\l10ntool.py +..\scripts\xtxex.py %_DEST%\bin%_EXT%\xtxex.py +..\scripts\sdf.py %_DEST%\bin%_EXT%\sdf.py +..\scripts\xtxex %_DEST%\bin%_EXT%\xtxex ..\inc\export.hxx %_DEST%\inc%_EXT%\l10ntools\export.hxx ..\inc\l10ntools\directory.hxx %_DEST%\inc%_EXT%\l10ntools\directory.hxx -- cgit v1.2.3 From bcd4bc56c93dd815da6b5d0e22348dabbc75ca9f Mon Sep 17 00:00:00 2001 From: Niklas Nebel Date: Wed, 7 Jul 2010 17:28:29 +0200 Subject: #i112250# #i113022# better handling of automatic decimals for small values or equal cells --- svl/source/numbers/zformat.cxx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/svl/source/numbers/zformat.cxx b/svl/source/numbers/zformat.cxx index 707b2362f0ed..2d0909c8782b 100644 --- a/svl/source/numbers/zformat.cxx +++ b/svl/source/numbers/zformat.cxx @@ -2086,7 +2086,9 @@ BOOL SvNumberformat::GetOutputString(double fNumber, if (!nLen) return false; - if (nLen > 11) + // #i112250# With the 10-decimal limit, small numbers are formatted as "0". + // Switch to scientific in that case, too: + if (nLen > 11 || (OutString.EqualsAscii("0") && fNumber != 0.0)) { sal_uInt16 nStandardPrec = rScan.GetStandardPrec(); nStandardPrec = ::std::min(nStandardPrec, static_cast(14)); // limits to 14 decimals -- cgit v1.2.3 From 8b45c14977a097d610126ba92625aa5fa1537e6a Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Wed, 7 Jul 2010 19:43:24 +0200 Subject: vcl113: #i110453# support disabled options in a choice --- vcl/inc/vcl/print.hxx | 2 ++ vcl/source/gdi/print3.cxx | 31 ++++++++++++++++++++++++++++++- vcl/source/window/printdlg.cxx | 17 +++++++++++++++++ 3 files changed, 49 insertions(+), 1 deletion(-) diff --git a/vcl/inc/vcl/print.hxx b/vcl/inc/vcl/print.hxx index 96822d9bc756..af83b2db40e1 100644 --- a/vcl/inc/vcl/print.hxx +++ b/vcl/inc/vcl/print.hxx @@ -478,6 +478,7 @@ public: */ void enableUIOption( const rtl::OUString& rPropName, bool bEnable ); bool isUIOptionEnabled( const rtl::OUString& rPropName ) const; + bool isUIChoiceEnabled( const rtl::OUString& rPropName, sal_Int32 nChoice ) const; /* returns the property name rPropName depends on or an empty string if no dependency exists. */ @@ -649,6 +650,7 @@ class VCL_DLLPUBLIC PrinterOptionsHelper const com::sun::star::uno::Sequence< rtl::OUString >& i_rChoices, sal_Int32 i_nValue, const rtl::OUString& i_rType = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Radio" ) ), + const com::sun::star::uno::Sequence< sal_Bool >& i_rDisabledChoices = com::sun::star::uno::Sequence< sal_Bool >(), const UIControlOptions& i_rControlOptions = UIControlOptions() ); diff --git a/vcl/source/gdi/print3.cxx b/vcl/source/gdi/print3.cxx index 191f8f26dc75..f6bd81ef1bea 100644 --- a/vcl/source/gdi/print3.cxx +++ b/vcl/source/gdi/print3.cxx @@ -150,6 +150,7 @@ public: typedef std::hash_map< rtl::OUString, size_t, rtl::OUStringHash > PropertyToIndexMap; typedef std::hash_map< rtl::OUString, ControlDependency, rtl::OUStringHash > ControlDependencyMap; + typedef std::hash_map< rtl::OUString, Sequence< sal_Bool >, rtl::OUStringHash > ChoiceDisableMap; boost::shared_ptr mpPrinter; Sequence< PropertyValue > maUIOptions; @@ -158,6 +159,7 @@ public: PropertyToIndexMap maPropertyToIndex; Link maOptionChangeHdl; ControlDependencyMap maControlDependencies; + ChoiceDisableMap maChoiceDisableMap; sal_Bool mbFirstPage; sal_Bool mbLastPage; sal_Bool mbReversePageOrder; @@ -1299,6 +1301,7 @@ void PrinterController::setUIOptions( const Sequence< beans::PropertyValue >& i_ bool bHaveProperty = false; rtl::OUString aPropName; vcl::ImplPrinterControllerData::ControlDependency aDep; + Sequence< sal_Bool > aChoicesDisabled; for( int n = 0; n < aOptProp.getLength(); n++ ) { const beans::PropertyValue& rEntry( aOptProp[ n ] ); @@ -1326,6 +1329,10 @@ void PrinterController::setUIOptions( const Sequence< beans::PropertyValue >& i_ { rEntry.Value >>= aDep.mnDependsOnEntry; } + else if( rEntry.Name.equalsAscii( "ChoicesDisabled" ) ) + { + rEntry.Value >>= aChoicesDisabled; + } } if( bHaveProperty ) { @@ -1338,6 +1345,8 @@ void PrinterController::setUIOptions( const Sequence< beans::PropertyValue >& i_ } if( aDep.maDependsOnName.getLength() > 0 ) mpImplData->maControlDependencies[ aPropName ] = aDep; + if( aChoicesDisabled.getLength() > 0 ) + mpImplData->maChoiceDisableMap[ aPropName ] = aChoicesDisabled; } } } @@ -1413,6 +1422,20 @@ bool PrinterController::isUIOptionEnabled( const rtl::OUString& i_rProperty ) co return bEnabled; } +bool PrinterController::isUIChoiceEnabled( const rtl::OUString& i_rProperty, sal_Int32 i_nValue ) const +{ + bool bEnabled = true; + ImplPrinterControllerData::ChoiceDisableMap::const_iterator it = + mpImplData->maChoiceDisableMap.find( i_rProperty ); + if(it != mpImplData->maChoiceDisableMap.end() ) + { + const Sequence< sal_Bool >& rDisabled( it->second ); + if( i_nValue >= 0 && i_nValue < rDisabled.getLength() ) + bEnabled = ! rDisabled[i_nValue]; + } + return bEnabled; +} + rtl::OUString PrinterController::getDependency( const rtl::OUString& i_rProperty ) const { rtl::OUString aDependency; @@ -1789,14 +1812,20 @@ Any PrinterOptionsHelper::getChoiceControlOpt( const rtl::OUString& i_rTitle, const Sequence< rtl::OUString >& i_rChoices, sal_Int32 i_nValue, const rtl::OUString& i_rType, + const Sequence< sal_Bool >& i_rDisabledChoices, const PrinterOptionsHelper::UIControlOptions& i_rControlOptions ) { UIControlOptions aOpt( i_rControlOptions ); sal_Int32 nUsed = aOpt.maAddProps.getLength(); - aOpt.maAddProps.realloc( nUsed + 1 ); + aOpt.maAddProps.realloc( nUsed + 1 + (i_rDisabledChoices.getLength() ? 1 : 0) ); aOpt.maAddProps[nUsed].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Choices" ) ); aOpt.maAddProps[nUsed].Value = makeAny( i_rChoices ); + if( i_rDisabledChoices.getLength() ) + { + aOpt.maAddProps[nUsed+1].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ChoicesDisabled" ) ); + aOpt.maAddProps[nUsed+1].Value = makeAny( i_rDisabledChoices ); + } PropertyValue aVal; aVal.Name = i_rProperty; diff --git a/vcl/source/window/printdlg.cxx b/vcl/source/window/printdlg.cxx index 35077b1cff0e..13cba8a4ce81 100644 --- a/vcl/source/window/printdlg.cxx +++ b/vcl/source/window/printdlg.cxx @@ -1192,6 +1192,7 @@ void PrintDialog::setupOptionalUI() rtl::OUString aText; rtl::OUString aPropertyName; Sequence< rtl::OUString > aChoices; + Sequence< sal_Bool > aChoicesDisabled; Sequence< rtl::OUString > aHelpTexts; sal_Int64 nMinValue = 0, nMaxValue = 0; sal_Int32 nCurHelpText = 0; @@ -1215,6 +1216,10 @@ void PrintDialog::setupOptionalUI() { rEntry.Value >>= aChoices; } + else if( rEntry.Name.equalsAscii( "ChoicesDisabled" ) ) + { + rEntry.Value >>= aChoicesDisabled; + } else if( rEntry.Name.equalsAscii( "Property" ) ) { PropertyValue aVal; @@ -1497,6 +1502,8 @@ void PrintDialog::setupOptionalUI() pBtn->SetText( aChoices[m] ); pBtn->Check( m == nSelectVal ); pBtn->SetToggleHdl( LINK( this, PrintDialog, UIOption_RadioHdl ) ); + if( aChoicesDisabled.getLength() > m && aChoicesDisabled[m] == sal_True ) + pBtn->Enable( FALSE ); pBtn->Show(); maPropertyToWindowMap[ aPropertyName ].push_back( pBtn ); maControlToPropertyMap[pBtn] = aPropertyName; @@ -1821,6 +1828,16 @@ void PrintDialog::checkOptionalControlDependencies() } } + if( bShouldbeEnabled && dynamic_cast(it->first) ) + { + std::map< Window*, sal_Int32 >::const_iterator r_it = maControlToNumValMap.find( it->first ); + if( r_it != maControlToNumValMap.end() ) + { + bShouldbeEnabled = maPController->isUIChoiceEnabled( it->second, r_it->second ); + } + } + + bool bIsEnabled = it->first->IsEnabled(); // Enable does not do a change check first, so can be less cheap than expected if( bShouldbeEnabled != bIsEnabled ) -- cgit v1.2.3 From 7ae66cbe2015930650f7d3b90695a0d331f618d2 Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Thu, 8 Jul 2010 13:00:42 +0200 Subject: fix a warning --- svtools/source/contnr/svlbitm.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/svtools/source/contnr/svlbitm.cxx b/svtools/source/contnr/svlbitm.cxx index 633cdc903ef6..53c15c5c2601 100644 --- a/svtools/source/contnr/svlbitm.cxx +++ b/svtools/source/contnr/svlbitm.cxx @@ -406,7 +406,7 @@ BOOL SvLBoxButton::ClickHdl( SvLBox*, SvLBoxEntry* pEntry ) } void SvLBoxButton::Paint( const Point& rPos, SvLBox& rDev, USHORT /* nFlags */, - SvLBoxEntry* pEntry ) + SvLBoxEntry* /*pEntry*/ ) { DBG_CHKTHIS(SvLBoxButton,0); USHORT nIndex = eKind == SvLBoxButtonKind_staticImage -- cgit v1.2.3 From 55ee3b3473b1b6728259e142fff62b0466710192 Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Thu, 8 Jul 2010 11:09:20 +0200 Subject: vcl113: fix a PEBCAD --- vcl/win/source/gdi/salgdi3.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vcl/win/source/gdi/salgdi3.cxx b/vcl/win/source/gdi/salgdi3.cxx index fa757fe58b83..01fecec94b2f 100644 --- a/vcl/win/source/gdi/salgdi3.cxx +++ b/vcl/win/source/gdi/salgdi3.cxx @@ -1763,7 +1763,7 @@ USHORT WinSalGraphics::SetFont( ImplFontSelectData* pFont, int nFallbackLevel ) void WinSalGraphics::GetFontMetric( ImplFontMetricData* pMetric, int nFallbackLevel ) { // temporarily change the HDC to the font in the fallback level - HFONT hOldFont = SelectFont( mhDC, mhFonts[i] ); + HFONT hOldFont = SelectFont( mhDC, mhFonts[nFallbackLevel] ); if ( aSalShlData.mbWNT ) { @@ -1783,7 +1783,7 @@ void WinSalGraphics::GetFontMetric( ImplFontMetricData* pMetric, int nFallbackLe const bool bOK = GetTextMetricsA( mhDC, &aWinMetric ); // restore the HDC to the font in the base level SelectFont( mhDC, hOldFont ); - if( !bOk ) + if( !bOK ) return; // device independent font attributes -- cgit v1.2.3 From d4b20337f69340abd5cc9bc3e72c617876cc15d6 Mon Sep 17 00:00:00 2001 From: sj Date: Thu, 8 Jul 2010 16:46:28 +0200 Subject: impress194: #i112166# always removing tempfile (now removing file via osl_removeFile instead of ucb::content - delete) --- vcl/inc/vcl/gfxlink.hxx | 7 ++--- vcl/source/gdi/gfxlink.cxx | 59 ++++++--------------------------------- vcl/source/gdi/pdfwriter_impl.cxx | 1 + 3 files changed, 11 insertions(+), 56 deletions(-) diff --git a/vcl/inc/vcl/gfxlink.hxx b/vcl/inc/vcl/gfxlink.hxx index 3b3938ec848b..dced5a19c461 100644 --- a/vcl/inc/vcl/gfxlink.hxx +++ b/vcl/inc/vcl/gfxlink.hxx @@ -33,9 +33,6 @@ #include #include -//#if 0 // _SOLAR__PRIVATE -#include - // ------------- // - ImpBuffer - // ------------- @@ -62,7 +59,7 @@ struct ImpBuffer struct ImpSwap { - INetURLObject maURL; + rtl::OUString maURL; ULONG mnDataSize; ULONG mnRefCount; @@ -71,7 +68,7 @@ struct ImpSwap BYTE* GetData() const; - BOOL IsSwapped() const { return maURL.GetMainURL( INetURLObject::NO_DECODE ).getLength() > 0; } + BOOL IsSwapped() const { return maURL.getLength() > 0; } void WriteTo( SvStream& rOStm ) const; }; diff --git a/vcl/source/gdi/gfxlink.cxx b/vcl/source/gdi/gfxlink.cxx index 4d32990f9335..60ad94a63273 100644 --- a/vcl/source/gdi/gfxlink.cxx +++ b/vcl/source/gdi/gfxlink.cxx @@ -28,6 +28,7 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_vcl.hxx" +#include #include #include #include @@ -398,12 +399,10 @@ ImpSwap::ImpSwap( BYTE* pData, ULONG nDataSize ) : { ::utl::TempFile aTempFile; - maURL = INetURLObject(aTempFile.GetURL()); - - if( maURL.GetMainURL( INetURLObject::NO_DECODE ).getLength() ) + maURL = aTempFile.GetURL(); + if( maURL.getLength() ) { - SvStream* pOStm = ::utl::UcbStreamHelper::CreateStream( maURL.GetMainURL( INetURLObject::NO_DECODE ), STREAM_READWRITE | STREAM_SHARE_DENYWRITE ); - + SvStream* pOStm = ::utl::UcbStreamHelper::CreateStream( maURL, STREAM_READWRITE | STREAM_SHARE_DENYWRITE ); if( pOStm ) { pOStm->Write( pData, mnDataSize ); @@ -412,28 +411,8 @@ ImpSwap::ImpSwap( BYTE* pData, ULONG nDataSize ) : if( bError ) { - try - { - ::ucbhelper::Content aCnt( maURL.GetMainURL( INetURLObject::NO_DECODE ), - ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XCommandEnvironment >() ); - - aCnt.executeCommand( ::rtl::OUString::createFromAscii( "delete" ), - ::com::sun::star::uno::makeAny( sal_Bool( sal_True ) ) ); - } - catch( const ::com::sun::star::ucb::ContentCreationException& ) - { - } - catch( const ::com::sun::star::uno::RuntimeException& ) - { - } - catch( const ::com::sun::star::ucb::CommandAbortedException& ) - { - } - catch( const ::com::sun::star::uno::Exception& ) - { - } - - maURL = INetURLObject(); + osl_removeFile( maURL.pData ); + maURL = String(); } } } @@ -445,28 +424,7 @@ ImpSwap::ImpSwap( BYTE* pData, ULONG nDataSize ) : ImpSwap::~ImpSwap() { if( IsSwapped() ) - { - try - { - ::ucbhelper::Content aCnt( maURL.GetMainURL( INetURLObject::NO_DECODE ), - ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XCommandEnvironment >() ); - - aCnt.executeCommand( ::rtl::OUString::createFromAscii( "delete" ), - ::com::sun::star::uno::makeAny( sal_Bool( sal_True ) ) ); - } - catch( const ::com::sun::star::ucb::ContentCreationException& ) - { - } - catch( const ::com::sun::star::uno::RuntimeException& ) - { - } - catch( const ::com::sun::star::ucb::CommandAbortedException& ) - { - } - catch( const ::com::sun::star::uno::Exception& ) - { - } - } + osl_removeFile( maURL.pData ); } // ------------------------------------------------------------------------ @@ -477,8 +435,7 @@ BYTE* ImpSwap::GetData() const if( IsSwapped() ) { - SvStream* pIStm = ::utl::UcbStreamHelper::CreateStream( maURL.GetMainURL( INetURLObject::NO_DECODE ), STREAM_READWRITE ); - + SvStream* pIStm = ::utl::UcbStreamHelper::CreateStream( maURL, STREAM_READWRITE ); if( pIStm ) { pData = new BYTE[ mnDataSize ]; diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx index 6cb0a7d07697..7b7f3bbcb4d3 100644 --- a/vcl/source/gdi/pdfwriter_impl.cxx +++ b/vcl/source/gdi/pdfwriter_impl.cxx @@ -32,6 +32,7 @@ #include #include +#include #include #include #include -- cgit v1.2.3 From 6754d6da581cab583e72dabe296b95a4b6e4c27a Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Thu, 8 Jul 2010 19:03:59 +0200 Subject: vcl113: #i63604# make inputwin for sw and sc adjust to font from system settings --- vcl/inc/vcl/edit.hxx | 4 ++++ vcl/source/control/edit.cxx | 8 ++++++++ 2 files changed, 12 insertions(+) mode change 100644 => 100755 vcl/inc/vcl/edit.hxx mode change 100644 => 100755 vcl/source/control/edit.cxx diff --git a/vcl/inc/vcl/edit.hxx b/vcl/inc/vcl/edit.hxx old mode 100644 new mode 100755 index a40de9503367..9dc427d83943 --- a/vcl/inc/vcl/edit.hxx +++ b/vcl/inc/vcl/edit.hxx @@ -247,6 +247,10 @@ public: virtual XubString GetSurroundingText() const; virtual Selection GetSurroundingTextSelection() const; + + // returns the minimum size a bordered Edit should have given the current + // global style settings (needed by sc's inputwin.cxx) + static Size GetMinimumEditSize(); }; inline ULONG Edit::IsUpdateDataEnabled() const diff --git a/vcl/source/control/edit.cxx b/vcl/source/control/edit.cxx old mode 100644 new mode 100755 index 0a29a627b8e3..d9a5de6dce30 --- a/vcl/source/control/edit.cxx +++ b/vcl/source/control/edit.cxx @@ -2862,6 +2862,14 @@ Size Edit::CalcMinimumSize() const return aSize; } +Size Edit::GetMinimumEditSize() +{ + Window* pDefWin = ImplGetDefaultWindow(); + Edit aEdit( pDefWin, WB_BORDER ); + Size aSize( aEdit.CalcMinimumSize() ); + return aSize; +} + // ----------------------------------------------------------------------- Size Edit::GetOptimalSize(WindowSizeType eType) const -- cgit v1.2.3 From 96be84bf43e4760a82c90dfdfe90816a26932e2f Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Mon, 12 Jul 2010 11:04:08 +0200 Subject: vcl113: #i113069# fix useless dereference (thanks cmc!) --- vcl/source/helper/strhelper.cxx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/vcl/source/helper/strhelper.cxx b/vcl/source/helper/strhelper.cxx index db622073cea9..67f50b69a182 100644 --- a/vcl/source/helper/strhelper.cxx +++ b/vcl/source/helper/strhelper.cxx @@ -365,8 +365,8 @@ String WhitespaceToSpace( const String& rLine, BOOL bProtect ) else { *pLeap = *pRun; - *pLeap++; - *pRun++; + ++pLeap; + ++pRun; } } } @@ -422,8 +422,8 @@ ByteString WhitespaceToSpace( const ByteString& rLine, BOOL bProtect ) else { *pLeap = *pRun; - *pLeap++; - *pRun++; + ++pLeap; + ++pRun; } } } -- cgit v1.2.3 From 85ce1d366eb685c655fc5f7ec2d45fbc05aad722 Mon Sep 17 00:00:00 2001 From: Ivo Hinkelmann Date: Mon, 12 Jul 2010 15:31:50 +0200 Subject: txtl10n: #i113008# add support for xtx files (single text files) --- l10ntools/scripts/l10ntool.py | 4 ++-- l10ntools/scripts/sdf.py | 2 -- l10ntools/scripts/xtxex.py | 29 ++++++++++++++++++++++------- 3 files changed, 24 insertions(+), 11 deletions(-) diff --git a/l10ntools/scripts/l10ntool.py b/l10ntools/scripts/l10ntool.py index caa15b7efd17..e98a8189e9b7 100644 --- a/l10ntools/scripts/l10ntool.py +++ b/l10ntools/scripts/l10ntool.py @@ -27,7 +27,7 @@ from optparse import OptionParser from sdf import SdfData -import string , sys , os +import sys , os class abstractL10nTool: _options = {} @@ -184,5 +184,5 @@ class abstractL10nTool: def get_filename_string(self, inputfile): absfile = os.path.realpath(os.path.abspath(inputfile)) absroot = os.path.realpath(os.path.abspath(self._options.project_root)) - return absfile[len(absroot):].replace('/','\\') + return absfile[len(absroot)+1:].replace('/','\\') diff --git a/l10ntools/scripts/sdf.py b/l10ntools/scripts/sdf.py index ce1077197622..1d7cc27f0733 100644 --- a/l10ntools/scripts/sdf.py +++ b/l10ntools/scripts/sdf.py @@ -25,8 +25,6 @@ # #************************************************************************* -import string - class MyOrderedDict(dict): _keylist = [] _valuelist = [] diff --git a/l10ntools/scripts/xtxex.py b/l10ntools/scripts/xtxex.py index 98ec1e86b596..a8677b10bf86 100644 --- a/l10ntools/scripts/xtxex.py +++ b/l10ntools/scripts/xtxex.py @@ -36,13 +36,21 @@ class xtxex(abstractL10nTool): def __init__(self): abstractL10nTool.__init__(self) - def merge_file(self, inputfilename, outputfilename, parsed_file_ref, lang,is_forced_lang, sdfdata): - print "merge_file lang " + lang +" file " + outputfilename + def merge_file(self, inputfilename, outputfilename, parsed_file_ref, lang, is_forced_lang, sdfdata): + # Special handling for en-US files + if lang == "en-US": + mod_outputfilename = outputfilename.replace("_en-US",'') + #print "DBG: merge_file lang " + lang +" file " + mod_outputfilename + self.copy_file(inputfilename, mod_outputfilename) + return + + # merge usual lang sdfline = self.prepare_sdf_line(inputfilename,lang) if sdfdata.has_key(sdfline.get_id()): line = sdfdata[sdfline.get_id()].text.replace("\\n", '\n') self.make_dirs(outputfilename) try: + #print "DBG: merge_file lang " + lang +" file " + outputfilename f = open(outputfilename, "w+") f.write(line) except IOError: @@ -51,12 +59,19 @@ class xtxex(abstractL10nTool): else: f.close() return + + # no sdf data found then copy en-US source file if is_forced_lang: - try: - shutil.copy(inputfilename, outputfilename) - except IOError: - print "ERROR: Can not copy file '" + inputfilename + "' to " + "'" + outputfilename + "'" - sys.exit(-1) + #print "DBG: merge_file lang " + lang +" file " + outputfilename + self.copy_file(inputfilename, outputfilename) + + def copy_file(self, inputfilename, outputfilename): + try: + #print "DBG: copy " + inputfilename + " to " + outputfilename + shutil.copy(inputfilename, outputfilename) + except IOError: + print "ERROR: Can not copy file '" + inputfilename + "' to " + "'" + outputfilename + "'" + sys.exit(-1) ##### Extract a single File def extract_file(self, inputfile): -- cgit v1.2.3 From cd9c760cfb830cdc991ae5d2c8bee15a6166f496 Mon Sep 17 00:00:00 2001 From: Ivo Hinkelmann Date: Tue, 13 Jul 2010 17:42:44 +0200 Subject: txtl10n: #113125# Support of help tree files in the L10N process --- l10ntools/source/localize.cxx | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/l10ntools/source/localize.cxx b/l10ntools/source/localize.cxx index 8e2fbee2bc85..420fa3a8d484 100644 --- a/l10ntools/source/localize.cxx +++ b/l10ntools/source/localize.cxx @@ -53,9 +53,7 @@ namespace transex3 const char *ExeTable[][5] = { { "src", "transex3", " -UTF8 -e", "negative", "noiso" }, { "hrc", "transex3", " -UTF8 -e", "positive", "noiso" }, - //{ "src", "transex3", "-UTF8 -e", "negative", "noiso" }, - //{ "hrc", "transex3", "-UTF8 -e", "positive", "noiso" }, - + { "xht", "xhtex", "", "negative", "noiso" }, { "xtx", "xtxex", "", "negative", "noiso" }, { "ulf", "ulfex", " -e", "negative", "noiso" }, { "xrb", "xmlex", "-UTF8 -e", "negative", "iso" }, -- cgit v1.2.3 From 17022b70d98093f0d33e119f6c59725c66674561 Mon Sep 17 00:00:00 2001 From: Ivo Hinkelmann Date: Tue, 13 Jul 2010 17:56:32 +0200 Subject: txtl10n: #i113008# #i113125# Support of help tree files and single txt files in the L10N process --- l10ntools/prj/d.lst | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/l10ntools/prj/d.lst b/l10ntools/prj/d.lst index e20114a1ed0d..9594dc416c8e 100644 --- a/l10ntools/prj/d.lst +++ b/l10ntools/prj/d.lst @@ -47,11 +47,13 @@ mkdir: %_DEST%\bin%_EXT%\help\com\sun\star\help ..\scripts\localize %_DEST%\bin%_EXT%\localize ..\scripts\fast_merge.pl %_DEST%\bin%_EXT%\fast_merge.pl ..\scripts\keyidGen.pl %_DEST%\bin%_EXT%\keyidGen.pl -..\scripts\const.py %_DEST%\bin%_EXT%\const.py -..\scripts\l10ntool.py %_DEST%\bin%_EXT%\l10ntool.py -..\scripts\xtxex.py %_DEST%\bin%_EXT%\xtxex.py -..\scripts\sdf.py %_DEST%\bin%_EXT%\sdf.py +..\scripts\tool\const.py %_DEST%\bin%_EXT%\const.py +..\scripts\tool\l10ntool.py %_DEST%\bin%_EXT%\l10ntool.py +..\scripts\tool\xtxex.py %_DEST%\bin%_EXT%\xtxex.py +..\scripts\tool\sdf.py %_DEST%\bin%_EXT%\sdf.py +..\scripts\tool\xhtex.py %_DEST%\bin%_EXT%\xhtex.py ..\scripts\xtxex %_DEST%\bin%_EXT%\xtxex +..\scripts\xhtex %_DEST%\bin%_EXT%\xhtex ..\inc\export.hxx %_DEST%\inc%_EXT%\l10ntools\export.hxx ..\inc\l10ntools\directory.hxx %_DEST%\inc%_EXT%\l10ntools\directory.hxx -- cgit v1.2.3 From a25f2a7a55a7611b75dc6721fa52426c466d4be0 Mon Sep 17 00:00:00 2001 From: Ivo Hinkelmann Date: Tue, 13 Jul 2010 17:58:25 +0200 Subject: txtl10n: #i113008# #i113125# Support of help tree files and single txt files in the L10N process --- l10ntools/scripts/tool/const.py | 39 +++++++ l10ntools/scripts/tool/l10ntool.py | 204 +++++++++++++++++++++++++++++++++ l10ntools/scripts/tool/sdf.py | 224 +++++++++++++++++++++++++++++++++++++ l10ntools/scripts/tool/xhtex.py | 133 ++++++++++++++++++++++ l10ntools/scripts/tool/xtxex.py | 89 +++++++++++++++ 5 files changed, 689 insertions(+) create mode 100644 l10ntools/scripts/tool/const.py create mode 100644 l10ntools/scripts/tool/l10ntool.py create mode 100644 l10ntools/scripts/tool/sdf.py create mode 100644 l10ntools/scripts/tool/xhtex.py create mode 100644 l10ntools/scripts/tool/xtxex.py diff --git a/l10ntools/scripts/tool/const.py b/l10ntools/scripts/tool/const.py new file mode 100644 index 000000000000..2d514eabdab6 --- /dev/null +++ b/l10ntools/scripts/tool/const.py @@ -0,0 +1,39 @@ +#************************************************************************* +# +# 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 +# +# for a copy of the LGPLv3 License. +# +#************************************************************************* + +# Pseudo const +class _const: + class ConstError(TypeError): pass + def __setattr__(self, name, value): + if self.__dict__.has_key(name): + raise self.ConstError, "Can't rebind const(%s)"%name + self.__dict__[name] = value + +import sys +sys.modules[__name__] = _const() + + diff --git a/l10ntools/scripts/tool/l10ntool.py b/l10ntools/scripts/tool/l10ntool.py new file mode 100644 index 000000000000..66afc309a1fb --- /dev/null +++ b/l10ntools/scripts/tool/l10ntool.py @@ -0,0 +1,204 @@ +#************************************************************************* +# +# 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 +# +# for a copy of the LGPLv3 License. +# +#************************************************************************* + +from optparse import OptionParser +from sdf import SdfData +import sys +import os +import shutil + +class abstractL10nTool: + _options = {} + _args = "" + _resource_type = "" + _source_language = "en-US" + + ##### Implement these abstract methods + + ##### Nameing scheme for the output files + def get_outputfile_format_str(self): + # filename,fileNoExt,language,extension,pathPrefix,pathPostFix,path + #return "{path}/{fileNoExt}_{language}.{extension}" + return self._options.pattern + + ################################# Merge single files ########################################### + + ##### Merge a single file + def merge_file(self, inputfilename, outputfilename, parsed_file_ref, lang, is_forced_lang, sdfdata): + pass + + ##### Helper for parse-once-use-often like parsing a xml file is needed implement it here + def parse_file(self, filename): + return None + + ################### Merge one big file containing all strings in all languages ################# + def merge_one_big_file(self, inputfile, outputfilename, parsed_file_ref, lang, sdfdata): + pass + + ################### Extract a single File ###################################################### + def extract_file(self, inputfile): + pass + + ################################################################################################ + + def format_outputfile(self, filename, language): + extension = filename[filename.rfind('.')+1:] + file = filename[:filename.rfind('.')] + return self.get_outputfile_format_str().replace('[', '{').replace(']','}').format( + filename=filename, fileNoExt=file, language=language, extension=extension, path_prefix=self._options.path_prefix, + path_postfix=self._options.path_postfix, path=self.get_path()) + + def get_path(self): + if self._options.outputfile.find('/') == -1: + return "" + else: + return self._options.outputfile[:self._options.outputfile.rfind('/')] + + def merge(self, sdfdata): + langset,forcedset, foundset = set(), set() , set() + + if self._options.languages: + langset = set(self._options.languages) + if self._options.forcedlanguages: + forcedset = set(self._options.forcedlanguages) + if sdfdata.get_languages_found_in_sdf(): + foundset = sdfdata.get_languages_found_in_sdf() + + if self.has_multi_inputfiles(): + filelist = self.read_inputfile_list() + else: + filelist = self._options.inputfile + + for inputfile in filelist: + ref = self.parse_file(inputfile) + # Don't write that files if there is no l10n present + if ((langset & foundset) - forcedset): # all langs given and found in sdf without enforced + [self.merge_file(inputfile,self.format_outputfile(inputfile, lang), ref, lang, False, sdfdata) for lang in ((langset & foundset) - forcedset)] + # Always write those files even if there is no l10n available + if forcedset: # all enforced langs + [self.merge_file(inputfile, self.format_outputfile(inputfile, lang), ref, lang, True, sdfdata) for lang in forcedset] + # In case a big file have to be written + if ((langset & foundset) | forcedset): # all langs given ,found in sdf and enforced ones + self.merge_one_big_file(inputfile, self.format_outputfile(inputfile, lang), ref, ((langset & foundset) | forcedset), sdfdata) + + def has_multi_inputfiles(self): + return self._options.inputfile[0] == '@' + + def copy_file(self, inputfilename, outputfilename): + try: + shutil.copy(inputfilename, outputfilename) + except IOError: + print "ERROR: Can not copy file '" + inputfilename + "' to " + "'" + outputfilename + "'" + sys.exit(-1) + + def extract(self): + try: + f = open(self._options.outputfile, "w+") + f.write(self.extract_file(self._options.inputfile)) + except IOError: + print "ERROR: Can not write file " + self._options.outputfile + else: + f.close() + + # Parse the common options + def parse_options(self): + parser = OptionParser() + parser.add_option("-i", "--inputfile", dest="inputfile", metavar="FILE", help="resource file to read" ) + parser.add_option("-o", "--outputfile", dest="outputfile", metavar="FILE", help="extracted sdf or merged file" ) + parser.add_option("-m", "--inputsdffile", dest="input_sdf_file", metavar="FILE", help="merge this sdf file" ) + parser.add_option("-x", "--pathprefix", dest="path_prefix", metavar="PATH", help="" ) + parser.add_option("-y", "--pathpostfix", dest="path_postfix", metavar="PATH", help="" ) + parser.add_option("-p", "--projectname", dest="project_name", metavar="NAME", help="" ) + parser.add_option("-r", "--projectroot", dest="project_root", metavar="PATH", help="" ) + parser.add_option("-f", "--forcedlanguages", dest="forcedlanguages", metavar="ISOCODE[,ISOCODE]", help="Always merge those langs even if no l10n is available for those langs" ) + parser.add_option("-l", "--languages", dest="languages", metavar="ISOCODE[,ISOCODE]", help="Merge those langs if l10n is found for each") + parser.add_option("-s", "--pattern", dest="pattern", metavar="", help="" ) + parser.add_option("-q", "--quiet", action="store_true", dest="quietmode", help="",default=False) + (self._options, self.args) = parser.parse_args() + + # -l "de,pr,pt-BR" => [ "de" , "pt" , "pt-BR" ] + parse_complex_arg = lambda arg: arg.split(",") + + if self._options.forcedlanguages: + self._options.forcedlanguages = parse_complex_arg(self._options.forcedlanguages) + if self._options.languages: + self._options.languages = parse_complex_arg(self._options.languages) + self.test_options() + + def __init__(self): + self.parse_options() + if self._options.input_sdf_file != None and len(self._options.input_sdf_file): + sdfdata = SdfData(self._options.input_sdf_file) + sdfdata.read() + self.merge(sdfdata) + else: + self.extract() + + def make_dirs(self, filename): + dir = filename[:filename.rfind('/')] + if os.path.exists(dir): + if os.path.isfile(dir): + print "ERROR: There is a file '"+dir+"' where I want create a directory" + sys.exit(-1) + else: + return + else: + try: + print "DBG: make_dir " + str(dir) + os.makedirs(dir) + except IOError: + print "Error: Can not create dir " + dir + sys.exit(-1) + + def test_options(self): + opt = self._options + is_valid = lambda x: x != None and len(x) > 0 + return is_valid(opt.project_root) and is_valid(opt.project_name) and is_valid(opt.languages) and \ + ( is_valid(opt.inputfile) and (( is_valid(opt.path_prefix) and is_valid(opt.path_postfix) ) or is_valid(opt.outputfile)) and \ + ( ( is_valid(opt.input_sdf_file) and ( is_valid(opt.outputfile) or ( is_valid(opt.path_prefix) and is_valid(opt.path_postfix) ) or \ + ( is_valid(opt.inputfile) and is_valid(opt.outputFile)) )))) + print "Strange options ..." + sys.exit( -1 ) + + def read_inputfile_list(self): + if self.has_multi_inputfiles(): + lines = [] + try: + f = open(self._options.inputfile[1:], "r") + lines = [line.strip('\n') for line in f.readlines()] + except IOError: + print "ERROR: Can not read file list " + self._options.inputfile[2:] + sys.exit(-1) + else: + f.close() + return lines + + def get_filename_string(self, inputfile): + absfile = os.path.realpath(os.path.abspath(inputfile)) + absroot = os.path.realpath(os.path.abspath(self._options.project_root)) + return absfile[len(absroot)+1:].replace('/','\\') + diff --git a/l10ntools/scripts/tool/sdf.py b/l10ntools/scripts/tool/sdf.py new file mode 100644 index 000000000000..33bf90b4ea68 --- /dev/null +++ b/l10ntools/scripts/tool/sdf.py @@ -0,0 +1,224 @@ +#************************************************************************* +# +# 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 +# +# for a copy of the LGPLv3 License. +# +#************************************************************************* + +class MyOrderedDict(dict): + _keylist = [] + _valuelist = [] + + def __init__(self, defaults={}): + dict.__init__(self) + for n,v in defaults.items(): + self[n] = v + + def __setitem__(self, key, value): + self._keylist.append(key) + self._valuelist.append(value) + return dict.__setitem__(self, key, value) + + def __delattr__(self, key): + self._keylist.__delattr__(key) + self._valuelist.__delattr__(dict[key]) + return dict.__delattr__(self, key) + + def __delitem__(self, key): + self._keylist.__delitem__(key) + self._valuelist.__delitem__(dict[key]) + return dict.__delitem__(self, key) + + def __iter(self): + return zip(self._keylist, self._valuelist) + + def __iterkeys__(self): + return self._keylist + + def __iteritems__(self): + return self._valuelist + + def items(self): + return zip(self._keylist,self._valuelist) + + def keys(self): + return self._keylist + + def __keysattr__(self): + return self._keylist + + def pop(self, key): + self._keylist.pop(key) + self._valuelist.pop(key) + return dict.__pop__(self, key) + + def popitem(self): + raise NotImplementedError("popitem") + + def clear(self): + self._keylist.clear() + self._valuelist.clear() + return dict.clear() + + def copy(self): + newobj = MyOrderedDict(self) + newobj._keylist = self._keylist + newobj._valuelist = self._valuelist + return newobj + +class SdfData: + _filename = ""; + _dict = MyOrderedDict() + _languages_found = []; + + def __init__ (self, filename=""): + self._filename = filename + + def __getitem__(self, key): + if self._dict.has_key(key): + return self._dict[key] + else: + return None + + def has_key(self, key): + return self._dict.has_key(key) + + def __setitem__(self, key, value): + self._dict[key] = value + + def get_languages_found_in_sdf(self): + return set(self._languages_found) + + def read(self): + try: + f = open(self._filename, "r") + lines = [line.rstrip('\n') for line in f.readlines()] + except IOError: + print "ERROR: Trying to read "+ self._filename + raise + else: + f.close() + for line in lines: + entity = SdfEntity() + entity.set_properties(line) + self._dict[entity.get_id()] = entity + self._languages_found.append(entity.langid) + + def write(self, filename): + try: + f = open(filename, "w+") + for value in self._dict.itervalues(): + #f.write( repr(value)+"\n" ) + f.write(value + "\n") + except IOError: + print "ERROR: Trying to write " + filename + raise + else: + f.close() + +import sys +class SdfEntity: + # Sdf format columns + project = "" + source_file = "" + dummy1 = "" + resource_type = "" + gid = "" + lid = "" + helpid = "" + platform = "" + dummy2 = "" + langid = "" + text = "" + helptext = "" + quickhelptext = "" + title = "" + date = "" + + import const + const._PROJECT_POS = 0 + const._SOURCE_FILE_POS = 1 + const._DUMMY1_POS = 2 + const._RESOURCE_TYPE_POS = 3 + const._GID_POS = 4 + const._LID_POS = 5 + const._HELPID_POS = 6 + const._PLATFORM_POS = 7 + const._DUMMY2_POS = 8 + const._LANGID_POS = 9 + const._TEXT_POS = 10 + const._HELPTEXT_POS = 11 + const._QUICKHELPTEXT_POS = 12 + const._TITLE_POS = 13 + const._DATE_POS = 14 + + def __init__(self, project="", source_file="", dummy1="", resource_type="", gid="", lid="", helpid="", platform="", dummy2="", langid="", + text="", helptext="", quickhelptext="", title="", date="2002-02-02 02:02:02"): + self.project = project; + self.source_file = source_file; + self.dummy1 = dummy1; + self.resource_type = resource_type; + self.gid = gid; + self.lid = lid; + self.helpid = helpid; + self.platform = platform; + self.dummy2 = dummy2; + self.langid = langid; + self.text = text; + self.helptext = helptext; + self.quickhelptext = quickhelptext; + self.title = title; + self.date = date; + + def set_properties(self, line): + splitted = line.split("\t") + if len(splitted) == 15: + self.project = splitted[ self.const._PROJECT_POS ] + self.source_file = splitted[ self.const._SOURCE_FILE_POS ] + self.dummy1 = splitted[ self.const._DUMMY1_POS ] + self.resource_type = splitted[ self.const._RESOURCE_TYPE_POS ] + self.gid = splitted[ self.const._GID_POS ] + self.lid = splitted[ self.const._LID_POS ] + self.helpid = splitted[ self.const._HELPID_POS ] + self.platform = splitted[ self.const._PLATFORM_POS ] + self.dummy2 = splitted[ self.const._DUMMY2_POS ] + self.langid = splitted[ self.const._LANGID_POS ] + self.text = splitted[ self.const._TEXT_POS ] + self.helptext = splitted[ self.const._HELPTEXT_POS ] + self.quickhelptext = splitted[ self.const._QUICKHELPTEXT_POS ] + self.title = splitted[ self.const._TITLE_POS ] + self.date = splitted[ self.const._DATE_POS ] + + def get_file_id(self): + return self.project + "\\" + self.source_file + + def get_resource_path(self): + return self.source_file[0:self.source_file.rfind( "\\" )-1] + + def __str__(self): + return ''.join([self.project, "\t", self.source_file, "\t", self.dummy1, "\t", self.resource_type, "\t" , + self.gid, "\t", self.lid, "\t", self.helpid, "\t", self.platform, "\t", self.dummy2, "\t" , self.langid, + "\t", self.text, "\t", self.helptext, "\t", self.quickhelptext, "\t" , self.title, "\t", self.date ]) + + def get_id(self): + return ''.join([self.project, self.gid, self.lid, self.source_file, self.resource_type, self.platform, self.helpid, self.langid]) diff --git a/l10ntools/scripts/tool/xhtex.py b/l10ntools/scripts/tool/xhtex.py new file mode 100644 index 000000000000..99e0f39259a2 --- /dev/null +++ b/l10ntools/scripts/tool/xhtex.py @@ -0,0 +1,133 @@ +#************************************************************************* +# +# 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 +# +# for a copy of the LGPLv3 License. +# +#************************************************************************* + +from l10ntool import abstractL10nTool +from sdf import SdfEntity +import sys +import xml.dom.minidom + +class xhtex(abstractL10nTool): + _resource_type = "xht" + _sdfdata = () + _lang = "" + + # Extract methods + def extract_topic(self, list, inputfile): + topics = [] + for elem in list: + if elem.childNodes[0].nodeType == elem.TEXT_NODE: + topics.append(self.prepare_sdf_line(id=elem.getAttribute("id").strip(), text=elem.childNodes[0].data, inputfile=inputfile)) + return topics + + def extract_title(self, list, inputfile): + titles = [] + for elem in list: + titles.append(self.prepare_sdf_line(id=elem.getAttribute("id").strip(), text=elem.getAttribute("title").strip(), inputfile=inputfile)) + return titles + + # Merge methods + def merge_topic(self, list, sdfdata, lang, inputfilename, dom): + for elem in list: + if elem.childNodes[0].nodeType == elem.TEXT_NODE and elem.getAttribute("id").strip(): + obj = self.prepare_sdf_line(inputfile=inputfilename, lang=lang, id=elem.getAttribute("id").strip()) + if sdfdata[obj.get_id()]: + elem.childNodes[0].data = str(sdfdata[obj.get_id()].text) + + def merge_title(self, list, sdfdata, lang, inputfilename): + for elem in list: + obj = self.prepare_sdf_line(inputfile=inputfilename, lang=lang, id=elem.getAttribute("id").strip()) + if elem.getAttribute("id").strip() and sdfdata[obj.get_id()]: + elem.setAttribute("title", str(sdfdata[obj.get_id()].text)) + + # L10N tool + def __init__(self): + abstractL10nTool.__init__(self) + + def parse_file(self, filename): + document = "" + try: + f = open(filename, "r+") + document = f.read() + except IOError: + print "ERROR: Can not read file " + filename + sys.exit(-1) + else: + f.close() + return xml.dom.minidom.parseString(document) + + + def merge_file(self, inputfilename, outputfilename, parsed_file_ref, lang,is_forced_lang, sdfdata): + if lang == "en-US": + mod_outputfilename = outputfilename.replace("_en-US",'') + self.copy_file(inputfilename, mod_outputfilename) + return + dom = parsed_file_ref.cloneNode(True) + #dom = self.parse_file(inputfilename) # in case cloneNode is buggy just parse it always + + self.merge_topic(dom.getElementsByTagName("topic"), sdfdata, lang, inputfilename, dom) + self.merge_title(dom.getElementsByTagName("node"), sdfdata, lang, inputfilename) + self.merge_title(dom.getElementsByTagName("help_section"), sdfdata, lang, inputfilename) + self.make_dirs(outputfilename) + try: + f = open(outputfilename, "w+") + str = dom.toxml() + f.write(str) + except IOError: + print "ERROR: Can not write file " + outputfilename + sys.exit(-1) + else: + f.close() + + ##### Helper for parse-once-use-often like parsing a xml file is needed implement it here + def parse_file(self, filename): + document = "" + try: + f = open(filename,"r+") + document = f.read() + except IOError: + print "ERROR: Can not read file " + filename + else: + f.close() + return xml.dom.minidom.parseString(document) + + ##### Extract a single File + def extract_file(self, inputfile): + sdf_data = [] + dom = self.parse_file(inputfile) + sdf_data.extend(self.extract_topic(dom.getElementsByTagName("topic"), inputfile)) + sdf_data.extend(self.extract_title(dom.getElementsByTagName("help_section"), inputfile)) + sdf_data.extend(self.extract_title(dom.getElementsByTagName("node"), inputfile)) + return ''.join([str(line)+"\n" for line in sdf_data]) + + def prepare_sdf_line(self, inputfile="", lang="" , id="" , text=""): + if lang == "": + lang = self._source_language + return SdfEntity(project=self._options.project_name, source_file=self.get_filename_string(inputfile), + resource_type=self._resource_type, gid=id, lid="", langid=lang,text=text) + +run = xhtex() + diff --git a/l10ntools/scripts/tool/xtxex.py b/l10ntools/scripts/tool/xtxex.py new file mode 100644 index 000000000000..bb11e337d37a --- /dev/null +++ b/l10ntools/scripts/tool/xtxex.py @@ -0,0 +1,89 @@ +#************************************************************************* +# +# 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 +# +# for a copy of the LGPLv3 License. +# +#************************************************************************* + +from l10ntool import abstractL10nTool +from sdf import SdfEntity +import sys +import shutil + +class xtxex(abstractL10nTool): + _resource_type = "xtx" + + def __init__(self): + abstractL10nTool.__init__(self) + + def merge_file(self, inputfilename, outputfilename, parsed_file_ref, lang, is_forced_lang, sdfdata): + # Special handling for en-US files + if lang == "en-US": + mod_outputfilename = outputfilename.replace("_en-US",'') + self.copy_file(inputfilename, mod_outputfilename) + return + # merge usual lang + sdfline = self.prepare_sdf_line(inputfilename,lang) + if sdfdata.has_key(sdfline.get_id()): + line = sdfdata[sdfline.get_id()].text.replace("\\n", '\n') + self.make_dirs(outputfilename) + try: + f = open(outputfilename, "w+") + f.write(line) + except IOError: + print "ERROR: Can not write file " + outputfilename + sys.exit(-1) + else: + f.close() + return + # no sdf data found then copy en-US source file + if is_forced_lang: + self.copy_file(inputfilename, outputfilename) + + ##### Extract a single File + def extract_file(self, inputfile): + lines = [] + try: + f = open(inputfile, "r") + lines = f.readlines() + except IOError: + print "ERROR: Can not open file " + inputfile + sys.exit(-1) + else: + f.close() + # remove legal header + lines = [line for line in lines if len(line) > 0 and not line[0] == '#'] + # escape all returns + lines = [line.replace('\n', "\\n") for line in lines] + line = ''.join(lines) + sdf_entity = self.prepare_sdf_line(inputfile); + sdf_entity.text = line + return str(sdf_entity) + + def prepare_sdf_line(self, inputfile="", lang=""): + if lang == "": + lang = self._source_language + return SdfEntity(project=self._options.project_name, source_file=self.get_filename_string(inputfile), + resource_type=self._resource_type, gid="none", lid="none", langid=lang,text="") + +run = xtxex() -- cgit v1.2.3 From 81864751ef5e6e51906d5bae7de39cf19505e868 Mon Sep 17 00:00:00 2001 From: Ivo Hinkelmann Date: Tue, 13 Jul 2010 18:00:06 +0200 Subject: txtl10n: #i113008# #i113125# Support of help tree files and single txt files in the L10N process --- l10ntools/scripts/const.py | 39 ------- l10ntools/scripts/l10ntool.py | 188 --------------------------------- l10ntools/scripts/sdf.py | 238 ------------------------------------------ l10ntools/scripts/xhtex | 47 +++++++++ l10ntools/scripts/xtxex.py | 107 ------------------- 5 files changed, 47 insertions(+), 572 deletions(-) delete mode 100644 l10ntools/scripts/const.py delete mode 100644 l10ntools/scripts/l10ntool.py delete mode 100644 l10ntools/scripts/sdf.py create mode 100755 l10ntools/scripts/xhtex delete mode 100644 l10ntools/scripts/xtxex.py diff --git a/l10ntools/scripts/const.py b/l10ntools/scripts/const.py deleted file mode 100644 index 2d514eabdab6..000000000000 --- a/l10ntools/scripts/const.py +++ /dev/null @@ -1,39 +0,0 @@ -#************************************************************************* -# -# 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 -# -# for a copy of the LGPLv3 License. -# -#************************************************************************* - -# Pseudo const -class _const: - class ConstError(TypeError): pass - def __setattr__(self, name, value): - if self.__dict__.has_key(name): - raise self.ConstError, "Can't rebind const(%s)"%name - self.__dict__[name] = value - -import sys -sys.modules[__name__] = _const() - - diff --git a/l10ntools/scripts/l10ntool.py b/l10ntools/scripts/l10ntool.py deleted file mode 100644 index e98a8189e9b7..000000000000 --- a/l10ntools/scripts/l10ntool.py +++ /dev/null @@ -1,188 +0,0 @@ -#************************************************************************* -# -# 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 -# -# for a copy of the LGPLv3 License. -# -#************************************************************************* - -from optparse import OptionParser -from sdf import SdfData -import sys , os - -class abstractL10nTool: - _options = {} - _args = "" - _resource_type = "" - _source_language = "en-US" - - ##### Implement these abstract methods - - ##### Nameing scheme for the output files - def get_outputfile_format_str(self): - # filename,fileNoExt,language,extension,pathPrefix,pathPostFix,path - return "{path}/{fileNoExt}_{language}.{extension}" - - ################################# Merge single files ########################################### - - ##### Merge a single file - def merge_file(self, inputfilename, outputfilename, parsed_file_ref, lang, is_forced_lang, sdfdata): - pass - - ##### Helper for parse-once-use-often like parsing a xml file is needed implement it here - def parse_file(self, filename): - return None - - ################### Merge one big file containing all strings in all languages ################# - def merge_one_big_file(self, inputfile, outputfilename, parsed_file_ref, lang, sdfdata): - pass - - ################### Extract a single File ###################################################### - def extract_file(self, inputfile): - pass - - ################################################################################################ - - def format_outputfile(self, filename, language): - extension = filename[filename.rfind('.')+1:] - file = filename[:filename.rfind('.')] - return self.get_outputfile_format_str().format( - filename=filename, fileNoExt=file, language=language, extension=extension, path_prefix=self._options.path_prefix, - path_postfix=self._options.path_postfix, path=self.get_path()) - - def get_path(self): - if self._options.outputfile.find('/') == -1: - return "" - else: - return self._options.outputfile[:self._options.outputfile.rfind('/')] - - def merge(self, sdfdata): - langset,forcedset, foundset = set(), set() , set() - - if self._options.languages: langset = set(self._options.languages) - if self._options.forcedlanguages: forcedset = set(self._options.forcedlanguages) - if sdfdata.get_languages_found_in_sdf(): foundset = sdfdata.get_languages_found_in_sdf() - - if self.has_multi_inputfiles(): - filelist = self.read_inputfile_list() - else: - filelist = self._options.inputfile - - for inputfile in filelist: - ref = self.parse_file(inputfile) - # Don't write that files if there is no l10n present - if ((langset & foundset) - forcedset): # all langs given and found in sdf without enforced - [self.merge_file(inputfile,self.format_outputfile(inputfile, lang), ref, lang, False, sdfdata) for lang in ((langset & foundset) - forcedset)] - # Always write those files even if there is no l10n available - if forcedset: # all enforced langs - [self.merge_file(inputfile, self.format_outputfile(inputfile, lang), ref, lang, True, sdfdata) for lang in forcedset] - # In case a big file have to be written - if ((langset & foundset) | forcedset): # all langs given ,found in sdf and enforced ones - self.merge_one_big_file(inputfile, self.format_outputfile(inputfile, lang), ref, ((langset & foundset) | forcedset), sdfdata) - - def has_multi_inputfiles(self): - return self._options.inputfile[0] == '@' - - def extract(self): - try: - f = open(self._options.outputfile, "w+") - f.write(self.extract_file(self._options.inputfile)) - except IOError: - print "ERROR: Can not write file " + self._options.outputfile - else: - f.close() - - # Parse the common options - def parse_options(self): - parser = OptionParser() - parser.add_option("-i", "--inputfile", dest="inputfile", metavar="FILE", help="resource file to read" ) - parser.add_option("-o", "--outputfile", dest="outputfile", metavar="FILE", help="extracted sdf or merged file" ) - parser.add_option("-m", "--inputsdffile", dest="input_sdf_file", metavar="FILE", help="merge this sdf file" ) - parser.add_option("-x", "--pathprefix", dest="path_prefix", metavar="PATH", help="" ) - parser.add_option("-y", "--pathpostfix", dest="path_postfix", metavar="PATH", help="" ) - parser.add_option("-p", "--projectname", dest="project_name", metavar="NAME", help="" ) - parser.add_option("-r", "--projectroot", dest="project_root", metavar="PATH", help="" ) - parser.add_option("-f", "--forcedlanguages", dest="forcedlanguages", metavar="ISOCODE[,ISOCODE]", help="Always merge those langs even if no l10n is available for those langs" ) - parser.add_option("-l", "--languages", dest="languages", metavar="ISOCODE[,ISOCODE]", help="Merge those langs if l10n is found for each") - parser.add_option("-q", "--quiet", action="store_true", dest="quietmode", help="",default=False) - (self._options, self.args) = parser.parse_args() - - # -l "de,pr,pt-BR" => [ "de" , "pt" , "pt-BR" ] - parse_complex_arg = lambda arg: arg.split(",") - if self._options.forcedlanguages: self._options.forcedlanguages = parse_complex_arg(self._options.forcedlanguages) - if self._options.languages: self._options.languages = parse_complex_arg(self._options.languages) - self.test_options() - - def __init__(self): - self.parse_options() - if self._options.input_sdf_file != None and len(self._options.input_sdf_file): - sdfdata = SdfData(self._options.input_sdf_file) - sdfdata.read() - self.merge(sdfdata) - else: - self.extract() - - def make_dirs(self, filename): - dir = filename[:filename.rfind('/')] - if os.path.exists(dir): - if os.path.isfile(dir): - print "ERROR: There is a file '"+dir+"' where I want create a directory" - sys.exit(-1) - else: - return - else: - try: - print "DBG: make_dir " + str(dir) - os.makedirs(dir) - except IOError: - print "Error: Can not create dir " + dir - sys.exit(-1) - - def test_options(self): - opt = self._options - is_valid = lambda x: x != None and len(x) > 0 - return is_valid(opt.project_root) and is_valid(opt.project_name) and is_valid(opt.languages) and \ - ( is_valid(opt.inputfile) and (( is_valid(opt.path_prefix) and is_valid(opt.path_postfix) ) or is_valid(opt.outputfile)) and \ - ( ( is_valid(opt.input_sdf_file) and ( is_valid(opt.outputfile) or ( is_valid(opt.path_prefix) and is_valid(opt.path_postfix) ) or \ - ( is_valid(opt.inputfile) and is_valid(opt.outputFile)) )))) - print "Strange options ..." - sys.exit( -1 ) - - - def read_inputfile_list(self): - if self.has_multi_inputfiles(): - lines = [] - try: - f = open(self._options.inputfile[1:], "r") - lines = [line.strip('\n') for line in f.readlines()] - except IOError: - print "ERROR: Can not read file list " + self._options.inputfile[2:] - sys.exit(-1) - else: - f.close() - return lines - - def get_filename_string(self, inputfile): - absfile = os.path.realpath(os.path.abspath(inputfile)) - absroot = os.path.realpath(os.path.abspath(self._options.project_root)) - return absfile[len(absroot)+1:].replace('/','\\') - diff --git a/l10ntools/scripts/sdf.py b/l10ntools/scripts/sdf.py deleted file mode 100644 index 1d7cc27f0733..000000000000 --- a/l10ntools/scripts/sdf.py +++ /dev/null @@ -1,238 +0,0 @@ -#************************************************************************* -# -# 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 -# -# for a copy of the LGPLv3 License. -# -#************************************************************************* - -class MyOrderedDict(dict): - _keylist = [] - _valuelist = [] - - #correct?!? - def __init__(self, defaults={}): - dict.__init__(self) - for n,v in defaults.items(): - self[n] = v - #def __getitem__(self): - # pass - - def __setitem__(self, key, value): - self._keylist.append(key) - self._valuelist.append(value) - return dict.__setitem__(self, key, value) - - def __delattr__(self, key): - self._keylist.__delattr__(key) - self._valuelist.__delattr__(dict[key]) - return dict.__delattr__(self, key) - - def __delitem__(self, key): - self._keylist.__delitem__(key) - self._valuelist.__delitem__(dict[key]) - return dict.__delitem__(self, key) - - def __iter(self): - return zip(self._keylist, self._valuelist) - - def __iterkeys__(self): - return self._keylist - - def __iteritems__(self): - return self._valuelist - - def items(self): - return zip(self._keylist,self._valuelist) - - def keys(self): - return self._keylist - - def __keysattr__(self): - return self._keylist - - def pop(self, key): - self._keylist.pop(key) - self._valuelist.pop(key) - return dict.__pop__(self, key) - - def popitem(self): - raise NotImplementedError("popitem") - - def clear(self): - self._keylist.clear() - self._valuelist.clear() - return dict.clear() - - def copy(self): - # correct?!? - newobj = MyOrderedDict(self) - newobj._keylist = self._keylist - newobj._valuelist = self._valuelist - return newobj - -class SdfData: - _filename = ""; - _dict = MyOrderedDict() - #_dict = {} - _languages_found = []; - - def __init__ (self, filename=""): - self._filename = filename - - def __getitem__(self, key): - if self._dict.has_key(key): - return self._dict[key] - else: - return None - - def has_key(self, key): - return self._dict.has_key(key) - - def __setitem__(self, key, value): - self._dict[key] = value - - def get_languages_found_in_sdf(self): - return set(self._languages_found) - - def read(self): - try: - f = open(self._filename, "r") - lines = [line.rstrip('\n') for line in f.readlines()] - except IOError: - print "ERROR: Trying to read "+ self._filename - raise - else: - f.close() - for line in lines: - entity = SdfEntity() - entity.set_properties(line) - self._dict[entity.get_id()] = entity - self._languages_found.append(entity.langid) - - def write(self, filename): - try: - f = open(filename, "w+") - for value in self._dict.itervalues(): - #f.write( repr(value)+"\n" ) - f.write(value + "\n") - except IOError: - print "ERROR: Trying to write " + filename - raise - else: - f.close() - - - -import sys -class SdfEntity: - # Sdf format columns - project = "" - source_file = "" - dummy1 = "" - resource_type = "" - gid = "" - lid = "" - helpid = "" - platform = "" - dummy2 = "" - langid = "" - text = "" - helptext = "" - quickhelptext = "" - title = "" - date = "" - - import const - const._PROJECT_POS = 0 - const._SOURCE_FILE_POS = 1 - const._DUMMY1_POS = 2 - const._RESOURCE_TYPE_POS = 3 - const._GID_POS = 4 - const._LID_POS = 5 - const._HELPID_POS = 6 - const._PLATFORM_POS = 7 - const._DUMMY2_POS = 8 - const._LANGID_POS = 9 - const._TEXT_POS = 10 - const._HELPTEXT_POS = 11 - const._QUICKHELPTEXT_POS = 12 - const._TITLE_POS = 13 - const._DATE_POS = 14 - - - - def __init__(self, project="", source_file="", dummy1="", resource_type="", gid="", lid="", helpid="", platform="", dummy2="", langid="", - text="", helptext="", quickhelptext="", title="", date="2002-02-02 02:02:02"): - self.project = project; - self.source_file = source_file; - self.dummy1 = dummy1; - self.resource_type = resource_type; - self.gid = gid; - self.lid = lid; - self.helpid = helpid; - self.platform = platform; - self.dummy2 = dummy2; - self.langid = langid; - self.text = text; - self.helptext = helptext; - self.quickhelptext = quickhelptext; - self.title = title; - self.date = date; - - def set_properties(self, line): - splitted = line.split("\t") - if len(splitted) == 15: - self.project = splitted[ self.const._PROJECT_POS ] - self.source_file = splitted[ self.const._SOURCE_FILE_POS ] - self.dummy1 = splitted[ self.const._DUMMY1_POS ] - self.resource_type = splitted[ self.const._RESOURCE_TYPE_POS ] - self.gid = splitted[ self.const._GID_POS ] - self.lid = splitted[ self.const._LID_POS ] - self.helpid = splitted[ self.const._HELPID_POS ] - self.platform = splitted[ self.const._PLATFORM_POS ] - self.dummy2 = splitted[ self.const._DUMMY2_POS ] - self.langid = splitted[ self.const._LANGID_POS ] - self.text = splitted[ self.const._TEXT_POS ] - self.helptext = splitted[ self.const._HELPTEXT_POS ] - self.quickhelptext = splitted[ self.const._QUICKHELPTEXT_POS ] - self.title = splitted[ self.const._TITLE_POS ] - self.date = splitted[ self.const._DATE_POS ] - #else: - # print "Offending line '"+line+"'" - # print "ERROR: Something is broken here! Line has {0} tabs".format( len(splitted) ) - # sys.exit( -1 ) - - def get_file_id(self): - return self.project + "\\" + self.source_file - - def get_resource_path(self): - return self.source_file[0:self.source_file.rfind( "\\" )-1] - - #def __repr__(self): - def __str__(self): - return ''.join([self.project, "\t", self.source_file, "\t", self.dummy1, "\t", self.resource_type, "\t" , - self.gid, "\t", self.lid, "\t", self.helpid, "\t", self.platform, "\t", self.dummy2, "\t" , self.langid, - "\t", self.text, "\t", self.helptext, "\t", self.quickhelptext, "\t" , self.title, "\t", self.date ]) - - def get_id(self): - return ''.join([self.project, self.gid, self.lid, self.source_file, self.resource_type, self.platform, self.helpid, self.langid]) diff --git a/l10ntools/scripts/xhtex b/l10ntools/scripts/xhtex new file mode 100755 index 000000000000..e6f7cf9f2003 --- /dev/null +++ b/l10ntools/scripts/xhtex @@ -0,0 +1,47 @@ +#!/bin/sh +#************************************************************************* +# +# 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 +# +# for a copy of the LGPLv3 License. +# +#************************************************************************* + +if [ x${SOLARENV}x = xx ]; then + echo No environment found, please use 'setsolar' +exit 1 +fi + +# localize.pl calls localize_sl in solver bin directory which depends on dynamic +# libraries in solver lib directory but has no correct RPATH (or equivalent): +if [ "${OS?}" = MACOSX ]; then + export DYLD_LIBRARY_PATH=${DYLD_LIBRARY_PATH+${DYLD_LIBRARY_PATH}:}${SOLARVERSION?}/${INPATH?}/lib${UPDMINOREXT} +else + export LD_LIBRARY_PATH=${LD_LIBRARY_PATH+${LD_LIBRARY_PATH}:}${SOLARVERSION?}/${INPATH?}/lib${UPDMINOREXT} +fi + +if [ x${SOLARVER}x = xx -o x${UPDMINOREXT}x = xx ]; then + exec python $SOLARVERSION/$INPATH/bin/xhtex.py "$@" +else + exec python $SOLARVERSION/$INPATH/bin$UPDMINOREXT/xhtex.py "$@" +fi + diff --git a/l10ntools/scripts/xtxex.py b/l10ntools/scripts/xtxex.py deleted file mode 100644 index a8677b10bf86..000000000000 --- a/l10ntools/scripts/xtxex.py +++ /dev/null @@ -1,107 +0,0 @@ -#************************************************************************* -# -# 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 -# -# for a copy of the LGPLv3 License. -# -#************************************************************************* - -from l10ntool import abstractL10nTool -from sdf import SdfEntity -import sys -import shutil - -class xtxex(abstractL10nTool): - _resourceType = "xtx" - - def __init__(self): - abstractL10nTool.__init__(self) - - def merge_file(self, inputfilename, outputfilename, parsed_file_ref, lang, is_forced_lang, sdfdata): - # Special handling for en-US files - if lang == "en-US": - mod_outputfilename = outputfilename.replace("_en-US",'') - #print "DBG: merge_file lang " + lang +" file " + mod_outputfilename - self.copy_file(inputfilename, mod_outputfilename) - return - - # merge usual lang - sdfline = self.prepare_sdf_line(inputfilename,lang) - if sdfdata.has_key(sdfline.get_id()): - line = sdfdata[sdfline.get_id()].text.replace("\\n", '\n') - self.make_dirs(outputfilename) - try: - #print "DBG: merge_file lang " + lang +" file " + outputfilename - f = open(outputfilename, "w+") - f.write(line) - except IOError: - print "ERROR: Can not write file " + outputfilename - sys.exit(-1) - else: - f.close() - return - - # no sdf data found then copy en-US source file - if is_forced_lang: - #print "DBG: merge_file lang " + lang +" file " + outputfilename - self.copy_file(inputfilename, outputfilename) - - def copy_file(self, inputfilename, outputfilename): - try: - #print "DBG: copy " + inputfilename + " to " + outputfilename - shutil.copy(inputfilename, outputfilename) - except IOError: - print "ERROR: Can not copy file '" + inputfilename + "' to " + "'" + outputfilename + "'" - sys.exit(-1) - - ##### Extract a single File - def extract_file(self, inputfile): - lines = [] - try: - f = open(inputfile, "r") - lines = f.readlines() - except IOError: - print "ERROR: Can not open file " + inputfile - sys.exit(-1) - else: - f.close() - # remove legal header - lines = [line for line in lines if len(line) > 0 and not line[0] == '#'] - # escape all returns - lines = [line.replace('\n', "\\n") for line in lines] - line = ''.join(lines) - sdf_entity = self.prepare_sdf_line(inputfile); - sdf_entity.text = line - return str(sdf_entity) - - ##### Nameing scheme for the output files - def get_outputfile_format_str(self): - # filename,fileNoExt,language,extension,pathPrefix,pathPostFix,path - return "{path}/{fileNoExt}_{language}.{extension}" - - def prepare_sdf_line(self, inputfile="", lang=""): - if lang == "": - lang = self._source_language - return SdfEntity(project=self._options.project_name, source_file=self.get_filename_string(inputfile), - resource_type=self._resource_type, gid="none", lid="none", langid=lang,text="") - -run = xtxex() -- cgit v1.2.3 From 75268e0d8608ec16767187d4ab850347a6d507b6 Mon Sep 17 00:00:00 2001 From: Vladimir Glazunov Date: Wed, 14 Jul 2010 12:07:17 +0200 Subject: unxlngxnewbaseline: #162926# some fixes for 64 bit linux baseline --- vcl/util/makefile.mk | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/vcl/util/makefile.mk b/vcl/util/makefile.mk index eb54531c375c..7395dcc9acce 100644 --- a/vcl/util/makefile.mk +++ b/vcl/util/makefile.mk @@ -312,7 +312,7 @@ SHL2STDLIBS=\ # prepare linking of Xinerama .IF "$(USE_XINERAMA)" != "NO" -.IF "$(OS)"=="MACOSX" +.IF "$(OS)"=="MACOSX" || "$(HOSTTYPE)" == "x86_64-linux" XINERAMALIBS=-lXinerama .ELSE .IF "$(OS)" != "SOLARIS" || "$(USE_XINERAMA_VERSION)" == "Xorg" @@ -397,6 +397,9 @@ SHL4STDLIBS+= $(XRANDR_LIBS) .IF "$(ENABLE_KDE)" != "" .IF "$(KDE_ROOT)"!="" EXTRALIBPATHS+=-L$(KDE_ROOT)$/lib +.IF "$(HOSTTYPE)" == "x86_64-linux" +EXTRALIBPATHS+=-L$(KDE_ROOT)$/lib64 +.ENDIF .ENDIF LIB5TARGET=$(SLB)$/ikde_plug_ LIB5FILES=$(SLB)$/kdeplug.lib -- cgit v1.2.3 From 78d231a2b56c7a1d3bce10ae3bbd5b915fddff1b Mon Sep 17 00:00:00 2001 From: sj Date: Wed, 14 Jul 2010 13:40:29 +0200 Subject: impress194: #i111380# applied patch (fixed typo) --- svtools/source/filter.vcl/wmf/winmtf.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/svtools/source/filter.vcl/wmf/winmtf.cxx b/svtools/source/filter.vcl/wmf/winmtf.cxx index bf176015fd77..787e6522b890 100644 --- a/svtools/source/filter.vcl/wmf/winmtf.cxx +++ b/svtools/source/filter.vcl/wmf/winmtf.cxx @@ -2043,7 +2043,7 @@ void WinMtfOutput::ModifyWorldTransform( const XForm& rXForm, UINT32 nMode ) case MWT_IDENTITY : { maXForm.eM11 = maXForm.eM12 = maXForm.eM21 = maXForm.eM22 = 1.0f; - maXForm.eDx = maXForm.eDx = 0.0f; + maXForm.eDx = maXForm.eDy = 0.0f; } break; -- cgit v1.2.3 From 0e880cfd4b2180d9ecade3d00608c446ccdf77c2 Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Wed, 14 Jul 2010 13:40:45 +0200 Subject: vcl113: #i43066# handle string concatenations in lexer --- rsc/source/parser/rsclex.cxx | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/rsc/source/parser/rsclex.cxx b/rsc/source/parser/rsclex.cxx index e0df5de254f9..cc5bd0eb39b4 100644 --- a/rsc/source/parser/rsclex.cxx +++ b/rsc/source/parser/rsclex.cxx @@ -175,11 +175,16 @@ int MakeToken( YYSTYPE * pTokenVal ){ c = pFI->GetFastChar(); if( c == '"' ) { - c = pFI->GetFastChar(); + do + { + c = pFI->GetFastChar(); + } + while( isblank( c ) ); if( c == '"' ) { - aBuf.append( '"' ); - aBuf.append( '"' ); + // this is a continued string + // note: multiline string continuations are handled by the parser + // see rscyacc.y } else bDone = TRUE; -- cgit v1.2.3 From 73d5f4f09c66ea29710a382dbd5bf971f603d335 Mon Sep 17 00:00:00 2001 From: Armin Le Grand Date: Wed, 14 Jul 2010 18:50:58 +0200 Subject: #i112959# enhanced bad handling of DrawTransparent in printer case --- vcl/source/gdi/outdev6.cxx | 41 +++++++++++++++++++++++++++++------------ 1 file changed, 29 insertions(+), 12 deletions(-) diff --git a/vcl/source/gdi/outdev6.cxx b/vcl/source/gdi/outdev6.cxx index 47b150ddc4c5..ebb91c82367d 100644 --- a/vcl/source/gdi/outdev6.cxx +++ b/vcl/source/gdi/outdev6.cxx @@ -345,6 +345,13 @@ void OutputDevice::DrawTransparent( const PolyPolygon& rPolyPoly, if( OUTDEV_PRINTER == meOutDevType ) { + if(100 >= nTransparencePercent) + { + // #i112959# 100% transparent, draw nothing + return; + } + + Rectangle aPolyRect( LogicToPixel( rPolyPoly ).GetBoundRect() ); const Size aDPISize( LogicToPixel( Size( 1, 1 ), MAP_INCH ) ); const long nBaseExtent = Max( FRound( aDPISize.Width() / 300. ), 1L ); @@ -359,30 +366,40 @@ void OutputDevice::DrawTransparent( const PolyPolygon& rPolyPoly, case( 25 ): nMove = nBaseExtent * 3; break; case( 50 ): nMove = nBaseExtent * 4; break; case( 75 ): nMove = nBaseExtent * 6; break; - // TODO What is the correct VALUE??? + + // #i112959# very transparent (88 < nTransparencePercent <= 99) + case( 100 ): nMove = nBaseExtent * 8; break; + + // #i112959# not transparent (nTransparencePercent < 13) default: nMove = 0; break; } Push( PUSH_CLIPREGION | PUSH_LINECOLOR ); IntersectClipRegion( rPolyPoly ); SetLineColor( GetFillColor() ); - - Rectangle aRect( aPolyRect.TopLeft(), Size( aPolyRect.GetWidth(), nBaseExtent ) ); - const BOOL bOldMap = mbMap; EnableMapMode( FALSE ); - while( aRect.Top() <= aPolyRect.Bottom() ) + if(nMove) { - DrawRect( aRect ); - aRect.Move( 0, nMove ); - } + Rectangle aRect( aPolyRect.TopLeft(), Size( aPolyRect.GetWidth(), nBaseExtent ) ); + while( aRect.Top() <= aPolyRect.Bottom() ) + { + DrawRect( aRect ); + aRect.Move( 0, nMove ); + } - aRect = Rectangle( aPolyRect.TopLeft(), Size( nBaseExtent, aPolyRect.GetHeight() ) ); - while( aRect.Left() <= aPolyRect.Right() ) + aRect = Rectangle( aPolyRect.TopLeft(), Size( nBaseExtent, aPolyRect.GetHeight() ) ); + while( aRect.Left() <= aPolyRect.Right() ) + { + DrawRect( aRect ); + aRect.Move( nMove, 0 ); + } + } + else { - DrawRect( aRect ); - aRect.Move( nMove, 0 ); + // #i112959# if not transparent, draw full rectangle in clip region + DrawRect( aPolyRect ); } EnableMapMode( bOldMap ); -- cgit v1.2.3 From 31236973b376567a7acf33962385329855f89665 Mon Sep 17 00:00:00 2001 From: Ivo Hinkelmann Date: Wed, 14 Jul 2010 16:59:49 +0200 Subject: txtl10n: #i113008# #i113125# Python 2.3.x compatible --- l10ntools/scripts/tool/l10ntool.py | 20 ++-- l10ntools/scripts/tool/pseudo.py | 184 +++++++++++++++++++++++++++++++++++++ l10ntools/scripts/tool/sdf.py | 65 +------------ l10ntools/scripts/tool/xhtex.py | 1 + 4 files changed, 202 insertions(+), 68 deletions(-) create mode 100644 l10ntools/scripts/tool/pseudo.py diff --git a/l10ntools/scripts/tool/l10ntool.py b/l10ntools/scripts/tool/l10ntool.py index 66afc309a1fb..42e8a6b4e428 100644 --- a/l10ntools/scripts/tool/l10ntool.py +++ b/l10ntools/scripts/tool/l10ntool.py @@ -27,6 +27,8 @@ from optparse import OptionParser from sdf import SdfData +from pseudo import PseudoSet + import sys import os import shutil @@ -68,9 +70,15 @@ class abstractL10nTool: def format_outputfile(self, filename, language): extension = filename[filename.rfind('.')+1:] file = filename[:filename.rfind('.')] - return self.get_outputfile_format_str().replace('[', '{').replace(']','}').format( - filename=filename, fileNoExt=file, language=language, extension=extension, path_prefix=self._options.path_prefix, - path_postfix=self._options.path_postfix, path=self.get_path()) + + # Python 2.3.x friendly + return self.get_outputfile_format_str().replace('[', '%(').replace(']',')s') % \ + { 'filename': filename, 'fileNoExt': file, 'language': language, 'extension': extension, 'path_prefix': self._options.path_prefix, + 'path_postfix': self._options.path_postfix, 'path': self.get_path() } + + #return self.get_outputfile_format_str().replace('[', '{').replace(']','}').format( + # filename=filename, fileNoExt=file, language=language, extension=extension, path_prefix=self._options.path_prefix, + # path_postfix=self._options.path_postfix, path=self.get_path()) def get_path(self): if self._options.outputfile.find('/') == -1: @@ -79,12 +87,12 @@ class abstractL10nTool: return self._options.outputfile[:self._options.outputfile.rfind('/')] def merge(self, sdfdata): - langset,forcedset, foundset = set(), set() , set() + langset,forcedset, foundset = PseudoSet(), PseudoSet() , PseudoSet() if self._options.languages: - langset = set(self._options.languages) + langset = PseudoSet(self._options.languages) if self._options.forcedlanguages: - forcedset = set(self._options.forcedlanguages) + forcedset = PseudoSet(self._options.forcedlanguages) if sdfdata.get_languages_found_in_sdf(): foundset = sdfdata.get_languages_found_in_sdf() diff --git a/l10ntools/scripts/tool/pseudo.py b/l10ntools/scripts/tool/pseudo.py new file mode 100644 index 000000000000..ee23b22f4e79 --- /dev/null +++ b/l10ntools/scripts/tool/pseudo.py @@ -0,0 +1,184 @@ +#************************************************************************* +# +# 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 +# +# for a copy of the LGPLv3 License. +# +#************************************************************************* + +# to support macosx baseline machines from Cretaceous period + +# incomplete set() class implementation of Python 2.4 +class PseudoSet: + _list = [] + + def __str__(self): + return str(self._list) + + def __init__(self, newlist=[]): + self._list = self._remove_dupes(newlist) + + def __or__(self, other): + tmplist = [] + if self._list != None and other != None: + tmplist.extend(self._list) + tmplist.extend(other) + return PseudoSet(self._remove_dupes(tmplist)) + else: + print "__or__(None)" + + def __sub__(self,other): + tmplist = [] + if self._list != None and other != None: + tmplist.extend(self._list) + [tmplist.remove(key) for key in other if key in tmplist] + else: + print __sub__(none) + return PseudoSet(tmplist) + + def __and__(self, other): + tmplist = [] + if other != None and self._list != None: + [tmplist.append(key) for key in self._list if key in other] + return PseudoSet(tmplist) + else: + print "__and__(None)" + + def __iter__(self): + return self._list.__iter__() + + def __items__(self): + return self._list.items() + + def __keys__(self): + return keys(self._list) + + def _remove_dupes(self, list): + tmpdict = {} + for key in list: + tmpdict[key] = 1 + return tmpdict.keys() + +# incomplete OrderedDict() class implementation +class PseudoOrderedDict(dict): + _keylist = [] + _valuelist = [] + + def __init__(self, defaults={}): + dict.__init__(self) + for n,v in defaults.items(): + self[n] = v + + def __setitem__(self, key, value): + self._keylist.append(key) + self._valuelist.append(value) + return dict.__setitem__(self, key, value) + + def __delattr__(self, key): + self._keylist.__delattr__(key) + self._valuelist.__delattr__(dict[key]) + return dict.__delattr__(self, key) + + def __delitem__(self, key): + self._keylist.__delitem__(key) + self._valuelist.__delitem__(dict[key]) + return dict.__delitem__(self, key) + + def __iter__(self): + raise NotImplementedError("__iter__") + + def __iterkeys__(self): + return self._keylist + + def iteritems(self): + #return self._valuelist + return zip(self._keylist, self._valuelist) + + def items(self): + return zip(self._keylist,self._valuelist) + + def __keys__(self): + return self._keylist + + def keys(self): + return self._keylist + + def __keysattr__(self): + return self._keylist + + def pop(self, key): + self._keylist.pop(key) + self._valuelist.pop(key) + return dict.__pop__(self, key) + + def popitem(self): + raise NotImplementedError("popitem") + +def _testdriver_set(): + list, list1 = [] ,[] + list.append("a") + list.append("b") + list.append("c") + + list1.append("a") + list1.append("b") + list1.append("d") + list1.append("e") + list1.append("e") + + if "a" in list: + print "YEAH!" + + a = PseudoSet(list) + b = PseudoSet(list1) + + print "a="+str(a) + print "b="+str(b) + print "a|b=" + str(a|b) + print "a="+str(a) + print "b="+str(b) + print "a&b=" + str(a&b) + print "a="+str(a) + print "b="+str(b) + print "a-b" + str(a-b) + + for key in a: + print key + +def _testdriver_dict(): + d = PseudoOrderedDict() + d["a"] = 1 + d["b"] = 2 + d["c"] = 3 + d["d"] = 4 + d["e"] = 5 + d["f"] = 6 + + print "a="+str(d["a"]) + print "e="+str(d["e"]) + for key,value in d.iteritems(): + print "d["+key+"]="+str(d[key]) + print "key="+str(key)+" value="+str(value) + + print "keys="+str(d.keys()) + +#_testdriver_dict() diff --git a/l10ntools/scripts/tool/sdf.py b/l10ntools/scripts/tool/sdf.py index 33bf90b4ea68..2afcbaf4bb1f 100644 --- a/l10ntools/scripts/tool/sdf.py +++ b/l10ntools/scripts/tool/sdf.py @@ -25,70 +25,11 @@ # #************************************************************************* -class MyOrderedDict(dict): - _keylist = [] - _valuelist = [] - - def __init__(self, defaults={}): - dict.__init__(self) - for n,v in defaults.items(): - self[n] = v - - def __setitem__(self, key, value): - self._keylist.append(key) - self._valuelist.append(value) - return dict.__setitem__(self, key, value) - - def __delattr__(self, key): - self._keylist.__delattr__(key) - self._valuelist.__delattr__(dict[key]) - return dict.__delattr__(self, key) +from pseudo import PseudoSet,PseudoOrderedDict - def __delitem__(self, key): - self._keylist.__delitem__(key) - self._valuelist.__delitem__(dict[key]) - return dict.__delitem__(self, key) - - def __iter(self): - return zip(self._keylist, self._valuelist) - - def __iterkeys__(self): - return self._keylist - - def __iteritems__(self): - return self._valuelist - - def items(self): - return zip(self._keylist,self._valuelist) - - def keys(self): - return self._keylist - - def __keysattr__(self): - return self._keylist - - def pop(self, key): - self._keylist.pop(key) - self._valuelist.pop(key) - return dict.__pop__(self, key) - - def popitem(self): - raise NotImplementedError("popitem") - - def clear(self): - self._keylist.clear() - self._valuelist.clear() - return dict.clear() - - def copy(self): - newobj = MyOrderedDict(self) - newobj._keylist = self._keylist - newobj._valuelist = self._valuelist - return newobj - class SdfData: _filename = ""; - _dict = MyOrderedDict() + _dict = PseudoOrderedDict() _languages_found = []; def __init__ (self, filename=""): @@ -107,7 +48,7 @@ class SdfData: self._dict[key] = value def get_languages_found_in_sdf(self): - return set(self._languages_found) + return PseudoSet(self._languages_found) def read(self): try: diff --git a/l10ntools/scripts/tool/xhtex.py b/l10ntools/scripts/tool/xhtex.py index 99e0f39259a2..c876b9f7c2a0 100644 --- a/l10ntools/scripts/tool/xhtex.py +++ b/l10ntools/scripts/tool/xhtex.py @@ -83,6 +83,7 @@ class xhtex(abstractL10nTool): def merge_file(self, inputfilename, outputfilename, parsed_file_ref, lang,is_forced_lang, sdfdata): if lang == "en-US": mod_outputfilename = outputfilename.replace("_en-US",'') + self.make_dirs(mod_outputfilename) self.copy_file(inputfilename, mod_outputfilename) return dom = parsed_file_ref.cloneNode(True) -- cgit v1.2.3 From a1b4b65e3514c8ac3c21bae04ceeccc90eb29bfa Mon Sep 17 00:00:00 2001 From: Ivo Hinkelmann Date: Wed, 14 Jul 2010 17:00:39 +0200 Subject: txtl10n: #i113008# #i113125# Python 2.3.x compatible --- l10ntools/prj/d.lst | 1 + 1 file changed, 1 insertion(+) diff --git a/l10ntools/prj/d.lst b/l10ntools/prj/d.lst index 9594dc416c8e..53c846832fca 100644 --- a/l10ntools/prj/d.lst +++ b/l10ntools/prj/d.lst @@ -52,6 +52,7 @@ mkdir: %_DEST%\bin%_EXT%\help\com\sun\star\help ..\scripts\tool\xtxex.py %_DEST%\bin%_EXT%\xtxex.py ..\scripts\tool\sdf.py %_DEST%\bin%_EXT%\sdf.py ..\scripts\tool\xhtex.py %_DEST%\bin%_EXT%\xhtex.py +..\scripts\tool\pseudo.py %_DEST%\bin%_EXT%\pseudo.py ..\scripts\xtxex %_DEST%\bin%_EXT%\xtxex ..\scripts\xhtex %_DEST%\bin%_EXT%\xhtex -- cgit v1.2.3 From f72e6b7a877f3d5326bb3c9dad53aa1913b0ed2e Mon Sep 17 00:00:00 2001 From: Ivo Hinkelmann Date: Wed, 14 Jul 2010 17:06:23 +0200 Subject: txtl10n: #i113008# #i113125# cleanup --- l10ntools/scripts/tool/l10ntool.py | 3 +-- l10ntools/scripts/tool/xhtex.py | 8 ++++---- l10ntools/scripts/tool/xtxex.py | 8 ++++---- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/l10ntools/scripts/tool/l10ntool.py b/l10ntools/scripts/tool/l10ntool.py index 42e8a6b4e428..70d88674f07b 100644 --- a/l10ntools/scripts/tool/l10ntool.py +++ b/l10ntools/scripts/tool/l10ntool.py @@ -33,7 +33,7 @@ import sys import os import shutil -class abstractL10nTool: +class AbstractL10nTool: _options = {} _args = "" _resource_type = "" @@ -176,7 +176,6 @@ class abstractL10nTool: return else: try: - print "DBG: make_dir " + str(dir) os.makedirs(dir) except IOError: print "Error: Can not create dir " + dir diff --git a/l10ntools/scripts/tool/xhtex.py b/l10ntools/scripts/tool/xhtex.py index c876b9f7c2a0..ab6e1dd14631 100644 --- a/l10ntools/scripts/tool/xhtex.py +++ b/l10ntools/scripts/tool/xhtex.py @@ -25,12 +25,12 @@ # #************************************************************************* -from l10ntool import abstractL10nTool +from l10ntool import AbstractL10nTool from sdf import SdfEntity import sys import xml.dom.minidom -class xhtex(abstractL10nTool): +class Xhtex(AbstractL10nTool): _resource_type = "xht" _sdfdata = () _lang = "" @@ -65,7 +65,7 @@ class xhtex(abstractL10nTool): # L10N tool def __init__(self): - abstractL10nTool.__init__(self) + AbstractL10nTool.__init__(self) def parse_file(self, filename): document = "" @@ -130,5 +130,5 @@ class xhtex(abstractL10nTool): return SdfEntity(project=self._options.project_name, source_file=self.get_filename_string(inputfile), resource_type=self._resource_type, gid=id, lid="", langid=lang,text=text) -run = xhtex() +run = Xhtex() diff --git a/l10ntools/scripts/tool/xtxex.py b/l10ntools/scripts/tool/xtxex.py index bb11e337d37a..317fb5cc7ff0 100644 --- a/l10ntools/scripts/tool/xtxex.py +++ b/l10ntools/scripts/tool/xtxex.py @@ -25,16 +25,16 @@ # #************************************************************************* -from l10ntool import abstractL10nTool +from l10ntool import AbstractL10nTool from sdf import SdfEntity import sys import shutil -class xtxex(abstractL10nTool): +class Xtxex(AbstractL10nTool): _resource_type = "xtx" def __init__(self): - abstractL10nTool.__init__(self) + AbstractL10nTool.__init__(self) def merge_file(self, inputfilename, outputfilename, parsed_file_ref, lang, is_forced_lang, sdfdata): # Special handling for en-US files @@ -86,4 +86,4 @@ class xtxex(abstractL10nTool): return SdfEntity(project=self._options.project_name, source_file=self.get_filename_string(inputfile), resource_type=self._resource_type, gid="none", lid="none", langid=lang,text="") -run = xtxex() +run = Xtxex() -- cgit v1.2.3 From 420279385334ce45af842ac28b66146029e56c83 Mon Sep 17 00:00:00 2001 From: Ivo Hinkelmann Date: Wed, 14 Jul 2010 17:08:59 +0200 Subject: txtl10n: #i113008# #i113125# cleanup --- l10ntools/scripts/tool/pseudo.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/l10ntools/scripts/tool/pseudo.py b/l10ntools/scripts/tool/pseudo.py index ee23b22f4e79..0956325e31db 100644 --- a/l10ntools/scripts/tool/pseudo.py +++ b/l10ntools/scripts/tool/pseudo.py @@ -52,7 +52,7 @@ class PseudoSet: tmplist.extend(self._list) [tmplist.remove(key) for key in other if key in tmplist] else: - print __sub__(none) + print "__sub__(none)" return PseudoSet(tmplist) def __and__(self, other): -- cgit v1.2.3 From 2c40a12f3307ac3a72f6036a9a2f8939fd7b77c8 Mon Sep 17 00:00:00 2001 From: Ivo Hinkelmann Date: Wed, 14 Jul 2010 17:39:22 +0200 Subject: txtl10n: #i113008# #i113125# skip on empty string --- l10ntools/scripts/tool/xhtex.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/l10ntools/scripts/tool/xhtex.py b/l10ntools/scripts/tool/xhtex.py index ab6e1dd14631..c427a7feccdd 100644 --- a/l10ntools/scripts/tool/xhtex.py +++ b/l10ntools/scripts/tool/xhtex.py @@ -39,14 +39,15 @@ class Xhtex(AbstractL10nTool): def extract_topic(self, list, inputfile): topics = [] for elem in list: - if elem.childNodes[0].nodeType == elem.TEXT_NODE: + if elem.childNodes[0].nodeType == elem.TEXT_NODE and len(elem.childNodes[0].data.strip()): topics.append(self.prepare_sdf_line(id=elem.getAttribute("id").strip(), text=elem.childNodes[0].data, inputfile=inputfile)) return topics def extract_title(self, list, inputfile): titles = [] for elem in list: - titles.append(self.prepare_sdf_line(id=elem.getAttribute("id").strip(), text=elem.getAttribute("title").strip(), inputfile=inputfile)) + if len(elem.getAttribute("title").strip()): + titles.append(self.prepare_sdf_line(id=elem.getAttribute("id").strip(), text=elem.getAttribute("title").strip(), inputfile=inputfile)) return titles # Merge methods -- cgit v1.2.3 From 9edb131f425e23ea9e9645fee441975959cfd02b Mon Sep 17 00:00:00 2001 From: Ivo Hinkelmann Date: Wed, 14 Jul 2010 17:46:14 +0200 Subject: txtl10n: #i113008# #i113125# skip on empty string --- l10ntools/scripts/tool/xtxex.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/l10ntools/scripts/tool/xtxex.py b/l10ntools/scripts/tool/xtxex.py index 317fb5cc7ff0..2c5f132530a6 100644 --- a/l10ntools/scripts/tool/xtxex.py +++ b/l10ntools/scripts/tool/xtxex.py @@ -76,10 +76,14 @@ class Xtxex(AbstractL10nTool): # escape all returns lines = [line.replace('\n', "\\n") for line in lines] line = ''.join(lines) - sdf_entity = self.prepare_sdf_line(inputfile); - sdf_entity.text = line - return str(sdf_entity) - + test = str(line) + if len(test.strip()): + sdf_entity = self.prepare_sdf_line(inputfile); + sdf_entity.text = line + return str(sdf_entity) + else: + return "" + def prepare_sdf_line(self, inputfile="", lang=""): if lang == "": lang = self._source_language -- cgit v1.2.3 From 676216ee1ce7e38d3f3a4584444334dfa3db18c5 Mon Sep 17 00:00:00 2001 From: Armin Le Grand Date: Thu, 15 Jul 2010 13:43:18 +0200 Subject: #i112959# corrected comparison --- vcl/source/gdi/outdev6.cxx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/vcl/source/gdi/outdev6.cxx b/vcl/source/gdi/outdev6.cxx index ebb91c82367d..819d205079e8 100644 --- a/vcl/source/gdi/outdev6.cxx +++ b/vcl/source/gdi/outdev6.cxx @@ -345,13 +345,12 @@ void OutputDevice::DrawTransparent( const PolyPolygon& rPolyPoly, if( OUTDEV_PRINTER == meOutDevType ) { - if(100 >= nTransparencePercent) + if(100 <= nTransparencePercent) { // #i112959# 100% transparent, draw nothing return; } - Rectangle aPolyRect( LogicToPixel( rPolyPoly ).GetBoundRect() ); const Size aDPISize( LogicToPixel( Size( 1, 1 ), MAP_INCH ) ); const long nBaseExtent = Max( FRound( aDPISize.Width() / 300. ), 1L ); -- cgit v1.2.3 From e3c23bd6b87f5676163f3fc01ad7532bb61d7007 Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Thu, 15 Jul 2010 19:24:32 +0200 Subject: pl07: #i113170# ensure existance of NSAutoreleasePool --- vcl/aqua/source/app/salinst.cxx | 9 +++++++++ vcl/aqua/source/window/salframe.cxx | 6 ++++++ 2 files changed, 15 insertions(+) diff --git a/vcl/aqua/source/app/salinst.cxx b/vcl/aqua/source/app/salinst.cxx index b8a2261ed9db..7ce45f090f28 100644 --- a/vcl/aqua/source/app/salinst.cxx +++ b/vcl/aqua/source/app/salinst.cxx @@ -975,6 +975,9 @@ void AquaSalInstance::DeletePrinterQueueInfo( SalPrinterQueueInfo* pInfo ) XubString AquaSalInstance::GetDefaultPrinter() { + // #i113170# may not be the main thread if called from UNO API + SalData::ensureThreadAutoreleasePool(); + if( ! maDefaultPrinter.getLength() ) { NSPrintInfo* pPI = [NSPrintInfo sharedPrintInfo]; @@ -999,6 +1002,9 @@ XubString AquaSalInstance::GetDefaultPrinter() SalInfoPrinter* AquaSalInstance::CreateInfoPrinter( SalPrinterQueueInfo* pQueueInfo, ImplJobSetup* pSetupData ) { + // #i113170# may not be the main thread if called from UNO API + SalData::ensureThreadAutoreleasePool(); + SalInfoPrinter* pNewInfoPrinter = NULL; if( pQueueInfo ) { @@ -1014,6 +1020,9 @@ SalInfoPrinter* AquaSalInstance::CreateInfoPrinter( SalPrinterQueueInfo* pQueueI void AquaSalInstance::DestroyInfoPrinter( SalInfoPrinter* pPrinter ) { + // #i113170# may not be the main thread if called from UNO API + SalData::ensureThreadAutoreleasePool(); + delete pPrinter; } diff --git a/vcl/aqua/source/window/salframe.cxx b/vcl/aqua/source/window/salframe.cxx index b14354e1b4bd..fdee24f09a10 100644 --- a/vcl/aqua/source/window/salframe.cxx +++ b/vcl/aqua/source/window/salframe.cxx @@ -293,6 +293,9 @@ BOOL AquaSalFrame::PostEvent( void *pData ) // ----------------------------------------------------------------------- void AquaSalFrame::SetTitle(const XubString& rTitle) { + // #i113170# may not be the main thread if called from UNO API + SalData::ensureThreadAutoreleasePool(); + NSString* pTitle = CreateNSString( rTitle ); [mpWindow setTitle: pTitle]; @@ -806,6 +809,9 @@ void AquaSalFrame::SetAlwaysOnTop( BOOL bOnTop ) void AquaSalFrame::ToTop(USHORT nFlags) { + // #i113170# may not be the main thread if called from UNO API + SalData::ensureThreadAutoreleasePool(); + if( ! (nFlags & SAL_FRAME_TOTOP_RESTOREWHENMIN) ) { if( ! [mpWindow isVisible] || [mpWindow isMiniaturized] ) -- cgit v1.2.3 From 636c3126b6146ac734953457394be84a33ec46b9 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Fri, 16 Jul 2010 08:58:23 +0100 Subject: cmcfixes77: #i113146# afms build type --- psprint_config/prj/build.lst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/psprint_config/prj/build.lst b/psprint_config/prj/build.lst index b2dea37df50b..697fcf6062f0 100644 --- a/psprint_config/prj/build.lst +++ b/psprint_config/prj/build.lst @@ -1,4 +1,4 @@ -pc psprint_config : soltools afms NULL +pc psprint_config : soltools AFMS:afms NULL pc psprint_config usr1 - all pc_mkout NULL pc psprint_config\configuration nmake - u pc_conf NULL pc psprint_config\configuration\ppds nmake - u pc_ppds NULL -- cgit v1.2.3 From d3e55e9977b1791bd91df636d9c6620132b5203f Mon Sep 17 00:00:00 2001 From: "Herbert Duerr [hdu]" Date: Fri, 16 Jul 2010 14:56:25 +0200 Subject: #i109651# PDF-builtin fonts disabled on OSX to allow glyph-fallback --- vcl/source/gdi/pdfwriter_impl.cxx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx index 6cb0a7d07697..34804363a456 100644 --- a/vcl/source/gdi/pdfwriter_impl.cxx +++ b/vcl/source/gdi/pdfwriter_impl.cxx @@ -1793,6 +1793,11 @@ PDFWriterImpl::PDFWriterImpl( const PDFWriter::PDFWriterContext& rContext ) m_aContext.Version = PDFWriter::PDF_1_4; //meaning we need PDF 1.4, PDF/A flavour m_bEmbedStandardFonts = m_aContext.EmbedStandardFonts; +#ifdef MACOSX // disable builtin fonts on the AQUA port + // on OSX the glyph fallback feature does not work for non-system fonts + // TODO: reevaluate when the OSX ports moves to CoreText + m_bEmbedStandardFonts = true; +#endif } PDFWriterImpl::~PDFWriterImpl() -- cgit v1.2.3 From df141ec59998680b75804e113885193a6c7dda5e Mon Sep 17 00:00:00 2001 From: Vladimir Glazunov Date: Fri, 16 Jul 2010 15:02:30 +0200 Subject: unxlngxnewbaseline: #162926# some fixes for 64 bit linux baseline --- vcl/util/makefile.mk | 3 +++ 1 file changed, 3 insertions(+) diff --git a/vcl/util/makefile.mk b/vcl/util/makefile.mk index 7395dcc9acce..92e36d198c47 100644 --- a/vcl/util/makefile.mk +++ b/vcl/util/makefile.mk @@ -391,6 +391,9 @@ SHL4STDLIBS+= $(XRANDR_LIBS) .ENDIF .ENDIF +.IF "$(HOSTTYPE)" == "x86_64-linux" +EXTRALIBPATHS+=-L$(LIBRARY_PATH) +.ENDIF # "$(HOSTTYPE)" == "x86_64-linux" .ENDIF # "$(ENABLE_GTK)" != "" # KDE plugin -- cgit v1.2.3 From c6087cfe26349b34b72dd17ef33bc1c385619ce5 Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Fri, 16 Jul 2010 18:17:05 +0200 Subject: vcl113: undo previous change --- vcl/source/gdi/pdfwriter_impl.cxx | 5 ----- 1 file changed, 5 deletions(-) diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx index 34804363a456..6cb0a7d07697 100644 --- a/vcl/source/gdi/pdfwriter_impl.cxx +++ b/vcl/source/gdi/pdfwriter_impl.cxx @@ -1793,11 +1793,6 @@ PDFWriterImpl::PDFWriterImpl( const PDFWriter::PDFWriterContext& rContext ) m_aContext.Version = PDFWriter::PDF_1_4; //meaning we need PDF 1.4, PDF/A flavour m_bEmbedStandardFonts = m_aContext.EmbedStandardFonts; -#ifdef MACOSX // disable builtin fonts on the AQUA port - // on OSX the glyph fallback feature does not work for non-system fonts - // TODO: reevaluate when the OSX ports moves to CoreText - m_bEmbedStandardFonts = true; -#endif } PDFWriterImpl::~PDFWriterImpl() -- cgit v1.2.3 From 325dec657f22b698dadc1253bbd13d8cfc40f14c Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Fri, 16 Jul 2010 16:31:00 +0200 Subject: vcl113: fix missing isblank on Windows --- rsc/source/parser/rsclex.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) mode change 100644 => 100755 rsc/source/parser/rsclex.cxx diff --git a/rsc/source/parser/rsclex.cxx b/rsc/source/parser/rsclex.cxx old mode 100644 new mode 100755 index cc5bd0eb39b4..76ec4c551d52 --- a/rsc/source/parser/rsclex.cxx +++ b/rsc/source/parser/rsclex.cxx @@ -179,7 +179,7 @@ int MakeToken( YYSTYPE * pTokenVal ){ { c = pFI->GetFastChar(); } - while( isblank( c ) ); + while( c == ' ' || c == '\t' ); if( c == '"' ) { // this is a continued string -- cgit v1.2.3 From 8444953804e704a4462c3416c1ad50db2ce9fec4 Mon Sep 17 00:00:00 2001 From: "Eike Rathke [er]" Date: Fri, 16 Jul 2010 20:13:45 +0200 Subject: calc56: #i108385# make TEXT return text if text was passed, handling text formats that include a @ code --- svl/inc/svl/zforlist.hxx | 9 +++++++ svl/source/numbers/zforlist.cxx | 52 +++++++++++++++++++++++++++++++++++++++++ svl/source/numbers/zformat.cxx | 2 +- 3 files changed, 62 insertions(+), 1 deletion(-) diff --git a/svl/inc/svl/zforlist.hxx b/svl/inc/svl/zforlist.hxx index 598295797ea6..5492759d4d36 100644 --- a/svl/inc/svl/zforlist.hxx +++ b/svl/inc/svl/zforlist.hxx @@ -520,6 +520,15 @@ public: String& sOutString, Color** ppColor, LanguageType eLnge = LANGUAGE_DONTKNOW ); + /** Format a string according to a format code string to be scanned. + @return + if format code contains an error + else, in which case the string and color are returned. + */ + BOOL GetPreviewString( const String& sFormatString, const String& sPreviewString, + String& sOutString, Color** ppColor, + LanguageType eLnge = LANGUAGE_DONTKNOW ); + /** Test whether the format code string is already present in container @return NUMBERFORMAT_ENTRY_NOT_FOUND if not found, else the format index. diff --git a/svl/source/numbers/zforlist.cxx b/svl/source/numbers/zforlist.cxx index cb66a75558c2..7343a0a9c0e6 100644 --- a/svl/source/numbers/zforlist.cxx +++ b/svl/source/numbers/zforlist.cxx @@ -1697,6 +1697,58 @@ BOOL SvNumberFormatter::GetPreviewStringGuess( const String& sFormatString, return FALSE; } +BOOL SvNumberFormatter::GetPreviewString( const String& sFormatString, + const String& sPreviewString, + String& sOutString, + Color** ppColor, + LanguageType eLnge ) +{ + if (sFormatString.Len() == 0) // no empty string + return FALSE; + + xub_StrLen nCheckPos = STRING_NOTFOUND; + sal_uInt32 nKey; + if (eLnge == LANGUAGE_DONTKNOW) + eLnge = IniLnge; + ChangeIntl(eLnge); // switch if needed + eLnge = ActLnge; + String sTmpString = sFormatString; + SvNumberformat* p_Entry = new SvNumberformat( sTmpString, + pFormatScanner, + pStringScanner, + nCheckPos, + eLnge); + if (nCheckPos == 0) // String ok + { + String aNonConstPreview( sPreviewString); + // May have to create standard formats for this locale. + sal_uInt32 CLOffset = ImpGenerateCL(eLnge); + nKey = ImpIsEntry( p_Entry->GetFormatstring(), CLOffset, eLnge); + if (nKey != NUMBERFORMAT_ENTRY_NOT_FOUND) // already present + GetOutputString( aNonConstPreview, nKey, sOutString, ppColor); + else + { + // If the format is valid but not a text format and does not + // include a text subformat, an empty string would result. Same as + // in SvNumberFormatter::GetOutputString() + if (p_Entry->IsTextFormat() || p_Entry->HasTextFormat()) + p_Entry->GetOutputString( aNonConstPreview, sOutString, ppColor); + else + { + *ppColor = NULL; + sOutString = sPreviewString; + } + } + delete p_Entry; + return TRUE; + } + else + { + delete p_Entry; + return FALSE; + } +} + sal_uInt32 SvNumberFormatter::TestNewString(const String& sFormatString, LanguageType eLnge) { diff --git a/svl/source/numbers/zformat.cxx b/svl/source/numbers/zformat.cxx index 2d0909c8782b..97f06171a4fc 100644 --- a/svl/source/numbers/zformat.cxx +++ b/svl/source/numbers/zformat.cxx @@ -2057,7 +2057,7 @@ BOOL SvNumberformat::GetOutputString(double fNumber, OutString = rScan.GetFalseString(); return FALSE; } - if (eType & NUMBERFORMAT_TEXT && bStandard) + if (eType & NUMBERFORMAT_TEXT) { ImpGetOutputStandard(fNumber, OutString); return FALSE; -- cgit v1.2.3 From cca8d69b1ed9c7dd7de7632824d702253d77a8b9 Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Mon, 19 Jul 2010 15:06:35 +0200 Subject: pl07: #i111256# MacOS calls unexecptectedly out of NSApplication:nextEventMatchingMask: without us securing the solar mutex --- vcl/aqua/inc/salframeview.h | 1 + vcl/aqua/source/window/salframeview.mm | 14 ++++++++++++++ 2 files changed, 15 insertions(+) diff --git a/vcl/aqua/inc/salframeview.h b/vcl/aqua/inc/salframeview.h index 0174c1a68832..996ca54cdfce 100755 --- a/vcl/aqua/inc/salframeview.h +++ b/vcl/aqua/inc/salframeview.h @@ -37,6 +37,7 @@ } -(id)initWithSalFrame: (AquaSalFrame*)pFrame; -(MacOSBOOL)canBecomeKeyWindow; +-(void)displayIfNeeded; -(void)windowDidBecomeKey: (NSNotification*)pNotification; -(void)windowDidResignKey: (NSNotification*)pNotification; -(void)windowDidChangeScreen: (NSNotification*)pNotification; diff --git a/vcl/aqua/source/window/salframeview.mm b/vcl/aqua/source/window/salframeview.mm index 25dadf0e592b..032c41c6aa0f 100755 --- a/vcl/aqua/source/window/salframeview.mm +++ b/vcl/aqua/source/window/salframeview.mm @@ -162,6 +162,20 @@ static AquaSalFrame* getMouseContainerFrame() return mpFrame; } +-(void)displayIfNeeded +{ + if( GetSalData() && GetSalData()->mpFirstInstance ) + { + vos::IMutex* pMutex = GetSalData()->mpFirstInstance->GetYieldMutex(); + if( pMutex ) + { + pMutex->acquire(); + [super displayIfNeeded]; + pMutex->release(); + } + } +} + -(MacOSBOOL)containsMouse { // is this event actually inside that NSWindow ? -- cgit v1.2.3 From a7a69a2a901654928b90ba40202612d778126682 Mon Sep 17 00:00:00 2001 From: Ivo Hinkelmann Date: Tue, 20 Jul 2010 13:11:02 +0200 Subject: txtl10n: #i113008# #i113125# rename .xht to .tree --- l10ntools/source/localize.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/l10ntools/source/localize.cxx b/l10ntools/source/localize.cxx index 420fa3a8d484..853dcc97dc3e 100644 --- a/l10ntools/source/localize.cxx +++ b/l10ntools/source/localize.cxx @@ -53,7 +53,7 @@ namespace transex3 const char *ExeTable[][5] = { { "src", "transex3", " -UTF8 -e", "negative", "noiso" }, { "hrc", "transex3", " -UTF8 -e", "positive", "noiso" }, - { "xht", "xhtex", "", "negative", "noiso" }, + { "tree", "xhtex", "", "negative", "noiso" }, { "xtx", "xtxex", "", "negative", "noiso" }, { "ulf", "ulfex", " -e", "negative", "noiso" }, { "xrb", "xmlex", "-UTF8 -e", "negative", "iso" }, -- cgit v1.2.3 From 084deeede12ec2c9bf5803f2370ef351ceddee84 Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Tue, 20 Jul 2010 19:07:21 +0200 Subject: vcl114: #i113259# refine gtk plugins XIOError handling (thanks cmc!) --- vcl/unx/gtk/app/gtkdata.cxx | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/vcl/unx/gtk/app/gtkdata.cxx b/vcl/unx/gtk/app/gtkdata.cxx index 2679f4a29c02..46c4b8e5f7c7 100644 --- a/vcl/unx/gtk/app/gtkdata.cxx +++ b/vcl/unx/gtk/app/gtkdata.cxx @@ -489,6 +489,7 @@ class GtkXLib : public SalXLib GSource *m_pUserEvent; oslMutex m_aDispatchMutex; oslCondition m_aDispatchCondition; + XIOErrorHandler m_aOrigGTKXIOErrorHandler; public: static gboolean timeoutFn(gpointer data); @@ -522,6 +523,7 @@ GtkXLib::GtkXLib() m_pUserEvent = NULL; m_aDispatchCondition = osl_createCondition(); m_aDispatchMutex = osl_createMutex(); + m_aOrigGTKXIOErrorHandler = NULL; } GtkXLib::~GtkXLib() @@ -535,6 +537,9 @@ GtkXLib::~GtkXLib() osl_setCondition( m_aDispatchCondition ); osl_destroyCondition( m_aDispatchCondition ); osl_destroyMutex( m_aDispatchMutex ); + + PopXErrorLevel(); + XSetIOErrorHandler (m_aOrigGTKXIOErrorHandler); } void GtkXLib::Init() @@ -596,6 +601,10 @@ void GtkXLib::Init() // init gtk/gdk gtk_init_check( &nParams, &pCmdLineAry ); + //gtk_init_check sets XError/XIOError handlers, we want our own one + m_aOrigGTKXIOErrorHandler = XSetIOErrorHandler ( (XIOErrorHandler)X11SalData::XIOErrorHdl ); + PushXErrorLevel( !!getenv( "SAL_IGNOREXERRORS" ) ); + for (i = 0; i < nParams; i++ ) g_free( pCmdLineAry[i] ); delete [] pCmdLineAry; -- cgit v1.2.3 From 5573de7952876cf759ac778f159ff095d0b40714 Mon Sep 17 00:00:00 2001 From: Carsten Driesner Date: Wed, 21 Jul 2010 10:20:25 +0200 Subject: fwk150: Fix problem that 'Icons in menus' doesn't work anymore --- svtools/source/config/menuoptions.cxx | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/svtools/source/config/menuoptions.cxx b/svtools/source/config/menuoptions.cxx index 70d9d1623ef2..1551361f252f 100644 --- a/svtools/source/config/menuoptions.cxx +++ b/svtools/source/config/menuoptions.cxx @@ -316,6 +316,7 @@ void SvtMenuOptions_Impl::Notify( const Sequence< OUString >& seqPropertyNames ) sal_Bool bMenuIcons = true; sal_Bool bSystemMenuIcons = true; + sal_Bool bMenuSettingsChanged = false; // Step over list of property names and get right value from coreesponding value list to set it on internal members! sal_Int32 nCount = seqPropertyNames.getLength(); @@ -334,12 +335,12 @@ void SvtMenuOptions_Impl::Notify( const Sequence< OUString >& seqPropertyNames ) else if( seqPropertyNames[nProperty] == PROPERTYNAME_SHOWICONSINMENUES ) { DBG_ASSERT(!(seqValues[nProperty].getValueTypeClass()!=TypeClass_BOOLEAN), "SvtMenuOptions_Impl::SvtMenuOptions_Impl()\nWho has changed the value type of \"Office.Common\\View\\Menu\\ShowIconsInMenues\"?" ); - seqValues[nProperty] >>= bMenuIcons; + bMenuSettingsChanged = seqValues[nProperty] >>= bMenuIcons; } else if( seqPropertyNames[nProperty] == PROPERTYNAME_SYSTEMICONSINMENUES ) { DBG_ASSERT(!(seqValues[nProperty].getValueTypeClass()!=TypeClass_BOOLEAN), "SvtMenuOptions_Impl::SvtMenuOptions_Impl()\nWho has changed the value type of \"Office.Common\\View\\Menu\\IsSystemIconsInMenus\"?" ); - seqValues[nProperty] >>= bSystemMenuIcons; + bMenuSettingsChanged = seqValues[nProperty] >>= bSystemMenuIcons; } #if OSL_DEBUG_LEVEL > 1 @@ -347,7 +348,8 @@ void SvtMenuOptions_Impl::Notify( const Sequence< OUString >& seqPropertyNames ) #endif } - m_nMenuIcons = bSystemMenuIcons ? 2 : bMenuIcons; + if ( bMenuSettingsChanged ) + m_nMenuIcons = bSystemMenuIcons ? 2 : bMenuIcons; for ( USHORT n=0; nCall( this ); @@ -377,11 +379,13 @@ void SvtMenuOptions_Impl::Commit() break; //Output cache of current setting as possibly modified by System Theme for older version case PROPERTYHANDLE_SHOWICONSINMENUES : { - seqValues[nProperty] <<=(sal_Bool)(Application::GetSettings().GetStyleSettings().GetUseImagesInMenus()); + sal_Bool bValue = (sal_Bool)(Application::GetSettings().GetStyleSettings().GetUseImagesInMenus()); + seqValues[nProperty] <<= bValue; } break; case PROPERTYHANDLE_SYSTEMICONSINMENUES : { - seqValues[nProperty] <<= (m_nMenuIcons == 2 ? sal_True : sal_False) ; + sal_Bool bValue = (m_nMenuIcons == 2 ? sal_True : sal_False) ; + seqValues[nProperty] <<= bValue; } break; } -- cgit v1.2.3 From 4b09ead45259ea6e467b33980e645b87d55a18d4 Mon Sep 17 00:00:00 2001 From: "Herbert Duerr [hdu]" Date: Wed, 21 Jul 2010 14:12:39 +0200 Subject: vcl114: #i106127# fix numeric problems --- basegfx/source/curve/b2dcubicbezier.cxx | 55 ++++++++++++++++----------------- 1 file changed, 27 insertions(+), 28 deletions(-) diff --git a/basegfx/source/curve/b2dcubicbezier.cxx b/basegfx/source/curve/b2dcubicbezier.cxx index 80bd8922160b..adf819a214a1 100644 --- a/basegfx/source/curve/b2dcubicbezier.cxx +++ b/basegfx/source/curve/b2dcubicbezier.cxx @@ -996,12 +996,11 @@ namespace basegfx if( fD >= 0.0 ) { const double fS = sqrt(fD); - // same as above but for very small fAX and/or fCX - // this has much better numerical stability - // see NRC chapter 5-6 (thanks THB!) - const double fQ = fBX + ((fBX >= 0) ? +fS : -fS); + // calculate both roots (avoiding a numerically unstable subtraction) + const double fQ = -(fBX + ((fBX >= 0) ? +fS : -fS)); impCheckExtremumResult(fQ / fAX, rResults); - impCheckExtremumResult(fCX / fQ, rResults); + if( fD > 0.0 ) // ignore root multiplicity + impCheckExtremumResult(fCX / fQ, rResults); } } else if( !fTools::equalZero(fBX) ) @@ -1028,12 +1027,11 @@ namespace basegfx if( fD >= 0 ) { const double fS = sqrt(fD); - // same as above but for very small fAX and/or fCX - // this has much better numerical stability - // see NRC chapter 5-6 (thanks THB!) - const double fQ = fBY + ((fBY >= 0) ? +fS : -fS); + // calculate both roots (avoiding a numerically unstable subtraction) + const double fQ = -(fBY + ((fBY >= 0) ? +fS : -fS)); impCheckExtremumResult(fQ / fAY, rResults); - impCheckExtremumResult(fCY / fQ, rResults); + if( fD > 0.0 ) // ignore root multiplicity, TODO: use equalZero() instead? + impCheckExtremumResult(fCY / fQ, rResults); } } else if( !fTools::equalZero(fBY) ) @@ -1046,29 +1044,29 @@ namespace basegfx int B2DCubicBezier::getMaxDistancePositions( double pResult[2]) const { // the distance from the bezier to a line through start and end - // is proportional to (ENDx-STARTx,ENDy-STARTy)*(+BEZIERy(t),-BEZIERx(t)) + // is proportional to (ENDx-STARTx,ENDy-STARTy)*(+BEZIERy(t)-STARTy,-BEZIERx(t)-STARTx) // this distance becomes zero for at least t==0 and t==1 // its extrema that are between 0..1 are interesting as split candidates // its derived function has the form dD/dt = fA*t^2 + 2*fB*t + fC const B2DPoint aRelativeEndPoint(maEndPoint-maStartPoint); - const double fA = 3 * (maEndPoint.getX() - maControlPointB.getX()) * aRelativeEndPoint.getY() - - 3 * (maEndPoint.getY() - maControlPointB.getY()) * aRelativeEndPoint.getX(); - const double fB = (maControlPointB.getX() - maControlPointA.getX()) * aRelativeEndPoint.getY() - - (maControlPointB.getY() - maControlPointA.getY()) * aRelativeEndPoint.getX(); + const double fA = (3 * (maControlPointA.getX() - maControlPointB.getX()) + aRelativeEndPoint.getX()) * aRelativeEndPoint.getY() + - (3 * (maControlPointA.getY() - maControlPointB.getY()) + aRelativeEndPoint.getY()) * aRelativeEndPoint.getX(); + const double fB = (maControlPointB.getX() - 2 * maControlPointA.getX() + maStartPoint.getX()) * aRelativeEndPoint.getY() + - (maControlPointB.getY() - 2 * maControlPointA.getY() + maStartPoint.getY()) * aRelativeEndPoint.getX(); const double fC = (maControlPointA.getX() - maStartPoint.getX()) * aRelativeEndPoint.getY() - (maControlPointA.getY() - maStartPoint.getY()) * aRelativeEndPoint.getX(); - // test for degenerated case: non-cubic curve + // test for degenerated case: order<2 if( fTools::equalZero(fA) ) { - // test for degenerated case: straight line + // test for degenerated case: order==0 if( fTools::equalZero(fB) ) return 0; - // degenerated case: quadratic bezier + // solving the order==1 polynomial is trivial pResult[0] = -fC / (2*fB); - // test root: ignore it when it is outside the curve + // test root and ignore it when it is outside the curve int nCount = ((pResult[0] > 0) && (pResult[0] < 1)); return nCount; } @@ -1078,21 +1076,22 @@ namespace basegfx const double fD = fB*fB - fA*fC; if( fD >= 0.0 ) // TODO: is this test needed? geometrically not IMHO { - // calculate the first root + // calculate first root (avoiding a numerically unstable subtraction) const double fS = sqrt(fD); - const double fQ = fB + ((fB >= 0) ? +fS : -fS); + const double fQ = -(fB + ((fB >= 0) ? +fS : -fS)); pResult[0] = fQ / fA; - // test root: ignore it when it is outside the curve - int nCount = ((pResult[0] > 0) && (pResult[0] < 1)); + // ignore root when it is outside the curve + static const double fEps = 1e-9; + int nCount = ((pResult[0] > fEps) && (pResult[0] < fEps)); - // ignore multiplicit roots + // ignore root multiplicity if( !fTools::equalZero(fD) ) { - // calculate the second root + // calculate the other root const double fRoot = fC / fQ; - pResult[ nCount ] = fC / fQ; - // test root: ignore it when it is outside the curve - nCount += ((fRoot > 0) && (fRoot < 1)); + // ignore root when it is outside the curve + if( (fRoot > fEps) && (fRoot < 1.0-fEps) ) + pResult[ nCount++ ] = fRoot; } return nCount; -- cgit v1.2.3 From 3e1796177f33f27dfd4116798ed87aba641145e6 Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Wed, 21 Jul 2010 16:03:55 +0200 Subject: vcl114: #i105434# solve a scaling issue --- vcl/source/gdi/print3.cxx | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/vcl/source/gdi/print3.cxx b/vcl/source/gdi/print3.cxx index 191f8f26dc75..a2b994fa7f22 100644 --- a/vcl/source/gdi/print3.cxx +++ b/vcl/source/gdi/print3.cxx @@ -184,17 +184,17 @@ public: {} ~ImplPrinterControllerData() { delete mpProgress; } - Size getRealPaperSize( const Size& i_rPageSize ) const + Size getRealPaperSize( const Size& i_rPageSize, bool bNoNUP ) const { if( maFixedPageSize.Width() > 0 && maFixedPageSize.Height() > 0 ) return maFixedPageSize; - if( maMultiPage.nRows * maMultiPage.nColumns > 1 ) + if( maMultiPage.nRows * maMultiPage.nColumns > 1 && ! bNoNUP ) return maMultiPage.aPaperSize; return i_rPageSize; } bool isFixedPageSize() const { return maFixedPageSize.Width() != 0 && maFixedPageSize.Height() != 0; } - PrinterController::PageSize modifyJobSetup( const Sequence< PropertyValue >& i_rProps ); + PrinterController::PageSize modifyJobSetup( const Sequence< PropertyValue >& i_rProps, bool bNoNUP ); }; PrinterController::PrinterController() @@ -738,7 +738,7 @@ bool PrinterController::setupPrinter( Window* i_pParent ) return bRet; } -PrinterController::PageSize vcl::ImplPrinterControllerData::modifyJobSetup( const Sequence< PropertyValue >& i_rProps ) +PrinterController::PageSize vcl::ImplPrinterControllerData::modifyJobSetup( const Sequence< PropertyValue >& i_rProps, bool bNoNUP ) { PrinterController::PageSize aPageSize; aPageSize.aSize = mpPrinter->GetPaperSize(); @@ -773,7 +773,7 @@ PrinterController::PageSize vcl::ImplPrinterControllerData::modifyJobSetup( cons if( aSetSize.Width && aSetSize.Height ) { Size aSetPaperSize( aSetSize.Width, aSetSize.Height ); - Size aRealPaperSize( getRealPaperSize( aSetPaperSize ) ); + Size aRealPaperSize( getRealPaperSize( aSetPaperSize, bNoNUP ) ); if( aRealPaperSize != aCurSize ) aIsSize = aSetSize; } @@ -783,7 +783,7 @@ PrinterController::PageSize vcl::ImplPrinterControllerData::modifyJobSetup( cons aPageSize.aSize.Width() = aIsSize.Width; aPageSize.aSize.Height() = aIsSize.Height; - Size aRealPaperSize( getRealPaperSize( aPageSize.aSize ) ); + Size aRealPaperSize( getRealPaperSize( aPageSize.aSize, bNoNUP ) ); if( aRealPaperSize != aCurSize ) mpPrinter->SetPaperSizeUser( aRealPaperSize, ! isFixedPageSize() ); } @@ -849,7 +849,7 @@ PrinterController::PageSize PrinterController::getPageFile( int i_nUnfilteredPag mpImplData->mpPrinter->SetMapMode( aMapMode ); // modify job setup if necessary - PrinterController::PageSize aPageSize = mpImplData->modifyJobSetup( aPageParm ); + PrinterController::PageSize aPageSize = mpImplData->modifyJobSetup( aPageParm, true ); o_rMtf.SetPrefSize( aPageSize.aSize ); o_rMtf.SetPrefMapMode( aMapMode ); @@ -931,7 +931,7 @@ PrinterController::PageSize PrinterController::getFilteredPageFile( int i_nFilte rMPS.nTopMargin == 0 && rMPS.nBottomMargin == 0 ) { PrinterController::PageSize aPageSize = getPageFile( i_nFilteredPage, o_rMtf, i_bMayUseCache ); - Size aPaperSize = mpImplData->getRealPaperSize( aPageSize.aSize ); + Size aPaperSize = mpImplData->getRealPaperSize( aPageSize.aSize, true ); mpImplData->mpPrinter->SetMapMode( MapMode( MAP_100TH_MM ) ); mpImplData->mpPrinter->SetPaperSizeUser( aPaperSize, ! mpImplData->isFixedPageSize() ); if( aPaperSize != aPageSize.aSize ) @@ -953,7 +953,7 @@ PrinterController::PageSize PrinterController::getFilteredPageFile( int i_nFilte sal_Bool bIsLastPage = mpImplData->mbLastPage; mpImplData->mbLastPage = sal_False; - Size aPaperSize( mpImplData->getRealPaperSize( mpImplData->maMultiPage.aPaperSize ) ); + Size aPaperSize( mpImplData->getRealPaperSize( mpImplData->maMultiPage.aPaperSize, false ) ); // multi page area: page size minus margins + one time spacing right and down // the added spacing is so each subpage can be calculated including its spacing -- cgit v1.2.3 From ed297064b56e492c7555b26f7c8f9c88d0cafa6c Mon Sep 17 00:00:00 2001 From: "Herbert Duerr [hdu]" Date: Wed, 21 Jul 2010 17:00:56 +0200 Subject: ooo33gsl03: #i113342# fix stlport-assertion when calling drawFilledTrapezoids() --- vcl/unx/source/gdi/salgdi.cxx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/vcl/unx/source/gdi/salgdi.cxx b/vcl/unx/source/gdi/salgdi.cxx index ae21c3aa9f7b..c0658c162489 100644 --- a/vcl/unx/source/gdi/salgdi.cxx +++ b/vcl/unx/source/gdi/salgdi.cxx @@ -1127,6 +1127,8 @@ bool X11SalGraphics::drawPolyPolygon( const ::basegfx::B2DPolyPolygon& rOrigPoly basegfx::B2DTrapezoidVector aB2DTrapVector; basegfx::tools::trapezoidSubdivide( aB2DTrapVector, aPolyPoly ); const int nTrapCount = aB2DTrapVector.size(); + if( !nTrapCount ) + return true; const bool bDrawn = drawFilledTrapezoids( &aB2DTrapVector[0], nTrapCount, fTransparency ); return bDrawn; } @@ -1239,6 +1241,8 @@ bool X11SalGraphics::drawPolyLine(const ::basegfx::B2DPolygon& rPolygon, double // draw tesselation result const int nTrapCount = aB2DTrapVector.size(); + if( !nTrapCount ) + return true; const bool bDrawOk = drawFilledTrapezoids( &aB2DTrapVector[0], nTrapCount, fTransparency ); // restore the original brush GC -- cgit v1.2.3 From c28b950220762319a3fff05cafa6947181d2f947 Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Wed, 21 Jul 2010 17:06:56 +0200 Subject: vcl114: #i113239# check mimetype of data in dragEnter --- vcl/source/control/edit.cxx | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/vcl/source/control/edit.cxx b/vcl/source/control/edit.cxx index 0a29a627b8e3..4df4f70de645 100644 --- a/vcl/source/control/edit.cxx +++ b/vcl/source/control/edit.cxx @@ -122,6 +122,7 @@ struct DDInfo BOOL bStarterOfDD; BOOL bDroppedInMe; BOOL bVisCursor; + BOOL bIsStringSupported; DDInfo() { @@ -130,6 +131,7 @@ struct DDInfo bStarterOfDD = FALSE; bDroppedInMe = FALSE; bVisCursor = FALSE; + bIsStringSupported = FALSE; } }; @@ -3055,17 +3057,26 @@ void Edit::drop( const ::com::sun::star::datatransfer::dnd::DropTargetDropEvent& rDTDE.Context->dropComplete( bChanges ); } -void Edit::dragEnter( const ::com::sun::star::datatransfer::dnd::DropTargetDragEnterEvent& ) throw (::com::sun::star::uno::RuntimeException) +void Edit::dragEnter( const ::com::sun::star::datatransfer::dnd::DropTargetDragEnterEvent& rDTDE ) throw (::com::sun::star::uno::RuntimeException) { if ( !mpDDInfo ) { mpDDInfo = new DDInfo; } -// sal_Bool bTextContent = mbReadOnly ? sal_False : sal_True; // quiery from rDTDEE.SupportedDataFlavors() -// if ( bTextContent ) -// rDTDEE.Context->acceptDrop(datatransfer::dnd::DNDConstants::ACTION_COPY_OR_MOVE); -// else -// rDTDEE.Context->rejectDrop(); + // search for string data type + const Sequence< com::sun::star::datatransfer::DataFlavor >& rFlavors( rDTDE.SupportedDataFlavors ); + sal_Int32 nEle = rFlavors.getLength(); + mpDDInfo->bIsStringSupported = FALSE; + for( sal_Int32 i = 0; i < nEle; i++ ) + { + sal_Int32 nIndex = 0; + rtl::OUString aMimetype = rFlavors[i].MimeType.getToken( 0, ';', nIndex ); + if( aMimetype.equalsAscii( "text/plain" ) ) + { + mpDDInfo->bIsStringSupported = TRUE; + break; + } + } } void Edit::dragExit( const ::com::sun::star::datatransfer::dnd::DropTargetEvent& ) throw (::com::sun::star::uno::RuntimeException) @@ -3097,7 +3108,7 @@ void Edit::dragOver( const ::com::sun::star::datatransfer::dnd::DropTargetDragEv aSel.Justify(); // Don't accept drop in selection or read-only field... - if ( IsReadOnly() || aSel.IsInside( mpDDInfo->nDropPos ) ) + if ( IsReadOnly() || aSel.IsInside( mpDDInfo->nDropPos ) || ! mpDDInfo->bIsStringSupported ) { ImplHideDDCursor(); rDTDE.Context->rejectDrag(); -- cgit v1.2.3 From 5b92062661eb9fe6ecee0ed3fd6356e6d6d9fca9 Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Wed, 21 Jul 2010 18:31:18 +0200 Subject: ooo33gsl03: #i113333# make D&D to certain ListBoxes possible --- svtools/source/contnr/svlbox.cxx | 11 ++++ vcl/inc/vcl/dndevdis.hxx | 114 +++++++++++++++++++++++++++++++++++ vcl/inc/vcl/dndlcon.hxx | 124 +++++++++++++++++++++++++++++++++++++++ vcl/inc/vcl/ilstbox.hxx | 2 + vcl/source/control/lstbox.cxx | 14 ++++- vcl/source/window/dndevdis.cxx | 4 +- vcl/source/window/dndevdis.hxx | 114 ----------------------------------- vcl/source/window/dndlcon.cxx | 2 +- vcl/source/window/dndlcon.hxx | 124 --------------------------------------- vcl/source/window/window.cxx | 4 +- vcl/source/window/winproc.cxx | 2 +- 11 files changed, 268 insertions(+), 247 deletions(-) create mode 100644 vcl/inc/vcl/dndevdis.hxx create mode 100644 vcl/inc/vcl/dndlcon.hxx delete mode 100644 vcl/source/window/dndevdis.hxx delete mode 100644 vcl/source/window/dndlcon.hxx diff --git a/svtools/source/contnr/svlbox.cxx b/svtools/source/contnr/svlbox.cxx index fb71f64772ad..a69253c69629 100644 --- a/svtools/source/contnr/svlbox.cxx +++ b/svtools/source/contnr/svlbox.cxx @@ -1518,6 +1518,13 @@ void SvLBox::MakeVisible( SvLBoxEntry* ) void SvLBox::Command( const CommandEvent& i_rCommandEvent ) { DBG_CHKTHIS(SvLBox,0); + + if ( COMMAND_STARTDRAG == i_rCommandEvent.GetCommand() ) + { + Point aEventPos( i_rCommandEvent.GetMousePosPixel() ); + MouseEvent aMouseEvt( aEventPos, 1, MOUSE_SELECT, MOUSE_LEFT ); + MouseButtonUp( aMouseEvt ); + } Control::Command( i_rCommandEvent ); } @@ -1775,6 +1782,10 @@ void SvLBox::StartDrag( sal_Int8, const Point& rPosPixel ) { DBG_CHKTHIS(SvLBox,0); + Point aEventPos( rPosPixel ); + MouseEvent aMouseEvt( aEventPos, 1, MOUSE_SELECT, MOUSE_LEFT ); + MouseButtonUp( aMouseEvt ); + nOldDragMode = GetDragDropMode(); if ( !nOldDragMode ) return; diff --git a/vcl/inc/vcl/dndevdis.hxx b/vcl/inc/vcl/dndevdis.hxx new file mode 100644 index 000000000000..5b91bd0713ec --- /dev/null +++ b/vcl/inc/vcl/dndevdis.hxx @@ -0,0 +1,114 @@ +/************************************************************************* + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _DNDEVDIS_HXX_ +#define _DNDEVDIS_HXX_ + +#include +#include + +#ifndef _COM_SUN_STAR_DATATRANSFER_DND_XDRAGESTURERECOGNIZER_HPP_ +#include +#endif +#include +#include + +class DNDEventDispatcher: public ::cppu::WeakImplHelper3< + ::com::sun::star::datatransfer::dnd::XDropTargetListener, + ::com::sun::star::datatransfer::dnd::XDropTargetDragContext, + ::com::sun::star::datatransfer::dnd::XDragGestureListener > +{ + Window * m_pTopWindow; + Window * m_pCurrentWindow; + + ::osl::Mutex m_aMutex; + ::com::sun::star::uno::Sequence< ::com::sun::star::datatransfer::DataFlavor > m_aDataFlavorList; + + /* + * fire the events on the dnd listener container of the specified window + */ + + sal_Int32 fireDragEnterEvent( Window *pWindow, const ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDropTargetDragContext >& xContext, + const sal_Int8 nDropAction, const Point& rLocation, const sal_Int8 nSourceAction, + const ::com::sun::star::uno::Sequence< ::com::sun::star::datatransfer::DataFlavor >& aFlavorList ) throw(::com::sun::star::uno::RuntimeException); + + sal_Int32 fireDragOverEvent( Window *pWindow, const ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDropTargetDragContext >& xContext, + const sal_Int8 nDropAction, const Point& rLocation, const sal_Int8 nSourceAction ) throw(::com::sun::star::uno::RuntimeException); + + sal_Int32 fireDragExitEvent( Window *pWindow ) throw(::com::sun::star::uno::RuntimeException); + + sal_Int32 fireDropActionChangedEvent( Window *pWindow, const ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDropTargetDragContext >& xContext, + const sal_Int8 nDropAction, const Point& rLocation, const sal_Int8 nSourceAction ) throw(::com::sun::star::uno::RuntimeException); + + sal_Int32 fireDropEvent( Window *pWindow, const ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDropTargetDropContext >& xContext, + const sal_Int8 nDropAction, const Point& rLocation, const sal_Int8 nSourceAction, + const ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable >& xTransferable ) throw(::com::sun::star::uno::RuntimeException); + + sal_Int32 fireDragGestureEvent( Window *pWindow, const ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDragSource >& xSource, + const ::com::sun::star::uno::Any event, const Point& rOrigin, const sal_Int8 nDragAction )throw(::com::sun::star::uno::RuntimeException); + +public: + + DNDEventDispatcher( Window * pTopWindow ); + virtual ~DNDEventDispatcher(); + + /* + * XDropTargetDragContext + */ + + virtual void SAL_CALL acceptDrag( sal_Int8 dropAction ) throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL rejectDrag() throw(::com::sun::star::uno::RuntimeException); + + /* + * XDropTargetListener + */ + + virtual void SAL_CALL drop( const ::com::sun::star::datatransfer::dnd::DropTargetDropEvent& dtde ) throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL dragEnter( const ::com::sun::star::datatransfer::dnd::DropTargetDragEnterEvent& dtdee ) throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL dragExit( const ::com::sun::star::datatransfer::dnd::DropTargetEvent& dte ) throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL dragOver( const ::com::sun::star::datatransfer::dnd::DropTargetDragEvent& dtde ) throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL dropActionChanged( const ::com::sun::star::datatransfer::dnd::DropTargetDragEvent& dtde ) throw(::com::sun::star::uno::RuntimeException); + + /* + * XDragGestureListener + */ + + virtual void SAL_CALL dragGestureRecognized( const ::com::sun::star::datatransfer::dnd::DragGestureEvent& dge ) throw(::com::sun::star::uno::RuntimeException); + + + /* + * XEventListener + */ + + virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& eo ) throw(::com::sun::star::uno::RuntimeException); +}; + +//================================================================================================== +// +//================================================================================================== + +#endif diff --git a/vcl/inc/vcl/dndlcon.hxx b/vcl/inc/vcl/dndlcon.hxx new file mode 100644 index 000000000000..5a41a20e4271 --- /dev/null +++ b/vcl/inc/vcl/dndlcon.hxx @@ -0,0 +1,124 @@ +/************************************************************************* + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _DNDLCON_HXX_ +#define _DNDLCON_HXX_ + +#include +#include +#include +#include +#include +#include + +#include + +class DNDListenerContainer : public ::vcl::unohelper::MutexHelper, + public ::cppu::WeakComponentImplHelper4< + ::com::sun::star::datatransfer::dnd::XDragGestureRecognizer, \ + ::com::sun::star::datatransfer::dnd::XDropTargetDragContext, + ::com::sun::star::datatransfer::dnd::XDropTargetDropContext, + ::com::sun::star::datatransfer::dnd::XDropTarget > +{ + sal_Bool m_bActive; + sal_Int8 m_nDefaultActions; + + ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDropTargetDragContext > m_xDropTargetDragContext; + ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDropTargetDropContext > m_xDropTargetDropContext; + +public: + + DNDListenerContainer( sal_Int8 nDefaultActions ); + virtual ~DNDListenerContainer(); + + sal_uInt32 fireDropEvent( + const ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDropTargetDropContext >& context, + sal_Int8 dropAction, sal_Int32 locationX, sal_Int32 locationY, sal_Int8 sourceActions, + const ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable >& transferable ); + + sal_uInt32 fireDragExitEvent(); + + sal_uInt32 fireDragOverEvent( + const ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDropTargetDragContext >& context, + sal_Int8 dropAction, sal_Int32 locationX, sal_Int32 locationY, sal_Int8 sourceActions ); + + sal_uInt32 fireDragEnterEvent( + const ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDropTargetDragContext >& context, + sal_Int8 dropAction, sal_Int32 locationX, sal_Int32 locationY, sal_Int8 sourceActions, + const ::com::sun::star::uno::Sequence< ::com::sun::star::datatransfer::DataFlavor >& dataFlavor ); + + sal_uInt32 fireDropActionChangedEvent( + const ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDropTargetDragContext >& context, + sal_Int8 dropAction, sal_Int32 locationX, sal_Int32 locationY, sal_Int8 sourceActions ); + + sal_uInt32 fireDragGestureEvent( + sal_Int8 dragAction, sal_Int32 dragOriginX, sal_Int32 dragOriginY, + const ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDragSource >& dragSource, + const ::com::sun::star::uno::Any& triggerEvent ); + + /* + * XDragGestureRecognizer + */ + + virtual void SAL_CALL addDragGestureListener( const ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDragGestureListener >& dgl ) throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeDragGestureListener( const ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDragGestureListener >& dgl ) throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL resetRecognizer( ) throw(::com::sun::star::uno::RuntimeException); + + /* + * XDropTargetDragContext + */ + + virtual void SAL_CALL acceptDrag( sal_Int8 dragOperation ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL rejectDrag( ) throw (::com::sun::star::uno::RuntimeException); + + + /* + * XDropTargetDropContext + */ + + virtual void SAL_CALL acceptDrop( sal_Int8 dropOperation ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL rejectDrop( ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL dropComplete( sal_Bool success ) throw (::com::sun::star::uno::RuntimeException); + + /* + * XDropTarget + */ + + virtual void SAL_CALL addDropTargetListener( const ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDropTargetListener >& dtl ) throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeDropTargetListener( const ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDropTargetListener >& dtl ) throw(::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL isActive( ) throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setActive( sal_Bool active ) throw(::com::sun::star::uno::RuntimeException); + virtual sal_Int8 SAL_CALL getDefaultActions( ) throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setDefaultActions( sal_Int8 actions ) throw(::com::sun::star::uno::RuntimeException); +}; + + +//================================================================================================== +// +//================================================================================================== + +#endif diff --git a/vcl/inc/vcl/ilstbox.hxx b/vcl/inc/vcl/ilstbox.hxx index 33f60a1e8a2f..ac278f76f65b 100644 --- a/vcl/inc/vcl/ilstbox.hxx +++ b/vcl/inc/vcl/ilstbox.hxx @@ -396,6 +396,7 @@ private: mbHScroll : 1, // HScroll an oder aus mbAutoHScroll : 1; // AutoHScroll an oder aus Link maScrollHdl; // Weil der vom ImplListBoxWindow selbst benoetigt wird. + ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > mxDNDListenerContainer; protected: virtual void GetFocus(); @@ -500,6 +501,7 @@ public: // pb: #106948# explicit mirroring for calc inline void EnableMirroring() { maLBWindow.EnableMirroring(); } + inline void SetDropTraget(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& i_xDNDListenerContainer){ mxDNDListenerContainer= i_xDNDListenerContainer; } }; // ----------------------------- diff --git a/vcl/source/control/lstbox.cxx b/vcl/source/control/lstbox.cxx index eb8c20d1d803..03527bf083a7 100644 --- a/vcl/source/control/lstbox.cxx +++ b/vcl/source/control/lstbox.cxx @@ -44,9 +44,10 @@ #include "tools/debug.hxx" +#include +#include - - // ======================================================================= +// ======================================================================= ListBox::ListBox( WindowType nType ) : Control( nType ) { @@ -119,6 +120,8 @@ void ListBox::ImplInit( Window* pParent, WinBits nStyle ) Control::ImplInit( pParent, nStyle, NULL ); SetBackground(); + ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDropTargetListener> xDrop = new DNDEventDispatcher(this); + if( nStyle & WB_DROPDOWN ) { sal_Int32 nLeft, nTop, nRight, nBottom; @@ -145,16 +148,19 @@ void ListBox::ImplInit( Window* pParent, WinBits nStyle ) mpFloatWin = new ImplListBoxFloatingWindow( this ); mpFloatWin->SetAutoWidth( TRUE ); mpFloatWin->SetPopupModeEndHdl( LINK( this, ListBox, ImplPopupModeEndHdl ) ); + mpFloatWin->GetDropTarget()->addDropTargetListener(xDrop); mpImplWin = new ImplWin( this, (nStyle & (WB_LEFT|WB_RIGHT|WB_CENTER))|WB_NOBORDER ); mpImplWin->SetMBDownHdl( LINK( this, ListBox, ImplClickBtnHdl ) ); mpImplWin->SetUserDrawHdl( LINK( this, ListBox, ImplUserDrawHdl ) ); mpImplWin->Show(); + mpImplWin->GetDropTarget()->addDropTargetListener(xDrop); mpBtn = new ImplBtn( this, WB_NOLIGHTBORDER | WB_RECTSTYLE ); ImplInitDropDownButton( mpBtn ); mpBtn->SetMBDownHdl( LINK( this, ListBox, ImplClickBtnHdl ) ); mpBtn->Show(); + mpBtn->GetDropTarget()->addDropTargetListener(xDrop); } @@ -170,6 +176,9 @@ void ListBox::ImplInit( Window* pParent, WinBits nStyle ) mpImplLB->SetPosPixel( Point() ); mpImplLB->Show(); + mpImplLB->GetDropTarget()->addDropTargetListener(xDrop); + mpImplLB->SetDropTraget(xDrop); + if ( mpFloatWin ) { mpFloatWin->SetImplListBox( mpImplLB ); @@ -1612,7 +1621,6 @@ const Wallpaper& ListBox::GetDisplayBackground() const } // ======================================================================= - MultiListBox::MultiListBox( Window* pParent, WinBits nStyle ) : ListBox( WINDOW_MULTILISTBOX ) { diff --git a/vcl/source/window/dndevdis.cxx b/vcl/source/window/dndevdis.cxx index efc49be6fbf8..e4d5a8c4c0eb 100644 --- a/vcl/source/window/dndevdis.cxx +++ b/vcl/source/window/dndevdis.cxx @@ -28,8 +28,8 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_vcl.hxx" -#include -#include +#include +#include #include #include diff --git a/vcl/source/window/dndevdis.hxx b/vcl/source/window/dndevdis.hxx deleted file mode 100644 index 5b91bd0713ec..000000000000 --- a/vcl/source/window/dndevdis.hxx +++ /dev/null @@ -1,114 +0,0 @@ -/************************************************************************* - * - * 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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#ifndef _DNDEVDIS_HXX_ -#define _DNDEVDIS_HXX_ - -#include -#include - -#ifndef _COM_SUN_STAR_DATATRANSFER_DND_XDRAGESTURERECOGNIZER_HPP_ -#include -#endif -#include -#include - -class DNDEventDispatcher: public ::cppu::WeakImplHelper3< - ::com::sun::star::datatransfer::dnd::XDropTargetListener, - ::com::sun::star::datatransfer::dnd::XDropTargetDragContext, - ::com::sun::star::datatransfer::dnd::XDragGestureListener > -{ - Window * m_pTopWindow; - Window * m_pCurrentWindow; - - ::osl::Mutex m_aMutex; - ::com::sun::star::uno::Sequence< ::com::sun::star::datatransfer::DataFlavor > m_aDataFlavorList; - - /* - * fire the events on the dnd listener container of the specified window - */ - - sal_Int32 fireDragEnterEvent( Window *pWindow, const ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDropTargetDragContext >& xContext, - const sal_Int8 nDropAction, const Point& rLocation, const sal_Int8 nSourceAction, - const ::com::sun::star::uno::Sequence< ::com::sun::star::datatransfer::DataFlavor >& aFlavorList ) throw(::com::sun::star::uno::RuntimeException); - - sal_Int32 fireDragOverEvent( Window *pWindow, const ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDropTargetDragContext >& xContext, - const sal_Int8 nDropAction, const Point& rLocation, const sal_Int8 nSourceAction ) throw(::com::sun::star::uno::RuntimeException); - - sal_Int32 fireDragExitEvent( Window *pWindow ) throw(::com::sun::star::uno::RuntimeException); - - sal_Int32 fireDropActionChangedEvent( Window *pWindow, const ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDropTargetDragContext >& xContext, - const sal_Int8 nDropAction, const Point& rLocation, const sal_Int8 nSourceAction ) throw(::com::sun::star::uno::RuntimeException); - - sal_Int32 fireDropEvent( Window *pWindow, const ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDropTargetDropContext >& xContext, - const sal_Int8 nDropAction, const Point& rLocation, const sal_Int8 nSourceAction, - const ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable >& xTransferable ) throw(::com::sun::star::uno::RuntimeException); - - sal_Int32 fireDragGestureEvent( Window *pWindow, const ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDragSource >& xSource, - const ::com::sun::star::uno::Any event, const Point& rOrigin, const sal_Int8 nDragAction )throw(::com::sun::star::uno::RuntimeException); - -public: - - DNDEventDispatcher( Window * pTopWindow ); - virtual ~DNDEventDispatcher(); - - /* - * XDropTargetDragContext - */ - - virtual void SAL_CALL acceptDrag( sal_Int8 dropAction ) throw(::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL rejectDrag() throw(::com::sun::star::uno::RuntimeException); - - /* - * XDropTargetListener - */ - - virtual void SAL_CALL drop( const ::com::sun::star::datatransfer::dnd::DropTargetDropEvent& dtde ) throw(::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL dragEnter( const ::com::sun::star::datatransfer::dnd::DropTargetDragEnterEvent& dtdee ) throw(::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL dragExit( const ::com::sun::star::datatransfer::dnd::DropTargetEvent& dte ) throw(::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL dragOver( const ::com::sun::star::datatransfer::dnd::DropTargetDragEvent& dtde ) throw(::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL dropActionChanged( const ::com::sun::star::datatransfer::dnd::DropTargetDragEvent& dtde ) throw(::com::sun::star::uno::RuntimeException); - - /* - * XDragGestureListener - */ - - virtual void SAL_CALL dragGestureRecognized( const ::com::sun::star::datatransfer::dnd::DragGestureEvent& dge ) throw(::com::sun::star::uno::RuntimeException); - - - /* - * XEventListener - */ - - virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& eo ) throw(::com::sun::star::uno::RuntimeException); -}; - -//================================================================================================== -// -//================================================================================================== - -#endif diff --git a/vcl/source/window/dndlcon.cxx b/vcl/source/window/dndlcon.cxx index c5d78dd6bae3..07819e76f957 100644 --- a/vcl/source/window/dndlcon.cxx +++ b/vcl/source/window/dndlcon.cxx @@ -28,7 +28,7 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_vcl.hxx" -#include +#include using namespace ::cppu; using namespace ::com::sun::star::uno; diff --git a/vcl/source/window/dndlcon.hxx b/vcl/source/window/dndlcon.hxx deleted file mode 100644 index 5a41a20e4271..000000000000 --- a/vcl/source/window/dndlcon.hxx +++ /dev/null @@ -1,124 +0,0 @@ -/************************************************************************* - * - * 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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#ifndef _DNDLCON_HXX_ -#define _DNDLCON_HXX_ - -#include -#include -#include -#include -#include -#include - -#include - -class DNDListenerContainer : public ::vcl::unohelper::MutexHelper, - public ::cppu::WeakComponentImplHelper4< - ::com::sun::star::datatransfer::dnd::XDragGestureRecognizer, \ - ::com::sun::star::datatransfer::dnd::XDropTargetDragContext, - ::com::sun::star::datatransfer::dnd::XDropTargetDropContext, - ::com::sun::star::datatransfer::dnd::XDropTarget > -{ - sal_Bool m_bActive; - sal_Int8 m_nDefaultActions; - - ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDropTargetDragContext > m_xDropTargetDragContext; - ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDropTargetDropContext > m_xDropTargetDropContext; - -public: - - DNDListenerContainer( sal_Int8 nDefaultActions ); - virtual ~DNDListenerContainer(); - - sal_uInt32 fireDropEvent( - const ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDropTargetDropContext >& context, - sal_Int8 dropAction, sal_Int32 locationX, sal_Int32 locationY, sal_Int8 sourceActions, - const ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable >& transferable ); - - sal_uInt32 fireDragExitEvent(); - - sal_uInt32 fireDragOverEvent( - const ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDropTargetDragContext >& context, - sal_Int8 dropAction, sal_Int32 locationX, sal_Int32 locationY, sal_Int8 sourceActions ); - - sal_uInt32 fireDragEnterEvent( - const ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDropTargetDragContext >& context, - sal_Int8 dropAction, sal_Int32 locationX, sal_Int32 locationY, sal_Int8 sourceActions, - const ::com::sun::star::uno::Sequence< ::com::sun::star::datatransfer::DataFlavor >& dataFlavor ); - - sal_uInt32 fireDropActionChangedEvent( - const ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDropTargetDragContext >& context, - sal_Int8 dropAction, sal_Int32 locationX, sal_Int32 locationY, sal_Int8 sourceActions ); - - sal_uInt32 fireDragGestureEvent( - sal_Int8 dragAction, sal_Int32 dragOriginX, sal_Int32 dragOriginY, - const ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDragSource >& dragSource, - const ::com::sun::star::uno::Any& triggerEvent ); - - /* - * XDragGestureRecognizer - */ - - virtual void SAL_CALL addDragGestureListener( const ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDragGestureListener >& dgl ) throw(::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL removeDragGestureListener( const ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDragGestureListener >& dgl ) throw(::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL resetRecognizer( ) throw(::com::sun::star::uno::RuntimeException); - - /* - * XDropTargetDragContext - */ - - virtual void SAL_CALL acceptDrag( sal_Int8 dragOperation ) throw (::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL rejectDrag( ) throw (::com::sun::star::uno::RuntimeException); - - - /* - * XDropTargetDropContext - */ - - virtual void SAL_CALL acceptDrop( sal_Int8 dropOperation ) throw (::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL rejectDrop( ) throw (::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL dropComplete( sal_Bool success ) throw (::com::sun::star::uno::RuntimeException); - - /* - * XDropTarget - */ - - virtual void SAL_CALL addDropTargetListener( const ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDropTargetListener >& dtl ) throw(::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL removeDropTargetListener( const ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDropTargetListener >& dtl ) throw(::com::sun::star::uno::RuntimeException); - virtual sal_Bool SAL_CALL isActive( ) throw(::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL setActive( sal_Bool active ) throw(::com::sun::star::uno::RuntimeException); - virtual sal_Int8 SAL_CALL getDefaultActions( ) throw(::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL setDefaultActions( sal_Int8 actions ) throw(::com::sun::star::uno::RuntimeException); -}; - - -//================================================================================================== -// -//================================================================================================== - -#endif diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx index 35641ab8d6f9..adedbde4c0f2 100644 --- a/vcl/source/window/window.cxx +++ b/vcl/source/window/window.cxx @@ -88,8 +88,8 @@ #include "vcl/dialog.hxx" #include "vcl/unowrap.hxx" -#include "dndlcon.hxx" -#include "dndevdis.hxx" +#include "vcl/dndlcon.hxx" +#include "vcl/dndevdis.hxx" #include "vcl/impbmpconv.hxx" #include "unotools/confignode.hxx" #include "vcl/gdimtf.hxx" diff --git a/vcl/source/window/winproc.cxx b/vcl/source/window/winproc.cxx index 7b0512a1320b..c964ad0d739b 100644 --- a/vcl/source/window/winproc.cxx +++ b/vcl/source/window/winproc.cxx @@ -62,7 +62,7 @@ #include #include -#include +#include #include #include -- cgit v1.2.3 From 031cd19797688ee3e3eb5ccd12e6e6abfa8bca88 Mon Sep 17 00:00:00 2001 From: Ivo Hinkelmann Date: Wed, 21 Jul 2010 19:07:24 +0200 Subject: txtl10n: #i113008# #i113125# don't die by empty sdf file --- l10ntools/java/jpropex/java/SdfEntity.java | 41 +++++++++++++++++------------- 1 file changed, 24 insertions(+), 17 deletions(-) diff --git a/l10ntools/java/jpropex/java/SdfEntity.java b/l10ntools/java/jpropex/java/SdfEntity.java index 52dc61ca40ca..a05ddf7c2304 100644 --- a/l10ntools/java/jpropex/java/SdfEntity.java +++ b/l10ntools/java/jpropex/java/SdfEntity.java @@ -98,23 +98,30 @@ public class SdfEntity implements Cloneable{ public void setProperties( String line ){ - String[] splitted = line.split("\t"); - - setProject( splitted[ SdfEntity.PROJECT_POS ] ); - setSource_file( splitted[ SdfEntity.SOURCE_FILE_POS ] ); - setDummy1( splitted[ SdfEntity.DUMMY1_POS ] ); - setResource_type( splitted[ SdfEntity.RESOURCE_TYPE_POS ] ); - setGid( splitted[ SdfEntity.GID_POS ] ); - setLid( splitted[ SdfEntity.LID_POS ] ); - setHelpid( splitted[ SdfEntity.HELPID_POS ] ); - setPlatform( splitted[ SdfEntity.PLATFORM_POS ] ); - setDummy2( splitted[ SdfEntity.DUMMY2_POS ] ); - setLangid( splitted[ SdfEntity.LANGID_POS ] ); - setText( splitted[ SdfEntity.TEXT_POS ] ); - setHelptext( splitted[ SdfEntity.HELPTEXT_POS ] ); - setQuickhelptext( splitted[ SdfEntity.QUICKHELPTEXT_POS ] ); - setTitle( splitted[ SdfEntity.TITLE_POS ] ); - setDate( splitted[ SdfEntity.DATE_POS ] ); + String test = new String( line ); + test.trim(); + if( line != null && test.length()>0 ) + { + String[] splitted = line.split("\t"); + if( splitted.length == 15 ) + { + setProject( splitted[ SdfEntity.PROJECT_POS ] ); + setSource_file( splitted[ SdfEntity.SOURCE_FILE_POS ] ); + setDummy1( splitted[ SdfEntity.DUMMY1_POS ] ); + setResource_type( splitted[ SdfEntity.RESOURCE_TYPE_POS ] ); + setGid( splitted[ SdfEntity.GID_POS ] ); + setLid( splitted[ SdfEntity.LID_POS ] ); + setHelpid( splitted[ SdfEntity.HELPID_POS ] ); + setPlatform( splitted[ SdfEntity.PLATFORM_POS ] ); + setDummy2( splitted[ SdfEntity.DUMMY2_POS ] ); + setLangid( splitted[ SdfEntity.LANGID_POS ] ); + setText( splitted[ SdfEntity.TEXT_POS ] ); + setHelptext( splitted[ SdfEntity.HELPTEXT_POS ] ); + setQuickhelptext( splitted[ SdfEntity.QUICKHELPTEXT_POS ] ); + setTitle( splitted[ SdfEntity.TITLE_POS ] ); + setDate( splitted[ SdfEntity.DATE_POS ] ); + } + } } public String getFileId(){ -- cgit v1.2.3 From 6d40e92dcf681213d86fbadbe1c7fc65fbe88ad7 Mon Sep 17 00:00:00 2001 From: Ivo Hinkelmann Date: Thu, 22 Jul 2010 09:48:43 +0200 Subject: txtl10n: #i113008# #i113125# don't die by empty sdf file --- l10ntools/java/jpropex/java/SdfEntity.java | 39 +++++++++++++----------------- 1 file changed, 17 insertions(+), 22 deletions(-) diff --git a/l10ntools/java/jpropex/java/SdfEntity.java b/l10ntools/java/jpropex/java/SdfEntity.java index a05ddf7c2304..c2f6a5d788b1 100644 --- a/l10ntools/java/jpropex/java/SdfEntity.java +++ b/l10ntools/java/jpropex/java/SdfEntity.java @@ -98,29 +98,24 @@ public class SdfEntity implements Cloneable{ public void setProperties( String line ){ - String test = new String( line ); - test.trim(); - if( line != null && test.length()>0 ) + if( line != null ) { - String[] splitted = line.split("\t"); - if( splitted.length == 15 ) - { - setProject( splitted[ SdfEntity.PROJECT_POS ] ); - setSource_file( splitted[ SdfEntity.SOURCE_FILE_POS ] ); - setDummy1( splitted[ SdfEntity.DUMMY1_POS ] ); - setResource_type( splitted[ SdfEntity.RESOURCE_TYPE_POS ] ); - setGid( splitted[ SdfEntity.GID_POS ] ); - setLid( splitted[ SdfEntity.LID_POS ] ); - setHelpid( splitted[ SdfEntity.HELPID_POS ] ); - setPlatform( splitted[ SdfEntity.PLATFORM_POS ] ); - setDummy2( splitted[ SdfEntity.DUMMY2_POS ] ); - setLangid( splitted[ SdfEntity.LANGID_POS ] ); - setText( splitted[ SdfEntity.TEXT_POS ] ); - setHelptext( splitted[ SdfEntity.HELPTEXT_POS ] ); - setQuickhelptext( splitted[ SdfEntity.QUICKHELPTEXT_POS ] ); - setTitle( splitted[ SdfEntity.TITLE_POS ] ); - setDate( splitted[ SdfEntity.DATE_POS ] ); - } + String[] splitted = line.split("\t",15); + setProject( splitted[ SdfEntity.PROJECT_POS ] ); + setSource_file( splitted[ SdfEntity.SOURCE_FILE_POS ] ); + setDummy1( splitted[ SdfEntity.DUMMY1_POS ] ); + setResource_type( splitted[ SdfEntity.RESOURCE_TYPE_POS ] ); + setGid( splitted[ SdfEntity.GID_POS ] ); + setLid( splitted[ SdfEntity.LID_POS ] ); + setHelpid( splitted[ SdfEntity.HELPID_POS ] ); + setPlatform( splitted[ SdfEntity.PLATFORM_POS ] ); + setDummy2( splitted[ SdfEntity.DUMMY2_POS ] ); + setLangid( splitted[ SdfEntity.LANGID_POS ] ); + setText( splitted[ SdfEntity.TEXT_POS ] ); + setHelptext( splitted[ SdfEntity.HELPTEXT_POS ] ); + setQuickhelptext( splitted[ SdfEntity.QUICKHELPTEXT_POS ] ); + setTitle( splitted[ SdfEntity.TITLE_POS ] ); + setDate( splitted[ SdfEntity.DATE_POS ] ); } } -- cgit v1.2.3 From 2b5bd61341cb2b2b2d229796443d3e3d6b9041bf Mon Sep 17 00:00:00 2001 From: Vladimir Glazunov Date: Thu, 22 Jul 2010 11:23:15 +0200 Subject: unxlngxnewbaseline: #162926# some fixes for 64 bit linux baseline, disactivated old, not-buildable debug code --- canvas/source/vcl/canvashelper_texturefill.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) mode change 100755 => 100644 canvas/source/vcl/canvashelper_texturefill.cxx diff --git a/canvas/source/vcl/canvashelper_texturefill.cxx b/canvas/source/vcl/canvashelper_texturefill.cxx old mode 100755 new mode 100644 index 023ceb2b5005..637b3af3315e --- a/canvas/source/vcl/canvashelper_texturefill.cxx +++ b/canvas/source/vcl/canvashelper_texturefill.cxx @@ -700,7 +700,7 @@ namespace vclcanvas } #endif // complex-clipping vs. XOR-trick -#if defined(VERBOSE) && OSL_DEBUG_LEVEL > 0 +#if 0 //defined(VERBOSE) && OSL_DEBUG_LEVEL > 0 { ::basegfx::B2DRectangle aRect(0.0, 0.0, 1.0, 1.0); ::basegfx::B2DRectangle aTextureDeviceRect; -- cgit v1.2.3 From 5168f157283efd30a48dbfc767a4ff726ce77ed3 Mon Sep 17 00:00:00 2001 From: sj Date: Thu, 22 Jul 2010 13:19:35 +0200 Subject: impress196: #i111356# applied patch (uninitialized buffer) --- svtools/source/filter.vcl/filter/filter2.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/svtools/source/filter.vcl/filter/filter2.cxx b/svtools/source/filter.vcl/filter/filter2.cxx index de2bef64ba6e..6abab2626516 100644 --- a/svtools/source/filter.vcl/filter/filter2.cxx +++ b/svtools/source/filter.vcl/filter/filter2.cxx @@ -1201,7 +1201,7 @@ BOOL GraphicDescriptor::ImpDetectPCT( SvStream& rStm, BOOL ) nFormat = GFF_PCT; else { - BYTE sBuf[4]; + BYTE sBuf[3]={0}; rStm.Seek( nStmPos + 522 ); rStm.Read( sBuf, 3 ); -- cgit v1.2.3 From 92fe5813fbcedeb034c6fa85f56bafa2113f142d Mon Sep 17 00:00:00 2001 From: Ivo Hinkelmann Date: Thu, 22 Jul 2010 15:13:04 +0200 Subject: txtl10n: removed obsolete dir --- transex3/java/jpropex/build.xml | 169 ---------- transex3/java/jpropex/java/JPropEx.java | 400 ----------------------- transex3/java/jpropex/java/Main.java | 38 --- transex3/java/jpropex/java/NoLocalizeFilter.java | 55 ---- transex3/java/jpropex/java/OrderedHashMap.java | 96 ------ transex3/java/jpropex/java/SdfData.java | 108 ------ transex3/java/jpropex/java/SdfEntity.java | 254 -------------- transex3/java/jpropex/jpropex | 10 - transex3/java/jpropex/jpropex.MF | 1 - transex3/java/jpropex/makefile.mk | 36 -- 10 files changed, 1167 deletions(-) delete mode 100755 transex3/java/jpropex/build.xml delete mode 100644 transex3/java/jpropex/java/JPropEx.java delete mode 100644 transex3/java/jpropex/java/Main.java delete mode 100644 transex3/java/jpropex/java/NoLocalizeFilter.java delete mode 100644 transex3/java/jpropex/java/OrderedHashMap.java delete mode 100644 transex3/java/jpropex/java/SdfData.java delete mode 100644 transex3/java/jpropex/java/SdfEntity.java delete mode 100755 transex3/java/jpropex/jpropex delete mode 100755 transex3/java/jpropex/jpropex.MF delete mode 100755 transex3/java/jpropex/makefile.mk diff --git a/transex3/java/jpropex/build.xml b/transex3/java/jpropex/build.xml deleted file mode 100755 index d74fb3975d0f..000000000000 --- a/transex3/java/jpropex/build.xml +++ /dev/null @@ -1,169 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/transex3/java/jpropex/java/JPropEx.java b/transex3/java/jpropex/java/JPropEx.java deleted file mode 100644 index 20175febe5d5..000000000000 --- a/transex3/java/jpropex/java/JPropEx.java +++ /dev/null @@ -1,400 +0,0 @@ -/************************************************************************* - * - * 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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - - -import java.util.*; -import java.io.*; - -public class JPropEx -{ - private String inputFileArg; - private String outputFileArg; - private String pathPrefixArg; - private String pathPostfixArg; - private String projectArg; - private String rootArg; - private Vector forcedLangsArg; - private Vector langsArg; - private String inputSdfFileArg; - private boolean isQuiet = false; - private final String resourceType = "javaproperties"; - private final String sourceLanguage = "en-US"; - //private SdfData data; - - public JPropEx() - { - //data = new SdfData(); - } - - public JPropEx( String args[] ) - { - super(); - parseArguments( args ); - testArguments(); - if( inputSdfFileArg != null && inputSdfFileArg.length() > 0 ) - merge(); - else - extract(); - } - - private String getSimpleArg( String[] args , int x ) - { - if( x < args.length ) x++; - else - { - System.err.println("ERROR: Missing arg for "+args[ x ]+"\n"); - help(); - } - return args[ x ]; - } - private Vector getComplexArg( String[] args , int x ) - { - if( x < args.length ) x++; - else - { - System.err.println("ERROR: Missing arg for "+args[ x ]+"\n"); - help(); - } - String value = args[ x ]; - Vector values = new Vector( Arrays.asList( value.split(",") ) ); - return values; - } - - private void help() - { - System.out.println("jpropex extract / merge java properties files"); - System.exit( -1 ); - } - - private void extract() - { - SdfData data = new SdfData(); - java.util.Properties prop = loadProp( inputFileArg ); - - // Get a prototype that already contains the most common settings - SdfEntity dolly = prepareSdfObj(); - String key; - SdfEntity currentStr; - String value; - for( Enumeration e = prop.propertyNames() ; e.hasMoreElements() ; ) - { - key = (String) e.nextElement(); - currentStr = (SdfEntity) dolly.clone(); - // Set the new LID and the string text - currentStr.setLid( key ); - value = prop.getProperty( key , "" ); - //if( value.equals("") ) System.err.println("Warning: in file "+inputFileArg+" the string with the key "+key+" has a empty string!"); - currentStr.setText( (prop.getProperty( key )).replaceAll("\t" , " " ) ); // TODO: Quoting!!!! - data.add( currentStr ); - } - data.write( outputFileArg ); - } - - private SdfEntity prepareSdfObj() - { - String path = makeAbs( inputFileArg ); - path = path.replace( rootArg + "/" , "" ); - path = path.replace("/","\\"); - return new SdfEntity( projectArg , path , "" /* dummy1 */ , resourceType , "", "" , "" , "" , "" /* dummy2 */ , - sourceLanguage , "", "" , "" , "" , "2002-02-02 02:02:02" ); - } - - private void merge() - { - SdfData data = getSdfData(); - if( inputFileArg.startsWith("@") ) - { - // Read files - Vector fileList = readFileList( inputFileArg ); - for( Enumeration e = fileList.elements(); e.hasMoreElements(); ) - mergeFile( (String) e.nextElement() , data ); - } - else - { - // Single file - mergeFile( inputFileArg , data ); - } - } - - private Vector readFileList( String filename ) - { - Vector lines = new Vector(); - try - { - BufferedReader in = new BufferedReader( new FileReader( filename.substring( 1 ) ) ); - while( in.ready() ) - lines.add( in.readLine() ); - } - catch( IOException e ) - { - System.out.println("ERROR: Can't open file '"+filename.substring( 1 )+"'"); - System.exit( -1 ); - } - return lines; - } - - private void mergeFile( String filename , SdfData data ) - { - java.util.Properties sourceProp = loadProp( filename ); - Vector langs = getLanguages( data ); - HashMap props = new HashMap(); - // Create a properties object for every language - for( Enumeration e = langs.elements(); e.hasMoreElements();) - { - - props.put( (String)e.nextElement() , new java.util.Properties() ); - } - // Get a prototype that already contains the most common settings - - SdfEntity dolly = prepareSdfObj(); - String key; - String sourceString; - SdfEntity curStr; - SdfEntity curEntity; - SdfEntity mergedEntity; - String curLang; - for( Enumeration e = sourceProp.propertyNames() ; e.hasMoreElements() ; ) // For all property keys - { - key = (String) e.nextElement(); - sourceString = sourceProp.getProperty( key ); - curStr = (SdfEntity) dolly.clone(); - curStr.setLid( key ); - for( Enumeration lang = langs.elements(); lang.hasMoreElements(); ) // merge in every language - { - curEntity = (SdfEntity) curStr.clone(); - curLang = (String) lang.nextElement(); - curEntity.setLangid( curLang ); - mergedEntity = data.get( curEntity ); - if( mergedEntity == null ) - { - // if case there is not translation the fallback to the en-US source string - ( (java.util.Properties) props.get( curLang )).setProperty( curEntity.getLid() , sourceString ); - } - else - { - // Set the merged text from the sdf file - ( (java.util.Properties) props.get( curLang )).setProperty( mergedEntity.getLid() , mergedEntity.getText() ); // TODO: Quoting ??? - } - } - - } - // Now write them out - String lang; - for( Iterator i = props.keySet().iterator() ; i.hasNext() ; ) - { - lang = (String) i.next(); - writeSinglePropertiesFile( filename , (java.util.Properties) props.get( lang ) , lang ); - } - } - private void writeSinglePropertiesFile( String filename , java.util.Properties prop , String lang ) - { - // Prepare path to file - int filenameIdx = filename.lastIndexOf( "/" ) > 0 ? filename.lastIndexOf( "/" )+1 : 0 ; - String path = new String(); - String name = new String(); - if( pathPrefixArg != null && pathPrefixArg.length()>0 && pathPostfixArg != null && pathPostfixArg.length()>0 ) - { - path = new StringBuffer().append( pathPrefixArg ).append( "/" ).append( lang ).append( "/" ).append( pathPostfixArg ).append( "/" ).toString(); - name = new StringBuffer().append( filename.substring( filenameIdx , filename.lastIndexOf( ".properties" ) ) ) - .append( "_" ).append( lang.replaceAll("-","_") ).append( ".properties" ).toString(); - } - else if( outputFileArg != null && outputFileArg.length()>0 ) - { - name = outputFileArg; - name += new StringBuffer().append( inputFileArg.substring( filenameIdx , filename.lastIndexOf( ".properties" ) ) ) - .append( "_" ).append( lang.replaceAll("-","_") ).append( ".properties" ).toString(); - - //name = outputFileArg; - } - else - { - System.err.println("ERROR: No outputfile specified .. either -o or -x -y !"); - System.exit( -1 ); - } - - File dir = new File( path ); - try - { - if( !dir.exists() && path.length()>0 ) - { - if( !dir.mkdirs() ) - { - System.out.println("ERROR: Can't create directory '"+path+"' !!!"); - System.exit( -1 ); - } - } - } - catch( SecurityException e ) - { - System.out.println("ERROR: Can't create directory '"+path+"'!!!Wrong Permissions?"); - System.exit( -1 ); - } - path += name; - // Write the properties file - System.out.println("DBG: Writing to "+path); - try{ - BufferedOutputStream out = new BufferedOutputStream( new FileOutputStream( path ) ); - if( prop == null ) - System.out.println("DBG: prop == null!!!"); - prop.store( out , "" ); // Legal headers? - } - catch( IOException e ) - { - System.out.println("ERROR: Can't write file '"+path+"' !!!!"); - System.exit( -1 ); - } - } - - private SdfData getSdfData() - { - SdfData data = new SdfData( inputSdfFileArg ); - data.read(); - return data; - } - private Vector getLanguages( SdfData data ) - { - Vector langs = new Vector(); - - if( ((String)langsArg.get( 0 )).equalsIgnoreCase( "all" ) ) // for "-l all" use all languages found in the -m sdf file - langs.addAll( data.getLanguages() ); - else - langs.addAll( langsArg ); // use the langs giving by -l - - if( forcedLangsArg != null ) - langs.addAll( forcedLangsArg ); - - return removeDupes( langs ); - } - private Vector removeDupes( Vector vec ) - { - Collection coll = new LinkedHashSet( vec ); - return new Vector( coll ); - } - private java.util.Properties loadProp( String filename ) - { - java.util.Properties prop = new java.util.Properties(); - try - { - prop.load( new BufferedInputStream( new NoLocalizeFilter( new FileInputStream( filename ) ) ) ); - } - catch( IOException e ) - { - System.err.println("ERROR: Can't read file '"+filename+"'!!!"); - } - return prop; - } - private void parseArguments( String[] args ) - { - - if( args.length == 0 ) - { - System.out.println("ERROR: No args???"); - help(); - System.exit( -1 ); - } - for( int x = 0; x < args.length ; x++ ) - { - if( args[ x ].equalsIgnoreCase("-i") ) - { - // Input resource file - inputFileArg = getSimpleArg( args , x ); - } - else if( args[ x ].equalsIgnoreCase("-o") ) - { - // Output sdf file - outputFileArg = getSimpleArg( args , x ); - } - else if( args[ x ].equalsIgnoreCase("-x") ) - { - // path prefix - pathPrefixArg = getSimpleArg( args , x ); - } - else if( args[ x ].equalsIgnoreCase("-y") ) - { - // path postfix - pathPostfixArg = getSimpleArg( args , x ); - } - else if( args[ x ].equalsIgnoreCase("-p") ) - { - // project - projectArg = getSimpleArg( args , x ); - } - else if( args[ x ].equalsIgnoreCase("-r") ) - { - // root - rootArg = getSimpleArg( args , x ); - rootArg = makeAbs( rootArg ); - } - else if( args[ x ].equalsIgnoreCase("-lf") ) - { - // forced langs - forcedLangsArg = getComplexArg( args , x ); - } - else if( args[ x ].equalsIgnoreCase("-l") ) - { - // langs - langsArg = getComplexArg( args , x ); - } - else if( args[ x ].equalsIgnoreCase("-m") ) - { - // input sdf file - inputSdfFileArg = getSimpleArg( args , x ); - } - else if( args[ x ].equalsIgnoreCase("-qq") ) - { - isQuiet = true; - } - } - } - private String makeAbs( String path ) - { - File file; - try - { - file = new File( path ); - return file.getCanonicalPath(); - }catch( IOException e ) - { - e.printStackTrace(); - System.exit( -1 ); - } - return null; - } - private boolean testArguments() - { - // nice merge - if( inputSdfFileArg != null && inputSdfFileArg.length()>0 ) - // nice merge - return projectArg != null && rootArg != null && inputFileArg != null && pathPrefixArg != null && pathPostfixArg != null && langsArg != null && - projectArg.length()>0 && rootArg.length()>0 && inputFileArg.length()>0 && pathPrefixArg.length()>0 && pathPostfixArg.length()>0 && langsArg.size()>0 ; - else - // nice extract - return projectArg != null && rootArg != null && inputFileArg != null && outputFileArg != null && langsArg != null && - projectArg.length()>0 && rootArg.length()>0 && inputFileArg.length()>0 && outputFileArg.length()>0 && langsArg.size()>0; - } - -} diff --git a/transex3/java/jpropex/java/Main.java b/transex3/java/jpropex/java/Main.java deleted file mode 100644 index 23dc477ddec3..000000000000 --- a/transex3/java/jpropex/java/Main.java +++ /dev/null @@ -1,38 +0,0 @@ -/************************************************************************* - * - * 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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - - -class Main -{ - - public static void main( String args[] ) - { - JPropEx jpropex = new JPropEx( args ); - //jpropex.init(); - } -} - diff --git a/transex3/java/jpropex/java/NoLocalizeFilter.java b/transex3/java/jpropex/java/NoLocalizeFilter.java deleted file mode 100644 index c1e62fc951a8..000000000000 --- a/transex3/java/jpropex/java/NoLocalizeFilter.java +++ /dev/null @@ -1,55 +0,0 @@ -/************************************************************************* - * - * 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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - - -import java.io.*; -import java.util.regex.*; - -// exit if the sequence x-no-localize is found in stream! -public class NoLocalizeFilter extends FilterInputStream -{ - InputStream in; -// Pattern p = Pattern.compile("[\\s]*#[\\s]*x-no-translate"); - - public NoLocalizeFilter( InputStream in ) { - super(in); - this.in = in; - } - public int read(byte[] b, int off, int len) throws IOException - { - String search = new String( b ); -// Matcher m = p.matcher( search ); - if( search.contains("x-no-translate" ) ) // TODO: fixme! - { -// System.out.println("found x-no-translate"); - in.close(); - close(); - System.exit( 0 ); - } - return in.read( b , off , len ); - } -} diff --git a/transex3/java/jpropex/java/OrderedHashMap.java b/transex3/java/jpropex/java/OrderedHashMap.java deleted file mode 100644 index a462d598b307..000000000000 --- a/transex3/java/jpropex/java/OrderedHashMap.java +++ /dev/null @@ -1,96 +0,0 @@ -/************************************************************************* - * - * 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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - - -import java.util.*; - -// LinkedHashMap implrementation -public class OrderedHashMap -{ - private HashMap hm = new HashMap(); - private LinkedList list = new LinkedList(); - - public Iterator iterator() { return list.iterator(); } - - public boolean isEmpty() { return hm.isEmpty(); } - public Object get( Object key ) { return hm.get( key ); } - public Object get( int index ) { return hm.get( list.get( index ) ); } - public Iterator keys() { return list.iterator(); } - public Object add( Object key , Object value ) - { - list.add( key ); - return hm.put( key, value ); - } - public Object add( int index , Object key , Object value ) - { - list.add( index , key ); - return hm.put( key, value ); - } - public Object remove( Object key ) - { - list.remove( list.indexOf( key ) ); - return hm.remove( key ); - } - public void move( int idxFrom , int idxTo ) - { - Object key = list.get( idxFrom ); - list.remove( idxFrom ); - list.add( idxTo , key ); - } - public void move( Object key , int idxTo ) - { - move( list.indexOf( key ) , idxTo ); - } - public int size() - { - return hm.size(); - } - public Enumeration elements() - { - return new OHMenum( this ); - } -} - -final class OHMenum implements Enumeration -{ - OrderedHashMap ohm; - int index = 0; - - private OHMenum(){}; - public OHMenum( OrderedHashMap ohm ){ - this.ohm = ohm ; - } - - public boolean hasMoreElements() - { - return index < ohm.size(); - } - public Object nextElement() - { - return ohm.get( index++ ); - } -} diff --git a/transex3/java/jpropex/java/SdfData.java b/transex3/java/jpropex/java/SdfData.java deleted file mode 100644 index 60f218c0ae15..000000000000 --- a/transex3/java/jpropex/java/SdfData.java +++ /dev/null @@ -1,108 +0,0 @@ -/************************************************************************* - * - * 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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - - -import java.util.*; -import java.io.*; - -public class SdfData -{ - private String filename; - private OrderedHashMap ohm; - private LinkedHashSet languagesFound; - - public SdfData() - { - languagesFound = new LinkedHashSet(); - ohm = new OrderedHashMap(); - languagesFound = new LinkedHashSet(); - } - public SdfData( String filename ){ - this(); - this.filename = filename; - } - - public LinkedHashSet getLanguages() - { - return languagesFound; - } - public SdfEntity get( SdfEntity obj ) - { - return (SdfEntity) ohm.get( (String)obj.getId() ); - } - public SdfEntity get( String key ){ - return (SdfEntity) ohm.get( key ); - } - public void add( SdfEntity obj ) - { - ohm.add( obj.getId() , obj ); - } - - public void read() - { - BufferedReader in; - try - { - in = new BufferedReader( new FileReader( filename ) ); - SdfEntity entity; - while( in.ready() ) - { - String line = in.readLine(); - if( line.length() > 0 ) - { - entity = new SdfEntity( line ); - ohm.add( entity.getId() , entity ); // test if is valid - languagesFound.add( entity.getLangid() ); - } - } - in.close(); - } - catch( IOException e ) - { - System.out.println("Error: reading file " + filename); - System.exit( -1 ); - } - } - public void write( String filename ) - { - FileWriter out; - try - { - out = new FileWriter( filename , true ); // Always append - for( Enumeration e = ohm.elements(); e.hasMoreElements(); ) - { - out.write( ( (SdfEntity) e.nextElement() ).toString() + "\n" ); - } - out.close(); - } - catch( IOException e ) - { - System.out.println("Error: Can't write to file " + filename); - System.exit( -1 ); - } - } -} diff --git a/transex3/java/jpropex/java/SdfEntity.java b/transex3/java/jpropex/java/SdfEntity.java deleted file mode 100644 index e2c1606ee7c2..000000000000 --- a/transex3/java/jpropex/java/SdfEntity.java +++ /dev/null @@ -1,254 +0,0 @@ -/************************************************************************* - * - * 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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - - -public class SdfEntity implements Cloneable{ - private String project = new String(""); - private String source_file = new String(""); - private String dummy1 = new String(""); - private String resource_type= new String(""); - private String gid = new String(""); - private String lid = new String(""); - private String helpid = new String(""); - private String platform = new String(""); - private String dummy2 = new String(""); - private String langid = new String(""); - private String text = new String(""); - private String helptext = new String(""); - private String quickhelptext= new String(""); - private String title = new String(""); - private String date = new String(""); - - public static int PROJECT_POS = 0; - public static int SOURCE_FILE_POS = 1; - public static int DUMMY1_POS = 2; - public static int RESOURCE_TYPE_POS = 3; - public static int GID_POS = 4; - public static int LID_POS = 5; - public static int HELPID_POS = 6; - public static int PLATFORM_POS = 7; - public static int DUMMY2_POS = 8; - public static int LANGID_POS = 9; - public static int TEXT_POS = 10; - public static int HELPTEXT_POS = 11; - public static int QUICKHELPTEXT_POS = 12; - public static int TITLE_POS = 13; - public static int DATE_POS = 14; - - public Object clone() - { - try - { - return super.clone(); - } - catch( CloneNotSupportedException e ) - { - System.out.println("ERROR: Can not clone, soemthing is broken here ...."); - System.exit( -1 ); - } - return null; // dummy - } - - public SdfEntity( String line ){ - // isValid? - setProperties( line ) ; - } - public SdfEntity(String project, String source_file, String dummy1, String resource_type, String gid, String lid, String helpid, String platform, String dummy2, String langid, String text, String helptext, String quickhelptext, String title , String date) { - super(); - this.project = project; - this.source_file = source_file; - this.dummy1 = dummy1; - this.resource_type = resource_type; - this.gid = gid; - this.lid = lid; - this.helpid = helpid; - this.platform = platform; - this.dummy2 = dummy2; - this.langid = langid; - this.text = text; - this.helptext = helptext; - this.quickhelptext = quickhelptext; - this.title = title; - this.date = date; - } - - public void setProperties( String line ){ - - String[] splitted = line.split("\t"); - - setProject( splitted[ SdfEntity.PROJECT_POS ] ); - setSource_file( splitted[ SdfEntity.SOURCE_FILE_POS ] ); - setDummy1( splitted[ SdfEntity.DUMMY1_POS ] ); - setResource_type( splitted[ SdfEntity.RESOURCE_TYPE_POS ] ); - setGid( splitted[ SdfEntity.GID_POS ] ); - setLid( splitted[ SdfEntity.LID_POS ] ); - setHelpid( splitted[ SdfEntity.HELPID_POS ] ); - setPlatform( splitted[ SdfEntity.PLATFORM_POS ] ); - setDummy2( splitted[ SdfEntity.DUMMY2_POS ] ); - setLangid( splitted[ SdfEntity.LANGID_POS ] ); - setText( splitted[ SdfEntity.TEXT_POS ] ); - setHelptext( splitted[ SdfEntity.HELPTEXT_POS ] ); - setQuickhelptext( splitted[ SdfEntity.QUICKHELPTEXT_POS ] ); - setTitle( splitted[ SdfEntity.TITLE_POS ] ); - setDate( splitted[ SdfEntity.DATE_POS ] ); - } - - public String getFileId(){ - return project+"\\"+source_file; - } - public String getResourcePath(){ - return source_file.substring(0 , source_file.lastIndexOf( "\\" )-1 ); - } - public String toString(){ - return project+"\t"+source_file+"\t"+dummy1+"\t"+resource_type+"\t"+gid+"\t" - +lid+"\t"+helpid+"\t"+platform+"\t"+dummy2+"\t"+langid+"\t" - +text+"\t"+helptext+"\t"+quickhelptext+"\t"+title+"\t"+date; - } - public String getId(){ - return project+gid+lid+source_file+resource_type+platform+helpid; - } - - public String getDummy1() { - return dummy1; - } - - public void setDummy1(String dummy1) { - this.dummy1 = dummy1; - } - - public String getPlatform() { - return platform; - } - - public void setPlatform(String platform) { - this.platform = platform; - } - - public String getDummy2() { - return dummy2; - } - - public void setDummy2(String dummy2) { - this.dummy2 = dummy2; - } - - public String getGid() { - return gid; - } - - public void setGid(String gid) { - this.gid = gid; - } - - public String getHelpid() { - return helpid; - } - - public void setHelpid(String helpid) { - this.helpid = helpid; - } - - public String getHelptext() { - return helptext; - } - - public void setHelptext(String helptext) { - this.helptext = helptext; - } - - public String getLangid() { - return langid; - } - - public void setLangid(String langid) { - this.langid = langid; - } - - public String getLid() { - return lid; - } - - public void setLid(String lid) { - this.lid = lid; - } - - public String getProject() { - return project; - } - - public void setProject(String project) { - this.project = project; - } - - public String getQuickhelptext() { - return quickhelptext; - } - - public void setQuickhelptext(String quickhelptext) { - this.quickhelptext = quickhelptext; - } - - public String getResource_type() { - return resource_type; - } - - public void setResource_type(String resource_type) { - this.resource_type = resource_type; - } - - public String getSource_file() { - return source_file; - } - - public void setSource_file(String source_file) { - this.source_file = source_file; - } - - public String getText() { - return text; - } - - public void setText(String text) { - this.text = text; - } - - public String getTitle() { - return title; - } - - public void setTitle(String title) { - this.title = title; - } - public String getDate() { - return date; - } - public void setDate(String date) { - this.date = date; - } - - -} diff --git a/transex3/java/jpropex/jpropex b/transex3/java/jpropex/jpropex deleted file mode 100755 index 2d62d13b093e..000000000000 --- a/transex3/java/jpropex/jpropex +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/sh -if [ x${SOLARENV}x = xx ]; then - echo No environment found, please use 'configure' or 'setsolar' - exit 1 -fi -if [ x${JAVA_HOME}x = xx ]; then - echo No Java found! - exit 1 -fi -exec java -DSOLARSRC=${SOLARSRC} -DWORK_STAMP=${WORK_STAMP} -DUSE_SHELL= -jar ${SOLARVER}/${INPATH}/bin${UPDMINOREXT}/jpropex.jar "$@" diff --git a/transex3/java/jpropex/jpropex.MF b/transex3/java/jpropex/jpropex.MF deleted file mode 100755 index 3e22e7e9bfbf..000000000000 --- a/transex3/java/jpropex/jpropex.MF +++ /dev/null @@ -1 +0,0 @@ -Main-Class: Main diff --git a/transex3/java/jpropex/makefile.mk b/transex3/java/jpropex/makefile.mk deleted file mode 100755 index f86d2c830025..000000000000 --- a/transex3/java/jpropex/makefile.mk +++ /dev/null @@ -1,36 +0,0 @@ -#************************************************************************* -# -# 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 -# -# for a copy of the LGPLv3 License. -# -#************************************************************************* - - -PRJ=../.. -PRJNAME=transex3 -TARGET=jpropex - -.INCLUDE : ant.mk - -ALLTAR : ANTBUILD - -- cgit v1.2.3 From 5ddf16d8358a38c0098d3060dcee90c518f0dd85 Mon Sep 17 00:00:00 2001 From: Ivo Hinkelmann Date: Thu, 22 Jul 2010 17:13:19 +0200 Subject: txtl10n: #i113008# #i113125# cleanup / removed unused lines --- l10ntools/scripts/xhtex | 8 -------- l10ntools/scripts/xtxex | 8 -------- 2 files changed, 16 deletions(-) diff --git a/l10ntools/scripts/xhtex b/l10ntools/scripts/xhtex index e6f7cf9f2003..659cd06e16d4 100755 --- a/l10ntools/scripts/xhtex +++ b/l10ntools/scripts/xhtex @@ -31,14 +31,6 @@ if [ x${SOLARENV}x = xx ]; then exit 1 fi -# localize.pl calls localize_sl in solver bin directory which depends on dynamic -# libraries in solver lib directory but has no correct RPATH (or equivalent): -if [ "${OS?}" = MACOSX ]; then - export DYLD_LIBRARY_PATH=${DYLD_LIBRARY_PATH+${DYLD_LIBRARY_PATH}:}${SOLARVERSION?}/${INPATH?}/lib${UPDMINOREXT} -else - export LD_LIBRARY_PATH=${LD_LIBRARY_PATH+${LD_LIBRARY_PATH}:}${SOLARVERSION?}/${INPATH?}/lib${UPDMINOREXT} -fi - if [ x${SOLARVER}x = xx -o x${UPDMINOREXT}x = xx ]; then exec python $SOLARVERSION/$INPATH/bin/xhtex.py "$@" else diff --git a/l10ntools/scripts/xtxex b/l10ntools/scripts/xtxex index cc9dac01fca2..28529506e3a2 100755 --- a/l10ntools/scripts/xtxex +++ b/l10ntools/scripts/xtxex @@ -31,14 +31,6 @@ if [ x${SOLARENV}x = xx ]; then exit 1 fi -# localize.pl calls localize_sl in solver bin directory which depends on dynamic -# libraries in solver lib directory but has no correct RPATH (or equivalent): -if [ "${OS?}" = MACOSX ]; then - export DYLD_LIBRARY_PATH=${DYLD_LIBRARY_PATH+${DYLD_LIBRARY_PATH}:}${SOLARVERSION?}/${INPATH?}/lib${UPDMINOREXT} -else - export LD_LIBRARY_PATH=${LD_LIBRARY_PATH+${LD_LIBRARY_PATH}:}${SOLARVERSION?}/${INPATH?}/lib${UPDMINOREXT} -fi - if [ x${SOLARVER}x = xx -o x${UPDMINOREXT}x = xx ]; then exec python $SOLARVERSION/$INPATH/bin/xtxex.py "$@" else -- cgit v1.2.3 From 6ea3c24201b2d4255306f6e745e242567f3bbb8c Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Thu, 22 Jul 2010 17:19:16 +0200 Subject: ooo33gsl03: #i113333# work around a double pointer grab --- vcl/unx/source/dtrans/X11_selection.cxx | 55 +++++++++++++++++++++++++++++++-- 1 file changed, 53 insertions(+), 2 deletions(-) diff --git a/vcl/unx/source/dtrans/X11_selection.cxx b/vcl/unx/source/dtrans/X11_selection.cxx index 7f205407b21b..4bb24e03917b 100644 --- a/vcl/unx/source/dtrans/X11_selection.cxx +++ b/vcl/unx/source/dtrans/X11_selection.cxx @@ -28,15 +28,17 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_vcl.hxx" +#include "saldisp.hxx" +#include "saldata.hxx" + #include #include #include #include + #include "tools/prex.h" #include #include -#include -#include #include #include "tools/postx.h" #if defined(LINUX) || defined(NETBSD) || defined (FREEBSD) @@ -3259,6 +3261,8 @@ void SelectionManager::startDrag( return; } + SalFrame* pCaptureFrame = NULL; + { ClearableMutexGuard aGuard(m_aMutex); @@ -3327,6 +3331,32 @@ void SelectionManager::startDrag( None, None, CurrentTime ); + /* if we could not grab the pointer here, there is a chance + that the pointer is grabbed by the other vcl display (the main loop) + so let's break that grab an reset it later + + remark: this whole code should really be molten into normal vcl so only + one display is used .... + */ + if( nPointerGrabSuccess != GrabSuccess ) + { + vos::IMutex& rSolarMutex( Application::GetSolarMutex() ); + if( rSolarMutex.tryToAcquire() ) + { + pCaptureFrame = GetX11SalData()->GetDisplay()->GetCaptureFrame(); + if( pCaptureFrame ) + { + GetX11SalData()->GetDisplay()->CaptureMouse( NULL ); + nPointerGrabSuccess = + XGrabPointer( m_pDisplay, it->second.m_aRootWindow, True, + DRAG_EVENT_MASK, + GrabModeAsync, GrabModeAsync, + None, + None, + CurrentTime ); + } + } + } #if OSL_DEBUG_LEVEL > 1 fprintf( stderr, "%d\n", nPointerGrabSuccess ); #endif @@ -3349,6 +3379,16 @@ void SelectionManager::startDrag( aGuard.clear(); if( listener.is() ) listener->dragDropEnd( aDragFailedEvent ); + if( pCaptureFrame ) + { + vos::IMutex& rSolarMutex( Application::GetSolarMutex() ); + if( rSolarMutex.tryToAcquire() ) + GetX11SalData()->GetDisplay()->CaptureMouse( pCaptureFrame ); +#if OSL_DEBUG_LEVEL > 0 + else + OSL_ENSURE( 0, "failed to acquire SolarMutex to reset capture frame" ); +#endif + } return; } @@ -3428,6 +3468,17 @@ void SelectionManager::startDrag( XUngrabKeyboard( m_pDisplay, CurrentTime ); XFlush( m_pDisplay ); + if( pCaptureFrame ) + { + vos::IMutex& rSolarMutex( Application::GetSolarMutex() ); + if( rSolarMutex.tryToAcquire() ) + GetX11SalData()->GetDisplay()->CaptureMouse( pCaptureFrame ); +#if OSL_DEBUG_LEVEL > 0 + else + OSL_ENSURE( 0, "failed to acquire SolarMutex to reset capture frame" ); +#endif + } + m_aDragRunning.reset(); if( listener.is() ) -- cgit v1.2.3 From 3a7826b9ff0ddcfc9032c5ef707f754ae4abd3d2 Mon Sep 17 00:00:00 2001 From: Ivo Hinkelmann Date: Thu, 22 Jul 2010 17:53:11 +0200 Subject: txtl10n: cleanup / remove all -QQ and quiet parts --- l10ntools/inc/lngmerge.hxx | 2 +- l10ntools/source/cfglex.l | 1 - l10ntools/source/cfgmerge.cxx | 9 --------- l10ntools/source/export.cxx | 11 ----------- l10ntools/source/helpex.cxx | 8 +------- l10ntools/source/lngex.cxx | 10 +--------- l10ntools/source/lngmerge.cxx | 5 ++--- l10ntools/source/localize.cxx | 38 +++++++++----------------------------- l10ntools/source/xrmmerge.cxx | 9 --------- 9 files changed, 14 insertions(+), 79 deletions(-) diff --git a/l10ntools/inc/lngmerge.hxx b/l10ntools/inc/lngmerge.hxx index 923da89988b6..843d1a6de3d2 100644 --- a/l10ntools/inc/lngmerge.hxx +++ b/l10ntools/inc/lngmerge.hxx @@ -58,7 +58,7 @@ private: const ByteString &rPrj , const ByteString &rRoot , const ByteString &sActFileName , const ByteString &sID ); public: - LngParser( const ByteString &rLngFile, BOOL bUTF8, BOOL bULFFormat, bool bQuiet_in ); + LngParser( const ByteString &rLngFile, BOOL bUTF8, BOOL bULFFormat ); ~LngParser(); BOOL CreateSDF( const ByteString &rSDFFile, const ByteString &rPrj, const ByteString &rRoot ); diff --git a/l10ntools/source/cfglex.l b/l10ntools/source/cfglex.l index d1b076d493b9..3fc3aa5b965c 100644 --- a/l10ntools/source/cfglex.l +++ b/l10ntools/source/cfglex.l @@ -177,7 +177,6 @@ main( int argc, char* argv[]) fprintf( stdout, " FileIn: Source files (*.src)\n" ); fprintf( stdout, " FileOut: Destination file (*.*)\n" ); fprintf( stdout, " DataBase: Mergedata (*.sdf)\n" ); - fprintf( stdout, " -QQ: quiet output\n" ); fprintf( stdout, " -e: Disable writing errorlog\n" ); fprintf( stdout, " -b: Break when Token \"HelpText\" found in source\n" ); fprintf( stdout, " -u: [english] and [german] are allowed, Id is Taken from DataBase \n" ); diff --git a/l10ntools/source/cfgmerge.cxx b/l10ntools/source/cfgmerge.cxx index 3e421d2d1046..e8feee1fe3c8 100644 --- a/l10ntools/source/cfgmerge.cxx +++ b/l10ntools/source/cfgmerge.cxx @@ -59,7 +59,6 @@ BOOL bMergeMode; BOOL bErrorLog; BOOL bForce; BOOL bUTF8; -bool bQuiet; ByteString sPrj; ByteString sPrjRoot; ByteString sInputFileName; @@ -83,7 +82,6 @@ extern char *GetOutputFile( int argc, char* argv[]) bErrorLog = TRUE; bForce = FALSE; bUTF8 = TRUE; - bQuiet = false; sPrj = ""; sPrjRoot = ""; sInputFileName = ""; @@ -128,9 +126,6 @@ extern char *GetOutputFile( int argc, char* argv[]) nState = STATE_FORCE; bForce = TRUE; } - else if ( sSwitch == "-QQ" ) { - bQuiet = true; - } else if ( sSwitch == "-L" ) { nState = STATE_LANGUAGES; } @@ -184,10 +179,6 @@ extern char *GetOutputFile( int argc, char* argv[]) // command line is not valid return NULL; } -int isQuiet(){ - if( bQuiet ) return 1; - else return 0; -} /*****************************************************************************/ int InitCfgExport( char *pOutput , char* pFilename ) /*****************************************************************************/ diff --git a/l10ntools/source/export.cxx b/l10ntools/source/export.cxx index 589c962c112c..d6c7a9533309 100644 --- a/l10ntools/source/export.cxx +++ b/l10ntools/source/export.cxx @@ -62,7 +62,6 @@ BOOL bErrorLog; BOOL bBreakWhenHelpText; BOOL bUnmerge; BOOL bUTF8; -bool bQuiet; ByteString sPrj; ByteString sPrjRoot; ByteString sActFileName; @@ -98,7 +97,6 @@ extern char *GetOutputFile( int argc, char* argv[]) Export::sForcedLanguages = ""; sTempFile = ""; pTempFile = NULL; - bQuiet = false; USHORT nState = STATE_NON; BOOL bInput = FALSE; @@ -115,9 +113,6 @@ extern char *GetOutputFile( int argc, char* argv[]) else if (sSwitch == "-p" || sSwitch == "-P" ) { nState = STATE_PRJ; // next token specifies the cur. project } - else if (sSwitch == "-qq" || sSwitch == "-QQ" ) { - bQuiet = true; - } else if (sSwitch == "-r" || sSwitch == "-R" ) { nState = STATE_ROOT; // next token specifies path to project root @@ -196,12 +191,6 @@ extern char *GetOutputFile( int argc, char* argv[]) return NULL; } /*****************************************************************************/ -int isQuiet(){ -/*****************************************************************************/ - if( bQuiet ) return 1; - else return 0; -} -/*****************************************************************************/ int InitExport( char *pOutput , char* pFilename ) /*****************************************************************************/ { diff --git a/l10ntools/source/helpex.cxx b/l10ntools/source/helpex.cxx index 49a59266a85d..15239db5d9bd 100644 --- a/l10ntools/source/helpex.cxx +++ b/l10ntools/source/helpex.cxx @@ -61,7 +61,6 @@ ByteString sOutputFile; ByteString sOutputFileX; ByteString sOutputFileY; ByteString sSDFFile; -bool bQuiet; /*****************************************************************************/ BOOL ParseCommandLine( int argc, char* argv[]) @@ -73,7 +72,6 @@ BOOL ParseCommandLine( int argc, char* argv[]) bUTF8 = TRUE; sPrj = ""; sPrjRoot = ""; - bQuiet = false; Export::sLanguages = ""; Export::sForcedLanguages = ""; @@ -111,9 +109,6 @@ BOOL ParseCommandLine( int argc, char* argv[]) nState = STATE_ERRORLOG; bErrorLog = FALSE; } - else if ( ByteString( argv[ i ] ).ToUpperAscii() == "-QQ" ) { - bQuiet = true; - } else if ( ByteString( argv[ i ]).ToUpperAscii() == "-UTF8" ) { nState = STATE_UTF8; bUTF8 = TRUE; @@ -188,13 +183,12 @@ BOOL ParseCommandLine( int argc, char* argv[]) void Help() /*****************************************************************************/ { - fprintf( stdout, "Syntax: HELPEX[-p Prj][-r PrjRoot]-i FileIn ( -o FileOut | -x path -y relfile )[-m DataBase][-e][-b][-u][-L l1,l2,...][-QQ] -LF l1,l2 \n" ); + fprintf( stdout, "Syntax: HELPEX[-p Prj][-r PrjRoot]-i FileIn ( -o FileOut | -x path -y relfile )[-m DataBase][-e][-b][-u][-L l1,l2,...] -LF l1,l2 \n" ); fprintf( stdout, " Prj: Project\n" ); fprintf( stdout, " PrjRoot: Path to project root (..\\.. etc.)\n" ); fprintf( stdout, " FileIn: Source file (*.lng)\n" ); fprintf( stdout, " FileOut: Destination file (*.*)\n" ); fprintf( stdout, " DataBase: Mergedata (*.sdf)\n" ); - fprintf( stdout, " -QQ: quiet output\n" ); fprintf( stdout, " -L: Restrict the handled languages. l1,l2,... are elements of (en-US,fr,de...)\n" ); fprintf( stdout, " A fallback language can be defined like this: l1=f1.\n" ); fprintf( stdout, " f1, f2,... are also elements of (en-US,fr,de...)\n" ); diff --git a/l10ntools/source/lngex.cxx b/l10ntools/source/lngex.cxx index 27136dc8797f..4ec069a810f5 100644 --- a/l10ntools/source/lngex.cxx +++ b/l10ntools/source/lngex.cxx @@ -53,7 +53,6 @@ BOOL bMergeMode; BOOL bErrorLog; BOOL bUTF8; BOOL bULF; // ULF = Unicode Language File -bool bQuiet; ByteString sPrj; ByteString sPrjRoot; ByteString sOutputFile; @@ -68,7 +67,6 @@ BOOL ParseCommandLine( int argc, char* argv[]) bErrorLog = TRUE; bUTF8 = TRUE; bULF = FALSE; - bQuiet = false; sPrj = ""; sPrjRoot = ""; Export::sLanguages = ""; @@ -92,9 +90,6 @@ BOOL ParseCommandLine( int argc, char* argv[]) else if ( sSwitch == "-R" ) { nState = STATE_ROOT; // next token specifies path to project root } - else if ( sSwitch == "-QQ" ) { - bQuiet = true; - } else if ( sSwitch == "-M" ) { nState = STATE_MERGESRC; // next token specifies the merge database } @@ -176,9 +171,6 @@ void Help() fprintf( stdout, " FileIn: Source file (*.lng)\n" ); fprintf( stdout, " FileOut: Destination file (*.*)\n" ); fprintf( stdout, " DataBase: Mergedata (*.sdf)\n" ); - fprintf( stdout, " -QQ: quite output\n" ); - //fprintf( stdout, " -NOUTF8: disable UTF8 as language independent encoding\n" ); - //fprintf( stdout, " -ULF: enables Unicode Language File format, leads to UTF8 encoded version of lng files" ); fprintf( stdout, " -L: Restrict the handled languages. l1,l2,... are elements of (de,en-US...)\n" ); fprintf( stdout, " A fallback language can be defined like this: l1=f1.\n" ); fprintf( stdout, " f1, f2,... are also elements of (de,en-US...)\n" ); @@ -202,7 +194,7 @@ int _cdecl main( int argc, char *argv[] ) fflush( stdout ); if ( sOutputFile.Len()) { - LngParser aParser( sInputFile, bUTF8, bULF , bQuiet ); + LngParser aParser( sInputFile, bUTF8, bULF ); if ( bMergeMode ) aParser.Merge( sMergeSrc, sOutputFile , sPrj ); else diff --git a/l10ntools/source/lngmerge.cxx b/l10ntools/source/lngmerge.cxx index 5f40a4346f53..f0093bbccea7 100644 --- a/l10ntools/source/lngmerge.cxx +++ b/l10ntools/source/lngmerge.cxx @@ -38,15 +38,14 @@ using namespace std; // class LngParser // /*****************************************************************************/ -LngParser::LngParser( const ByteString &rLngFile, BOOL bUTF8, BOOL bULFFormat , bool bQuiet_in ) +LngParser::LngParser( const ByteString &rLngFile, BOOL bUTF8, BOOL bULFFormat ) /*****************************************************************************/ : nError( LNG_OK ), pLines( NULL ), sSource( rLngFile ), bDBIsUTF8( bUTF8 ), - bULF( bULFFormat ), - bQuiet( bQuiet_in ) + bULF( bULFFormat ) { pLines = new LngLineList( 100, 100 ); DirEntry aEntry( String( sSource, RTL_TEXTENCODING_ASCII_US )); diff --git a/l10ntools/source/localize.cxx b/l10ntools/source/localize.cxx index 853dcc97dc3e..bbc27dc229e7 100644 --- a/l10ntools/source/localize.cxx +++ b/l10ntools/source/localize.cxx @@ -134,7 +134,6 @@ private: ByteString sLanguageRestriction; ByteString sOutputFile; - bool bQuiet2; int nFileCnt; @@ -167,7 +166,7 @@ private: ); public: - SourceTreeLocalizer( const ByteString &rRoot, const ByteString &rVersion , bool bLocal , bool bQuiet2_in , bool skip_links ); + SourceTreeLocalizer( const ByteString &rRoot, const ByteString &rVersion , bool bLocal , bool skip_links ); ~SourceTreeLocalizer(); ByteString getSourceLanguages( ByteString sLanguageRestriction , ByteString sCommand ); @@ -183,11 +182,10 @@ public: /*****************************************************************************/ SourceTreeLocalizer::SourceTreeLocalizer( - const ByteString &rRoot, const ByteString &rVersion, bool bLocal_in , bool bQuiet2_in , bool skip_links ) + const ByteString &rRoot, const ByteString &rVersion, bool bLocal_in , bool skip_links ) /*****************************************************************************/ : SourceTreeIterator( rRoot, rVersion , bLocal_in ), nMode( LOCALIZE_NONE ), - bQuiet2( bQuiet2_in ), nFileCnt( 0 ) { bSkipLinks = skip_links ; @@ -323,9 +321,6 @@ void SourceTreeLocalizer::WorkOnFile( sCommand += getSourceLanguages( sLanguageRestriction , sCommand ); } - if( bQuiet2 ){ - //sCommand +=" -QQ "; - } //printf("DBG: %s\n",sCommand.GetBuffer()); if (system(sCommand.GetBuffer()) == -1) fprintf(stderr, "%s failed\n", sCommand.GetBuffer()); @@ -485,7 +480,6 @@ void SourceTreeLocalizer::OnExecuteDirectory( const rtl::OUString &aDirectory ) { ByteString rDirectory( rtl::OUStringToOString( aDirectory , RTL_TEXTENCODING_UTF8 , aDirectory.getLength() ) ) ; if ( nMode == LOCALIZE_NONE ){ - if( !bQuiet2 ) fprintf( stdout, "%s\n", rDirectory.GetBuffer()); } else WorkOnDirectory( rDirectory ); @@ -541,7 +535,6 @@ BOOL SourceTreeLocalizer::MergeSingleFile( ByteString sFile( aEntry.GetFull(), RTL_TEXTENCODING_ASCII_US ); ByteString sBCur( aEntry.GetFull(), RTL_TEXTENCODING_ASCII_US ); - if( !bQuiet2 ) fprintf( stdout, "##### %s #####\n", sBCur.GetBuffer()); ULONG nIndex = 0; ByteString sExtension( aEntry.GetExtension(), RTL_TEXTENCODING_ASCII_US ); @@ -589,9 +582,6 @@ BOOL SourceTreeLocalizer::MergeSingleFile( sCommand += " -l "; sCommand += sLanguageRestriction; } - if( bQuiet2 ){ - sCommand +=" -QQ "; - } DirEntry aPath( aEntry.GetPath()); DirEntry aOldCWD; @@ -601,7 +591,6 @@ BOOL SourceTreeLocalizer::MergeSingleFile( fprintf(stderr, "%s failed\n", sCommand.GetBuffer()); nFileCnt++; printf("."); - //if( bQuiet2 ){ printf("."); } SvFileStream aInStream( aOut.GetFull(), STREAM_READ ); if ( !aInStream.IsOpen()) { fprintf( stderr, @@ -792,12 +781,11 @@ void Help() fprintf( stdout, "As part of the L10N framework, localize extracts and merges translations\n" "out of and into the whole source tree.\n\n" - "Syntax: localize -e -l en-US -f FileName [-QQ]\n" + "Syntax: localize -e -l en-US -f FileName \n" "Parameter:\n" "\t-e: Extract mode\n" "\tFileName: Output file when extract mode, input file when merge mode\n" "\tl1...ln: supported languages (\"all\" for all languages).\n" - "\tQQ: quiet output)" ); fprintf( stdout, @@ -840,15 +828,12 @@ int _cdecl main( int argc, char *argv[] ) BOOL bExport = FALSE; BOOL bMerge = FALSE; - bool bQuiet = false; - bool bQuiet2 = false; bool bSkipLinks = false; ByteString sLanguages; ByteString sFileName; ByteString sOutput; - bQuiet2 = true; bExport = TRUE; for( int i = 1; i < argc; i++ ) { @@ -861,17 +846,12 @@ int _cdecl main( int argc, char *argv[] ) return Error(); bExport = TRUE; } - else if( sSwitch.Equals( "-Q" )) { - bQuiet = true; - } else if ( sSwitch.Equals( "-I" ) ) nState = STATE_ISOCODE; else if ( sSwitch.Equals( "-L" ) ) nState = STATE_LANGUAGES; else if ( sSwitch.Equals( "-F" ) ) nState = STATE_FILENAME; - else if ( sSwitch.Equals( "-QQ" )) - bQuiet2 = true; else if ( ByteString( argv[ i ]).ToUpperAscii().Equals( "-O" ) ) nState = STATE_OUTPUT; else { @@ -954,10 +934,10 @@ int _cdecl main( int argc, char *argv[] ) else curRepository = string( Export::GetEnv("SOURCE_ROOT_DIR") ) + "/" + *iter; cout << "Localizing repository " << curRepository << "\n"; - SourceTreeLocalizer aIter( ByteString( curRepository.c_str() ) , sVersion , (sOutput.Len() > 0) , bQuiet2 , bSkipLinks ); + SourceTreeLocalizer aIter( ByteString( curRepository.c_str() ) , sVersion , (sOutput.Len() > 0) , bSkipLinks ); aIter.SetLanguageRestriction( sLanguages ); if ( bExport ){ - if( bQuiet2 ){ /*printf("");*/fflush( stdout );} + fflush( stdout ); if( *iter == "ooo" ) aIter.Extract( sFileName ); else @@ -967,7 +947,7 @@ int _cdecl main( int argc, char *argv[] ) sFileNameWithExt += ByteString( (*iter).c_str() ); aIter.Extract( sFileNameWithExt ); } - if( bQuiet2 ){ printf("\n%d files found!\n",aIter.GetFileCnt());} + printf("\n%d files found!\n",aIter.GetFileCnt()); } } if( hasPwd ) @@ -975,12 +955,12 @@ int _cdecl main( int argc, char *argv[] ) string pwd; Export::getCurrentDir( pwd ); cout << "Localizing repository " << pwd << "\n"; - SourceTreeLocalizer aIter( ByteString( pwd.c_str() ) , sVersion , (sOutput.Len() > 0) , bQuiet2 , bSkipLinks ); + SourceTreeLocalizer aIter( ByteString( pwd.c_str() ) , sVersion , (sOutput.Len() > 0) , bSkipLinks ); aIter.SetLanguageRestriction( sLanguages ); if ( bExport ){ - if( bQuiet2 ){ /*printf("");*/fflush( stdout );} + fflush( stdout ); aIter.Extract( sFileName ); - if( bQuiet2 ){ printf("\n%d files found!\n",aIter.GetFileCnt());} + printf("\n%d files found!\n",aIter.GetFileCnt()); } } diff --git a/l10ntools/source/xrmmerge.cxx b/l10ntools/source/xrmmerge.cxx index dc3d2fe6a283..fa7fdb4b4376 100644 --- a/l10ntools/source/xrmmerge.cxx +++ b/l10ntools/source/xrmmerge.cxx @@ -61,7 +61,6 @@ BOOL bEnableExport; BOOL bMergeMode; BOOL bErrorLog; BOOL bUTF8; -bool bQuiet; ByteString sPrj; ByteString sPrjRoot; ByteString sInputFileName; @@ -87,7 +86,6 @@ extern char *GetOutputFile( int argc, char* argv[]) sInputFileName = ""; sActFileName = ""; Export::sLanguages = ""; - bQuiet = false; USHORT nState = STATE_NON; BOOL bInput = FALSE; @@ -108,9 +106,6 @@ extern char *GetOutputFile( int argc, char* argv[]) else if ( ByteString( argv[ i ] ).ToUpperAscii() == "-M" ) { nState = STATE_MERGESRC; // next token specifies the merge database } - else if ( ByteString( argv[ i ] ).ToUpperAscii() == "-QQ" ) { - bQuiet = true; - } else if ( ByteString( argv[ i ] ).ToUpperAscii() == "-E" ) { nState = STATE_ERRORLOG; bErrorLog = FALSE; @@ -199,10 +194,6 @@ int InitXrmExport( char *pOutput , char* pFilename) return 1; } -int isQuiet(){ - if( bQuiet ) return 1; - else return 0; -} /*****************************************************************************/ int EndXrmExport() /*****************************************************************************/ -- cgit v1.2.3 From 4f41cb65cb10667b61d7a919fd4abd57711747a2 Mon Sep 17 00:00:00 2001 From: sj Date: Thu, 22 Jul 2010 18:56:01 +0200 Subject: impress196: #161749# if a wmf is containing an embedded emf graphic, than this graphic is no longer lost after swapout/swapin --- svtools/source/filter.vcl/wmf/winwmf.cxx | 69 +++++++++++++++++--------------- 1 file changed, 37 insertions(+), 32 deletions(-) diff --git a/svtools/source/filter.vcl/wmf/winwmf.cxx b/svtools/source/filter.vcl/wmf/winwmf.cxx index f7c4f51ce1e2..cea1ab490b04 100644 --- a/svtools/source/filter.vcl/wmf/winwmf.cxx +++ b/svtools/source/filter.vcl/wmf/winwmf.cxx @@ -1081,6 +1081,8 @@ void WMFReader::ReadWMF() nEMFRec = 0; nEMFSize = 0; + sal_Bool bEMFAvailable = sal_False; + pOut->SetMapMode( MM_ANISOTROPIC ); pOut->SetWinOrg( Point() ); pOut->SetWinExt( Size( 1, 1 ) ); @@ -1117,50 +1119,53 @@ void WMFReader::ReadWMF() break; } - if( aBmpSaveList.Count() && - ( nFunction != W_META_STRETCHDIB ) && - ( nFunction != W_META_DIBBITBLT ) && - ( nFunction != W_META_DIBSTRETCHBLT ) ) - { - pOut->ResolveBitmapActions( aBmpSaveList ); - } - if ( !nSkipActions ) - ReadRecordParams( nFunction ); - else - nSkipActions--; - - if( pEMFStream && nEMFRecCount == nEMFRec ) + if ( !bEMFAvailable ) { - GDIMetaFile aMeta; - pEMFStream->Seek( 0 ); - EnhWMFReader* pEMFReader = new EnhWMFReader ( *pEMFStream, aMeta ); - BOOL bRead = pEMFReader->ReadEnhWMF(); - delete pEMFReader; // destroy first!!! - - if( bRead ) + if( aBmpSaveList.Count() && + ( nFunction != W_META_STRETCHDIB ) && + ( nFunction != W_META_DIBBITBLT ) && + ( nFunction != W_META_DIBSTRETCHBLT ) ) { - pOut->AddFromGDIMetaFile( aMeta ); - pOut->SetrclFrame( Rectangle(0, 0, aMeta.GetPrefSize().Width(), aMeta.GetPrefSize().Height() )); - // we have successfully read the embedded EMF data - // no need to process WMF data further - break; + pOut->ResolveBitmapActions( aBmpSaveList ); } + if ( !nSkipActions ) + ReadRecordParams( nFunction ); else + nSkipActions--; + + if( pEMFStream && nEMFRecCount == nEMFRec ) { - // something went wrong - // continue with WMF, don't try this again - delete pEMFStream; - pEMFStream = NULL; - } + GDIMetaFile aMeta; + pEMFStream->Seek( 0 ); + EnhWMFReader* pEMFReader = new EnhWMFReader ( *pEMFStream, aMeta ); + bEMFAvailable = pEMFReader->ReadEnhWMF(); + delete pEMFReader; // destroy first!!! + if( bEMFAvailable ) + { + pOut->AddFromGDIMetaFile( aMeta ); + pOut->SetrclFrame( Rectangle(0, 0, aMeta.GetPrefSize().Width(), aMeta.GetPrefSize().Height() )); + + // the stream needs to be set to the wmf end position, + // otherwise the GfxLink that is created will be incorrect + // (leading to graphic loss after swapout/swapin). + // so we will proceed normally, but are ignoring further wmf + // records + } + else + { + // something went wrong + // continue with WMF, don't try this again + delete pEMFStream; + pEMFStream = NULL; + } + } } - nPos += nRecSize * 2; if ( nPos <= nEndPos ) pWMF->Seek( nPos ); else pWMF->SetError( SVSTREAM_FILEFORMAT_ERROR ); - } } else -- cgit v1.2.3 From 37d90e1b4567aeecd23417ed700b2fd1d7d45e5b Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Thu, 22 Jul 2010 20:53:07 +0200 Subject: vcl114: #i48666# allow input of arbitrary unicode characters --- vcl/unx/inc/saldata.hxx | 2 + vcl/unx/inc/salframe.h | 4 ++ vcl/unx/source/gdi/salgdi.cxx | 15 +++-- vcl/unx/source/window/salframe.cxx | 126 ++++++++++++++++++++++++++++++++++++- 4 files changed, 140 insertions(+), 7 deletions(-) diff --git a/vcl/unx/inc/saldata.hxx b/vcl/unx/inc/saldata.hxx index 7e38e0a89bf2..939437060750 100644 --- a/vcl/unx/inc/saldata.hxx +++ b/vcl/unx/inc/saldata.hxx @@ -63,6 +63,7 @@ protected: SalDisplay *m_pSalDisplay; pthread_t hMainThread_; rtl::OUString maLocalHostName; + rtl::OUString maUnicodeAccumulator; public: X11SalData(); @@ -90,6 +91,7 @@ public: const rtl::OUString& GetLocalHostName() const { return maLocalHostName; } + rtl::OUString& GetUnicodeAccumulator() { return maUnicodeAccumulator; } static int XErrorHdl( Display*, XErrorEvent* ); static int XIOErrorHdl( Display* ); diff --git a/vcl/unx/inc/salframe.h b/vcl/unx/inc/salframe.h index 6f962c9a13b3..0aea9c3a5f53 100644 --- a/vcl/unx/inc/salframe.h +++ b/vcl/unx/inc/salframe.h @@ -206,6 +206,10 @@ public: bool isMapped() const { return bMapped_; } bool hasFocus() const { return mbInputFocus; } + void beginUnicodeSequence(); + bool appendUnicodeSequence( sal_Unicode ); + bool endUnicodeSequence(); + virtual SalGraphics* GetGraphics(); virtual void ReleaseGraphics( SalGraphics* pGraphics ); diff --git a/vcl/unx/source/gdi/salgdi.cxx b/vcl/unx/source/gdi/salgdi.cxx index ae21c3aa9f7b..19b84b26eb91 100644 --- a/vcl/unx/source/gdi/salgdi.cxx +++ b/vcl/unx/source/gdi/salgdi.cxx @@ -1238,12 +1238,17 @@ bool X11SalGraphics::drawPolyLine(const ::basegfx::B2DPolygon& rPolygon, double basegfx::tools::createLineTrapezoidFromB2DPolygon( aB2DTrapVector, aPolygon, rLineWidth.getX() ); // draw tesselation result - const int nTrapCount = aB2DTrapVector.size(); - const bool bDrawOk = drawFilledTrapezoids( &aB2DTrapVector[0], nTrapCount, fTransparency ); + if( ! aB2DTrapVector.empty() ) + { + const int nTrapCount = aB2DTrapVector.size(); + const bool bDrawOk = drawFilledTrapezoids( &aB2DTrapVector[0], nTrapCount, fTransparency ); - // restore the original brush GC - nBrushColor_ = aKeepBrushColor; - return bDrawOk; + // restore the original brush GC + nBrushColor_ = aKeepBrushColor; + return bDrawOk; + } + else + return true; } // get the area polygon for the line polygon diff --git a/vcl/unx/source/window/salframe.cxx b/vcl/unx/source/window/salframe.cxx index 6d243e41db8c..2289a5f9a486 100644 --- a/vcl/unx/source/window/salframe.cxx +++ b/vcl/unx/source/window/salframe.cxx @@ -3146,6 +3146,100 @@ GetAlternateKeyCode( const USHORT nKeyCode ) return aAlternate; } +void X11SalFrame::beginUnicodeSequence() +{ + rtl::OUString& rSeq( GetX11SalData()->GetUnicodeAccumulator() ); + DeletionListener aDeleteWatch( this ); + + if( rSeq.getLength() ) + endUnicodeSequence(); + + rSeq = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "u" ) ); + + if( ! aDeleteWatch.isDeleted() ) + { + USHORT nTextAttr = SAL_EXTTEXTINPUT_ATTR_UNDERLINE; + SalExtTextInputEvent aEv; + aEv.mnTime = 0; + aEv.maText = rSeq; + aEv.mpTextAttr = &nTextAttr; + aEv.mnCursorPos = 0; + aEv.mnDeltaStart = 0; + aEv.mnCursorFlags = 0; + aEv.mbOnlyCursor = FALSE; + + CallCallback(SALEVENT_EXTTEXTINPUT, (void*)&aEv); + } +} + +bool X11SalFrame::appendUnicodeSequence( sal_Unicode c ) +{ + bool bRet = false; + rtl::OUString& rSeq( GetX11SalData()->GetUnicodeAccumulator() ); + if( rSeq.getLength() > 0 ) + { + // range check + if( (c >= sal_Unicode('0') && c <= sal_Unicode('9')) || + (c >= sal_Unicode('a') && c <= sal_Unicode('f')) || + (c >= sal_Unicode('A') && c <= sal_Unicode('F')) ) + { + rtl::OUStringBuffer aBuf( rSeq.getLength() + 1 ); + aBuf.append( rSeq ); + aBuf.append( c ); + rSeq = aBuf.makeStringAndClear(); + std::vector attribs( rSeq.getLength(), SAL_EXTTEXTINPUT_ATTR_UNDERLINE ); + + SalExtTextInputEvent aEv; + aEv.mnTime = 0; + aEv.maText = rSeq; + aEv.mpTextAttr = &attribs[0]; + aEv.mnCursorPos = 0; + aEv.mnDeltaStart = 0; + aEv.mnCursorFlags = 0; + aEv.mbOnlyCursor = FALSE; + + CallCallback(SALEVENT_EXTTEXTINPUT, (void*)&aEv); + bRet = true; + } + else + bRet = endUnicodeSequence(); + } + else + endUnicodeSequence(); + return bRet; +} + +bool X11SalFrame::endUnicodeSequence() +{ + rtl::OUString& rSeq( GetX11SalData()->GetUnicodeAccumulator() ); + + DeletionListener aDeleteWatch( this ); + if( rSeq.getLength() > 1 && rSeq.getLength() < 6 ) + { + // cut the "u" + rtl::OUString aNumbers( rSeq.copy( 1 ) ); + sal_Int32 nValue = aNumbers.toInt32( 16 ); + if( nValue >= 32 ) + { + USHORT nTextAttr = SAL_EXTTEXTINPUT_ATTR_UNDERLINE; + SalExtTextInputEvent aEv; + aEv.mnTime = 0; + aEv.maText = rtl::OUString( sal_Unicode(nValue) ); + aEv.mpTextAttr = &nTextAttr; + aEv.mnCursorPos = 0; + aEv.mnDeltaStart = 0; + aEv.mnCursorFlags = 0; + aEv.mbOnlyCursor = FALSE; + CallCallback(SALEVENT_EXTTEXTINPUT, (void*)&aEv); + } + } + bool bWasInput = rSeq.getLength() > 0; + rSeq = rtl::OUString(); + if( bWasInput && ! aDeleteWatch.isDeleted() ) + CallCallback(SALEVENT_ENDEXTTEXTINPUT, NULL); + return bWasInput; +} + // -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= long X11SalFrame::HandleKeyEvent( XKeyEvent *pEvent ) { @@ -3191,6 +3285,9 @@ long X11SalFrame::HandleKeyEvent( XKeyEvent *pEvent ) if( pEvent->state & Mod1Mask ) nModCode |= KEY_MOD2; + if( nModCode != (KEY_SHIFT|KEY_MOD1) ) + endUnicodeSequence(); + if( nKeySym == XK_Shift_L || nKeySym == XK_Shift_R || nKeySym == XK_Control_L || nKeySym == XK_Control_R || nKeySym == XK_Alt_L || nKeySym == XK_Alt_R @@ -3314,6 +3411,33 @@ long X11SalFrame::HandleKeyEvent( XKeyEvent *pEvent ) if( !nKeyCode && !nLen && !nKeyString) return 0; + DeletionListener aDeleteWatch( this ); + + if( nModCode == (KEY_SHIFT | KEY_MOD1) && pEvent->type == XLIB_KeyPress ) + { + USHORT nSeqKeyCode = pDisplay_->GetKeyCode( nUnmodifiedKeySym, &aDummy ); + if( nSeqKeyCode == KEY_U ) + { + beginUnicodeSequence(); + return 1; + } + else if( nSeqKeyCode >= KEY_0 && nSeqKeyCode <= KEY_9 ) + { + if( appendUnicodeSequence( sal_Unicode( '0' ) + sal_Unicode(nSeqKeyCode - KEY_0) ) ) + return 1; + } + else if( nSeqKeyCode >= KEY_A && nSeqKeyCode <= KEY_F ) + { + if( appendUnicodeSequence( sal_Unicode( 'a' ) + sal_Unicode(nSeqKeyCode - KEY_A) ) ) + return 1; + } + else + endUnicodeSequence(); + } + + if( aDeleteWatch.isDeleted() ) + return 0; + rtl_TextEncoding nEncoding; if (mpInputContext != NULL && mpInputContext->IsMultiLingual() ) @@ -3372,8 +3496,6 @@ long X11SalFrame::HandleKeyEvent( XKeyEvent *pEvent ) nSize = 0; } - DeletionListener aDeleteWatch( this ); - if ( mpInputContext != NULL && mpInputContext->UseContext() && KeyRelease != pEvent->type -- cgit v1.2.3 From f3bf8628235e3ccf352c52edae3be8c57517f850 Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Fri, 23 Jul 2010 13:29:06 +0200 Subject: pl07: #i113170# ensure autorelease pool in ::Show --- vcl/aqua/source/window/salframe.cxx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/vcl/aqua/source/window/salframe.cxx b/vcl/aqua/source/window/salframe.cxx index fdee24f09a10..83fdfe3c8a47 100644 --- a/vcl/aqua/source/window/salframe.cxx +++ b/vcl/aqua/source/window/salframe.cxx @@ -404,6 +404,9 @@ void AquaSalFrame::SendPaintEvent( const Rectangle* pRect ) void AquaSalFrame::Show(BOOL bVisible, BOOL bNoActivate) { + // #i113170# may not be the main thread if called from UNO API + SalData::ensureThreadAutoreleasePool(); + mbShown = bVisible; if(bVisible) { -- cgit v1.2.3 From 5a2f2d2d037d92ec0546513c7732df4cccbee5b1 Mon Sep 17 00:00:00 2001 From: Vladimir Glazunov Date: Fri, 23 Jul 2010 14:43:01 +0200 Subject: unxlngxnewbaseline: #162926# use another condition to determine build environment --- vcl/util/makefile.mk | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/vcl/util/makefile.mk b/vcl/util/makefile.mk index 92e36d198c47..04bc3f13ce4d 100644 --- a/vcl/util/makefile.mk +++ b/vcl/util/makefile.mk @@ -312,7 +312,7 @@ SHL2STDLIBS=\ # prepare linking of Xinerama .IF "$(USE_XINERAMA)" != "NO" -.IF "$(OS)"=="MACOSX" || "$(HOSTTYPE)" == "x86_64-linux" +.IF "$(OS)"=="MACOSX" || "$(OS)$(CPU)" == "LINUXX" XINERAMALIBS=-lXinerama .ELSE .IF "$(OS)" != "SOLARIS" || "$(USE_XINERAMA_VERSION)" == "Xorg" @@ -391,16 +391,16 @@ SHL4STDLIBS+= $(XRANDR_LIBS) .ENDIF .ENDIF -.IF "$(HOSTTYPE)" == "x86_64-linux" +.IF "$(OS)$(CPU)" == "LINUXX" EXTRALIBPATHS+=-L$(LIBRARY_PATH) -.ENDIF # "$(HOSTTYPE)" == "x86_64-linux" +.ENDIF # "$(OS)$(CPU)" == "LINUXX" .ENDIF # "$(ENABLE_GTK)" != "" # KDE plugin .IF "$(ENABLE_KDE)" != "" .IF "$(KDE_ROOT)"!="" EXTRALIBPATHS+=-L$(KDE_ROOT)$/lib -.IF "$(HOSTTYPE)" == "x86_64-linux" +.IF "$(OS)$(CPU)" == "LINUXX" EXTRALIBPATHS+=-L$(KDE_ROOT)$/lib64 .ENDIF .ENDIF -- cgit v1.2.3 From 7f950830b70dd233a2c7ccb676e76b79abfebfda Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Fri, 23 Jul 2010 16:31:08 +0200 Subject: pl07: #i113170# make more AquaSalFrame entry points safe agains missing thread autorelease pool --- vcl/aqua/source/window/salframe.cxx | 86 +++++++++++++++++++++++++++++++------ 1 file changed, 72 insertions(+), 14 deletions(-) diff --git a/vcl/aqua/source/window/salframe.cxx b/vcl/aqua/source/window/salframe.cxx index 83fdfe3c8a47..f1656981b896 100644 --- a/vcl/aqua/source/window/salframe.cxx +++ b/vcl/aqua/source/window/salframe.cxx @@ -207,8 +207,6 @@ void AquaSalFrame::initWindowAndView() UpdateFrameGeometry(); - // setContentView causes a display; in multithreaded use this can deadlock - //YieldMutexReleaser aRel; [mpWindow setContentView: mpView]; } @@ -334,6 +332,9 @@ void AquaSalFrame::SetIcon( USHORT ) void AquaSalFrame::SetRepresentedURL( const rtl::OUString& i_rDocURL ) { + // #i113170# may not be the main thread if called from UNO API + SalData::ensureThreadAutoreleasePool(); + if( i_rDocURL.indexOfAsciiL( "file:", 5 ) == 0 ) { rtl::OUString aSysPath; @@ -417,8 +418,6 @@ void AquaSalFrame::Show(BOOL bVisible, BOOL bNoActivate) // trigger filling our backbuffer SendPaintEvent(); - //YieldMutexReleaser aRel; - if( bNoActivate || [mpWindow canBecomeKeyWindow] == NO ) [mpWindow orderFront: NSApp]; else @@ -449,8 +448,6 @@ void AquaSalFrame::Show(BOOL bVisible, BOOL bNoActivate) if( mpMenu && mpMenu->mbMenuBar && AquaSalMenu::pCurrentMenuBar == mpMenu ) AquaSalMenu::setDefaultMenu(); - //YieldMutexReleaser aRel; - // #i90440# #i94443# work around the focus going back to some other window // if a child gets hidden for a parent window if( mpParent && mpParent->mbShown && [mpWindow isKeyWindow] ) @@ -474,6 +471,9 @@ void AquaSalFrame::Enable( BOOL bEnable ) void AquaSalFrame::SetMinClientSize( long nWidth, long nHeight ) { + // #i113170# may not be the main thread if called from UNO API + SalData::ensureThreadAutoreleasePool(); + mnMinWidth = nWidth; mnMinHeight = nHeight; @@ -496,6 +496,9 @@ void AquaSalFrame::SetMinClientSize( long nWidth, long nHeight ) void AquaSalFrame::SetMaxClientSize( long nWidth, long nHeight ) { + // #i113170# may not be the main thread if called from UNO API + SalData::ensureThreadAutoreleasePool(); + mnMaxWidth = nWidth; mnMaxHeight = nHeight; @@ -522,6 +525,9 @@ void AquaSalFrame::SetMaxClientSize( long nWidth, long nHeight ) void AquaSalFrame::SetClientSize( long nWidth, long nHeight ) { + // #i113170# may not be the main thread if called from UNO API + SalData::ensureThreadAutoreleasePool(); + if( mpWindow ) { NSSize aSize = { nWidth, nHeight }; @@ -554,6 +560,9 @@ void AquaSalFrame::GetClientSize( long& rWidth, long& rHeight ) void AquaSalFrame::SetWindowState( const SalFrameState* pState ) { + // #i113170# may not be the main thread if called from UNO API + SalData::ensureThreadAutoreleasePool(); + // set normal state NSRect aStateRect = [mpWindow frame]; aStateRect = [NSWindow contentRectForFrameRect: aStateRect styleMask: mnStyleMask]; @@ -571,7 +580,6 @@ void AquaSalFrame::SetWindowState( const SalFrameState* pState ) // relase and acquire mutex again since this call can block waiting for an internal lock { - //YieldMutexReleaser aRel; [mpWindow setFrame: aStateRect display: NO]; } @@ -602,8 +610,6 @@ void AquaSalFrame::SetWindowState( const SalFrameState* pState ) SendPaintEvent(); // tell the system the views need to be updated - //YieldMutexReleaser aRel; - [mpWindow display]; } } @@ -612,6 +618,9 @@ void AquaSalFrame::SetWindowState( const SalFrameState* pState ) BOOL AquaSalFrame::GetWindowState( SalFrameState* pState ) { + // #i113170# may not be the main thread if called from UNO API + SalData::ensureThreadAutoreleasePool(); + pState->mnMask = SAL_FRAMESTATE_MASK_X | SAL_FRAMESTATE_MASK_Y | SAL_FRAMESTATE_MASK_WIDTH | @@ -648,6 +657,9 @@ BOOL AquaSalFrame::GetWindowState( SalFrameState* pState ) void AquaSalFrame::SetScreenNumber(unsigned int nScreen) { + // #i113170# may not be the main thread if called from UNO API + SalData::ensureThreadAutoreleasePool(); + NSArray* pScreens = [NSScreen screens]; Rectangle aRet; NSScreen* pScreen = nil; @@ -679,6 +691,9 @@ void AquaSalFrame::SetScreenNumber(unsigned int nScreen) void AquaSalFrame::ShowFullScreen( BOOL bFullScreen, sal_Int32 nDisplay ) { + // #i113170# may not be the main thread if called from UNO API + SalData::ensureThreadAutoreleasePool(); + if( mbFullScreen == bFullScreen ) return; @@ -737,7 +752,6 @@ void AquaSalFrame::ShowFullScreen( BOOL bFullScreen, sal_Int32 nDisplay ) maFullScreenRect = [mpWindow frame]; { - //YieldMutexReleaser aRel; [mpWindow setFrame: [NSWindow frameRectForContentRect: aNewContentRect styleMask: mnStyleMask] display: mbShown ? YES : NO]; } @@ -749,7 +763,6 @@ void AquaSalFrame::ShowFullScreen( BOOL bFullScreen, sal_Int32 nDisplay ) else { { - //YieldMutexReleaser aRel; [mpWindow setFrame: maFullScreenRect display: mbShown ? YES : NO]; } UpdateFrameGeometry(); @@ -788,6 +801,9 @@ public: void AquaSalFrame::StartPresentation( BOOL bStart ) { + // #i113170# may not be the main thread if called from UNO API + SalData::ensureThreadAutoreleasePool(); + if( bStart ) { mpActivityTimer.reset( new PreventSleepTimer() ); @@ -815,6 +831,9 @@ void AquaSalFrame::ToTop(USHORT nFlags) // #i113170# may not be the main thread if called from UNO API SalData::ensureThreadAutoreleasePool(); + // #i113170# may not be the main thread if called from UNO API + SalData::ensureThreadAutoreleasePool(); + if( ! (nFlags & SAL_FRAME_TOTOP_RESTOREWHENMIN) ) { if( ! [mpWindow isVisible] || [mpWindow isMiniaturized] ) @@ -868,6 +887,9 @@ NSCursor* AquaSalFrame::getCurrentCursor() const void AquaSalFrame::SetPointer( PointerStyle ePointerStyle ) { + // #i113170# may not be the main thread if called from UNO API + SalData::ensureThreadAutoreleasePool(); + if( ePointerStyle >= POINTER_COUNT || ePointerStyle == mePointerStyle ) return; mePointerStyle = ePointerStyle; @@ -894,6 +916,10 @@ void AquaSalFrame::Flush( void ) if( !(mbGraphics && mpGraphics && mpView && mbShown) ) return; + // #i113170# may not be the main thread if called from UNO API + SalData::ensureThreadAutoreleasePool(); + + [mpView setNeedsDisplay: YES]; // outside of the application's event loop (e.g. IntroWindow) @@ -912,6 +938,9 @@ void AquaSalFrame::Flush( const Rectangle& rRect ) if( !(mbGraphics && mpGraphics && mpView && mbShown) ) return; + // #i113170# may not be the main thread if called from UNO API + SalData::ensureThreadAutoreleasePool(); + NSRect aNSRect = { {rRect.Left(), rRect.Top()}, { rRect.GetWidth(), rRect.GetHeight() } }; VCLToCocoa( aNSRect, false ); [mpView setNeedsDisplayInRect: aNSRect]; @@ -931,7 +960,8 @@ void AquaSalFrame::Sync() { if( mbGraphics && mpGraphics && mpView && mbShown ) { - //YieldMutexReleaser aRel; + // #i113170# may not be the main thread if called from UNO API + SalData::ensureThreadAutoreleasePool(); [mpView setNeedsDisplay: YES]; [mpView display]; @@ -1155,6 +1185,9 @@ void AquaSalFrame::getResolution( long& o_rDPIX, long& o_rDPIY ) // doesn't make the anything cleaner for now void AquaSalFrame::UpdateSettings( AllSettings& rSettings ) { + // #i113170# may not be the main thread if called from UNO API + SalData::ensureThreadAutoreleasePool(); + [mpView lockFocus]; StyleSettings aStyleSettings = rSettings.GetStyleSettings(); @@ -1266,6 +1299,9 @@ void AquaSalFrame::Beep( SoundType eSoundType ) void AquaSalFrame::SetPosSize(long nX, long nY, long nWidth, long nHeight, USHORT nFlags) { + // #i113170# may not be the main thread if called from UNO API + SalData::ensureThreadAutoreleasePool(); + USHORT nEvent = 0; if( [mpWindow isMiniaturized] ) @@ -1330,7 +1366,6 @@ void AquaSalFrame::SetPosSize(long nX, long nY, long nWidth, long nHeight, USHOR // do not display yet, we need to update our backbuffer { - //YieldMutexReleaser aRel; [mpWindow setFrame: [NSWindow frameRectForContentRect: aContentRect styleMask: mnStyleMask] display: NO]; } @@ -1345,13 +1380,15 @@ void AquaSalFrame::SetPosSize(long nX, long nY, long nWidth, long nHeight, USHOR SendPaintEvent(); // now inform the system that the views need to be drawn - //YieldMutexReleaser aRel; [mpWindow display]; } } void AquaSalFrame::GetWorkArea( Rectangle& rRect ) { + // #i113170# may not be the main thread if called from UNO API + SalData::ensureThreadAutoreleasePool(); + NSScreen* pScreen = [mpWindow screen]; if( pScreen == nil ) pScreen = [NSScreen mainScreen]; @@ -1365,6 +1402,9 @@ void AquaSalFrame::GetWorkArea( Rectangle& rRect ) SalPointerState AquaSalFrame::GetPointerState() { + // #i113170# may not be the main thread if called from UNO API + SalData::ensureThreadAutoreleasePool(); + SalPointerState state; state.mnState = 0; @@ -1472,6 +1512,9 @@ void AquaSalFrame::DrawMenuBar() void AquaSalFrame::SetMenu( SalMenu* pSalMenu ) { + // #i113170# may not be the main thread if called from UNO API + SalData::ensureThreadAutoreleasePool(); + AquaSalMenu* pMenu = static_cast(pSalMenu); DBG_ASSERT( ! pMenu || pMenu->mbMenuBar, "setting non menubar on frame" ); mpMenu = pMenu; @@ -1481,6 +1524,9 @@ void AquaSalFrame::SetMenu( SalMenu* pSalMenu ) void AquaSalFrame::SetExtendedFrameStyle( SalExtStyle nStyle ) { + // #i113170# may not be the main thread if called from UNO API + SalData::ensureThreadAutoreleasePool(); + if( (mnExtStyle & SAL_FRAME_EXT_STYLE_DOCMODIFIED) != (nStyle & SAL_FRAME_EXT_STYLE_DOCMODIFIED) ) [mpWindow setDocumentEdited: (nStyle & SAL_FRAME_EXT_STYLE_DOCMODIFIED) ? YES : NO]; mnExtStyle = nStyle; @@ -1585,6 +1631,9 @@ void AquaSalFrame::CaptureMouse( BOOL bCapture ) void AquaSalFrame::ResetClipRegion() { + // #i113170# may not be the main thread if called from UNO API + SalData::ensureThreadAutoreleasePool(); + // release old path and indicate no clipping CGPathRelease( mrClippingPath ); mrClippingPath = NULL; @@ -1600,6 +1649,9 @@ void AquaSalFrame::ResetClipRegion() void AquaSalFrame::BeginSetClipRegion( ULONG nRects ) { + // #i113170# may not be the main thread if called from UNO API + SalData::ensureThreadAutoreleasePool(); + // release old path if( mrClippingPath ) { @@ -1618,6 +1670,9 @@ void AquaSalFrame::BeginSetClipRegion( ULONG nRects ) void AquaSalFrame::UnionClipRegion( long nX, long nY, long nWidth, long nHeight ) { + // #i113170# may not be the main thread if called from UNO API + SalData::ensureThreadAutoreleasePool(); + if( nWidth && nHeight ) { NSRect aRect = { { nX, nY }, { nWidth, nHeight } }; @@ -1628,6 +1683,9 @@ void AquaSalFrame::UnionClipRegion( long nX, long nY, long nWidth, long nHeight void AquaSalFrame::EndSetClipRegion() { + // #i113170# may not be the main thread if called from UNO API + SalData::ensureThreadAutoreleasePool(); + if( ! maClippingRects.empty() ) { mrClippingPath = CGPathCreateMutable(); -- cgit v1.2.3 From 089d8fb8650da2277d4d40f5f19380ef9832c889 Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Fri, 23 Jul 2010 17:19:53 +0200 Subject: pl07: #i111076# catch a dragsource being destroyed after its frame --- toolkit/qa/unoapi/knownissues.xcl | 3 --- vcl/aqua/source/dtrans/DragSource.cxx | 14 ++++++++++++-- vcl/aqua/source/dtrans/DragSource.hxx | 2 ++ 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/toolkit/qa/unoapi/knownissues.xcl b/toolkit/qa/unoapi/knownissues.xcl index 429d7693c833..7f8896a35597 100644 --- a/toolkit/qa/unoapi/knownissues.xcl +++ b/toolkit/qa/unoapi/knownissues.xcl @@ -241,9 +241,6 @@ toolkit.AccessibleMenu::com::sun::star::accessibility::XAccessibleValue toolkit.AccessibleMenuBar::com::sun::star::accessibility::XAccessibleEventBroadcaster toolkit.AccessibleMenuBar::com::sun::star::accessibility::XAccessibleSelection -### i111076 ### -toolkit.Toolkit::com::sun::star::awt::XDataTransferProviderAccess - ### i111113 ### toolkit.AccessibleStatusBarItem::com::sun::star::accessibility::XAccessibleComponent toolkit.AccessibleStatusBarItem::com::sun::star::accessibility::XAccessibleContext diff --git a/vcl/aqua/source/dtrans/DragSource.cxx b/vcl/aqua/source/dtrans/DragSource.cxx index adb247d70711..1a8f950e50d4 100644 --- a/vcl/aqua/source/dtrans/DragSource.cxx +++ b/vcl/aqua/source/dtrans/DragSource.cxx @@ -38,6 +38,7 @@ #include "DragSourceContext.hxx" #include "aqua_clipboard.hxx" #include "DragActionConversion.hxx" +#include "salframe.h" #include #include @@ -158,6 +159,7 @@ Sequence dragSource_getSupportedServiceNames() DragSource::DragSource(): WeakComponentImplHelper3(m_aMutex), mView(NULL), + mpFrame(NULL), mLastMouseEventBeforeStartDrag(nil), m_MouseButton(0) { @@ -166,8 +168,9 @@ DragSource::DragSource(): DragSource::~DragSource() { - [(id )mView unregisterMouseEventListener: mDragSourceHelper]; - [mDragSourceHelper release]; + if( mpFrame && AquaSalFrame::isAlive( mpFrame ) ) + [(id )mView unregisterMouseEventListener: mDragSourceHelper]; + [mDragSourceHelper release]; } @@ -197,6 +200,13 @@ void SAL_CALL DragSource::initialize(const Sequence< Any >& aArguments) throw Exception(OUString(RTL_CONSTASCII_USTRINGPARAM("DragSource::initialize: Provided view doesn't support mouse listener")), static_cast(this)); } + NSWindow* pWin = [mView window]; + if( ! pWin || ![pWin respondsToSelector: @selector(getSalFrame)] ) + { + throw Exception(OUString(RTL_CONSTASCII_USTRINGPARAM("DragSource::initialize: Provided view is not attached to a vcl frame")), + static_cast(this)); + } + mpFrame = (AquaSalFrame*)[pWin performSelector: @selector(getSalFrame)]; mDragSourceHelper = [[DragSourceHelper alloc] initWithDragSource: this]; diff --git a/vcl/aqua/source/dtrans/DragSource.hxx b/vcl/aqua/source/dtrans/DragSource.hxx index 5d02b9874149..f8f55176a308 100644 --- a/vcl/aqua/source/dtrans/DragSource.hxx +++ b/vcl/aqua/source/dtrans/DragSource.hxx @@ -46,6 +46,7 @@ class DragSource; +class AquaSalFrame; /* The functions declared in this protocol are actually declared in vcl/aqua/inc/salframe.h. Because we want @@ -120,6 +121,7 @@ public: com::sun::star::uno::Reference< com::sun::star::datatransfer::dnd::XDragSourceContext > mXCurrentContext; id mView; + AquaSalFrame* mpFrame; NSEvent* mLastMouseEventBeforeStartDrag; DragSourceHelper* mDragSourceHelper; com::sun::star::awt::MouseEvent mMouseEvent; -- cgit v1.2.3 From e937a4331fafe99449c42a07cd3ea66ffc3e488a Mon Sep 17 00:00:00 2001 From: "Thomas Lange [tl]" Date: Mon, 26 Jul 2010 13:12:35 +0200 Subject: cws tl82: #i106993# thesaurus code clean-up --- svl/inc/lngmisc.hxx | 3 +++ svl/source/misc/lngmisc.cxx | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+) mode change 100644 => 100755 svl/inc/lngmisc.hxx mode change 100644 => 100755 svl/source/misc/lngmisc.cxx diff --git a/svl/inc/lngmisc.hxx b/svl/inc/lngmisc.hxx old mode 100644 new mode 100755 index d85de673c4c9..5143d147227d --- a/svl/inc/lngmisc.hxx +++ b/svl/inc/lngmisc.hxx @@ -32,6 +32,7 @@ #include #include #include +#include /////////////////////////////////////////////////////////////////////////// @@ -68,6 +69,8 @@ SVL_DLLPUBLIC BOOL RemoveControlChars( rtl::OUString &rTxt ); SVL_DLLPUBLIC BOOL ReplaceControlChars( rtl::OUString &rTxt, sal_Char aRplcChar = ' ' ); +SVL_DLLPUBLIC String GetThesaurusReplaceText( const String &rText ); + } // namespace linguistic #endif diff --git a/svl/source/misc/lngmisc.cxx b/svl/source/misc/lngmisc.cxx old mode 100644 new mode 100755 index 2203cc08458e..488e317c6f58 --- a/svl/source/misc/lngmisc.cxx +++ b/svl/source/misc/lngmisc.cxx @@ -27,6 +27,7 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_svl.hxx" + #include #include #include @@ -132,6 +133,38 @@ BOOL ReplaceControlChars( rtl::OUString &rTxt, sal_Char /*aRplcChar*/ ) return bModified; } + +String GetThesaurusReplaceText( const String &rText ) +{ + // The strings for synonyms returned by the thesaurus sometimes have some + // explanation text put in between '(' and ')' or a trailing '*'. + // These parts should not be put in the ReplaceEdit Text that may get + // inserted into the document. Thus we strip them from the text. + + String aText( rText ); + + xub_StrLen nPos = aText.Search( sal_Unicode('(') ); + while (STRING_NOTFOUND != nPos) + { + xub_StrLen nEnd = aText.Search( sal_Unicode(')'), nPos ); + if (STRING_NOTFOUND != nEnd) + aText.Erase( nPos, nEnd-nPos+1 ); + else + break; + nPos = aText.Search( sal_Unicode('(') ); + } + + nPos = aText.Search( sal_Unicode('*') ); + if (STRING_NOTFOUND != nPos) + aText.Erase( nPos ); + + // remove any possible remaining ' ' that may confuse the thesaurus + // when it gets called with the text + aText.EraseLeadingAndTrailingChars( sal_Unicode(' ') ); + + return aText; +} + /////////////////////////////////////////////////////////////////////////// } // namespace linguistic -- cgit v1.2.3 From 0c9940e6205ad56d62920faa890ebf3ebf1d5da8 Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Mon, 26 Jul 2010 13:13:40 +0200 Subject: pl07: #i111047# workaround modal behavior of mac native menus --- toolkit/qa/unoapi/toolkit.sce | 6 +++--- vcl/source/window/menu.cxx | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/toolkit/qa/unoapi/toolkit.sce b/toolkit/qa/unoapi/toolkit.sce index 5a148feee573..00af010d23d6 100644 --- a/toolkit/qa/unoapi/toolkit.sce +++ b/toolkit/qa/unoapi/toolkit.sce @@ -8,10 +8,10 @@ #i86110 -o toolkit.AccessibleList #i86110 -o toolkit.AccessibleListBox #i86110 -o toolkit.AccessibleListItem -#i111047# -o toolkit.AccessibleMenu -#i111047# -o toolkit.AccessibleMenuBar +-o toolkit.AccessibleMenu +-o toolkit.AccessibleMenuBar #i86009 -o toolkit.AccessibleMenuItem -#i111047# -o toolkit.AccessibleMenuSeparator +-o toolkit.AccessibleMenuSeparator #i52607 -o toolkit.AccessiblePopupMenu #i86107,i86110 -o toolkit.AccessibleRadioButton -o toolkit.AccessibleScrollBar diff --git a/vcl/source/window/menu.cxx b/vcl/source/window/menu.cxx index 1723d26ce399..592fd5369a40 100644 --- a/vcl/source/window/menu.cxx +++ b/vcl/source/window/menu.cxx @@ -3722,7 +3722,7 @@ USHORT PopupMenu::ImplExecute( Window* pW, const Rectangle& rRect, ULONG nPopupM if ( GetItemCount() ) { SalMenu* pMenu = ImplGetSalMenu(); - if( pMenu && pMenu->ShowNativePopupMenu( pWin, aRect, nPopupModeFlags | FLOATWIN_POPUPMODE_GRABFOCUS ) ) + if( pMenu && bRealExecute && pMenu->ShowNativePopupMenu( pWin, aRect, nPopupModeFlags | FLOATWIN_POPUPMODE_GRABFOCUS ) ) { pWin->StopExecute(0); pWin->doShutdown(); -- cgit v1.2.3 From 3f0d5190f8150e29fef87f635fbd31af201027fd Mon Sep 17 00:00:00 2001 From: "Herbert Duerr [hdu]" Date: Tue, 27 Jul 2010 17:21:38 +0200 Subject: #i113472# more consistent glyph fallback on non-fc platforms --- vcl/source/gdi/outdev3.cxx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/vcl/source/gdi/outdev3.cxx b/vcl/source/gdi/outdev3.cxx index bf1cc2728bf1..300272dccd63 100644 --- a/vcl/source/gdi/outdev3.cxx +++ b/vcl/source/gdi/outdev3.cxx @@ -1327,11 +1327,11 @@ void ImplDevFontList::InitGenericGlyphFallback( void ) const "msmincho", "fzmingti", "fzheiti", "ipamincho", "sazanamimincho", "kochimincho", "", "sunbatang", "sundotum", "baekmukdotum", "gulim", "batang", "dotum", "", "hgmincholightj", "msunglightsc", "msunglighttc", "hymyeongjolightk", "", - "tahoma", "dejavusans", "timesnewroman", "lucidatypewriter", "lucidasans", "nimbussansl", "", + "tahoma", "dejavusans", "timesnewroman", "liberationsans", "", "shree", "mangal", "", "raavi", "shruti", "tunga", "", "latha", "gautami", "kartika", "vrinda", "", - "shayyalmt", "naskmt", "", + "shayyalmt", "naskmt", "scheherazade", "", "david", "nachlieli", "lucidagrande", "", "norasi", "angsanaupc", "", "khmerossystem", "", @@ -1381,6 +1381,7 @@ void ImplDevFontList::InitGenericGlyphFallback( void ) const } } +#ifdef SAL_FONTENUM_STABLE_ON_PLATFORM // #i113472# // sort the list of fonts for glyph fallback by quality (highest first) // #i33947# keep the EUDC font at the front of the list // an insertion sort is good enough for this short list @@ -1396,6 +1397,7 @@ void ImplDevFontList::InitGenericGlyphFallback( void ) const break; pFallbackList[ j+1 ] = pTestFont; } +#endif #if defined(HDU_DEBUG) for( int i = 0; i < nMaxLevel; ++i ) -- cgit v1.2.3 From 5bdcd17292c63698e8c9c6d72f4941954bf9b5aa Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Tue, 27 Jul 2010 17:19:20 +0200 Subject: vcl114: #i113304# optionally do not draw menubutton separator for flat menu button --- vcl/inc/vcl/button.hxx | 2 +- vcl/source/control/button.cxx | 29 ++++++++++++++++++++--------- 2 files changed, 21 insertions(+), 10 deletions(-) diff --git a/vcl/inc/vcl/button.hxx b/vcl/inc/vcl/button.hxx index fa185c32dcda..ab92445b5e03 100644 --- a/vcl/inc/vcl/button.hxx +++ b/vcl/inc/vcl/button.hxx @@ -132,7 +132,7 @@ protected: SAL_DLLPRIVATE WinBits ImplInitStyle( const Window* pPrevWindow, WinBits nStyle ); SAL_DLLPRIVATE void ImplInitSettings( BOOL bFont, BOOL bForeground, BOOL bBackground ); SAL_DLLPRIVATE void ImplDrawPushButtonContent( OutputDevice* pDev, ULONG nDrawFlags, - const Rectangle& rRect, bool bLayout ); + const Rectangle& rRect, bool bLayout, bool bMenuBtnSep ); SAL_DLLPRIVATE void ImplDrawPushButton( bool bLayout = false ); using Button::ImplGetTextStyle; SAL_DLLPRIVATE USHORT ImplGetTextStyle( ULONG nDrawFlags ) const; diff --git a/vcl/source/control/button.cxx b/vcl/source/control/button.cxx index d4f29e224e7b..9f0bdf462eed 100644 --- a/vcl/source/control/button.cxx +++ b/vcl/source/control/button.cxx @@ -1155,7 +1155,9 @@ static void ImplDrawBtnDropDownArrow( OutputDevice* pDev, void PushButton::ImplDrawPushButtonContent( OutputDevice* pDev, ULONG nDrawFlags, const Rectangle& rRect, - bool bLayout ) + bool bLayout, + bool bMenuBtnSep + ) { const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings(); Rectangle aInRect = rRect; @@ -1210,12 +1212,15 @@ void PushButton::ImplDrawPushButtonContent( OutputDevice* pDev, ULONG nDrawFlags if( ! bLayout ) { - DecorationView aDecoView( pDev ); long nDistance = (aInRect.GetHeight() > 10) ? 2 : 1; - long nX = aInRect.Left() - 2*nDistance;; - Point aStartPt( nX, aInRect.Top()+nDistance ); - Point aEndPt( nX, aInRect.Bottom()-nDistance ); - aDecoView.DrawSeparator( aStartPt, aEndPt ); + DecorationView aDecoView( pDev ); + if( bMenuBtnSep ) + { + long nX = aInRect.Left() - 2*nDistance;; + Point aStartPt( nX, aInRect.Top()+nDistance ); + Point aEndPt( nX, aInRect.Bottom()-nDistance ); + aDecoView.DrawSeparator( aStartPt, aEndPt ); + } aDecoView.DrawSymbol( aInRect, SYMBOL_SPIN_DOWN, aColor, nStyle ); aInRect.Left() -= 2*nDistance; ImplSetSymbolRect( aInRect ); @@ -1356,6 +1361,12 @@ void PushButton::ImplDrawPushButton( bool bLayout ) return; bool bRollOver = (IsMouseOver() && aInRect.IsInside( GetPointerPosPixel() )); + bool bDrawMenuSep = true; + if( (GetStyle() & WB_FLATBUTTON) ) + { + if( ! bRollOver && ! HasFocus() ) + bDrawMenuSep = false; + } if ( (bNativeOK=IsNativeControlSupported(CTRL_PUSHBUTTON, PART_ENTIRE_CONTROL)) == TRUE ) { PushButtonValue aControlValue; @@ -1406,7 +1417,7 @@ void PushButton::ImplDrawPushButton( bool bLayout ) // draw content using the same aInRect as non-native VCL would do ImplDrawPushButtonContent( this, (nState&CTRL_STATE_ROLLOVER) ? WINDOW_DRAW_ROLLOVER : 0, - aInRect, bLayout ); + aInRect, bLayout, bDrawMenuSep ); if ( HasFocus() ) ShowFocus( ImplGetFocusRect() ); @@ -1432,7 +1443,7 @@ void PushButton::ImplDrawPushButton( bool bLayout ) } // draw content - ImplDrawPushButtonContent( this, 0, aInRect, bLayout ); + ImplDrawPushButtonContent( this, 0, aInRect, bLayout, bDrawMenuSep ); if( ! bLayout && HasFocus() ) { @@ -1753,7 +1764,7 @@ void PushButton::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, nButtonStyle |= BUTTON_DRAW_CHECKED; aRect = aDecoView.DrawButton( aRect, nButtonStyle ); - ImplDrawPushButtonContent( pDev, nFlags, aRect, false ); + ImplDrawPushButtonContent( pDev, nFlags, aRect, false, true ); pDev->Pop(); } -- cgit v1.2.3 From 86daa367395d94cdd19fa8771955096f4a8fe53b Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Tue, 27 Jul 2010 17:35:21 +0200 Subject: vcl114: #i113304# cleanup --- vcl/source/control/button.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vcl/source/control/button.cxx b/vcl/source/control/button.cxx index 9f0bdf462eed..bacd875fb473 100644 --- a/vcl/source/control/button.cxx +++ b/vcl/source/control/button.cxx @@ -1205,7 +1205,7 @@ void PushButton::ImplDrawPushButtonContent( OutputDevice* pDev, ULONG nDrawFlags aSize.Width() -= ( 5 + nSymbolSize ); ImplDrawAlignedImage( pDev, aPos, aSize, bLayout, nImageSep, - nDrawFlags, nTextStyle, NULL, (GetStyle() & WB_FLATBUTTON) != 0 ); + nDrawFlags, nTextStyle, NULL, true ); } else ImplCalcSymbolRect( aInRect ); @@ -1232,7 +1232,7 @@ void PushButton::ImplDrawPushButtonContent( OutputDevice* pDev, ULONG nDrawFlags // FIXME: (GetStyle() & WB_FLATBUTTON) != 0 is preliminary // in the next major this should be replaced by "true" ImplDrawAlignedImage( pDev, aPos, aSize, bLayout, nImageSep, nDrawFlags, - nTextStyle, IsSymbol() ? &aSymbolRect : NULL, (GetStyle() & WB_FLATBUTTON) != 0 ); + nTextStyle, IsSymbol() ? &aSymbolRect : NULL, true ); if ( IsSymbol() && ! bLayout ) { -- cgit v1.2.3 From 64910a778a9a37dee885fca38af04205367bae9f Mon Sep 17 00:00:00 2001 From: Carsten Driesner Date: Tue, 27 Jul 2010 18:11:00 +0200 Subject: fwk151: Fixed problems that configuration changes notifications were not correctly sent/processed --- unotools/inc/unotools/configpathes.hxx | 6 +++++- unotools/source/config/configpathes.cxx | 11 ++++++++--- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/unotools/inc/unotools/configpathes.hxx b/unotools/inc/unotools/configpathes.hxx index 2a1e76abf1fc..4e537193b22f 100644 --- a/unotools/inc/unotools/configpathes.hxx +++ b/unotools/inc/unotools/configpathes.hxx @@ -76,6 +76,9 @@ namespace utl If this is not a valid configuration path, it is interpreted as a single name of a node. + @param _sOutPath + If non-null, contains the remainder of the path upon return. + @returns The plain (non-escaped) name of the node that is the first step when traversing _sInPath.
@@ -83,7 +86,8 @@ namespace utl configuration path, it is returned unaltered. */ - UNOTOOLS_DLLPUBLIC ::rtl::OUString extractFirstFromConfigurationPath(::rtl::OUString const& _sInPath); + UNOTOOLS_DLLPUBLIC ::rtl::OUString extractFirstFromConfigurationPath( + ::rtl::OUString const& _sInPath, ::rtl::OUString* _sOutPath = 0); //---------------------------------------------------------------------------- /** check whether a path is to a nested node with respect to a parent path. diff --git a/unotools/source/config/configpathes.cxx b/unotools/source/config/configpathes.cxx index dc66854a8d43..5e7a4c80813e 100644 --- a/unotools/source/config/configpathes.cxx +++ b/unotools/source/config/configpathes.cxx @@ -154,7 +154,7 @@ sal_Bool splitLastFromConfigurationPath(OUString const& _sInPath, } //---------------------------------------------------------------------------- -OUString extractFirstFromConfigurationPath(OUString const& _sInPath) +OUString extractFirstFromConfigurationPath(OUString const& _sInPath, OUString* _sOutPath) { sal_Int32 nSep = _sInPath.indexOf('/'); sal_Int32 nBracket = _sInPath.indexOf('['); @@ -179,8 +179,7 @@ OUString extractFirstFromConfigurationPath(OUString const& _sInPath) nBracket = nEnd; } OSL_ENSURE(nEnd > nStart && _sInPath[nBracket] == ']', "Invalid config path: improper mismatch of quote or bracket"); - OSL_DEBUG_ONLY(nSep = nBracket+1); - OSL_ENSURE(nSep == _sInPath.getLength() || _sInPath[nSep] == '/', "Invalid config path: brackets not followed by slash"); + OSL_ENSURE((nBracket+1 == _sInPath.getLength() && nSep == -1) || (_sInPath[nBracket+1] == '/' && nSep == nBracket+1), "Invalid config path: brackets not followed by slash"); } else // ... but our initial element name is in simple form nStart = 0; @@ -188,6 +187,12 @@ OUString extractFirstFromConfigurationPath(OUString const& _sInPath) OUString sResult = (nEnd >= 0) ? _sInPath.copy(nStart, nEnd-nStart) : _sInPath; lcl_resolveCharEntities(sResult); + + if (_sOutPath != 0) + { + *_sOutPath = (nSep >= 0) ? _sInPath.copy(nSep + 1) : OUString(); + } + return sResult; } -- cgit v1.2.3 From f56ae64d51b8d6326023cff6c7d4063cdf9dc694 Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Tue, 27 Jul 2010 20:11:20 +0200 Subject: vcl114: #i89515# add a print selection button to print accessory view --- vcl/aqua/source/gdi/aquaprintaccessoryview.mm | 678 ++++++++++++++++---------- vcl/source/src/print.src | 1 + 2 files changed, 410 insertions(+), 269 deletions(-) diff --git a/vcl/aqua/source/gdi/aquaprintaccessoryview.mm b/vcl/aqua/source/gdi/aquaprintaccessoryview.mm index d00fc9a6cd0e..d19290d8320a 100644 --- a/vcl/aqua/source/gdi/aquaprintaccessoryview.mm +++ b/vcl/aqua/source/gdi/aquaprintaccessoryview.mm @@ -112,7 +112,7 @@ class ControllerProperties maLocalizedStrings( VclResId( SV_PRINT_NATIVE_STRINGS ) ) { mpState->bNeedRestart = false; - DBG_ASSERT( maLocalizedStrings.Count() >= 4, "resources not found !" ); + DBG_ASSERT( maLocalizedStrings.Count() >= 5, "resources not found !" ); } rtl::OUString getMoreString() @@ -122,6 +122,13 @@ class ControllerProperties : rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "More" ) ); } + rtl::OUString getPrintSelectionString() + { + return maLocalizedStrings.Count() >= 5 + ? rtl::OUString( maLocalizedStrings.GetString( 4 ) ) + : rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Print selection only" ) ); + } + void updatePrintJob() { // TODO: refresh page count etc from mpController @@ -246,7 +253,11 @@ class ControllerProperties PropertyValue* pVal = mpController->getValue( name_it->second ); if( pVal ) { - pVal->Value <<= i_bValue; + // ugly + if( name_it->second.equalsAscii( "PrintContent" ) ) + pVal->Value <<= i_bValue ? sal_Int32(2) : sal_Int32(0); + else + pVal->Value <<= i_bValue; updatePrintJob(); } } @@ -283,7 +294,7 @@ class ControllerProperties -1; std::map< int, rtl::OUString >::const_iterator name_it = maTagToPropertyName.find( nTag ); - if( name_it != maTagToPropertyName.end() ) + if( name_it != maTagToPropertyName.end() && ! name_it->second.equalsAscii( "PrintContent" ) ) { MacOSBOOL bEnabled = mpController->isUIOptionEnabled( name_it->second ) ? YES : NO; if( pCtrl ) @@ -768,6 +779,319 @@ static void linebreakCell( NSCell* pBtn, const rtl::OUString& i_rText ) } } +static void addSubgroup( NSView* pCurParent, long& rCurY, const rtl::OUString& rText ) +{ + NSControl* pTextView = createLabel( rText ); + [pCurParent addSubview: [pTextView autorelease]]; + NSRect aTextRect = [pTextView frame]; + // move to nCurY + aTextRect.origin.y = rCurY - aTextRect.size.height; + [pTextView setFrame: aTextRect]; + + NSRect aSepRect = { { aTextRect.size.width + 1, aTextRect.origin.y }, { 100, 6 } }; + NSBox* pBox = [[NSBox alloc] initWithFrame: aSepRect]; + [pBox setBoxType: NSBoxSeparator]; + [pCurParent addSubview: [pBox autorelease]]; + + // update nCurY + rCurY = aTextRect.origin.y - 5; +} + +static void addBool( NSView* pCurParent, long& rCurX, long& rCurY, long nAttachOffset, + const rtl::OUString& rText, sal_Bool bEnabled, + const rtl::OUString& rProperty, sal_Bool bValue, + std::vector& rRightColumn, + ControllerProperties* pControllerProperties, + ControlTarget* pCtrlTarget + ) +{ + NSRect aCheckRect = { { rCurX + nAttachOffset, 0 }, { 0, 15 } }; + NSButton* pBtn = [[NSButton alloc] initWithFrame: aCheckRect]; + [pBtn setButtonType: NSSwitchButton]; + [pBtn setState: bValue ? NSOnState : NSOffState]; + if( ! bEnabled ) + [pBtn setEnabled: NO]; + linebreakCell( [pBtn cell], rText ); + [pBtn sizeToFit]; + [pCurParent addSubview: [pBtn autorelease]]; + + rRightColumn.push_back( ColumnItem( pBtn ) ); + + // connect target + [pBtn setTarget: pCtrlTarget]; + [pBtn setAction: @selector(triggered:)]; + int nTag = pControllerProperties->addNameTag( rProperty ); + pControllerProperties->addObservedControl( pBtn ); + [pBtn setTag: nTag]; + + aCheckRect = [pBtn frame]; + + // move to rCurY + aCheckRect.origin.y = rCurY - aCheckRect.size.height; + [pBtn setFrame: aCheckRect]; + + // update rCurY + rCurY = aCheckRect.origin.y - 5; +} + +static void addRadio( NSView* pCurParent, long& rCurX, long& rCurY, long nAttachOffset, + const rtl::OUString& rText, + const rtl::OUString& rProperty, Sequence< rtl::OUString > rChoices, sal_Int32 nSelectValue, + std::vector& rLeftColumn, + std::vector& rRightColumn, + ControllerProperties* pControllerProperties, + ControlTarget* pCtrlTarget + ) +{ + sal_Int32 nOff = 0; + if( rText.getLength() ) + { + // add a label + NSControl* pTextView = createLabel( rText ); + NSRect aTextRect = [pTextView frame]; + aTextRect.origin.x = rCurX + nAttachOffset; + [pCurParent addSubview: [pTextView autorelease]]; + + rLeftColumn.push_back( ColumnItem( pTextView ) ); + + // move to nCurY + aTextRect.origin.y = rCurY - aTextRect.size.height; + [pTextView setFrame: aTextRect]; + + // update nCurY + rCurY = aTextRect.origin.y - 5; + + // indent the radio group relative to the text + // nOff = 20; + } + + // setup radio matrix + NSButtonCell* pProto = [[NSButtonCell alloc] init]; + + NSRect aRadioRect = { { rCurX + nOff, 0 }, { 280 - rCurX, 5*rChoices.getLength() } }; + [pProto setTitle: @"RadioButtonGroup"]; + [pProto setButtonType: NSRadioButton]; + NSMatrix* pMatrix = [[NSMatrix alloc] initWithFrame: aRadioRect + mode: NSRadioModeMatrix + prototype: (NSCell*)pProto + numberOfRows: rChoices.getLength() + numberOfColumns: 1]; + // set individual titles + NSArray* pCells = [pMatrix cells]; + for( sal_Int32 m = 0; m < rChoices.getLength(); m++ ) + { + NSCell* pCell = [pCells objectAtIndex: m]; + filterAccelerator( rChoices[m] ); + linebreakCell( pCell, rChoices[m] ); + // connect target and action + [pCell setTarget: pCtrlTarget]; + [pCell setAction: @selector(triggered:)]; + int nTag = pControllerProperties->addNameAndValueTag( rProperty, m ); + pControllerProperties->addObservedControl( pCell ); + [pCell setTag: nTag]; + // set current selection + if( nSelectValue == m ) + [pMatrix selectCellAtRow: m column: 0]; + } + [pMatrix sizeToFit]; + aRadioRect = [pMatrix frame]; + + // move it down, so it comes to the correct position + aRadioRect.origin.y = rCurY - aRadioRect.size.height; + [pMatrix setFrame: aRadioRect]; + [pCurParent addSubview: [pMatrix autorelease]]; + + rRightColumn.push_back( ColumnItem( pMatrix ) ); + + // update nCurY + rCurY = aRadioRect.origin.y - 5; + + [pProto release]; +} + +static void addList( NSView* pCurParent, long& rCurX, long& rCurY, long nAttachOffset, + const rtl::OUString& rText, + const rtl::OUString& rProperty, const Sequence< rtl::OUString > rChoices, sal_Int32 nSelectValue, + std::vector& rLeftColumn, + std::vector& rRightColumn, + ControllerProperties* pControllerProperties, + ControlTarget* pCtrlTarget + ) +{ + // don't indent attached lists, looks bad in the existing cases + NSControl* pTextView = createLabel( rText ); + [pCurParent addSubview: [pTextView autorelease]]; + rLeftColumn.push_back( ColumnItem( pTextView ) ); + NSRect aTextRect = [pTextView frame]; + aTextRect.origin.x = rCurX /* + nAttachOffset*/; + + // don't indent attached lists, looks bad in the existing cases + NSRect aBtnRect = { { rCurX /*+ nAttachOffset*/ + aTextRect.size.width, 0 }, { 0, 15 } }; + NSPopUpButton* pBtn = [[NSPopUpButton alloc] initWithFrame: aBtnRect pullsDown: NO]; + + // iterate options + for( sal_Int32 m = 0; m < rChoices.getLength(); m++ ) + { + NSString* pItemText = CreateNSString( rChoices[m] ); + [pBtn addItemWithTitle: pItemText]; + NSMenuItem* pItem = [pBtn itemWithTitle: pItemText]; + int nTag = pControllerProperties->addNameAndValueTag( rProperty, m ); + [pItem setTag: nTag]; + [pItemText release]; + } + + [pBtn selectItemAtIndex: nSelectValue]; + + // add the button to observed controls for enabled state changes + // also add a tag just for this purpose + pControllerProperties->addObservedControl( pBtn ); + [pBtn setTag: pControllerProperties->addNameTag( rProperty )]; + + [pBtn sizeToFit]; + [pCurParent addSubview: [pBtn autorelease]]; + + rRightColumn.push_back( ColumnItem( pBtn ) ); + + // connect target and action + [pBtn setTarget: pCtrlTarget]; + [pBtn setAction: @selector(triggered:)]; + + // move to nCurY + aBtnRect = [pBtn frame]; + aBtnRect.origin.y = rCurY - aBtnRect.size.height; + [pBtn setFrame: aBtnRect]; + + // align label + aTextRect.origin.y = aBtnRect.origin.y + (aBtnRect.size.height - aTextRect.size.height)/2; + [pTextView setFrame: aTextRect]; + + // update rCurY + rCurY = aBtnRect.origin.y - 5; +} + +static void addEdit( NSView* pCurParent, long& rCurX, long& rCurY, long nAttachOffset, + const rtl::OUString rCtrlType, + const rtl::OUString& rText, + const rtl::OUString& rProperty, const PropertyValue* pValue, + sal_Int64 nMinValue, sal_Int64 nMaxValue, + std::vector& rLeftColumn, + std::vector& rRightColumn, + ControllerProperties* pControllerProperties, + ControlTarget* pCtrlTarget + ) +{ + sal_Int32 nOff = 0; + if( rText.getLength() ) + { + // add a label + NSControl* pTextView = createLabel( rText ); + [pCurParent addSubview: [pTextView autorelease]]; + + rLeftColumn.push_back( ColumnItem( pTextView ) ); + + // move to nCurY + NSRect aTextRect = [pTextView frame]; + aTextRect.origin.x = rCurX + nAttachOffset; + aTextRect.origin.y = rCurY - aTextRect.size.height; + [pTextView setFrame: aTextRect]; + + // update nCurY + rCurY = aTextRect.origin.y - 5; + + // and set the offset for the real edit field + nOff = aTextRect.size.width + 5; + } + + NSRect aFieldRect = { { rCurX + nOff + nAttachOffset, 0 }, { 100, 25 } }; + NSTextField* pFieldView = [[NSTextField alloc] initWithFrame: aFieldRect]; + [pFieldView setEditable: YES]; + [pFieldView setSelectable: YES]; + [pFieldView setDrawsBackground: YES]; + [pFieldView sizeToFit]; // FIXME: this does nothing + [pCurParent addSubview: [pFieldView autorelease]]; + + rRightColumn.push_back( ColumnItem( pFieldView ) ); + + // add the field to observed controls for enabled state changes + // also add a tag just for this purpose + pControllerProperties->addObservedControl( pFieldView ); + int nTag = pControllerProperties->addNameTag( rProperty ); + [pFieldView setTag: nTag]; + // pControllerProperties->addNamedView( pFieldView, aPropertyName ); + + // move to nCurY + aFieldRect.origin.y = rCurY - aFieldRect.size.height; + [pFieldView setFrame: aFieldRect]; + + if( rCtrlType.equalsAscii( "Range" ) ) + { + // add a stepper control + NSRect aStepFrame = { { aFieldRect.origin.x + aFieldRect.size.width + 5, + aFieldRect.origin.y }, + { 15, aFieldRect.size.height } }; + NSStepper* pStep = [[NSStepper alloc] initWithFrame: aStepFrame]; + [pStep setIncrement: 1]; + [pStep setValueWraps: NO]; + [pStep setTag: nTag]; + [pCurParent addSubview: [pStep autorelease]]; + + rRightColumn.back().pSubControl = pStep; + + pControllerProperties->addObservedControl( pStep ); + [pStep setTarget: pCtrlTarget]; + [pStep setAction: @selector(triggered:)]; + + // constrain the text field to decimal numbers + NSNumberFormatter* pFormatter = [[NSNumberFormatter alloc] init]; + [pFormatter setFormatterBehavior: NSNumberFormatterBehavior10_4]; + [pFormatter setNumberStyle: NSNumberFormatterDecimalStyle]; + [pFormatter setAllowsFloats: NO]; + [pFormatter setMaximumFractionDigits: 0]; + if( nMinValue != nMaxValue ) + { + [pFormatter setMinimum: [[NSNumber numberWithInt: nMinValue] autorelease]]; + [pStep setMinValue: nMinValue]; + [pFormatter setMaximum: [[NSNumber numberWithInt: nMaxValue] autorelease]]; + [pStep setMaxValue: nMaxValue]; + } + [pFieldView setFormatter: pFormatter]; + + sal_Int64 nSelectVal = 0; + if( pValue && pValue->Value.hasValue() ) + pValue->Value >>= nSelectVal; + + [pFieldView setIntValue: nSelectVal]; + [pStep setIntValue: nSelectVal]; + + pControllerProperties->addViewPair( pFieldView, pStep ); + // connect target and action + [pFieldView setTarget: pCtrlTarget]; + [pFieldView setAction: @selector(triggeredNumeric:)]; + [pStep setTarget: pCtrlTarget]; + [pStep setAction: @selector(triggeredNumeric:)]; + } + else + { + // connect target and action + [pFieldView setTarget: pCtrlTarget]; + [pFieldView setAction: @selector(triggered:)]; + + if( pValue && pValue->Value.hasValue() ) + { + rtl::OUString aValue; + pValue->Value >>= aValue; + if( aValue.getLength() ) + { + NSString* pText = CreateNSString( aValue ); + [pFieldView setStringValue: pText]; + [pText release]; + } + } + } + + // update nCurY + rCurY = aFieldRect.origin.y - 5; +} @implementation AquaPrintAccessoryView +(NSObject*)setupPrinterPanel: (NSPrintOperation*)pOp withController: (vcl::PrinterController*)pController withState: (PrintAccessoryViewState*)pState; @@ -792,6 +1116,54 @@ static void linebreakCell( NSCell* pBtn, const rtl::OUString& i_rText ) ControlTarget* pCtrlTarget = [[ControlTarget alloc] initWithControllerMap: pControllerProperties]; std::vector< ColumnItem > aLeftColumn, aRightColumn; + + // ugly: + // prepend a "selection" checkbox if the properties have such a selection in PrintContent + bool bAddSelectionCheckBox = false, bSelectionBoxEnabled = false, bSelectionBoxChecked = false; + for( int i = 0; i < rOptions.getLength(); i++ ) + { + Sequence< beans::PropertyValue > aOptProp; + rOptions[i].Value >>= aOptProp; + + rtl::OUString aCtrlType; + rtl::OUString aPropertyName; + Sequence< rtl::OUString > aChoices; + Sequence< sal_Bool > aChoicesDisabled; + sal_Int32 aSelectionChecked = 0; + for( int n = 0; n < aOptProp.getLength(); n++ ) + { + const beans::PropertyValue& rEntry( aOptProp[ n ] ); + if( rEntry.Name.equalsAscii( "ControlType" ) ) + { + rEntry.Value >>= aCtrlType; + } + else if( rEntry.Name.equalsAscii( "Choices" ) ) + { + rEntry.Value >>= aChoices; + } + else if( rEntry.Name.equalsAscii( "ChoicesDisabled" ) ) + { + rEntry.Value >>= aChoicesDisabled; + } + else if( rEntry.Name.equalsAscii( "Property" ) ) + { + PropertyValue aVal; + rEntry.Value >>= aVal; + aPropertyName = aVal.Name; + if( aPropertyName.equalsAscii( "PrintContent" ) ) + aVal.Value >>= aSelectionChecked; + } + } + if( aCtrlType.equalsAscii( "Radio" ) && + aPropertyName.equalsAscii( "PrintContent" ) && + aChoices.getLength() > 2 ) + { + bAddSelectionCheckBox = true; + bSelectionBoxEnabled = aChoicesDisabled.getLength() < 2 || ! aChoicesDisabled[2]; + bSelectionBoxChecked = (aSelectionChecked==2); + break; + } + } for( int i = 0; i < rOptions.getLength(); i++ ) { @@ -803,6 +1175,7 @@ static void linebreakCell( NSCell* pBtn, const rtl::OUString& i_rText ) rtl::OUString aCtrlType; rtl::OUString aText; rtl::OUString aPropertyName; + rtl::OUString aGroupHint; Sequence< rtl::OUString > aChoices; sal_Int64 nMinValue = 0, nMaxValue = 0; long nAttachOffset = 0; @@ -852,6 +1225,10 @@ static void linebreakCell( NSCell* pBtn, const rtl::OUString& i_rText ) { rEntry.Value >>= bIgnore; } + else if( rEntry.Name.equalsAscii( "GroupingHint" ) ) + { + rEntry.Value >>= aGroupHint; + } } if( aCtrlType.equalsAscii( "Group" ) || @@ -894,6 +1271,15 @@ static void linebreakCell( NSCell* pBtn, const rtl::OUString& i_rText ) // clear columns aLeftColumn.clear(); aRightColumn.clear(); + + if( bAddSelectionCheckBox ) + { + addBool( pCurParent, nCurX, nCurY, 0, + pControllerProperties->getPrintSelectionString(), bSelectionBoxEnabled, + rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintContent" ) ), bSelectionBoxChecked, + aRightColumn, pControllerProperties, pCtrlTarget ); + bAddSelectionCheckBox = false; + } } if( aCtrlType.equalsAscii( "Subgroup" ) && pCurParent ) @@ -902,302 +1288,56 @@ static void linebreakCell( NSCell* pBtn, const rtl::OUString& i_rText ) if( bIgnore ) continue; - NSControl* pTextView = createLabel( aText ); - [pCurParent addSubview: [pTextView autorelease]]; - NSRect aTextRect = [pTextView frame]; - // move to nCurY - aTextRect.origin.y = nCurY - aTextRect.size.height; - [pTextView setFrame: aTextRect]; - - NSRect aSepRect = { { aTextRect.size.width + 1, aTextRect.origin.y }, { 100, 6 } }; - NSBox* pBox = [[NSBox alloc] initWithFrame: aSepRect]; - [pBox setBoxType: NSBoxSeparator]; - [pCurParent addSubview: [pBox autorelease]]; - - // update nCurY - nCurY = aTextRect.origin.y - 5; + addSubgroup( pCurParent, nCurY, aText ); } else if( bIgnoreSubgroup || bIgnore ) + { continue; + } else if( aCtrlType.equalsAscii( "Bool" ) && pCurParent ) { - NSRect aCheckRect = { { nCurX + nAttachOffset, 0 }, { 0, 15 } }; - NSButton* pBtn = [[NSButton alloc] initWithFrame: aCheckRect]; - [pBtn setButtonType: NSSwitchButton]; sal_Bool bVal = sal_False; PropertyValue* pVal = pController->getValue( aPropertyName ); if( pVal ) pVal->Value >>= bVal; - [pBtn setState: bVal ? NSOnState : NSOffState]; - linebreakCell( [pBtn cell], aText ); - [pBtn sizeToFit]; - [pCurParent addSubview: [pBtn autorelease]]; - - aRightColumn.push_back( ColumnItem( pBtn ) ); - - // connect target - [pBtn setTarget: pCtrlTarget]; - [pBtn setAction: @selector(triggered:)]; - int nTag = pControllerProperties->addNameTag( aPropertyName ); - pControllerProperties->addObservedControl( pBtn ); - [pBtn setTag: nTag]; - - aCheckRect = [pBtn frame]; - - // move to nCurY - aCheckRect.origin.y = nCurY - aCheckRect.size.height; - [pBtn setFrame: aCheckRect]; - - // update nCurY - nCurY = aCheckRect.origin.y - 5; + addBool( pCurParent, nCurX, nCurY, nAttachOffset, + aText, true, aPropertyName, bVal, + aRightColumn, pControllerProperties, pCtrlTarget ); } else if( aCtrlType.equalsAscii( "Radio" ) && pCurParent ) { - sal_Int32 nOff = 0; - if( aText.getLength() ) - { - // add a label - NSControl* pTextView = createLabel( aText ); - NSRect aTextRect = [pTextView frame]; - aTextRect.origin.x = nCurX + nAttachOffset; - [pCurParent addSubview: [pTextView autorelease]]; - - aLeftColumn.push_back( ColumnItem( pTextView ) ); - - // move to nCurY - aTextRect.origin.y = nCurY - aTextRect.size.height; - [pTextView setFrame: aTextRect]; - - // update nCurY - nCurY = aTextRect.origin.y - 5; - - // indent the radio group relative to the text - // nOff = 20; - } - - // setup radio matrix - NSButtonCell* pProto = [[NSButtonCell alloc] init]; - - NSRect aRadioRect = { { nCurX + nOff, 0 }, { 280 - nCurX, 5*aChoices.getLength() } }; - [pProto setTitle: @"RadioButtonGroup"]; - [pProto setButtonType: NSRadioButton]; - NSMatrix* pMatrix = [[NSMatrix alloc] initWithFrame: aRadioRect - mode: NSRadioModeMatrix - prototype: (NSCell*)pProto - numberOfRows: aChoices.getLength() - numberOfColumns: 1]; // get currently selected value sal_Int32 nSelectVal = 0; PropertyValue* pVal = pController->getValue( aPropertyName ); if( pVal && pVal->Value.hasValue() ) pVal->Value >>= nSelectVal; - // set individual titles - NSArray* pCells = [pMatrix cells]; - for( sal_Int32 m = 0; m < aChoices.getLength(); m++ ) - { - NSCell* pCell = [pCells objectAtIndex: m]; - filterAccelerator( aChoices[m] ); - linebreakCell( pCell, aChoices[m] ); - //NSString* pTitle = CreateNSString( aChoices[m] ); - //[pCell setTitle: pTitle]; - // connect target and action - [pCell setTarget: pCtrlTarget]; - [pCell setAction: @selector(triggered:)]; - int nTag = pControllerProperties->addNameAndValueTag( aPropertyName, m ); - pControllerProperties->addObservedControl( pCell ); - [pCell setTag: nTag]; - //[pTitle release]; - // set current selection - if( nSelectVal == m ) - [pMatrix selectCellAtRow: m column: 0]; - } - [pMatrix sizeToFit]; - aRadioRect = [pMatrix frame]; - // move it down, so it comes to the correct position - aRadioRect.origin.y = nCurY - aRadioRect.size.height; - [pMatrix setFrame: aRadioRect]; - [pCurParent addSubview: [pMatrix autorelease]]; - - aRightColumn.push_back( ColumnItem( pMatrix ) ); - - // update nCurY - nCurY = aRadioRect.origin.y - 5; - - [pProto release]; + addRadio( pCurParent, nCurX, nCurY, nAttachOffset, + aText, aPropertyName, aChoices, nSelectVal, + aLeftColumn, aRightColumn, + pControllerProperties, pCtrlTarget ); } else if( aCtrlType.equalsAscii( "List" ) && pCurParent ) { - // don't indent attached lists, looks bad in the existing cases - NSControl* pTextView = createLabel( aText ); - [pCurParent addSubview: [pTextView autorelease]]; - aLeftColumn.push_back( ColumnItem( pTextView ) ); - NSRect aTextRect = [pTextView frame]; - aTextRect.origin.x = nCurX /* + nAttachOffset*/; - - // don't indent attached lists, looks bad in the existing cases - NSRect aBtnRect = { { nCurX /*+ nAttachOffset*/ + aTextRect.size.width, 0 }, { 0, 15 } }; - NSPopUpButton* pBtn = [[NSPopUpButton alloc] initWithFrame: aBtnRect pullsDown: NO]; - - // iterate options - for( sal_Int32 m = 0; m < aChoices.getLength(); m++ ) - { - NSString* pItemText = CreateNSString( aChoices[m] ); - [pBtn addItemWithTitle: pItemText]; - NSMenuItem* pItem = [pBtn itemWithTitle: pItemText]; - int nTag = pControllerProperties->addNameAndValueTag( aPropertyName, m ); - [pItem setTag: nTag]; - [pItemText release]; - } - PropertyValue* pVal = pController->getValue( aPropertyName ); sal_Int32 aSelectVal = 0; if( pVal && pVal->Value.hasValue() ) pVal->Value >>= aSelectVal; - [pBtn selectItemAtIndex: aSelectVal]; - - // add the button to observed controls for enabled state changes - // also add a tag just for this purpose - pControllerProperties->addObservedControl( pBtn ); - [pBtn setTag: pControllerProperties->addNameTag( aPropertyName )]; - - [pBtn sizeToFit]; - [pCurParent addSubview: [pBtn autorelease]]; - - aRightColumn.push_back( ColumnItem( pBtn ) ); - - // connect target and action - [pBtn setTarget: pCtrlTarget]; - [pBtn setAction: @selector(triggered:)]; - - // move to nCurY - aBtnRect = [pBtn frame]; - aBtnRect.origin.y = nCurY - aBtnRect.size.height; - [pBtn setFrame: aBtnRect]; - - // align label - aTextRect.origin.y = aBtnRect.origin.y + (aBtnRect.size.height - aTextRect.size.height)/2; - [pTextView setFrame: aTextRect]; - // update nCurY - nCurY = aBtnRect.origin.y - 5; + addList( pCurParent, nCurX, nCurY, nAttachOffset, + aText, aPropertyName, aChoices, aSelectVal, + aLeftColumn, aRightColumn, + pControllerProperties, pCtrlTarget ); } else if( (aCtrlType.equalsAscii( "Edit" ) || aCtrlType.equalsAscii( "Range" )) && pCurParent ) { - sal_Int32 nOff = 0; - if( aText.getLength() ) - { - // add a label - NSControl* pTextView = createLabel( aText ); - [pCurParent addSubview: [pTextView autorelease]]; - - aLeftColumn.push_back( ColumnItem( pTextView ) ); - - // move to nCurY - NSRect aTextRect = [pTextView frame]; - aTextRect.origin.x = nCurX + nAttachOffset; - aTextRect.origin.y = nCurY - aTextRect.size.height; - [pTextView setFrame: aTextRect]; - - // update nCurY - nCurY = aTextRect.origin.y - 5; - - // and set the offset for the real edit field - nOff = aTextRect.size.width + 5; - } - - NSRect aFieldRect = { { nCurX + nOff + nAttachOffset, 0 }, { 100, 25 } }; - NSTextField* pFieldView = [[NSTextField alloc] initWithFrame: aFieldRect]; - [pFieldView setEditable: YES]; - [pFieldView setSelectable: YES]; - [pFieldView setDrawsBackground: YES]; - [pFieldView sizeToFit]; // FIXME: this does nothing - [pCurParent addSubview: [pFieldView autorelease]]; - - aRightColumn.push_back( ColumnItem( pFieldView ) ); - - // add the field to observed controls for enabled state changes - // also add a tag just for this purpose - pControllerProperties->addObservedControl( pFieldView ); - int nTag = pControllerProperties->addNameTag( aPropertyName ); - [pFieldView setTag: nTag]; - // pControllerProperties->addNamedView( pFieldView, aPropertyName ); - - // move to nCurY - aFieldRect.origin.y = nCurY - aFieldRect.size.height; - [pFieldView setFrame: aFieldRect]; - // current value PropertyValue* pVal = pController->getValue( aPropertyName ); - if( aCtrlType.equalsAscii( "Range" ) ) - { - // add a stepper control - NSRect aStepFrame = { { aFieldRect.origin.x + aFieldRect.size.width + 5, - aFieldRect.origin.y }, - { 15, aFieldRect.size.height } }; - NSStepper* pStep = [[NSStepper alloc] initWithFrame: aStepFrame]; - [pStep setIncrement: 1]; - [pStep setValueWraps: NO]; - [pStep setTag: nTag]; - [pCurParent addSubview: [pStep autorelease]]; - - aRightColumn.back().pSubControl = pStep; - - pControllerProperties->addObservedControl( pStep ); - [pStep setTarget: pCtrlTarget]; - [pStep setAction: @selector(triggered:)]; - - // constrain the text field to decimal numbers - NSNumberFormatter* pFormatter = [[NSNumberFormatter alloc] init]; - [pFormatter setFormatterBehavior: NSNumberFormatterBehavior10_4]; - [pFormatter setNumberStyle: NSNumberFormatterDecimalStyle]; - [pFormatter setAllowsFloats: NO]; - [pFormatter setMaximumFractionDigits: 0]; - if( nMinValue != nMaxValue ) - { - [pFormatter setMinimum: [[NSNumber numberWithInt: nMinValue] autorelease]]; - [pStep setMinValue: nMinValue]; - [pFormatter setMaximum: [[NSNumber numberWithInt: nMaxValue] autorelease]]; - [pStep setMaxValue: nMaxValue]; - } - [pFieldView setFormatter: pFormatter]; - - sal_Int64 nSelectVal = 0; - if( pVal && pVal->Value.hasValue() ) - pVal->Value >>= nSelectVal; - - [pFieldView setIntValue: nSelectVal]; - [pStep setIntValue: nSelectVal]; - - pControllerProperties->addViewPair( pFieldView, pStep ); - // connect target and action - [pFieldView setTarget: pCtrlTarget]; - [pFieldView setAction: @selector(triggeredNumeric:)]; - [pStep setTarget: pCtrlTarget]; - [pStep setAction: @selector(triggeredNumeric:)]; - } - else - { - // connect target and action - [pFieldView setTarget: pCtrlTarget]; - [pFieldView setAction: @selector(triggered:)]; - - if( pVal && pVal->Value.hasValue() ) - { - rtl::OUString aValue; - pVal->Value >>= aValue; - if( aValue.getLength() ) - { - NSString* pText = CreateNSString( aValue ); - [pFieldView setStringValue: pText]; - [pText release]; - } - } - } - - // update nCurY - nCurY = aFieldRect.origin.y - 5; - + addEdit( pCurParent, nCurX, nCurY, nAttachOffset, + aCtrlType, aText, aPropertyName, pVal, + nMinValue, nMaxValue, + aLeftColumn, aRightColumn, + pControllerProperties, pCtrlTarget ); } } else @@ -1205,7 +1345,7 @@ static void linebreakCell( NSCell* pBtn, const rtl::OUString& i_rText ) DBG_ERROR( "Unsupported UI option" ); } } - + pControllerProperties->updateEnableState(); adjustViewAndChildren( pCurParent, aMaxTabSize, aLeftColumn, aRightColumn ); diff --git a/vcl/source/src/print.src b/vcl/source/src/print.src index 58f0a477c848..010cae338e0e 100644 --- a/vcl/source/src/print.src +++ b/vcl/source/src/print.src @@ -488,5 +488,6 @@ StringArray SV_PRINT_NATIVE_STRINGS < "Page number"; >; < "Number of pages"; >; < "More"; >; + < "Print selection only"; >; }; }; -- cgit v1.2.3 From cb183c4c7750bedb079337b01f32590bf2ec0176 Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Wed, 28 Jul 2010 13:22:52 +0200 Subject: vcl114: #i113490# avoid accessing a possible NULL ptr (thanks cmc!) --- vcl/unx/gtk/a11y/atkutil.cxx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/vcl/unx/gtk/a11y/atkutil.cxx b/vcl/unx/gtk/a11y/atkutil.cxx index 13492f3d4a5c..ad33cdf67de6 100644 --- a/vcl/unx/gtk/a11y/atkutil.cxx +++ b/vcl/unx/gtk/a11y/atkutil.cxx @@ -77,11 +77,10 @@ atk_wrapper_focus_idle_handler (gpointer data) uno::Reference< accessibility::XAccessible > xAccessible = xNextFocusObject; if( xAccessible.get() == reinterpret_cast < accessibility::XAccessible * > (data) ) { + AtkObject *atk_obj = xAccessible.is() ? atk_object_wrapper_ref( xAccessible ) : NULL; // Gail does not notify focus changes to NULL, so do we .. - if( xAccessible.is() ) + if( atk_obj ) { - AtkObject *atk_obj = atk_object_wrapper_ref( xAccessible ); - #ifdef ENABLE_TRACING fprintf(stderr, "notifying focus event for %p\n", atk_obj); #endif -- cgit v1.2.3 From 0a9d3dfbb7083398a3950b273bd09d1a8d4ffbcb Mon Sep 17 00:00:00 2001 From: "Herbert Duerr [hdu]" Date: Wed, 28 Jul 2010 14:49:14 +0200 Subject: #i113301# avoid problems with hyphenation within graphite ligature (thanks kstribley) --- vcl/source/glyphs/graphite_layout.cxx | 67 +++++++++++++++++++++++++++++------ vcl/win/source/gdi/winlayout.cxx | 5 +++ 2 files changed, 61 insertions(+), 11 deletions(-) diff --git a/vcl/source/glyphs/graphite_layout.cxx b/vcl/source/glyphs/graphite_layout.cxx index ae7ec8246e33..2a56d4517e0b 100644 --- a/vcl/source/glyphs/graphite_layout.cxx +++ b/vcl/source/glyphs/graphite_layout.cxx @@ -594,21 +594,39 @@ bool GraphiteLayout::LayoutText(ImplLayoutArgs & rArgs) { #ifdef GRCACHE GrSegRecord * pSegRecord = NULL; - gr::Segment * pSegment = CreateSegment(rArgs, &pSegRecord); - if (!pSegment) - return false; - + gr::Segment * pSegment = NULL; + // Graphite can in rare cases crash with a zero length + if (rArgs.mnMinCharPos < rArgs.mnEndCharPos) + { + pSegment = CreateSegment(rArgs, &pSegRecord); + if (!pSegment) + return false; + } + else + { + clear(); + return true; + } // layout the glyphs as required by OpenOffice bool success = LayoutGlyphs(rArgs, pSegment, pSegRecord); if (pSegRecord) pSegRecord->unlock(); else delete pSegment; #else - gr::Segment * pSegment = CreateSegment(rArgs); - if (!pSegment) - return false; - bool success = LayoutGlyphs(rArgs, pSegment); - delete pSegment; + gr::Segment * pSegment = NULL; + bool success = true; + if (rArgs.mnMinCharPos < rArgs.mnEndCharPos) + { + pSegment = CreateSegment(rArgs); + if (!pSegment) + return false; + success = LayoutGlyphs(rArgs, pSegment); + if (pSegment) delete pSegment; + } + else + { + clear(); + } #endif return success; } @@ -722,7 +740,7 @@ gr::Segment * GraphiteLayout::CreateSegment(ImplLayoutArgs& rArgs) (GraphiteCacheHandler::instance).getCache(aFontHash); if (pCache) { - *pSegRecord = pCache->getSegment(rArgs, bRtl, nSegCharLimit); + *pSegRecord = pCache->getSegment(rArgs, bRtl, limit); if (*pSegRecord) { pSegment = (*pSegRecord)->getSegment(); @@ -736,7 +754,34 @@ gr::Segment * GraphiteLayout::CreateSegment(ImplLayoutArgs& rArgs) (*pSegRecord)->clearVectors(); } mpTextSrc->switchLayoutArgs(rArgs); - return pSegment; + if (limit > rArgs.mnMinCharPos && limit == rArgs.mnEndCharPos + && pSegment->stopCharacter() != limit) + { + // check that the last character is not part of a ligature + glyph_set_range_t aGlyphSet = pSegment->charToGlyphs(limit - 1); + if (aGlyphSet.first == aGlyphSet.second) + { + // no glyphs associated with this glyph - occurs mid ligature + pSegment = NULL; + *pSegRecord = NULL; + } + else + { + while (aGlyphSet.first != aGlyphSet.second) + { + int lastChar = static_cast((*aGlyphSet.first).lastChar()); + if (lastChar >= limit) + { + pSegment = NULL; + *pSegRecord = NULL; + break; + } + aGlyphSet.first++; + } + } + } + if (pSegment) + return pSegment; } } #endif diff --git a/vcl/win/source/gdi/winlayout.cxx b/vcl/win/source/gdi/winlayout.cxx index 6f0c98279e7b..806d3b420b33 100755 --- a/vcl/win/source/gdi/winlayout.cxx +++ b/vcl/win/source/gdi/winlayout.cxx @@ -2894,6 +2894,11 @@ void GraphiteWinLayout::RestoreDC(gr::Segment & segment) const bool GraphiteWinLayout::LayoutText( ImplLayoutArgs & args) { + if (args.mnMinCharPos >= args.mnEndCharPos) + { + maImpl.clear(); + return true; + } HFONT hUnRotatedFont; if (args.mnOrientation) { -- cgit v1.2.3 From 95a5931e6942c1d2bd9a91c64ae85ac41b53d5f2 Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Wed, 28 Jul 2010 19:23:35 +0200 Subject: vcl114: #i113499# fix an erroneous assertion --- vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx index 9d3ce6b137cd..188bc0b34931 100644 --- a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx +++ b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx @@ -2291,11 +2291,10 @@ BOOL GtkSalGraphics::NWPaintGTKTabItem( ControlType nType, ControlPart, const ImplControlValue& aValue, const OUString& ) { - OSL_ASSERT( aValue.getType() == CTRL_TAB_ITEM ); + OSL_ASSERT( nType != CTRL_TAB_ITEM || aValue.getType() == CTRL_TAB_ITEM ); GdkPixmap * pixmap; Rectangle pixmapRect; Rectangle tabRect; - const TabitemValue * pTabitemValue = static_cast(&aValue); GtkStateType stateType; GtkShadowType shadowType; if( ! gWidgetData[ m_nScreen ].gCacheTabItems ) @@ -2311,9 +2310,8 @@ BOOL GtkSalGraphics::NWPaintGTKTabItem( ControlType nType, ControlPart, if( !aCachePage.GetSize() ) aCachePage.SetSize( 1 ); - if ( !pTabitemValue && (nType==CTRL_TAB_ITEM) ) + if ( (nType == CTRL_TAB_ITEM) && (aValue.getType() != CTRL_TAB_ITEM) ) { - std::fprintf( stderr, "NWPaintGTKTabItem() received a NULL TabitemValue. Cannot draw native tab\n" ); return( false ); } @@ -2326,6 +2324,7 @@ BOOL GtkSalGraphics::NWPaintGTKTabItem( ControlType nType, ControlPart, pixmapRect = rControlRectangle; if ( nType == CTRL_TAB_ITEM ) { + const TabitemValue * pTabitemValue = static_cast(&aValue); if ( !pTabitemValue->isFirst() ) { // GTK+ tabs overlap on the right edge (the top tab obscures the -- cgit v1.2.3 From 8bc23cb3091b61e2b48df090cf384e06c9d2d0a1 Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Thu, 29 Jul 2010 13:11:16 +0200 Subject: vcl114: #i111139# symbol style was missing from style settings comparison operator --- vcl/source/app/settings.cxx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/vcl/source/app/settings.cxx b/vcl/source/app/settings.cxx index 980e0f1c5b58..ff4799d754f1 100755 --- a/vcl/source/app/settings.cxx +++ b/vcl/source/app/settings.cxx @@ -1041,6 +1041,8 @@ BOOL StyleSettings::operator ==( const StyleSettings& rSet ) const (mpData->mnUseSystemUIFonts == rSet.mpData->mnUseSystemUIFonts) && (mpData->mnUseFlatBorders == rSet.mpData->mnUseFlatBorders) && (mpData->mnUseFlatMenues == rSet.mpData->mnUseFlatMenues) && + (mpData->mnSymbolsStyle == rSet.mpData->mnSymbolsStyle) && + (mpData->mnPreferredSymbolsStyle == rSet.mpData->mnPreferredSymbolsStyle) && (mpData->maFaceColor == rSet.mpData->maFaceColor) && (mpData->maCheckedColor == rSet.mpData->maCheckedColor) && (mpData->maLightColor == rSet.mpData->maLightColor) && -- cgit v1.2.3 From 99cb21415053ce5ddccfaa7fca6f66b3732e4763 Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Thu, 29 Jul 2010 13:34:04 +0200 Subject: vcl114: #113502# do not use Alt-F6 --- vcl/source/window/taskpanelist.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vcl/source/window/taskpanelist.cxx b/vcl/source/window/taskpanelist.cxx index c09dc464b809..1adabe487492 100644 --- a/vcl/source/window/taskpanelist.cxx +++ b/vcl/source/window/taskpanelist.cxx @@ -206,7 +206,7 @@ BOOL TaskPaneList::HandleKeyEvent( KeyEvent aKeyEvent ) BOOL bFocusInList = FALSE; KeyCode aKeyCode = aKeyEvent.GetKeyCode(); BOOL bForward = !aKeyCode.IsShift(); - if( aKeyCode.GetCode() == KEY_F6 ) // F6 + if( aKeyCode.GetCode() == KEY_F6 && ! aKeyCode.IsMod2() ) // F6 { bSplitterOnly = aKeyCode.IsMod1() && aKeyCode.IsShift(); -- cgit v1.2.3 From deee1f03fb16af83c642121a5682af3398d90ece Mon Sep 17 00:00:00 2001 From: obo Date: Fri, 30 Jul 2010 13:29:03 +0200 Subject: DEV300 masterfix: #i10000# fix merge problem --- svtools/source/contnr/svlbitm.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/svtools/source/contnr/svlbitm.cxx b/svtools/source/contnr/svlbitm.cxx index ab5a71d88c32..d260f984c2b0 100644 --- a/svtools/source/contnr/svlbitm.cxx +++ b/svtools/source/contnr/svlbitm.cxx @@ -463,12 +463,12 @@ void SvLBoxButton::ImplAdjustBoxSize( Size& io_rSize, ControlType i_eType, Windo if ( i_pParent->IsNativeControlSupported( i_eType, PART_ENTIRE_CONTROL) ) { ImplControlValue aControlValue; - Region aCtrlRegion( Rectangle( Point( 0, 0 ), io_rSize ) ); + Rectangle aCtrlRegion( Point( 0, 0 ), io_rSize ); ControlState nState = CTRL_STATE_ENABLED; aControlValue.setTristateVal( BUTTONVALUE_ON ); - Region aNativeBounds, aNativeContent; + Rectangle aNativeBounds, aNativeContent; bool bNativeOK = i_pParent->GetNativeControlRegion( i_eType, PART_ENTIRE_CONTROL, aCtrlRegion, @@ -479,7 +479,7 @@ void SvLBoxButton::ImplAdjustBoxSize( Size& io_rSize, ControlType i_eType, Windo aNativeContent ); if( bNativeOK ) { - Size aContentSize( aNativeContent.GetBoundRect().GetSize() ); + Size aContentSize( aNativeContent.GetSize() ); // leave a little space around the box image (looks better if( aContentSize.Height() + 2 > io_rSize.Height() ) io_rSize.Height() = aContentSize.Height() + 2; -- cgit v1.2.3 From 3262dedec5adc4c5ed1ef6c864811d4f6b6c5f19 Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Fri, 30 Jul 2010 13:44:58 +0200 Subject: ooo33gsl04: #i113479# handle collation correctly on printers supporting only a copycount of 1 --- vcl/source/gdi/print3.cxx | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) mode change 100644 => 100755 vcl/source/gdi/print3.cxx diff --git a/vcl/source/gdi/print3.cxx b/vcl/source/gdi/print3.cxx old mode 100644 new mode 100755 index 191f8f26dc75..0aeb928856fc --- a/vcl/source/gdi/print3.cxx +++ b/vcl/source/gdi/print3.cxx @@ -594,12 +594,20 @@ bool Printer::StartJob( const rtl::OUString& i_rJobName, boost::shared_ptrjobStarted(); int nJobs = 1; - int nRepeatCount = bUserCopy ? mnCopyCount : 1; + int nOuterRepeatCount = 1; + int nInnerRepeatCount = 1; + if( bUserCopy ) + { + if( mbCollateCopy ) + nOuterRepeatCount = mnCopyCount; + else + nInnerRepeatCount = mnCopyCount; + } if( bSinglePrintJobs ) { nJobs = mnCopyCount; nCopies = 1; - nRepeatCount = 1; + nOuterRepeatCount = nInnerRepeatCount = 1; } for( int nJobIteration = 0; nJobIteration < nJobs; nJobIteration++ ) @@ -616,13 +624,21 @@ bool Printer::StartJob( const rtl::OUString& i_rJobName, boost::shared_ptrcreateProgressDialog(); int nPages = i_pController->getFilteredPageCount(); - for( int nIteration = 0; nIteration < nRepeatCount; nIteration++ ) + for( int nOuterIteration = 0; nOuterIteration < nOuterRepeatCount; nOuterIteration++ ) { for( int nPage = 0; nPage < nPages; nPage++ ) { - if( nPage == nPages-1 && nIteration == nRepeatCount-1 && nJobIteration == nJobs-1 ) - i_pController->setLastPage( sal_True ); - i_pController->printFilteredPage( nPage ); + for( int nInnerIteration = 0; nInnerIteration < nInnerRepeatCount; nInnerIteration++ ) + { + if( nPage == nPages-1 && + nOuterIteration == nOuterRepeatCount-1 && + nInnerIteration == nInnerRepeatCount-1 && + nJobIteration == nJobs-1 ) + { + i_pController->setLastPage( sal_True ); + } + i_pController->printFilteredPage( nPage ); + } } // FIXME: duplex ? } -- cgit v1.2.3 From af820cae74c9fc08d7da6c304aec432c23cc8811 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Fri, 30 Jul 2010 12:58:40 +0100 Subject: cmcfixes77: #i113543# automatic icons in menus entry stuck --- svtools/source/config/menuoptions.cxx | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/svtools/source/config/menuoptions.cxx b/svtools/source/config/menuoptions.cxx index 70d9d1623ef2..2e63be347fbe 100644 --- a/svtools/source/config/menuoptions.cxx +++ b/svtools/source/config/menuoptions.cxx @@ -314,8 +314,15 @@ void SvtMenuOptions_Impl::Notify( const Sequence< OUString >& seqPropertyNames ) // We need values from ALL notified configuration keys. DBG_ASSERT( !(seqPropertyNames.getLength()!=seqValues.getLength()), "SvtMenuOptions_Impl::Notify()\nI miss some values of configuration keys!\n" ); - sal_Bool bMenuIcons = true; - sal_Bool bSystemMenuIcons = true; + sal_Bool bMenuIcons = sal_True; + sal_Bool bSystemMenuIcons = sal_True; + if (m_nMenuIcons == 2) + bMenuIcons = (sal_Bool)(Application::GetSettings().GetStyleSettings().GetUseImagesInMenus()); + else + { + bSystemMenuIcons = sal_False; + bMenuIcons = m_nMenuIcons ? sal_True : sal_False; + } // Step over list of property names and get right value from coreesponding value list to set it on internal members! sal_Int32 nCount = seqPropertyNames.getLength(); -- cgit v1.2.3 From 9508308e2a25be243ec8e65147b0b407f3dbe846 Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Fri, 30 Jul 2010 14:47:09 +0200 Subject: ooo33gsl04: #i113479# fix collate handling with not native dialog --- vcl/aqua/source/gdi/salprn.cxx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/vcl/aqua/source/gdi/salprn.cxx b/vcl/aqua/source/gdi/salprn.cxx index 1c0401f769b5..ff4edcbf83f9 100644 --- a/vcl/aqua/source/gdi/salprn.cxx +++ b/vcl/aqua/source/gdi/salprn.cxx @@ -445,7 +445,7 @@ ULONG AquaSalInfoPrinter::GetCapabilities( const ImplJobSetup* i_pSetupData, USH case PRINTER_CAPABILITIES_COPIES: return 0xffff; case PRINTER_CAPABILITIES_COLLATECOPIES: - return 0; + return 0xffff; case PRINTER_CAPABILITIES_SETORIENTATION: return 1; case PRINTER_CAPABILITIES_SETDUPLEX: @@ -634,6 +634,8 @@ BOOL AquaSalInfoPrinter::StartJob( const String* i_pFileName, } [pPrintDict setObject: [[NSNumber numberWithInt: nCopies] autorelease] forKey: NSPrintCopies]; + if( nCopies > 1 ) + [pPrintDict setObject: [[NSNumber numberWithBool: pPrinter->IsCollateCopy()] autorelease] forKey: NSPrintMustCollate]; [pPrintDict setObject: [[NSNumber numberWithBool: YES] autorelease] forKey: NSPrintDetailedErrorReporting]; [pPrintDict setObject: [[NSNumber numberWithInt: 1] autorelease] forKey: NSPrintFirstPage]; // #i103253# weird: for some reason, autoreleasing the value below like the others above -- cgit v1.2.3 From 09bef4bf9ec8b77c55f4fa8ace4650bf1bfcd017 Mon Sep 17 00:00:00 2001 From: "Eike Rathke [er]" Date: Fri, 30 Jul 2010 21:31:39 +0200 Subject: calc57: #i113485# Uyghur is CTL --- i18npool/source/isolang/mslangid.cxx | 1 + 1 file changed, 1 insertion(+) diff --git a/i18npool/source/isolang/mslangid.cxx b/i18npool/source/isolang/mslangid.cxx index da9da0ff8646..a03d24e6fcdb 100644 --- a/i18npool/source/isolang/mslangid.cxx +++ b/i18npool/source/isolang/mslangid.cxx @@ -373,6 +373,7 @@ sal_Int16 MsLangId::getScriptType( LanguageType nLang ) case LANGUAGE_USER_BODO_INDIA: case LANGUAGE_USER_DOGRI_INDIA: case LANGUAGE_USER_MAITHILI_INDIA: + case LANGUAGE_UIGHUR_CHINA: nScript = ::com::sun::star::i18n::ScriptType::COMPLEX; break; -- cgit v1.2.3 From df927c57ac0c1843d180902eb746a572fdabbc17 Mon Sep 17 00:00:00 2001 From: "Herbert Duerr [hdu]" Date: Mon, 2 Aug 2010 09:02:35 +0200 Subject: #i113563# fix compile with system-graphite (thanks cmc) --- vcl/source/glyphs/graphite_layout.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vcl/source/glyphs/graphite_layout.cxx b/vcl/source/glyphs/graphite_layout.cxx index 2a56d4517e0b..5d971d4bc985 100644 --- a/vcl/source/glyphs/graphite_layout.cxx +++ b/vcl/source/glyphs/graphite_layout.cxx @@ -677,7 +677,7 @@ public: return hash; }; protected: - virtual void UniqueCacheInfo(std::wstring & stuFace, bool & fBold, bool & fItalic) + virtual void UniqueCacheInfo( ext_std::wstring& stuFace, bool& fBold, bool& fItalic ) { #ifdef WIN32 dynamic_cast(mrRealFont).UniqueCacheInfo(stuFace, fBold, fItalic); -- cgit v1.2.3 From 7c50521fa26e17ae7c7dba6d6d20a1e6a52a24de Mon Sep 17 00:00:00 2001 From: "Herbert Duerr [hdu]" Date: Mon, 2 Aug 2010 16:31:58 +0200 Subject: #i106817# clarify relative and absolute positions in textline drawing to fix word-wise decorations --- vcl/source/gdi/outdev3.cxx | 91 ++++++++++++++++++++++++++-------------------- 1 file changed, 51 insertions(+), 40 deletions(-) diff --git a/vcl/source/gdi/outdev3.cxx b/vcl/source/gdi/outdev3.cxx index 300272dccd63..3faab0875717 100644 --- a/vcl/source/gdi/outdev3.cxx +++ b/vcl/source/gdi/outdev3.cxx @@ -3133,17 +3133,17 @@ long OutputDevice::ImplGetTextWidth( const SalLayout& rSalLayout ) const // ----------------------------------------------------------------------- void OutputDevice::ImplDrawTextRect( long nBaseX, long nBaseY, - long nX, long nY, long nWidth, long nHeight ) + long nDistX, long nDistY, long nWidth, long nHeight ) { + long nX = nDistX; + long nY = nDistY; + short nOrientation = mpFontEntry->mnOrientation; if ( nOrientation ) { // Rotate rect without rounding problems for 90 degree rotations if ( !(nOrientation % 900) ) { - nX -= nBaseX; - nY -= nBaseY; - if ( nOrientation == 900 ) { long nTemp = nX; @@ -3171,12 +3171,11 @@ void OutputDevice::ImplDrawTextRect( long nBaseX, long nBaseY, nHeight = nTemp; nX -= nWidth; } - - nX += nBaseX; - nY += nBaseY; } else { + nX += nBaseX; + nY += nBaseY; // inflate because polygons are drawn smaller Rectangle aRect( Point( nX, nY ), Size( nWidth+1, nHeight+1 ) ); Polygon aPoly( aRect ); @@ -3186,6 +3185,8 @@ void OutputDevice::ImplDrawTextRect( long nBaseX, long nBaseY, } } + nX += nBaseX; + nY += nBaseY; mpGraphics->DrawRect( nX, nY, nWidth, nHeight, this ); } @@ -3206,7 +3207,7 @@ void OutputDevice::ImplDrawTextBackground( const SalLayout& rSalLayout ) mpGraphics->SetFillColor( ImplColorToSal( GetTextFillColor() ) ); mbInitFillColor = TRUE; - ImplDrawTextRect( nX, nY, nX, nY-mpFontEntry->maMetric.mnAscent-mnEmphasisAscent, + ImplDrawTextRect( nX, nY, 0, -(mpFontEntry->maMetric.mnAscent + mnEmphasisAscent), nWidth, mpFontEntry->mnLineHeight+mnEmphasisAscent+mnEmphasisDescent ); } @@ -3491,7 +3492,7 @@ static void ImplDrawWavePixel( long nOriginX, long nOriginY, // ----------------------------------------------------------------------- void OutputDevice::ImplDrawWaveLine( long nBaseX, long nBaseY, - long nStartX, long nStartY, + long nDistX, long nDistY, long nWidth, long nHeight, long nLineWidth, short nOrientation, const Color& rColor ) @@ -3499,6 +3500,9 @@ void OutputDevice::ImplDrawWaveLine( long nBaseX, long nBaseY, if ( !nHeight ) return; + long nStartX = nBaseX + nDistX; + long nStartY = nBaseY + nDistY; + // Bei Hoehe von 1 Pixel reicht es, eine Linie auszugeben if ( (nLineWidth == 1) && (nHeight == 1) ) { @@ -3513,7 +3517,6 @@ void OutputDevice::ImplDrawWaveLine( long nBaseX, long nBaseY, ImplRotatePos( nBaseX, nBaseY, nEndX, nEndY, nOrientation ); } mpGraphics->DrawLine( nStartX, nStartY, nEndX, nEndY, this ); - } else { @@ -3613,7 +3616,7 @@ void OutputDevice::ImplDrawWaveLine( long nBaseX, long nBaseY, // ----------------------------------------------------------------------- void OutputDevice::ImplDrawWaveTextLine( long nBaseX, long nBaseY, - long nX, long nY, long nWidth, + long nDistX, long nDistY, long nWidth, FontUnderline eTextLine, Color aColor, BOOL bIsAbove ) @@ -3639,7 +3642,7 @@ void OutputDevice::ImplDrawWaveTextLine( long nBaseX, long nBaseY, nLineWidth = 1; if ( eTextLine == UNDERLINE_BOLDWAVE ) nLineWidth *= 2; - nLinePos += nY - (nLineHeight / 2); + nLinePos += nDistY - (nLineHeight / 2); long nLineWidthHeight = ((nLineWidth*mnDPIX)+(mnDPIY/2))/mnDPIY; if ( eTextLine == UNDERLINE_DOUBLEWAVE ) { @@ -3660,16 +3663,16 @@ void OutputDevice::ImplDrawWaveTextLine( long nBaseX, long nBaseY, nLineDY2 = 1; nLinePos -= nLineWidthHeight-nLineDY2; - ImplDrawWaveLine( nBaseX, nBaseY, nX, nLinePos, nWidth, nLineHeight, + ImplDrawWaveLine( nBaseX, nBaseY, nDistX, nLinePos, nWidth, nLineHeight, nLineWidth, mpFontEntry->mnOrientation, aColor ); nLinePos += nLineWidthHeight+nLineDY; - ImplDrawWaveLine( nBaseX, nBaseY, nX, nLinePos, nWidth, nLineHeight, + ImplDrawWaveLine( nBaseX, nBaseY, nDistX, nLinePos, nWidth, nLineHeight, nLineWidth, mpFontEntry->mnOrientation, aColor ); } else { nLinePos -= nLineWidthHeight/2; - ImplDrawWaveLine( nBaseX, nBaseY, nX, nLinePos, nWidth, nLineHeight, + ImplDrawWaveLine( nBaseX, nBaseY, nDistX, nLinePos, nWidth, nLineHeight, nLineWidth, mpFontEntry->mnOrientation, aColor ); } } @@ -3677,7 +3680,7 @@ void OutputDevice::ImplDrawWaveTextLine( long nBaseX, long nBaseY, // ----------------------------------------------------------------------- void OutputDevice::ImplDrawStraightTextLine( long nBaseX, long nBaseY, - long nX, long nY, long nWidth, + long nDistX, long nDistY, long nWidth, FontUnderline eTextLine, Color aColor, BOOL bIsAbove ) @@ -3687,6 +3690,8 @@ void OutputDevice::ImplDrawStraightTextLine( long nBaseX, long nBaseY, long nLinePos = 0; long nLinePos2 = 0; + const long nY = nDistY; + if ( eTextLine > UNDERLINE_LAST ) eTextLine = UNDERLINE_SINGLE; @@ -3754,7 +3759,7 @@ void OutputDevice::ImplDrawStraightTextLine( long nBaseX, long nBaseY, mpGraphics->SetFillColor( ImplColorToSal( aColor ) ); mbInitFillColor = TRUE; - long nLeft = nX; + long nLeft = nDistX; switch ( eTextLine ) { @@ -3907,7 +3912,7 @@ void OutputDevice::ImplDrawStraightTextLine( long nBaseX, long nBaseY, // ----------------------------------------------------------------------- void OutputDevice::ImplDrawStrikeoutLine( long nBaseX, long nBaseY, - long nX, long nY, long nWidth, + long nDistX, long nDistY, long nWidth, FontStrikeout eStrikeout, Color aColor ) { @@ -3916,6 +3921,8 @@ void OutputDevice::ImplDrawStrikeoutLine( long nBaseX, long nBaseY, long nLinePos = 0; long nLinePos2 = 0; + long nY = nDistY; + if ( eStrikeout > STRIKEOUT_LAST ) eStrikeout = STRIKEOUT_SINGLE; @@ -3948,7 +3955,7 @@ void OutputDevice::ImplDrawStrikeoutLine( long nBaseX, long nBaseY, mpGraphics->SetFillColor( ImplColorToSal( aColor ) ); mbInitFillColor = TRUE; - long nLeft = nX; + const long& nLeft = nDistX; switch ( eStrikeout ) { @@ -3969,7 +3976,7 @@ void OutputDevice::ImplDrawStrikeoutLine( long nBaseX, long nBaseY, // ----------------------------------------------------------------------- void OutputDevice::ImplDrawStrikeoutChar( long nBaseX, long nBaseY, - long nX, long nY, long nWidth, + long nDistX, long nDistY, long nWidth, FontStrikeout eStrikeout, Color aColor ) { @@ -4003,12 +4010,12 @@ void OutputDevice::ImplDrawStrikeoutChar( long nBaseX, long nBaseY, // calculate acceptable strikeout length // allow the strikeout to be one pixel larger than the text it strikes out - long nMaxWidth = nStrikeoutWidth / 2; + long nMaxWidth = nStrikeoutWidth * 3 / 4; if ( nMaxWidth < 2 ) nMaxWidth = 2; nMaxWidth += nWidth + 1; - int nStrikeStrLen = (nMaxWidth + nStrikeoutWidth - 1) / nStrikeoutWidth; + int nStrikeStrLen = (nMaxWidth - 1) / nStrikeoutWidth; // if the text width is smaller than the strikeout text, then do not // strike out at all. This case requires user interaction, e.g. adding // a space to the text @@ -4023,7 +4030,9 @@ void OutputDevice::ImplDrawStrikeoutChar( long nBaseX, long nBaseY, const String aStrikeoutText( aChars, xub_StrLen(nStrikeStrLen) ); if( mpFontEntry->mnOrientation ) - ImplRotatePos( nBaseX, nBaseY, nX, nY, mpFontEntry->mnOrientation ); + ImplRotatePos( 0, 0, nDistX, nDistY, mpFontEntry->mnOrientation ); + nBaseX += nDistX; + nBaseY += nDistY; // strikeout text has to be left aligned ULONG nOrigTLM = mnTextLayoutMode; @@ -4039,7 +4048,7 @@ void OutputDevice::ImplDrawStrikeoutChar( long nBaseX, long nBaseY, SetTextColor( aColor ); ImplInitTextColor(); - pLayout->DrawBase() = Point( nX+mnTextOffX, nY+mnTextOffY ); + pLayout->DrawBase() = Point( nBaseX+mnTextOffX, nBaseY+mnTextOffY ); pLayout->DrawText( *mpGraphics ); pLayout->Release(); @@ -4049,8 +4058,8 @@ void OutputDevice::ImplDrawStrikeoutChar( long nBaseX, long nBaseY, // ----------------------------------------------------------------------- -void OutputDevice::ImplDrawTextLine( long nBaseX, - long nX, long nY, long nWidth, +void OutputDevice::ImplDrawTextLine( long nX, long nY, + long nDistX, long nWidth, FontStrikeout eStrikeout, FontUnderline eUnderline, FontUnderline eOverline, @@ -4069,7 +4078,7 @@ void OutputDevice::ImplDrawTextLine( long nBaseX, // TODO: fix rotated text if ( IsRTLEnabled() ) // --- RTL --- mirror at basex - nX = nBaseX - nWidth - (nX - nBaseX - 1); + nX = nDistX - nWidth - (nX - nDistX - 1); if ( !IsTextLineColor() ) aUnderlineColor = GetTextColor(); @@ -4082,7 +4091,7 @@ void OutputDevice::ImplDrawTextLine( long nBaseX, (eUnderline == UNDERLINE_DOUBLEWAVE) || (eUnderline == UNDERLINE_BOLDWAVE) ) { - ImplDrawWaveTextLine( nBaseX, nY, nX, nY, nWidth, eUnderline, aUnderlineColor, bUnderlineAbove ); + ImplDrawWaveTextLine( nX, nY, nDistX, 0, nWidth, eUnderline, aUnderlineColor, bUnderlineAbove ); bUnderlineDone = TRUE; } if ( (eOverline == UNDERLINE_SMALLWAVE) || @@ -4090,25 +4099,25 @@ void OutputDevice::ImplDrawTextLine( long nBaseX, (eOverline == UNDERLINE_DOUBLEWAVE) || (eOverline == UNDERLINE_BOLDWAVE) ) { - ImplDrawWaveTextLine( nBaseX, nY, nX, nY, nWidth, eOverline, aOverlineColor, TRUE ); + ImplDrawWaveTextLine( nX, nY, nDistX, 0, nWidth, eOverline, aOverlineColor, TRUE ); bOverlineDone = TRUE; } if ( (eStrikeout == STRIKEOUT_SLASH) || (eStrikeout == STRIKEOUT_X) ) { - ImplDrawStrikeoutChar( nBaseX, nY, nX, nY, nWidth, eStrikeout, aStrikeoutColor ); + ImplDrawStrikeoutChar( nX, nY, nDistX, 0, nWidth, eStrikeout, aStrikeoutColor ); bStrikeoutDone = TRUE; } if ( !bUnderlineDone ) - ImplDrawStraightTextLine( nBaseX, nY, nX, nY, nWidth, eUnderline, aUnderlineColor, bUnderlineAbove ); + ImplDrawStraightTextLine( nX, nY, nDistX, 0, nWidth, eUnderline, aUnderlineColor, bUnderlineAbove ); if ( !bOverlineDone ) - ImplDrawStraightTextLine( nBaseX, nY, nX, nY, nWidth, eOverline, aOverlineColor, TRUE ); + ImplDrawStraightTextLine( nX, nY, nDistX, 0, nWidth, eOverline, aOverlineColor, TRUE ); if ( !bStrikeoutDone ) - ImplDrawStrikeoutLine( nBaseX, nY, nX, nY, nWidth, eStrikeout, aStrikeoutColor ); + ImplDrawStrikeoutLine( nX, nY, nDistX, 0, nWidth, eStrikeout, aStrikeoutColor ); } // ----------------------------------------------------------------------- @@ -4130,14 +4139,16 @@ void OutputDevice::ImplDrawTextLines( SalLayout& rSalLayout, { if( !nWidth ) { - aStartPt = aPos;//rSalLayout.DrawBase() - (aPos - rSalLayout.DrawOffset()); + // TODO: keep both base point + // and relative distance (as projection to baseline) + aStartPt = aPos; } nWidth += nAdvance; } else if( nWidth > 0 ) { - ImplDrawTextLine( rSalLayout.DrawBase().X(), aStartPt.X(), aStartPt.Y(), nWidth, + ImplDrawTextLine( aStartPt.X(), aStartPt.Y(), 0, nWidth, eStrikeout, eUnderline, eOverline, bUnderlineAbove ); nWidth = 0; } @@ -4145,7 +4156,7 @@ void OutputDevice::ImplDrawTextLines( SalLayout& rSalLayout, if( nWidth > 0 ) { - ImplDrawTextLine( rSalLayout.DrawBase().X(), aStartPt.X(), aStartPt.Y(), nWidth, + ImplDrawTextLine( aStartPt.X(), aStartPt.Y(), 0, nWidth, eStrikeout, eUnderline, eOverline, bUnderlineAbove ); } } @@ -4153,7 +4164,7 @@ void OutputDevice::ImplDrawTextLines( SalLayout& rSalLayout, { Point aStartPt = rSalLayout.GetDrawPosition(); int nWidth = rSalLayout.GetTextWidth() / rSalLayout.GetUnitsPerPixel(); - ImplDrawTextLine( rSalLayout.DrawBase().X(), aStartPt.X(), aStartPt.Y(), nWidth, + ImplDrawTextLine( aStartPt.X(), aStartPt.Y(), 0, nWidth, eStrikeout, eUnderline, eOverline, bUnderlineAbove ); } } @@ -4172,7 +4183,7 @@ void OutputDevice::ImplDrawMnemonicLine( long nX, long nY, long nWidth ) nX = nBaseX - nWidth - (nX - nBaseX - 1); } - ImplDrawTextLine( nBaseX, nX, nY, nWidth, STRIKEOUT_NONE, UNDERLINE_SINGLE, UNDERLINE_NONE, FALSE ); + ImplDrawTextLine( nX, nY, 0, nWidth, STRIKEOUT_NONE, UNDERLINE_SINGLE, UNDERLINE_NONE, FALSE ); } // ----------------------------------------------------------------------- @@ -5420,7 +5431,7 @@ void OutputDevice::DrawTextLine( const Point& rPos, long nWidth, Point aPos = ImplLogicToDevicePixel( rPos ); nWidth = ImplLogicWidthToDevicePixel( nWidth ); aPos += Point( mnTextOffX, mnTextOffY ); - ImplDrawTextLine( aPos.X(), aPos.X(), aPos.Y(), nWidth, eStrikeout, eUnderline, eOverline, bUnderlineAbove ); + ImplDrawTextLine( aPos.X(), aPos.X(), 0, nWidth, eStrikeout, eUnderline, eOverline, bUnderlineAbove ); if( mpAlphaVDev ) mpAlphaVDev->DrawTextLine( rPos, nWidth, eStrikeout, eUnderline, eOverline, bUnderlineAbove ); @@ -5497,7 +5508,7 @@ void OutputDevice::DrawWaveLine( const Point& rStartPos, const Point& rEndPos, if( nWaveHeight > pFontEntry->maMetric.mnWUnderlineSize ) nWaveHeight = pFontEntry->maMetric.mnWUnderlineSize; - ImplDrawWaveLine( nStartX, nStartY, nStartX, nStartY, + ImplDrawWaveLine( nStartX, nStartY, 0, 0, nEndX-nStartX, nWaveHeight, 1, nOrientation, GetLineColor() ); if( mpAlphaVDev ) -- cgit v1.2.3 From eea9cfb7b25fce9dd8257b8735edbe891ae42ca6 Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Mon, 2 Aug 2010 17:30:58 +0200 Subject: vcl114: #i113470# fix a signed/unsigned problem --- vcl/aqua/source/window/salframe.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vcl/aqua/source/window/salframe.cxx b/vcl/aqua/source/window/salframe.cxx index b14354e1b4bd..fa436104172a 100644 --- a/vcl/aqua/source/window/salframe.cxx +++ b/vcl/aqua/source/window/salframe.cxx @@ -356,12 +356,12 @@ void AquaSalFrame::initShow() if( mpParent ) // center relative to parent { // center on parent - long nNewX = mpParent->maGeometry.nX + (mpParent->maGeometry.nWidth - maGeometry.nWidth)/2; + long nNewX = mpParent->maGeometry.nX + ((long)mpParent->maGeometry.nWidth - (long)maGeometry.nWidth)/2; if( nNewX < aScreenRect.Left() ) nNewX = aScreenRect.Left(); if( long(nNewX + maGeometry.nWidth) > aScreenRect.Right() ) nNewX = aScreenRect.Right() - maGeometry.nWidth-1; - long nNewY = mpParent->maGeometry.nY + (mpParent->maGeometry.nHeight - maGeometry.nHeight)/2; + long nNewY = mpParent->maGeometry.nY + ((long)mpParent->maGeometry.nHeight - (long)maGeometry.nHeight)/2; if( nNewY < aScreenRect.Top() ) nNewY = aScreenRect.Top(); if( nNewY > aScreenRect.Bottom() ) -- cgit v1.2.3 From 1d0220bd674b04559dd7f76f4187fabb90c09d85 Mon Sep 17 00:00:00 2001 From: Daniel Rentz Date: Mon, 2 Aug 2010 17:38:06 +0200 Subject: calc57: #i113446# reduce indentation of child elements to make the words fit into the available space --- vcl/source/window/printdlg.cxx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/vcl/source/window/printdlg.cxx b/vcl/source/window/printdlg.cxx index 52f54db0e50e..d0fae33acf3b 100644 --- a/vcl/source/window/printdlg.cxx +++ b/vcl/source/window/printdlg.cxx @@ -498,8 +498,10 @@ void PrintDialog::NUpTabPage::showAdvancedControls( bool i_bShow ) void PrintDialog::NUpTabPage::setupLayout() { - Size aBorder( LogicToPixel( Size( 5, 5 ), MapMode( MAP_APPFONT ) ) ); - long nIndent = 3*aBorder.Width(); + Size aBorder( LogicToPixel( Size( 6, 6 ), MapMode( MAP_APPFONT ) ) ); + /* According to OOo style guide, the horizontal indentation of child + elements to their parent element should always be 6 map units. */ + long nIndent = aBorder.Width(); maLayout.setParentWindow( this ); maLayout.setOuterBorder( aBorder.Width() ); -- cgit v1.2.3 From 010fa697caf3558f087220dcca3531d13e22b987 Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Mon, 2 Aug 2010 18:15:47 +0200 Subject: vcl114: #i113593# flat buttons need transparency handling also in non NWF case --- vcl/source/control/button.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vcl/source/control/button.cxx b/vcl/source/control/button.cxx index bacd875fb473..ce1119481e87 100644 --- a/vcl/source/control/button.cxx +++ b/vcl/source/control/button.cxx @@ -896,7 +896,7 @@ void PushButton::ImplInitSettings( BOOL bFont, // #i38498#: do not check for GetParent()->IsChildTransparentModeEnabled() // otherwise the formcontrol button will be overdrawn due to PARENTCLIPMODE_NOCLIP // for radio and checkbox this is ok as they shoud appear transparent in documents - if ( IsNativeControlSupported( CTRL_PUSHBUTTON, PART_ENTIRE_CONTROL ) ) + if ( IsNativeControlSupported( CTRL_PUSHBUTTON, PART_ENTIRE_CONTROL ) || WB_FLATBUTTON ) { EnableChildTransparentMode( TRUE ); SetParentClipMode( PARENTCLIPMODE_NOCLIP ); -- cgit v1.2.3 From 6b16723121bffd8ebf9b8e688af5457235f687ef Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Tue, 3 Aug 2010 10:01:07 +0100 Subject: cmcfixes77: #i113503# system non-stlport cppunit with OOo stlport --- basebmp/test/basictest.cxx | 2 + basebmp/test/bmpmasktest.cxx | 2 + basebmp/test/bmptest.cxx | 2 + basebmp/test/cliptest.cxx | 2 + basebmp/test/filltest.cxx | 2 + basebmp/test/linetest.cxx | 2 + basebmp/test/makefile.mk | 7 ++++ basebmp/test/masktest.cxx | 2 + basebmp/test/polytest.cxx | 2 + basegfx/test/basegfx1d.cxx | 2 + basegfx/test/basegfx2d.cxx | 2 + basegfx/test/basegfx3d.cxx | 2 + basegfx/test/basegfxtools.cxx | 2 + basegfx/test/boxclipper.cxx | 2 + basegfx/test/clipstate.cxx | 2 + basegfx/test/genericclipper.cxx | 2 + basegfx/test/makefile.mk | 7 ++++ o3tl/qa/makefile.mk | 7 ++++ o3tl/qa/test-cow_wrapper.cxx | 2 + o3tl/qa/test-heap_ptr.cxx | 2 + o3tl/qa/test-range.cxx | 2 + o3tl/qa/test-vector_pool.cxx | 2 + sax/qa/cppunit/makefile.mk | 7 ++++ sax/qa/cppunit/test_converter.cxx | 2 + tools/inc/tools/postextstl.h | 36 ----------------- tools/inc/tools/preextstl.h | 71 ---------------------------------- tools/prj/d.lst | 3 -- vcl/inc/vcl/graphite_adaptors.hxx | 4 +- vcl/inc/vcl/graphite_features.hxx | 4 +- vcl/inc/vcl/graphite_layout.hxx | 4 +- vcl/source/glyphs/graphite_cache.cxx | 4 +- vcl/source/glyphs/graphite_layout.cxx | 4 +- vcl/source/glyphs/graphite_textsrc.hxx | 4 +- vcl/util/makefile2.pmk | 2 +- 34 files changed, 81 insertions(+), 123 deletions(-) delete mode 100644 tools/inc/tools/postextstl.h delete mode 100644 tools/inc/tools/preextstl.h diff --git a/basebmp/test/basictest.cxx b/basebmp/test/basictest.cxx index 6f96cf56f492..a9c533a3a134 100644 --- a/basebmp/test/basictest.cxx +++ b/basebmp/test/basictest.cxx @@ -27,10 +27,12 @@ // autogenerated file with codegen.pl +#include "preextstl.h" #include "cppunit/TestAssert.h" #include "cppunit/TestFixture.h" #include "cppunit/extensions/HelperMacros.h" #include "cppunit/plugin/TestPlugIn.h" +#include "postextstl.h" #include #include diff --git a/basebmp/test/bmpmasktest.cxx b/basebmp/test/bmpmasktest.cxx index 9be504819fe8..29e261423a06 100644 --- a/basebmp/test/bmpmasktest.cxx +++ b/basebmp/test/bmpmasktest.cxx @@ -27,9 +27,11 @@ // autogenerated file with codegen.pl +#include "preextstl.h" #include "cppunit/TestAssert.h" #include "cppunit/TestFixture.h" #include "cppunit/extensions/HelperMacros.h" +#include "postextstl.h" #include #include diff --git a/basebmp/test/bmptest.cxx b/basebmp/test/bmptest.cxx index 9e33f0a8d713..9d083980790b 100644 --- a/basebmp/test/bmptest.cxx +++ b/basebmp/test/bmptest.cxx @@ -27,9 +27,11 @@ // autogenerated file with codegen.pl +#include "preextstl.h" #include "cppunit/TestAssert.h" #include "cppunit/TestFixture.h" #include "cppunit/extensions/HelperMacros.h" +#include "postextstl.h" #include #include diff --git a/basebmp/test/cliptest.cxx b/basebmp/test/cliptest.cxx index 875016d878cc..b0f0b72f07e0 100644 --- a/basebmp/test/cliptest.cxx +++ b/basebmp/test/cliptest.cxx @@ -27,9 +27,11 @@ // autogenerated file with codegen.pl +#include "preextstl.h" #include "cppunit/TestAssert.h" #include "cppunit/TestFixture.h" #include "cppunit/extensions/HelperMacros.h" +#include "postextstl.h" #include #include diff --git a/basebmp/test/filltest.cxx b/basebmp/test/filltest.cxx index 150fa11b3a72..d03e887dbcc5 100644 --- a/basebmp/test/filltest.cxx +++ b/basebmp/test/filltest.cxx @@ -27,9 +27,11 @@ // autogenerated file with codegen.pl +#include "preextstl.h" #include "cppunit/TestAssert.h" #include "cppunit/TestFixture.h" #include "cppunit/extensions/HelperMacros.h" +#include "postextstl.h" #include #include diff --git a/basebmp/test/linetest.cxx b/basebmp/test/linetest.cxx index fcd383fccdb0..dbdbe57de0a7 100644 --- a/basebmp/test/linetest.cxx +++ b/basebmp/test/linetest.cxx @@ -27,9 +27,11 @@ // autogenerated file with codegen.pl +#include "preextstl.h" #include "cppunit/TestAssert.h" #include "cppunit/TestFixture.h" #include "cppunit/extensions/HelperMacros.h" +#include "postextstl.h" #include #include diff --git a/basebmp/test/makefile.mk b/basebmp/test/makefile.mk index ca77721716f7..8dc95dcea0e5 100644 --- a/basebmp/test/makefile.mk +++ b/basebmp/test/makefile.mk @@ -60,6 +60,13 @@ CDEFS+=-xalias_level=compatible .ENDIF .ENDIF +#building with stlport, but cppunit was not built with stlport +.IF "$(USE_SYSTEM_STL)"!="YES" +.IF "$(SYSTEM_CPPUNIT)"=="YES" +CFLAGSCXX+=-DADAPT_EXT_STL +.ENDIF +.ENDIF + CFLAGSCXX += $(CPPUNIT_CFLAGS) # --- Common ---------------------------------------------------------- diff --git a/basebmp/test/masktest.cxx b/basebmp/test/masktest.cxx index 77cd05588d5a..63f357a314d0 100644 --- a/basebmp/test/masktest.cxx +++ b/basebmp/test/masktest.cxx @@ -27,9 +27,11 @@ // autogenerated file with codegen.pl +#include "preextstl.h" #include "cppunit/TestAssert.h" #include "cppunit/TestFixture.h" #include "cppunit/extensions/HelperMacros.h" +#include "postextstl.h" #include #include diff --git a/basebmp/test/polytest.cxx b/basebmp/test/polytest.cxx index f3b1f0018e17..2feef67774de 100644 --- a/basebmp/test/polytest.cxx +++ b/basebmp/test/polytest.cxx @@ -27,9 +27,11 @@ // autogenerated file with codegen.pl +#include "preextstl.h" #include "cppunit/TestAssert.h" #include "cppunit/TestFixture.h" #include "cppunit/extensions/HelperMacros.h" +#include "postextstl.h" #include #include diff --git a/basegfx/test/basegfx1d.cxx b/basegfx/test/basegfx1d.cxx index 41ac65da56e3..9b189bd8b236 100644 --- a/basegfx/test/basegfx1d.cxx +++ b/basegfx/test/basegfx1d.cxx @@ -30,10 +30,12 @@ #include "precompiled_basegfx.hxx" // autogenerated file with codegen.pl +#include "preextstl.h" #include "cppunit/TestAssert.h" #include "cppunit/TestFixture.h" #include "cppunit/extensions/HelperMacros.h" #include "cppunit/plugin/TestPlugIn.h" +#include "postextstl.h" namespace basegfx1d { diff --git a/basegfx/test/basegfx2d.cxx b/basegfx/test/basegfx2d.cxx index 31005a158982..53501d190c03 100644 --- a/basegfx/test/basegfx2d.cxx +++ b/basegfx/test/basegfx2d.cxx @@ -30,9 +30,11 @@ #include "precompiled_basegfx.hxx" // autogenerated file with codegen.pl +#include "preextstl.h" #include "cppunit/TestAssert.h" #include "cppunit/TestFixture.h" #include "cppunit/extensions/HelperMacros.h" +#include "postextstl.h" #include #include diff --git a/basegfx/test/basegfx3d.cxx b/basegfx/test/basegfx3d.cxx index a16132e0810f..4871dcbd16c4 100644 --- a/basegfx/test/basegfx3d.cxx +++ b/basegfx/test/basegfx3d.cxx @@ -30,9 +30,11 @@ #include "precompiled_basegfx.hxx" // autogenerated file with codegen.pl +#include "preextstl.h" #include "cppunit/TestAssert.h" #include "cppunit/TestFixture.h" #include "cppunit/extensions/HelperMacros.h" +#include "postextstl.h" namespace basegfx3d { diff --git a/basegfx/test/basegfxtools.cxx b/basegfx/test/basegfxtools.cxx index 1a8b97a559b2..7e385f1eb78c 100644 --- a/basegfx/test/basegfxtools.cxx +++ b/basegfx/test/basegfxtools.cxx @@ -30,9 +30,11 @@ #include "precompiled_basegfx.hxx" // autogenerated file with codegen.pl +#include "preextstl.h" #include "cppunit/TestAssert.h" #include "cppunit/TestFixture.h" #include "cppunit/extensions/HelperMacros.h" +#include "postextstl.h" #include #include diff --git a/basegfx/test/boxclipper.cxx b/basegfx/test/boxclipper.cxx index d52218a51ee0..b1e08087136f 100644 --- a/basegfx/test/boxclipper.cxx +++ b/basegfx/test/boxclipper.cxx @@ -30,9 +30,11 @@ #include "precompiled_basegfx.hxx" // autogenerated file with codegen.pl +#include "preextstl.h" #include "cppunit/TestAssert.h" #include "cppunit/TestFixture.h" #include "cppunit/extensions/HelperMacros.h" +#include "postextstl.h" #include #include diff --git a/basegfx/test/clipstate.cxx b/basegfx/test/clipstate.cxx index 3d9f59979aa7..48c1e5967260 100644 --- a/basegfx/test/clipstate.cxx +++ b/basegfx/test/clipstate.cxx @@ -30,9 +30,11 @@ #include "precompiled_basegfx.hxx" // autogenerated file with codegen.pl +#include "preextstl.h" #include "cppunit/TestAssert.h" #include "cppunit/TestFixture.h" #include "cppunit/extensions/HelperMacros.h" +#include "postextstl.h" #include #include diff --git a/basegfx/test/genericclipper.cxx b/basegfx/test/genericclipper.cxx index 84230a084493..d6c97c0567dc 100644 --- a/basegfx/test/genericclipper.cxx +++ b/basegfx/test/genericclipper.cxx @@ -30,9 +30,11 @@ #include "precompiled_basegfx.hxx" // autogenerated file with codegen.pl +#include "preextstl.h" #include "cppunit/TestAssert.h" #include "cppunit/TestFixture.h" #include "cppunit/extensions/HelperMacros.h" +#include "postextstl.h" #include #include diff --git a/basegfx/test/makefile.mk b/basegfx/test/makefile.mk index 2c0f30c291a9..09d8b805f9f5 100644 --- a/basegfx/test/makefile.mk +++ b/basegfx/test/makefile.mk @@ -36,6 +36,13 @@ ENABLE_EXCEPTIONS=TRUE .INCLUDE : settings.mk +#building with stlport, but cppunit was not built with stlport +.IF "$(USE_SYSTEM_STL)"!="YES" +.IF "$(SYSTEM_CPPUNIT)"=="YES" +CFLAGSCXX+=-DADAPT_EXT_STL +.ENDIF +.ENDIF + CFLAGSCXX += $(CPPUNIT_CFLAGS) # --- Common ---------------------------------------------------------- diff --git a/o3tl/qa/makefile.mk b/o3tl/qa/makefile.mk index 3475aeeca9bb..0c6ecd88e56b 100644 --- a/o3tl/qa/makefile.mk +++ b/o3tl/qa/makefile.mk @@ -36,6 +36,13 @@ ENABLE_EXCEPTIONS=TRUE .INCLUDE : settings.mk +#building with stlport, but cppunit was not built with stlport +.IF "$(USE_SYSTEM_STL)"!="YES" +.IF "$(SYSTEM_CPPUNIT)"=="YES" +CFLAGSCXX+=-DADAPT_EXT_STL +.ENDIF +.ENDIF + CFLAGSCXX += $(CPPUNIT_CFLAGS) .IF "$(L10N_framework)"=="" diff --git a/o3tl/qa/test-cow_wrapper.cxx b/o3tl/qa/test-cow_wrapper.cxx index 84d615fca3db..cd69ab1c5e3d 100644 --- a/o3tl/qa/test-cow_wrapper.cxx +++ b/o3tl/qa/test-cow_wrapper.cxx @@ -1,9 +1,11 @@ // autogenerated file with codegen.pl +#include "preextstl.h" #include "cppunit/TestAssert.h" #include "cppunit/TestFixture.h" #include "cppunit/extensions/HelperMacros.h" #include "cppunit/plugin/TestPlugIn.h" +#include "postextstl.h" #include "cow_wrapper_clients.hxx" diff --git a/o3tl/qa/test-heap_ptr.cxx b/o3tl/qa/test-heap_ptr.cxx index fe2f78eec8af..63ec692efe5c 100644 --- a/o3tl/qa/test-heap_ptr.cxx +++ b/o3tl/qa/test-heap_ptr.cxx @@ -25,9 +25,11 @@ * ************************************************************************/ +#include "preextstl.h" #include "cppunit/TestAssert.h" #include "cppunit/TestFixture.h" #include "cppunit/extensions/HelperMacros.h" +#include "postextstl.h" #include diff --git a/o3tl/qa/test-range.cxx b/o3tl/qa/test-range.cxx index 31cf2aec7c10..634b04de9122 100644 --- a/o3tl/qa/test-range.cxx +++ b/o3tl/qa/test-range.cxx @@ -25,9 +25,11 @@ * ************************************************************************/ +#include "preextstl.h" #include "cppunit/TestAssert.h" #include "cppunit/TestFixture.h" #include "cppunit/extensions/HelperMacros.h" +#include "postextstl.h" #include #include diff --git a/o3tl/qa/test-vector_pool.cxx b/o3tl/qa/test-vector_pool.cxx index 4efaebdd3414..ab301752532e 100644 --- a/o3tl/qa/test-vector_pool.cxx +++ b/o3tl/qa/test-vector_pool.cxx @@ -1,8 +1,10 @@ // autogenerated file with codegen.pl +#include "preextstl.h" #include "cppunit/TestAssert.h" #include "cppunit/TestFixture.h" #include "cppunit/extensions/HelperMacros.h" +#include "postextstl.h" #include diff --git a/sax/qa/cppunit/makefile.mk b/sax/qa/cppunit/makefile.mk index e06eca25a737..b28f0cbac2ab 100644 --- a/sax/qa/cppunit/makefile.mk +++ b/sax/qa/cppunit/makefile.mk @@ -35,6 +35,13 @@ ENABLE_EXCEPTIONS=TRUE .INCLUDE : settings.mk +#building with stlport, but cppunit was not built with stlport +.IF "$(USE_SYSTEM_STL)"!="YES" +.IF "$(SYSTEM_CPPUNIT)"=="YES" +CFLAGSCXX+=-DADAPT_EXT_STL +.ENDIF +.ENDIF + CFLAGSCXX += $(CPPUNIT_CFLAGS) DLLPRE = # no leading "lib" on .so files diff --git a/sax/qa/cppunit/test_converter.cxx b/sax/qa/cppunit/test_converter.cxx index 1ea781afff95..b1881f248c0c 100644 --- a/sax/qa/cppunit/test_converter.cxx +++ b/sax/qa/cppunit/test_converter.cxx @@ -25,10 +25,12 @@ * ************************************************************************/ +#include "preextstl.h" #include #include #include #include +#include "postextstl.h" #include diff --git a/tools/inc/tools/postextstl.h b/tools/inc/tools/postextstl.h deleted file mode 100644 index 81a21e25c15b..000000000000 --- a/tools/inc/tools/postextstl.h +++ /dev/null @@ -1,36 +0,0 @@ -/************************************************************************* - * - * 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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#ifdef std_was_redefined_as_stlport -// put things back the way they were -# define std std_was_redefined_as_stlport -# undef _STLP_OUTERMOST_HEADER_ID -// force config to be re-read -# undef _STLP_NOTHROW_INHERENTLY -# undef _STLP_CONFIG_H -# include -#endif diff --git a/tools/inc/tools/preextstl.h b/tools/inc/tools/preextstl.h deleted file mode 100644 index 27aed38686f0..000000000000 --- a/tools/inc/tools/preextstl.h +++ /dev/null @@ -1,71 +0,0 @@ -/************************************************************************* - * - * 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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -//1. Force inclusion of a std:: using header to ensure the stlport define -//of std as "stlport" -#include -#if defined(ADAPT_EXT_STL) -//2. Force inclusion of stlport headers to get their stlport:: definitions -# include -# include -# include -# include -# include -# include -# include -//3. Now force inclusion of native headers to get their std:: definitions -# if defined(std) -# define std_was_redefined_as_stlport std -# undef std -# define _STLP_OUTERMOST_HEADER_ID 0xdeadbeaf -# if defined(_GNUC__) -# pragma GCC visibility push(default) -# endif -# include _STLP_NATIVE_HEADER(exception_defines.h) -# include _STLP_NATIVE_HEADER(limits) -# include _STLP_NATIVE_HEADER(memory) -# include _STLP_NATIVE_HEADER(exception) -# include _STLP_NATIVE_HEADER(iosfwd) -# include _STLP_NATIVE_HEADER(algorithm) -# include _STLP_NATIVE_HEADER(string) -# include _STLP_NATIVE_HEADER(streambuf) -# include _STLP_NATIVE_HEADER(ios) -# include _STLP_NATIVE_HEADER(locale) -# include _STLP_NATIVE_HEADER(stdexcept) -# include _STLP_NATIVE_HEADER(ostream) -# include _STLP_NATIVE_HEADER(istream) -# include _STLP_NATIVE_HEADER(iostream) -# include _STLP_NATIVE_HEADER(vector) -# include _STLP_NATIVE_HEADER(list) -# include _STLP_NATIVE_HEADER(map) -# if defined(_GNUC__) -# pragma GCC visibility pop -# endif -# endif -#endif -//ext_std resolves to the std that external c++ libs, e.g. Graphite were built -//against regardless of whether that is stlport or system stl -namespace ext_std = std; diff --git a/tools/prj/d.lst b/tools/prj/d.lst index e0291c2f8ad0..4a705025a89e 100644 --- a/tools/prj/d.lst +++ b/tools/prj/d.lst @@ -34,9 +34,6 @@ mkdir: %_DEST%\inc%_EXT%\bootstrp ..\inc\tools\postx.h %_DEST%\inc%_EXT%\tools\postx.h ..\inc\tools\prex.h %_DEST%\inc%_EXT%\tools\prex.h -..\inc\tools\postextstl.h %_DEST%\inc%_EXT%\tools\postextstl.h -..\inc\tools\preextstl.h %_DEST%\inc%_EXT%\tools\preextstl.h - ..\inc\tools\svlibrary.hxx %_DEST%\inc%_EXT%\tools\svlibrary.hxx ..\inc\tools\solarmutex.hxx %_DEST%\inc%_EXT%\tools\solarmutex.hxx ..\inc\tools\wintypes.hxx %_DEST%\inc%_EXT%\tools\wintypes.hxx diff --git a/vcl/inc/vcl/graphite_adaptors.hxx b/vcl/inc/vcl/graphite_adaptors.hxx index 43c2e37a5fb2..a6e3d8c3efd1 100644 --- a/vcl/inc/vcl/graphite_adaptors.hxx +++ b/vcl/inc/vcl/graphite_adaptors.hxx @@ -55,11 +55,11 @@ #include "vcl/dllapi.h" // Libraries -#include +#include #include #include #include -#include +#include // Module type definitions and forward declarations. // diff --git a/vcl/inc/vcl/graphite_features.hxx b/vcl/inc/vcl/graphite_features.hxx index 47f4c3a01e7f..47b8f062e299 100644 --- a/vcl/inc/vcl/graphite_features.hxx +++ b/vcl/inc/vcl/graphite_features.hxx @@ -29,11 +29,11 @@ // Parse a string of features specified as ; separated pairs. // e.g. // 1001=1&2002=2&fav1=0 -#include +#include #include #include #include -#include +#include namespace grutils { diff --git a/vcl/inc/vcl/graphite_layout.hxx b/vcl/inc/vcl/graphite_layout.hxx index 520f4620cd90..eaddd308c05c 100644 --- a/vcl/inc/vcl/graphite_layout.hxx +++ b/vcl/inc/vcl/graphite_layout.hxx @@ -40,13 +40,13 @@ #include #include // Libraries -#include +#include #include #include #include #include #include -#include +#include // Platform #include #include diff --git a/vcl/source/glyphs/graphite_cache.cxx b/vcl/source/glyphs/graphite_cache.cxx index 64bbb0a38d60..5582c1eecc93 100644 --- a/vcl/source/glyphs/graphite_cache.cxx +++ b/vcl/source/glyphs/graphite_cache.cxx @@ -36,10 +36,10 @@ #include #include -#include +#include #include #include -#include +#include #include #include diff --git a/vcl/source/glyphs/graphite_layout.cxx b/vcl/source/glyphs/graphite_layout.cxx index ff2fd8f306b1..de3ae3ada505 100644 --- a/vcl/source/glyphs/graphite_layout.cxx +++ b/vcl/source/glyphs/graphite_layout.cxx @@ -63,13 +63,13 @@ #include // Graphite Libraries (must be after vcl headers on windows) -#include +#include #include #include #include #include #include -#include +#include #include #include diff --git a/vcl/source/glyphs/graphite_textsrc.hxx b/vcl/source/glyphs/graphite_textsrc.hxx index 2b9c705a5ea7..cea9e4d5b607 100644 --- a/vcl/source/glyphs/graphite_textsrc.hxx +++ b/vcl/source/glyphs/graphite_textsrc.hxx @@ -59,11 +59,11 @@ #include "vcl/dllapi.h" // Libraries -#include +#include #include #include #include -#include +#include // Module type definitions and forward declarations. // diff --git a/vcl/util/makefile2.pmk b/vcl/util/makefile2.pmk index df9ba1a214d7..ac2977ca8eab 100644 --- a/vcl/util/makefile2.pmk +++ b/vcl/util/makefile2.pmk @@ -36,6 +36,6 @@ CFLAGSCXX+=$(OBJCXXFLAGS) #building with stlport, but graphite was not built with stlport .IF "$(USE_SYSTEM_STL)"!="YES" .IF "$(SYSTEM_GRAPHITE)"=="YES" -CDEFS += -DADAPT_EXT_STL +CFLAGSCXX+=-DADAPT_EXT_STL .ENDIF .ENDIF -- cgit v1.2.3 From 6e027a4662f04e311670ec5f36344d931b75a589 Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Tue, 3 Aug 2010 18:06:21 +0200 Subject: sw33bf08: #i113623#: stgio.cxx: fix operator delete mismatch --- sot/source/sdstor/stgio.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sot/source/sdstor/stgio.cxx b/sot/source/sdstor/stgio.cxx index 00dd454233e2..2c18429b9d64 100644 --- a/sot/source/sdstor/stgio.cxx +++ b/sot/source/sdstor/stgio.cxx @@ -158,7 +158,7 @@ class EasyFat public: EasyFat( StgIo & rIo, StgStrm *pFatStream, INT32 nPSize ); - ~EasyFat() { delete pFat; delete pFree; } + ~EasyFat() { delete[] pFat; delete[] pFree; } INT32 GetPageSize() { return nPageSize; } INT32 Count() { return nPages; } INT32 operator[]( INT32 nOffset ) { return pFat[ nOffset ]; } -- cgit v1.2.3 From 3abef1d286a55f0d99c6f0af9d0ab9bb2a77eaee Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Tue, 3 Aug 2010 19:11:55 +0200 Subject: vcl114: #i113627# enable full drag as default --- vcl/source/app/settings.cxx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/vcl/source/app/settings.cxx b/vcl/source/app/settings.cxx index ff4799d754f1..b91afbbae9fe 100755 --- a/vcl/source/app/settings.cxx +++ b/vcl/source/app/settings.cxx @@ -424,7 +424,10 @@ ImplStyleData::ImplStyleData() mnPushButtonStyle = 0; mnTabControlStyle = 0; mnLogoDisplayTime = LOGO_DISPLAYTIME_STARTTIME; - mnDragFullOptions = 0; + mnDragFullOptions = DRAGFULL_OPTION_WINDOWMOVE | DRAGFULL_OPTION_WINDOWSIZE | + DRAGFULL_OPTION_OBJECTMOVE | DRAGFULL_OPTION_OBJECTSIZE | + DRAGFULL_OPTION_DOCKING | DRAGFULL_OPTION_SPLIT | + DRAGFULL_OPTION_SCROLL; mnAnimationOptions = 0; mnSelectionOptions = 0; mnDisplayOptions = 0; -- cgit v1.2.3 From eba87aac1973b79e977b38b2dbe135a8667a0390 Mon Sep 17 00:00:00 2001 From: Ivo Hinkelmann Date: Wed, 4 Aug 2010 11:38:44 +0200 Subject: #i10000# quote issue --- l10ntools/java/jpropex/java/SdfEntity.java | 36 ++++++++++++++++-------------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/l10ntools/java/jpropex/java/SdfEntity.java b/l10ntools/java/jpropex/java/SdfEntity.java index 52dc61ca40ca..c2f6a5d788b1 100644 --- a/l10ntools/java/jpropex/java/SdfEntity.java +++ b/l10ntools/java/jpropex/java/SdfEntity.java @@ -98,23 +98,25 @@ public class SdfEntity implements Cloneable{ public void setProperties( String line ){ - String[] splitted = line.split("\t"); - - setProject( splitted[ SdfEntity.PROJECT_POS ] ); - setSource_file( splitted[ SdfEntity.SOURCE_FILE_POS ] ); - setDummy1( splitted[ SdfEntity.DUMMY1_POS ] ); - setResource_type( splitted[ SdfEntity.RESOURCE_TYPE_POS ] ); - setGid( splitted[ SdfEntity.GID_POS ] ); - setLid( splitted[ SdfEntity.LID_POS ] ); - setHelpid( splitted[ SdfEntity.HELPID_POS ] ); - setPlatform( splitted[ SdfEntity.PLATFORM_POS ] ); - setDummy2( splitted[ SdfEntity.DUMMY2_POS ] ); - setLangid( splitted[ SdfEntity.LANGID_POS ] ); - setText( splitted[ SdfEntity.TEXT_POS ] ); - setHelptext( splitted[ SdfEntity.HELPTEXT_POS ] ); - setQuickhelptext( splitted[ SdfEntity.QUICKHELPTEXT_POS ] ); - setTitle( splitted[ SdfEntity.TITLE_POS ] ); - setDate( splitted[ SdfEntity.DATE_POS ] ); + if( line != null ) + { + String[] splitted = line.split("\t",15); + setProject( splitted[ SdfEntity.PROJECT_POS ] ); + setSource_file( splitted[ SdfEntity.SOURCE_FILE_POS ] ); + setDummy1( splitted[ SdfEntity.DUMMY1_POS ] ); + setResource_type( splitted[ SdfEntity.RESOURCE_TYPE_POS ] ); + setGid( splitted[ SdfEntity.GID_POS ] ); + setLid( splitted[ SdfEntity.LID_POS ] ); + setHelpid( splitted[ SdfEntity.HELPID_POS ] ); + setPlatform( splitted[ SdfEntity.PLATFORM_POS ] ); + setDummy2( splitted[ SdfEntity.DUMMY2_POS ] ); + setLangid( splitted[ SdfEntity.LANGID_POS ] ); + setText( splitted[ SdfEntity.TEXT_POS ] ); + setHelptext( splitted[ SdfEntity.HELPTEXT_POS ] ); + setQuickhelptext( splitted[ SdfEntity.QUICKHELPTEXT_POS ] ); + setTitle( splitted[ SdfEntity.TITLE_POS ] ); + setDate( splitted[ SdfEntity.DATE_POS ] ); + } } public String getFileId(){ -- cgit v1.2.3 From 87a7151b48af28bc1c8d8f672e57694f27182236 Mon Sep 17 00:00:00 2001 From: Ivo Hinkelmann Date: Wed, 4 Aug 2010 11:47:54 +0200 Subject: #i10000# JAVA_HOME check removed --- l10ntools/java/jpropex/jpropex | 4 ---- 1 file changed, 4 deletions(-) diff --git a/l10ntools/java/jpropex/jpropex b/l10ntools/java/jpropex/jpropex index 2d62d13b093e..796b44e749e7 100755 --- a/l10ntools/java/jpropex/jpropex +++ b/l10ntools/java/jpropex/jpropex @@ -3,8 +3,4 @@ if [ x${SOLARENV}x = xx ]; then echo No environment found, please use 'configure' or 'setsolar' exit 1 fi -if [ x${JAVA_HOME}x = xx ]; then - echo No Java found! - exit 1 -fi exec java -DSOLARSRC=${SOLARSRC} -DWORK_STAMP=${WORK_STAMP} -DUSE_SHELL= -jar ${SOLARVER}/${INPATH}/bin${UPDMINOREXT}/jpropex.jar "$@" -- cgit v1.2.3 From 36902ea20c93a25f373395a4e5dcb8f3b37b4674 Mon Sep 17 00:00:00 2001 From: Ivo Hinkelmann Date: Wed, 4 Aug 2010 11:52:52 +0200 Subject: #i10000# JAVA_HOME check restored --- l10ntools/java/jpropex/jpropex | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/l10ntools/java/jpropex/jpropex b/l10ntools/java/jpropex/jpropex index 796b44e749e7..8c9982f2b1d3 100755 --- a/l10ntools/java/jpropex/jpropex +++ b/l10ntools/java/jpropex/jpropex @@ -3,4 +3,10 @@ if [ x${SOLARENV}x = xx ]; then echo No environment found, please use 'configure' or 'setsolar' exit 1 fi + +if [ x${JAVA_HOME}x = xx ]; then + echo ERROR: No java found + exit 1 +fi + exec java -DSOLARSRC=${SOLARSRC} -DWORK_STAMP=${WORK_STAMP} -DUSE_SHELL= -jar ${SOLARVER}/${INPATH}/bin${UPDMINOREXT}/jpropex.jar "$@" -- cgit v1.2.3 From c7821efc469f4bff0fd2a7ddfa922088111a0408 Mon Sep 17 00:00:00 2001 From: Mikhail Voytenko Date: Wed, 4 Aug 2010 12:21:22 +0200 Subject: mib18: #163185# avoid crash when document is closed and a modal dialog is active --- toolkit/source/awt/vclxwindows.cxx | 10 +++++++++- toolkit/source/helper/unowrapper.cxx | 15 ++++++++++----- 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/toolkit/source/awt/vclxwindows.cxx b/toolkit/source/awt/vclxwindows.cxx index 4a68b4c80e3f..68f09abfdb78 100644 --- a/toolkit/source/awt/vclxwindows.cxx +++ b/toolkit/source/awt/vclxwindows.cxx @@ -2363,15 +2363,23 @@ sal_Int16 VCLXDialog::execute() throw(::com::sun::star::uno::RuntimeException) Dialog* pDlg = (Dialog*) GetWindow(); Window* pParent = pDlg->GetWindow( WINDOW_PARENTOVERLAP ); Window* pOldParent = NULL; + Window* pSetParent = NULL; if ( pParent && !pParent->IsReallyVisible() ) { pOldParent = pDlg->GetParent(); Window* pFrame = pDlg->GetWindow( WINDOW_FRAME ); if( pFrame != pDlg ) + { pDlg->SetParent( pFrame ); + pSetParent = pFrame; + } } + nRet = pDlg->Execute(); - if ( pOldParent ) + + // set the parent back only in case no new parent was set from outside + // in other words, revert only own changes + if ( pOldParent && pDlg->GetParent() == pSetParent ) pDlg->SetParent( pOldParent ); } return nRet; diff --git a/toolkit/source/helper/unowrapper.cxx b/toolkit/source/helper/unowrapper.cxx index d7cec7c17354..c36ae29d4531 100644 --- a/toolkit/source/helper/unowrapper.cxx +++ b/toolkit/source/helper/unowrapper.cxx @@ -318,12 +318,17 @@ void UnoWrapper::WindowDestroyed( Window* pWindow ) Window* pTopWindowChild = pWindow->GetWindow( WINDOW_FIRSTTOPWINDOWCHILD ); while ( pTopWindowChild ) { - OSL_ENSURE( pTopWindowChild->GetParent() == pWindow, "UnoWrapper::WindowDestroyed: inconsistency in the SystemWindow relationship!" ); + OSL_ENSURE( pTopWindowChild->GetParent() == pWindow, + "UnoWrapper::WindowDestroyed: inconsistency in the SystemWindow relationship!" ); - uno::Reference< lang::XComponent > xComp( pTopWindowChild->GetComponentInterface( FALSE ), uno::UNO_QUERY ); - pTopWindowChild = pTopWindowChild->GetWindow( WINDOW_NEXTTOPWINDOWSIBLING ); - if ( xComp.is() ) - xComp->dispose(); + Window* pNextTopChild = pTopWindowChild->GetWindow( WINDOW_NEXTTOPWINDOWSIBLING ); + + //the window still could be on the stack, so we have to + // use lazy delete ( it will automatically + // disconnect from the currently destroyed parent window ) + pTopWindowChild->doLazyDelete(); + + pTopWindowChild = pNextTopChild; } } } -- cgit v1.2.3 From 92d15d82cfa7c7cc9ac3e8f7f90d89e2669ad30e Mon Sep 17 00:00:00 2001 From: "Herbert Duerr [hdu]" Date: Wed, 4 Aug 2010 16:05:53 +0200 Subject: #i106817# fix rotated textline drawing also in mirrored mode --- vcl/source/gdi/outdev3.cxx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/vcl/source/gdi/outdev3.cxx b/vcl/source/gdi/outdev3.cxx index aacbf7ed416c..c45f1a5bb287 100644 --- a/vcl/source/gdi/outdev3.cxx +++ b/vcl/source/gdi/outdev3.cxx @@ -4090,10 +4090,14 @@ void OutputDevice::ImplDrawTextLine( long nX, long nY, BOOL bUnderlineDone = FALSE; BOOL bOverlineDone = FALSE; - // TODO: fix rotated text if ( IsRTLEnabled() ) + { // --- RTL --- mirror at basex - nX = nDistX - nWidth - (nX - nDistX - 1); + long nRotDX = nDistX; + if( mpFontEntry->mnOrientation ) + nRotDX = FRound( nRotDX * cos( mpFontEntry->mnOrientation*F_PI1800 ) ); + nX += 1 + nWidth - nRotDX; + } if ( !IsTextLineColor() ) aUnderlineColor = GetTextColor(); -- cgit v1.2.3 From 6fb28a9b7f848342f34b7586df99dc57af709c17 Mon Sep 17 00:00:00 2001 From: "Herbert Duerr [hdu]" Date: Wed, 4 Aug 2010 16:13:46 +0200 Subject: #i106817# fix rotated textline drawing also in mirrored mode --- vcl/source/gdi/outdev3.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/vcl/source/gdi/outdev3.cxx b/vcl/source/gdi/outdev3.cxx index c45f1a5bb287..810309e33cc2 100644 --- a/vcl/source/gdi/outdev3.cxx +++ b/vcl/source/gdi/outdev3.cxx @@ -4093,10 +4093,10 @@ void OutputDevice::ImplDrawTextLine( long nX, long nY, if ( IsRTLEnabled() ) { // --- RTL --- mirror at basex - long nRotDX = nDistX; + long nXAdd = nWidth - nDistX; if( mpFontEntry->mnOrientation ) - nRotDX = FRound( nRotDX * cos( mpFontEntry->mnOrientation*F_PI1800 ) ); - nX += 1 + nWidth - nRotDX; + nXAdd = FRound( nXAdd * cos( mpFontEntry->mnOrientation * F_PI1800 ) ); + nX += nXAdd - 1; } if ( !IsTextLineColor() ) -- cgit v1.2.3 From 4e56d229e64b2baca9b25af8deb8d6cd954315e0 Mon Sep 17 00:00:00 2001 From: Release Engineering Date: Wed, 4 Aug 2010 19:26:02 +0200 Subject: #i10000# workaround gtk xerror handler --- vcl/unx/source/dtrans/X11_selection.cxx | 47 +++++++++++++++++++++++++-------- 1 file changed, 36 insertions(+), 11 deletions(-) diff --git a/vcl/unx/source/dtrans/X11_selection.cxx b/vcl/unx/source/dtrans/X11_selection.cxx index 4bb24e03917b..403ee9707a94 100644 --- a/vcl/unx/source/dtrans/X11_selection.cxx +++ b/vcl/unx/source/dtrans/X11_selection.cxx @@ -3966,6 +3966,18 @@ void SelectionManager::deregisterHandler( Atom selection ) // ------------------------------------------------------------------------ +static bool bWasError = false; + +extern "C" +{ + int local_xerror_handler(Display* , XErrorEvent*) + { + bWasError = true; + return 0; + } + typedef int(*xerror_hdl_t)(Display*,XErrorEvent*); +} + void SelectionManager::registerDropTarget( XLIB_Window aWindow, DropTarget* pTarget ) { MutexGuard aGuard(m_aMutex); @@ -3977,18 +3989,31 @@ void SelectionManager::registerDropTarget( XLIB_Window aWindow, DropTarget* pTar OSL_ASSERT( "attempt to register window as drop target twice" ); else if( aWindow && m_pDisplay ) { - XSelectInput( m_pDisplay, aWindow, PropertyChangeMask ); - - // set XdndAware - XChangeProperty( m_pDisplay, aWindow, m_nXdndAware, XA_ATOM, 32, PropModeReplace, (unsigned char*)&nXdndProtocolRevision, 1 ); - DropTargetEntry aEntry( pTarget ); - // get root window of window (in 99.999% of all cases this will be - // DefaultRootWindow( m_pDisplay ) - int x, y; - unsigned int w, h, bw, d; - XGetGeometry( m_pDisplay, aWindow, &aEntry.m_aRootWindow, - &x, &y, &w, &h, &bw, &d ); + bWasError=false; + /* #i100000# ugly workaround: gtk sets its own XErrorHandler which is not suitable for us + unfortunately XErrorHandler is not per display, so this is just and ugly hack + Need to remove separate display and integrate clipboard/dnd into vcl's unx code ASAP + */ + xerror_hdl_t pOldHandler = XSetErrorHandler( local_xerror_handler ); + XSelectInput( m_pDisplay, aWindow, PropertyChangeMask ); + if( ! bWasError ) + { + // set XdndAware + XChangeProperty( m_pDisplay, aWindow, m_nXdndAware, XA_ATOM, 32, PropModeReplace, (unsigned char*)&nXdndProtocolRevision, 1 ); + if( ! bWasError ) + { + // get root window of window (in 99.999% of all cases this will be + // DefaultRootWindow( m_pDisplay ) + int x, y; + unsigned int w, h, bw, d; + XGetGeometry( m_pDisplay, aWindow, &aEntry.m_aRootWindow, + &x, &y, &w, &h, &bw, &d ); + } + } + XSetErrorHandler( pOldHandler ); + if(bWasError) + return; m_aDropTargets[ aWindow ] = aEntry; } else -- cgit v1.2.3 From bb35798127d77b5b88bdd63170d0c4f7fb94474a Mon Sep 17 00:00:00 2001 From: "Herbert Duerr [hdu]" Date: Thu, 5 Aug 2010 11:38:08 +0200 Subject: #i106817# fix rotated textline drawing also for CTL text --- vcl/source/gdi/outdev3.cxx | 27 ++++++++++++++++++++------- 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/vcl/source/gdi/outdev3.cxx b/vcl/source/gdi/outdev3.cxx index 810309e33cc2..63bc233ef4e0 100644 --- a/vcl/source/gdi/outdev3.cxx +++ b/vcl/source/gdi/outdev3.cxx @@ -4146,36 +4146,49 @@ void OutputDevice::ImplDrawTextLines( SalLayout& rSalLayout, { if( bWordLine ) { - Point aPos, aStartPt; - sal_Int32 nWidth = 0, nAdvance=0; + // draw everything relative to the layout base point + const Point aStartPt = rSalLayout.DrawBase(); + // calculate distance of each word from the base point + Point aPos; + sal_Int32 nDist = 0, nWidth = 0, nAdvance=0; for( int nStart = 0;;) { + // iterate through the layouted glyphs sal_GlyphId nGlyphIndex; if( !rSalLayout.GetNextGlyphs( 1, &nGlyphIndex, aPos, nStart, &nAdvance ) ) break; + // calculate the boundaries of each word if( !rSalLayout.IsSpacingGlyph( nGlyphIndex ) ) { if( !nWidth ) { - // TODO: keep both base point - // and relative distance (as projection to baseline) - aStartPt = aPos; + // get the distance to the base point (as projected to baseline) + nDist = aPos.X() - aStartPt.X(); + if( mpFontEntry->mnOrientation ) + { + const long nDY = aPos.Y() - aStartPt.Y(); + const double fRad = mpFontEntry->mnOrientation * F_PI1800; + nDist = FRound( nDist*cos(fRad) - nDY*sin(fRad) ); + } } + // update the length of the textline nWidth += nAdvance; } else if( nWidth > 0 ) { - ImplDrawTextLine( aStartPt.X(), aStartPt.Y(), 0, nWidth, + // draw the textline for each word + ImplDrawTextLine( aStartPt.X(), aStartPt.Y(), nDist, nWidth, eStrikeout, eUnderline, eOverline, bUnderlineAbove ); nWidth = 0; } } + // draw textline for the last word if( nWidth > 0 ) { - ImplDrawTextLine( aStartPt.X(), aStartPt.Y(), 0, nWidth, + ImplDrawTextLine( aStartPt.X(), aStartPt.Y(), nDist, nWidth, eStrikeout, eUnderline, eOverline, bUnderlineAbove ); } } -- cgit v1.2.3 From 7809a5b0996a2d8da3f182782b5003138b1c0cf8 Mon Sep 17 00:00:00 2001 From: Ivo Hinkelmann Date: Thu, 5 Aug 2010 19:06:15 +0200 Subject: #i10000# remove returns --- l10ntools/java/jpropex/java/JPropEx.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/l10ntools/java/jpropex/java/JPropEx.java b/l10ntools/java/jpropex/java/JPropEx.java index 224bed783cf6..be59d7f29479 100644 --- a/l10ntools/java/jpropex/java/JPropEx.java +++ b/l10ntools/java/jpropex/java/JPropEx.java @@ -121,6 +121,7 @@ public class JPropEx String key; SdfEntity currentStr; String value; + String str; for( Enumeration e = prop.propertyNames() ; e.hasMoreElements() ; ) { key = (String) e.nextElement(); @@ -129,8 +130,11 @@ public class JPropEx currentStr.setLid( key ); value = prop.getProperty( key , "" ); //if( value.equals("") ) System.err.println("Warning: in file "+inputFileArg+" the string with the key "+key+" has a empty string!"); - currentStr.setText( (prop.getProperty( key )).replaceAll("\t" , " " ) ); // TODO: Quoting!!!! - data.add( currentStr ); + str = (prop.getProperty( key )).replaceAll("\t" , " " ); // remove tab + str = str.replaceAll("\n"," "); // remove return + currentStr.setText( str ); + if( str.length() > 0 ) + data.add( currentStr ); } data.write( outputFileArg ); } -- cgit v1.2.3 From 2d146ca41ce65767bd6deb0989118b5acb8e2ea3 Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Thu, 5 Aug 2010 19:43:22 +0200 Subject: vcl114: #i40812# implement ShowNativeMessageBox on Mac --- vcl/aqua/inc/salsys.h | 5 -- vcl/aqua/source/app/salsys.cxx | 101 ++++++++++++++++++++++++++++++++++++++--- 2 files changed, 95 insertions(+), 11 deletions(-) diff --git a/vcl/aqua/inc/salsys.h b/vcl/aqua/inc/salsys.h index 6f5c45880e68..ae20706a1756 100644 --- a/vcl/aqua/inc/salsys.h +++ b/vcl/aqua/inc/salsys.h @@ -55,11 +55,6 @@ public: virtual Rectangle GetDisplayWorkAreaPosSizePixel( unsigned int nScreen ); virtual rtl::OUString GetScreenName( unsigned int nScreen ); - // overload pure virtual methods - virtual int ShowNativeDialog( const String& rTitle, - const String& rMessage, - const std::list< String >& rButtons, - int nDefButton ); virtual int ShowNativeMessageBox( const String& rTitle, const String& rMessage, int nButtonCombination, diff --git a/vcl/aqua/source/app/salsys.cxx b/vcl/aqua/source/app/salsys.cxx index 3b548099feef..cf5cf00b7fe4 100644 --- a/vcl/aqua/source/app/salsys.cxx +++ b/vcl/aqua/source/app/salsys.cxx @@ -30,9 +30,11 @@ #include "tools/rc.hxx" #include "vcl/svids.hrc" +#include "vcl/button.hxx" #include "salsys.h" #include "saldata.hxx" +#include "salinst.h" #include "rtl/ustrbuf.hxx" using namespace rtl; @@ -114,12 +116,22 @@ rtl::OUString AquaSalSystem::GetScreenName( unsigned int nScreen ) return aRet; } -int AquaSalSystem::ShowNativeDialog( const String& rTitle, - const String& rMessage, - const std::list< String >& rButtons, - int nDefButton ) +static NSString* getStandardString( int nButtonId ) { - return 0; + rtl::OUString aText( Button::GetStandardText( nButtonId ) ); + if( ! aText.getLength() ) // this is for bad cases, we might be missing the vcl resource + { + switch( nButtonId ) + { + case BUTTON_OK: aText = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "OK" ) );break; + case BUTTON_ABORT: aText = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Abort" ) );break; + case BUTTON_CANCEL: aText = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Cancel" ) );break; + case BUTTON_RETRY: aText = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Retry" ) );break; + case BUTTON_YES: aText = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Yes" ) );break; + case BUTTON_NO : aText = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "No" ) );break; + } + } + return aText.getLength() ? CreateNSString( aText) : nil; } int AquaSalSystem::ShowNativeMessageBox( const String& rTitle, @@ -127,5 +139,82 @@ int AquaSalSystem::ShowNativeMessageBox( const String& rTitle, int nButtonCombination, int nDefaultButton) { - return 0; + NSString* pTitle = CreateNSString( rTitle ); + NSString* pMessage = CreateNSString( rMessage ); + + struct id_entry + { + int nCombination; + int nDefaultButton; + int nTextIds[3]; + } aButtonIds[] = + { + { SALSYSTEM_SHOWNATIVEMSGBOX_BTNCOMBI_OK, SALSYSTEM_SHOWNATIVEMSGBOX_BTN_OK, { BUTTON_OK, -1, -1 } }, + { SALSYSTEM_SHOWNATIVEMSGBOX_BTNCOMBI_OK_CANCEL, SALSYSTEM_SHOWNATIVEMSGBOX_BTN_OK, { BUTTON_OK, BUTTON_CANCEL, -1 } }, + { SALSYSTEM_SHOWNATIVEMSGBOX_BTNCOMBI_OK_CANCEL, SALSYSTEM_SHOWNATIVEMSGBOX_BTN_CANCEL, { BUTTON_CANCEL, BUTTON_OK, -1 } }, + { SALSYSTEM_SHOWNATIVEMSGBOX_BTNCOMBI_ABORT_RETRY_IGNORE, SALSYSTEM_SHOWNATIVEMSGBOX_BTN_ABORT, { BUTTON_ABORT, BUTTON_IGNORE, BUTTON_RETRY } }, + { SALSYSTEM_SHOWNATIVEMSGBOX_BTNCOMBI_ABORT_RETRY_IGNORE, SALSYSTEM_SHOWNATIVEMSGBOX_BTN_RETRY, { BUTTON_RETRY, BUTTON_IGNORE, BUTTON_ABORT } }, + { SALSYSTEM_SHOWNATIVEMSGBOX_BTNCOMBI_ABORT_RETRY_IGNORE, SALSYSTEM_SHOWNATIVEMSGBOX_BTN_IGNORE, { BUTTON_IGNORE, BUTTON_IGNORE, BUTTON_ABORT } }, + { SALSYSTEM_SHOWNATIVEMSGBOX_BTNCOMBI_YES_NO_CANCEL, SALSYSTEM_SHOWNATIVEMSGBOX_BTN_YES, { BUTTON_YES, BUTTON_NO, BUTTON_CANCEL } }, + { SALSYSTEM_SHOWNATIVEMSGBOX_BTNCOMBI_YES_NO_CANCEL, SALSYSTEM_SHOWNATIVEMSGBOX_BTN_NO, { BUTTON_NO, BUTTON_YES, BUTTON_CANCEL } }, + { SALSYSTEM_SHOWNATIVEMSGBOX_BTNCOMBI_YES_NO_CANCEL, SALSYSTEM_SHOWNATIVEMSGBOX_BTN_CANCEL, { BUTTON_CANCEL, BUTTON_YES, BUTTON_NO } }, + { SALSYSTEM_SHOWNATIVEMSGBOX_BTNCOMBI_YES_NO, SALSYSTEM_SHOWNATIVEMSGBOX_BTN_YES, { BUTTON_YES, BUTTON_NO, -1 } }, + { SALSYSTEM_SHOWNATIVEMSGBOX_BTNCOMBI_YES_NO, SALSYSTEM_SHOWNATIVEMSGBOX_BTN_NO, { BUTTON_NO, BUTTON_YES, -1 } }, + { SALSYSTEM_SHOWNATIVEMSGBOX_BTNCOMBI_RETRY_CANCEL, SALSYSTEM_SHOWNATIVEMSGBOX_BTN_RETRY, { BUTTON_RETRY, BUTTON_CANCEL, -1 } }, + { SALSYSTEM_SHOWNATIVEMSGBOX_BTNCOMBI_RETRY_CANCEL, SALSYSTEM_SHOWNATIVEMSGBOX_BTN_CANCEL, { BUTTON_CANCEL, BUTTON_RETRY, -1 } } + }; + + NSString* pDefText = nil; + NSString* pAltText = nil; + NSString* pOthText = nil; + + unsigned int nC; + for( nC = 0; nC < sizeof(aButtonIds)/sizeof(aButtonIds[0]); nC++ ) + { + if( aButtonIds[nC].nCombination == nButtonCombination ) + { + if( aButtonIds[nC].nDefaultButton == nDefaultButton ) + { + if( aButtonIds[nC].nTextIds[0] != -1 ) + pDefText = getStandardString( aButtonIds[nC].nTextIds[0] ); + if( aButtonIds[nC].nTextIds[1] != -1 ) + pAltText = getStandardString( aButtonIds[nC].nTextIds[1] ); + if( aButtonIds[nC].nTextIds[2] != -1 ) + pOthText = getStandardString( aButtonIds[nC].nTextIds[2] ); + break; + } + } + } + + + int nResult = NSRunAlertPanel( pTitle, pMessage, pDefText, pAltText, pOthText ); + + if( pTitle ) + [pTitle release]; + if( pMessage ) + [pMessage release]; + if( pDefText ) + [pDefText release]; + if( pAltText ) + [pAltText release]; + if( pOthText ) + [pOthText release]; + + int nRet = 0; + if( nC < sizeof(aButtonIds)/sizeof(aButtonIds[0]) && nResult >= 1 && nResult <= 3 ) + { + int nPressed = aButtonIds[nC].nTextIds[nResult-1]; + switch( nPressed ) + { + case BUTTON_NO: nRet = SALSYSTEM_SHOWNATIVEMSGBOX_BTN_NO; break; + case BUTTON_YES: nRet = SALSYSTEM_SHOWNATIVEMSGBOX_BTN_YES; break; + case BUTTON_OK: nRet = SALSYSTEM_SHOWNATIVEMSGBOX_BTN_OK; break; + case BUTTON_CANCEL: nRet = SALSYSTEM_SHOWNATIVEMSGBOX_BTN_CANCEL; break; + case BUTTON_ABORT: nRet = SALSYSTEM_SHOWNATIVEMSGBOX_BTN_ABORT; break; + case BUTTON_RETRY: nRet = SALSYSTEM_SHOWNATIVEMSGBOX_BTN_RETRY; break; + case BUTTON_IGNORE: nRet = SALSYSTEM_SHOWNATIVEMSGBOX_BTN_IGNORE; break; + } + } + + return nRet; } -- cgit v1.2.3 From 7071206deeb9c653740e3f3e897c5d7d0555545d Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Fri, 6 Aug 2010 13:53:18 +0200 Subject: vcl114: #i62101# filter whitespace from outline entries --- vcl/source/gdi/pdfwriter_impl.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx index 7b7f3bbcb4d3..09cf1734eb6f 100644 --- a/vcl/source/gdi/pdfwriter_impl.cxx +++ b/vcl/source/gdi/pdfwriter_impl.cxx @@ -67,6 +67,7 @@ #include "cppuhelper/implbase1.hxx" #include #include +#include "vcl/strhelper.hxx" using namespace vcl; using namespace rtl; @@ -10839,7 +10840,7 @@ sal_Int32 PDFWriterImpl::setOutlineItemText( sal_Int32 nItem, const OUString& rT if( nItem < 1 || nItem >= (sal_Int32)m_aOutline.size() ) return -1; - m_aOutline[ nItem ].m_aTitle = rText; + m_aOutline[ nItem ].m_aTitle = psp::WhitespaceToSpace( rText ); return 0; } -- cgit v1.2.3 From 840d9a7c6ad6f30cfa54958584ef808ca5f46a34 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Fri, 6 Aug 2010 13:25:47 +0100 Subject: cmcfixes77: #i113400# Maths brackets misformed in presentation mode --- canvas/source/cairo/cairo_textlayout.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/canvas/source/cairo/cairo_textlayout.cxx b/canvas/source/cairo/cairo_textlayout.cxx index dfe2071c3726..d0873b63f5f0 100644 --- a/canvas/source/cairo/cairo_textlayout.cxx +++ b/canvas/source/cairo/cairo_textlayout.cxx @@ -521,8 +521,8 @@ namespace cairocanvas nWidth = aFont.GetHeight(); } else { // any scaling needs to be relative to the platform-dependent definition - // of width of the font - nWidth = aFont.GetHeight() * aFont.GetWidth() / aMetric.GetWidth(); + // of height of the font + nWidth = aFont.GetWidth() * aFont.GetHeight() / aMetric.GetHeight(); } cairo_matrix_init_identity(&m); -- cgit v1.2.3 From 100e71ffeac18415d7500200e1b0258a8b079afa Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Fri, 6 Aug 2010 17:25:55 +0200 Subject: vcl114: #i79083# use correct paint method for inconsistent checkbox --- vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx | 60 ++------------------------------ vcl/unx/inc/plugins/gtk/gtkgdi.hxx | 4 --- 2 files changed, 3 insertions(+), 61 deletions(-) diff --git a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx index 188bc0b34931..69751843582d 100644 --- a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx +++ b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx @@ -732,12 +732,6 @@ BOOL GtkSalGraphics::drawNativeControl( ControlType nType, const ImplControlValue& aValue, const OUString& rCaption ) { - if( (nType==CTRL_CHECKBOX) && (nPart==PART_ENTIRE_CONTROL) && - aValue.getTristateVal() == BUTTONVALUE_MIXED ) - { - return drawNativeMixedStateCheck( nType, nPart, rControlRegion, nState, aValue, rCaption ); - } - BOOL returnVal = FALSE; // get a GC with current clipping region set SelectFont(); @@ -895,55 +889,6 @@ BOOL GtkSalGraphics::drawNativeControl( ControlType nType, return( returnVal ); } -BOOL GtkSalGraphics::drawNativeMixedStateCheck( ControlType nType, - ControlPart nPart, - const Rectangle& rControlRegion, - ControlState nState, - const ImplControlValue& aValue, - const OUString& rCaption ) -{ - // need to emulate something for mixed state - - // do this via pixmap since some themes don't care for regions - bool bOldNeedPixmapPaint = bNeedPixmapPaint; - bNeedPixmapPaint = true; - - Rectangle aCtrlRect = rControlRegion; - BOOL returnVal = FALSE; - SelectFont(); - - // draw upper half in off state - const_cast(aValue).setTristateVal( BUTTONVALUE_OFF ); - XLIB_Region aRegion = XCreateRegion(); - XRectangle aXRect = { aCtrlRect.Left(), aCtrlRect.Top(), aCtrlRect.GetWidth(), aCtrlRect.GetHeight() }; - const unsigned short nH = aXRect.height/2; - aXRect.height -= nH; - XUnionRectWithRegion( &aXRect, aRegion, aRegion ); - SetClipRegion( pFontGC_, aRegion ); - XDestroyRegion( aRegion ); - - returnVal = drawNativeControl( nType, nPart, rControlRegion, nState, aValue, rCaption ); - - if( returnVal ) - { - // draw lower half in on state - const_cast(aValue).setTristateVal( BUTTONVALUE_ON ); - aXRect.y += nH; - aRegion = XCreateRegion(); - XUnionRectWithRegion( &aXRect, aRegion, aRegion ); - SetClipRegion( pFontGC_, aRegion ); - XDestroyRegion( aRegion ); - returnVal = drawNativeControl( nType, nPart, rControlRegion, nState, aValue, rCaption ); - } - - // clean up - bNeedPixmapPaint = bOldNeedPixmapPaint; - const_cast(aValue).setTristateVal( BUTTONVALUE_MIXED ); - SetClipRegion( pFontGC_ ); - return returnVal; -} - - /* * DrawNativeControlText() * @@ -1378,7 +1323,8 @@ BOOL GtkSalGraphics::NWPaintGTKCheck( GdkDrawable* gdkDrawable, { GtkStateType stateType; GtkShadowType shadowType; - BOOL isChecked = (aValue.getTristateVal()==BUTTONVALUE_ON) ? TRUE : FALSE; + bool isChecked = (aValue.getTristateVal() == BUTTONVALUE_ON); + bool isInconsistent = (aValue.getTristateVal() == BUTTONVALUE_MIXED); GdkRectangle clipRect; gint x,y; @@ -1393,7 +1339,7 @@ BOOL GtkSalGraphics::NWPaintGTKCheck( GdkDrawable* gdkDrawable, y = rControlRectangle.Top() + (rControlRectangle.GetHeight()-indicator_size)/2; // Set the shadow based on if checked or not so we get a checkmark. - shadowType = isChecked ? GTK_SHADOW_IN : GTK_SHADOW_OUT; + shadowType = isChecked ? GTK_SHADOW_IN : isInconsistent ? GTK_SHADOW_ETCHED_IN : GTK_SHADOW_OUT; NWSetWidgetState( gWidgetData[m_nScreen].gCheckWidget, nState, stateType ); GTK_TOGGLE_BUTTON(gWidgetData[m_nScreen].gCheckWidget)->active = isChecked; diff --git a/vcl/unx/inc/plugins/gtk/gtkgdi.hxx b/vcl/unx/inc/plugins/gtk/gtkgdi.hxx index 7544a566d8ae..38c79b3e11df 100644 --- a/vcl/unx/inc/plugins/gtk/gtkgdi.hxx +++ b/vcl/unx/inc/plugins/gtk/gtkgdi.hxx @@ -178,10 +178,6 @@ protected: const clipList& rClipList, ControlState nState, const ImplControlValue& aValue, const OUString& rCaption ); - - BOOL drawNativeMixedStateCheck( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion, - ControlState nState, const ImplControlValue& aValue, - const rtl::OUString& rCaption ); }; #endif // _VCL_GTKGDI_HXX -- cgit v1.2.3 From fb51494aaa2e361ec036b81d59b620324eb25c7e Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Fri, 6 Aug 2010 20:04:45 +0200 Subject: vcl114: #i96895# fix toolbar buttons, control state is actually misleading here --- vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx index 69751843582d..b8a3ac773a8f 100644 --- a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx +++ b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx @@ -2479,7 +2479,6 @@ BOOL GtkSalGraphics::NWPaintGTKToolbar( gint g_x=0, g_y=0, g_w=10, g_h=10; bool bPaintButton = true; GtkWidget* pButtonWidget = gWidgetData[m_nScreen].gToolbarButtonWidget; - const gchar* pButtonDetail = "button"; GdkRectangle clipRect; NWEnsureGTKToolbar( m_nScreen ); @@ -2538,13 +2537,18 @@ BOOL GtkSalGraphics::NWPaintGTKToolbar( { pButtonWidget = gWidgetData[m_nScreen].gToolbarToggleWidget; shadowType = GTK_SHADOW_IN; + stateType = GTK_STATE_ACTIVE; // special case stateType value for depressed toggle buttons // cf. gtk+/gtk/gtktogglebutton.c (gtk_toggle_button_update_state) - if( ! (nState & (CTRL_STATE_PRESSED|CTRL_STATE_ROLLOVER)) ) - stateType = GTK_STATE_ACTIVE; - pButtonDetail = "togglebutton"; + if( (nState & (CTRL_STATE_ROLLOVER|CTRL_STATE_PRESSED)) ) + { + stateType = GTK_STATE_PRELIGHT; + shadowType = GTK_SHADOW_OUT; + } bPaintButton = true; } + else + stateType = GTK_STATE_PRELIGHT; // only for bPaintButton = true, in which case always rollver is meant NWSetWidgetState( pButtonWidget, nState, stateType ); gtk_widget_ensure_style( pButtonWidget ); @@ -2602,7 +2606,7 @@ BOOL GtkSalGraphics::NWPaintGTKToolbar( stateType, shadowType, &clipRect, - pButtonWidget, pButtonDetail, x, y, w, h ); + pButtonWidget, "button", x, y, w, h ); } } } -- cgit v1.2.3 From 6fad3bbef4e10023962b2fb8b5157af13148e76c Mon Sep 17 00:00:00 2001 From: Mikhail Voytenko Date: Mon, 9 Aug 2010 10:47:38 +0200 Subject: fwk152: #i108004# check the URLs correctly --- unotools/inc/unotools/ucbhelper.hxx | 1 + unotools/source/ucbhelper/ucbhelper.cxx | 49 +++++++++++++++++++++++++++++++++ 2 files changed, 50 insertions(+) diff --git a/unotools/inc/unotools/ucbhelper.hxx b/unotools/inc/unotools/ucbhelper.hxx index 687868adbdb4..38b355439c2b 100644 --- a/unotools/inc/unotools/ucbhelper.hxx +++ b/unotools/inc/unotools/ucbhelper.hxx @@ -80,6 +80,7 @@ namespace utl static sal_Bool FindInPath( const String& rPath, const String& rName, String& rFile, char cDelim = ';', BOOL bAllowWildCards = TRUE ); static sal_Bool Find( const String& rFolder, const String& rName, String& rFile, BOOL bAllowWildCards = FALSE ); static sal_Bool IsSubPath( const ::rtl::OUString& rPath, const ::rtl::OUString& rChildCandidate, const ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XContentProvider >& xContentProvider = ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XContentProvider >() ); + static sal_Bool EqualURLs( const ::rtl::OUString& aFirstURL, const ::rtl::OUString& aSecondURL ); }; } diff --git a/unotools/source/ucbhelper/ucbhelper.cxx b/unotools/source/ucbhelper/ucbhelper.cxx index 4160f2f2f443..8befb8a0f209 100644 --- a/unotools/source/ucbhelper/ucbhelper.cxx +++ b/unotools/source/ucbhelper/ucbhelper.cxx @@ -872,5 +872,54 @@ sal_Bool UCBContentHelper::IsSubPath( const ::rtl::OUString& rPath, const ::rtl: return bResult; } +// ----------------------------------------------------------------------- +sal_Bool UCBContentHelper::EqualURLs( const ::rtl::OUString& aFirstURL, const ::rtl::OUString& aSecondURL ) +{ + sal_Bool bResult = sal_False; + + if ( aFirstURL.getLength() && aSecondURL.getLength() ) + { + INetURLObject aFirst( aFirstURL ); + INetURLObject aSecond( aSecondURL ); + + if ( aFirst.GetProtocol() != INET_PROT_NOT_VALID && aSecond.GetProtocol() != INET_PROT_NOT_VALID ) + { + try + { + ::ucbhelper::ContentBroker* pBroker = ::ucbhelper::ContentBroker::get(); + if ( !pBroker ) + throw uno::RuntimeException(); + + uno::Reference< ::com::sun::star::ucb::XContentIdentifierFactory > xIdFac + = pBroker->getContentIdentifierFactoryInterface(); + if ( !xIdFac.is() ) + throw uno::RuntimeException(); + + uno::Reference< ::com::sun::star::ucb::XContentIdentifier > xIdFirst + = xIdFac->createContentIdentifier( aFirst.GetMainURL( INetURLObject::NO_DECODE ) ); + uno::Reference< ::com::sun::star::ucb::XContentIdentifier > xIdSecond + = xIdFac->createContentIdentifier( aSecond.GetMainURL( INetURLObject::NO_DECODE ) ); + + if ( xIdFirst.is() && xIdSecond.is() ) + { + uno::Reference< ::com::sun::star::ucb::XContentProvider > xProvider = + pBroker->getContentProviderInterface(); + if ( !xProvider.is() ) + throw uno::RuntimeException(); + bResult = !xProvider->compareContentIds( xIdFirst, xIdSecond ); + } + } + catch( uno::Exception& ) + { + OSL_ENSURE( sal_False, "Can't compare URL's, treat as different!\n" ); + } + } + } + + return bResult; +} + + + } // namespace utl -- cgit v1.2.3 From a65f403bfdd25572330b1a7a6142ae2ce3e30031 Mon Sep 17 00:00:00 2001 From: "Herbert Duerr [hdu]" Date: Mon, 9 Aug 2010 12:27:56 +0200 Subject: #i113731# fix compile warning on an pre-4.0-release gcc version --- vcl/source/glyphs/graphite_layout.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vcl/source/glyphs/graphite_layout.cxx b/vcl/source/glyphs/graphite_layout.cxx index 5d971d4bc985..0f7d2f5f3005 100644 --- a/vcl/source/glyphs/graphite_layout.cxx +++ b/vcl/source/glyphs/graphite_layout.cxx @@ -1103,7 +1103,7 @@ void GraphiteLayout::ApplyDXArray(ImplLayoutArgs &args, std::vector & rDelt { nXOffset = args.mpDXArray[nChars - 1] - mvCharDxs[nChars - 1]; } - int nPrevClusterGlyph = (bRtl)? mvGlyphs.size() : -1; + int nPrevClusterGlyph = (bRtl)? (signed)mvGlyphs.size() : -1; int nPrevClusterLastChar = -1; for (size_t i = 0; i < nChars; i++) { -- cgit v1.2.3 From 57534c0d9f60b454bdfb7bd488443b42afb67658 Mon Sep 17 00:00:00 2001 From: sj Date: Mon, 9 Aug 2010 14:11:58 +0200 Subject: impress197: #163250# fixed string handling, improved polygon splitting --- tools/source/generic/poly.cxx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tools/source/generic/poly.cxx b/tools/source/generic/poly.cxx index 2290cfdbe7c2..e9f98b07adbd 100644 --- a/tools/source/generic/poly.cxx +++ b/tools/source/generic/poly.cxx @@ -243,6 +243,11 @@ void ImplPolygon::ImplSetSize( USHORT nNewSize, BOOL bResize ) void ImplPolygon::ImplSplit( USHORT nPos, USHORT nSpace, ImplPolygon* pInitPoly ) { const ULONG nSpaceSize = nSpace * sizeof( Point ); + + //Can't fit this in :-(, throw ? + if (mnPoints + nSpace > USHRT_MAX) + return; + const USHORT nNewSize = mnPoints + nSpace; if( nPos >= mnPoints ) -- cgit v1.2.3 From 9c3d0de22682058f525c69e2caca7a9fbace452a Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Mon, 9 Aug 2010 17:09:53 +0200 Subject: vcl114: #i113753# fix ResId assertion --- svtools/source/java/javainteractionhandler.cxx | 27 +++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/svtools/source/java/javainteractionhandler.cxx b/svtools/source/java/javainteractionhandler.cxx index ec34ed07f25d..2d1112d54d49 100644 --- a/svtools/source/java/javainteractionhandler.cxx +++ b/svtools/source/java/javainteractionhandler.cxx @@ -150,20 +150,25 @@ void SAL_CALL JavaInteractionHandler::handle( const Reference< XInteractionReque //We first try to get the patch resource svp680xxx.res //If the resource is not found then svt680xxx.res is used ResId idWBX = SvtResId(WARNINGBOX_JAVANOTFOUND); - SvpResId pidPatchWBX(WARNINGBOX_JAVANOTFOUND); - pidPatchWBX.SetRT(RSC_WARNINGBOX); - ResMgr *pMgrWB = pidPatchWBX.GetResMgr(); - if (pMgrWB && pMgrWB->IsAvailable(pidPatchWBX)) - idWBX = pidPatchWBX; + ResMgr* pPatchMgr = ImpSvtData::GetSvtData().GetPatchResMgr(); + if( pPatchMgr ) + { + ResId pidPatchWBX(WARNINGBOX_JAVANOTFOUND, *pPatchMgr); + pidPatchWBX.SetRT(RSC_WARNINGBOX); + if ( pPatchMgr->IsAvailable(pidPatchWBX)) + idWBX = pidPatchWBX; + } WarningBox aWarningBox( NULL, idWBX); String aTitle; - SvpResId pidString(STR_WARNING_JAVANOTFOUND); - pidString.SetRT(RSC_STRING); - ResMgr *pmgr = pidString.GetResMgr(); - if ( pmgr && pmgr->IsAvailable(pidString)) - aTitle = String(pidString); - else + if( pPatchMgr ) + { + ResId pidString(STR_WARNING_JAVANOTFOUND, *pPatchMgr); + pidString.SetRT(RSC_STRING); + if( pPatchMgr->IsAvailable(pidString)) + aTitle = String(pidString); + } + if( ! aTitle.Len() ) aTitle = String( SvtResId( STR_WARNING_JAVANOTFOUND )); aWarningBox.SetText( aTitle ); -- cgit v1.2.3 From a9c8d32d6f96b327b2e8e46eadd6a7c454c02f9b Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Mon, 9 Aug 2010 17:39:22 +0200 Subject: vcl114: #i113755# remove unused svp resource --- svtools/inc/svtools/svtdata.hxx | 16 +--- svtools/source/java/javainteractionhandler.cxx | 108 +++---------------------- svtools/source/misc/svtdata.cxx | 19 ----- 3 files changed, 11 insertions(+), 132 deletions(-) diff --git a/svtools/inc/svtools/svtdata.hxx b/svtools/inc/svtools/svtdata.hxx index 9faadaff7305..1501afbb6157 100644 --- a/svtools/inc/svtools/svtdata.hxx +++ b/svtools/inc/svtools/svtdata.hxx @@ -40,11 +40,10 @@ class ImpSvtData public: SfxItemDesruptorList_Impl * pItemDesruptList; ResMgr * pResMgr; - ResMgr * pPatchResMgr; private: ImpSvtData(): - pItemDesruptList(0), pResMgr(0), pPatchResMgr(0) + pItemDesruptList(0), pResMgr(0) {} ~ImpSvtData(); @@ -52,25 +51,12 @@ private: public: ResMgr * GetResMgr(const ::com::sun::star::lang::Locale aLocale); ResMgr * GetResMgr(); // VCL dependant, only available in SVT, not in SVL! - ResMgr * GetPatchResMgr(); - ResMgr * GetPatchResMgr(const ::com::sun::star::lang::Locale& aLocale); static ImpSvtData & GetSvtData(); }; //============================================================================ -class SvpResId: public ResId -{ -public: - SvpResId( USHORT nId, const ::com::sun::star::lang::Locale aLocale ): - ResId( nId, *ImpSvtData::GetSvtData().GetResMgr( aLocale ) ) {} - - // VCL dependant, only available in SVT, not in SVL! - SvpResId( USHORT nId ); -}; - - class SvtResId: public ResId { public: diff --git a/svtools/source/java/javainteractionhandler.cxx b/svtools/source/java/javainteractionhandler.cxx index 2d1112d54d49..dc01de750b06 100644 --- a/svtools/source/java/javainteractionhandler.cxx +++ b/svtools/source/java/javainteractionhandler.cxx @@ -147,29 +147,8 @@ void SAL_CALL JavaInteractionHandler::handle( const Reference< XInteractionReque // No suitable JRE found vos::OGuard aSolarGuard( Application::GetSolarMutex() ); m_bJavaNotFound_Handled = true; - //We first try to get the patch resource svp680xxx.res - //If the resource is not found then svt680xxx.res is used - ResId idWBX = SvtResId(WARNINGBOX_JAVANOTFOUND); - ResMgr* pPatchMgr = ImpSvtData::GetSvtData().GetPatchResMgr(); - if( pPatchMgr ) - { - ResId pidPatchWBX(WARNINGBOX_JAVANOTFOUND, *pPatchMgr); - pidPatchWBX.SetRT(RSC_WARNINGBOX); - if ( pPatchMgr->IsAvailable(pidPatchWBX)) - idWBX = pidPatchWBX; - } - WarningBox aWarningBox( NULL, idWBX); - - String aTitle; - if( pPatchMgr ) - { - ResId pidString(STR_WARNING_JAVANOTFOUND, *pPatchMgr); - pidString.SetRT(RSC_STRING); - if( pPatchMgr->IsAvailable(pidString)) - aTitle = String(pidString); - } - if( ! aTitle.Len() ) - aTitle = String( SvtResId( STR_WARNING_JAVANOTFOUND )); + WarningBox aWarningBox( NULL, SvtResId( WARNINGBOX_JAVANOTFOUND ) ); + String aTitle( SvtResId( STR_WARNING_JAVANOTFOUND ) ); aWarningBox.SetText( aTitle ); nResult = aWarningBox.Execute(); @@ -187,24 +166,8 @@ void SAL_CALL JavaInteractionHandler::handle( const Reference< XInteractionReque // javavendors.xml was updated and Java has not been configured yet vos::OGuard aSolarGuard( Application::GetSolarMutex() ); m_bInvalidSettings_Handled = true; - //We first try to get the patch resource svp680xxx.res - //If the resource is not found then svt680xxx.res is used - ResId idWBX = SvtResId(WARNINGBOX_INVALIDJAVASETTINGS); - SvpResId pidPatchWBX(WARNINGBOX_INVALIDJAVASETTINGS); - pidPatchWBX.SetRT(RSC_WARNINGBOX); - ResMgr *pMgrWB = pidPatchWBX.GetResMgr(); - if (pMgrWB && pMgrWB->IsAvailable(pidPatchWBX)) - idWBX = pidPatchWBX; - WarningBox aWarningBox( NULL, idWBX); - - String aTitle; - SvpResId pidString(STR_WARNING_INVALIDJAVASETTINGS); - pidString.SetRT(RSC_STRING); - ResMgr *pmgr = pidString.GetResMgr(); - if ( pmgr && pmgr->IsAvailable(pidString)) - aTitle = String(pidString); - else - aTitle = String( SvtResId(STR_WARNING_INVALIDJAVASETTINGS)); + WarningBox aWarningBox( NULL, SvtResId( WARNINGBOX_INVALIDJAVASETTINGS ) ); + String aTitle( SvtResId(STR_WARNING_INVALIDJAVASETTINGS)); aWarningBox.SetText( aTitle ); nResult = aWarningBox.Execute(); @@ -221,27 +184,8 @@ void SAL_CALL JavaInteractionHandler::handle( const Reference< XInteractionReque vos::OGuard aSolarGuard( Application::GetSolarMutex() ); m_bJavaDisabled_Handled = true; // Java disabled. Give user a chance to enable Java inside Office. - //We first try to get the patch resource svp680xxx.res - //If the resource is not found then svt680xxx.res is used - ResId idQBX = SvtResId( QBX_JAVADISABLED ); - SvpResId pidPatchQBX(QBX_JAVADISABLED); - pidPatchQBX.SetRT(RSC_QUERYBOX); - ResMgr *pMgrQB = pidPatchQBX.GetResMgr(); - - if (pMgrQB && pMgrQB->IsAvailable(pidPatchQBX)) - idQBX = pidPatchQBX; - - QueryBox aQueryBox(NULL, idQBX); - - String aTitle; - - SvpResId pidString(STR_QUESTION_JAVADISABLED); - pidString.SetRT(RSC_STRING); - ResMgr *pmgr = pidString.GetResMgr(); - if ( pmgr && pmgr->IsAvailable(pidString)) - aTitle = String(pidString); - else - aTitle = String( SvtResId( STR_QUESTION_JAVADISABLED )); + QueryBox aQueryBox( NULL, SvtResId( QBX_JAVADISABLED ) ); + String aTitle( SvtResId( STR_QUESTION_JAVADISABLED ) ); aQueryBox.SetText( aTitle ); nResult = aQueryBox.Execute(); @@ -265,24 +209,8 @@ void SAL_CALL JavaInteractionHandler::handle( const Reference< XInteractionReque // Java not correctly installed, or damaged vos::OGuard aSolarGuard( Application::GetSolarMutex() ); m_bVMCreationFailure_Handled = true; - //We first try to get the patch resource svp680xxx.res - //If the resource is not found then svt680xxx.res is used - ResId idEBX = SvtResId(ERRORBOX_JVMCREATIONFAILED); - SvpResId pidPatchEBX(ERRORBOX_JVMCREATIONFAILED); - pidPatchEBX.SetRT(RSC_ERRORBOX); - ResMgr *pMgrEB = pidPatchEBX.GetResMgr(); - if (pMgrEB && pMgrEB->IsAvailable(pidPatchEBX)) - idEBX = pidPatchEBX; - ErrorBox aErrorBox( NULL, idEBX); - - String aTitle; - SvpResId pidString(STR_ERROR_JVMCREATIONFAILED); - pidString.SetRT(RSC_STRING); - ResMgr *pmgr = pidString.GetResMgr(); - if ( pmgr && pmgr->IsAvailable(pidString)) - aTitle = String(pidString); - else - aTitle = String( SvtResId(STR_ERROR_JVMCREATIONFAILED)); + ErrorBox aErrorBox( NULL, SvtResId( ERRORBOX_JVMCREATIONFAILED ) ); + String aTitle( SvtResId( STR_ERROR_JVMCREATIONFAILED ) ); aErrorBox.SetText( aTitle ); nResult = aErrorBox.Execute(); @@ -300,24 +228,8 @@ void SAL_CALL JavaInteractionHandler::handle( const Reference< XInteractionReque //before it can be used. vos::OGuard aSolarGuard( Application::GetSolarMutex() ); m_bRestartRequired_Handled = true; - //We first try to get the patch resource svp680xxx.res - //If the resource is not found then svt680xxx.res is used - ResId idEBX = SvtResId(ERRORBOX_RESTARTREQUIRED); - SvpResId pidPatchEBX(ERRORBOX_RESTARTREQUIRED); - pidPatchEBX.SetRT(RSC_ERRORBOX); - ResMgr *pMgrEB = pidPatchEBX.GetResMgr(); - if (pMgrEB && pMgrEB->IsAvailable(pidPatchEBX)) - idEBX = pidPatchEBX; - ErrorBox aErrorBox(NULL, idEBX); - - String aTitle; - SvpResId pidString(STR_ERROR_RESTARTREQUIRED); - pidString.SetRT(RSC_STRING); - ResMgr *pmgr = pidString.GetResMgr(); - if ( pmgr && pmgr->IsAvailable(pidString)) - aTitle = String(pidString); - else - aTitle = String( SvtResId(STR_ERROR_RESTARTREQUIRED)); + ErrorBox aErrorBox(NULL, SvtResId( ERRORBOX_RESTARTREQUIRED ) ); + String aTitle( SvtResId( STR_ERROR_RESTARTREQUIRED ) ); aErrorBox.SetText( aTitle ); nResult = aErrorBox.Execute(); diff --git a/svtools/source/misc/svtdata.cxx b/svtools/source/misc/svtdata.cxx index 65715f635883..7a04b3276c9f 100644 --- a/svtools/source/misc/svtdata.cxx +++ b/svtools/source/misc/svtdata.cxx @@ -61,25 +61,6 @@ ResMgr * ImpSvtData::GetResMgr() return GetResMgr(Application::GetSettings().GetUILocale()); } -ResMgr * ImpSvtData::GetPatchResMgr(const ::com::sun::star::lang::Locale& aLocale) -{ - if (!pPatchResMgr) - { - pPatchResMgr = ResMgr::CreateResMgr(CREATEVERSIONRESMGR_NAME(svp), aLocale); - } - return pPatchResMgr; -} - -ResMgr * ImpSvtData::GetPatchResMgr() -{ - return GetPatchResMgr(Application::GetSettings().GetUILocale()); -} - -SvpResId::SvpResId( USHORT nId ) : - ResId( nId, *ImpSvtData::GetSvtData().GetPatchResMgr() ) -{ -} - //============================================================================ // static ImpSvtData & ImpSvtData::GetSvtData() -- cgit v1.2.3 From 823d3cc493c8654a294ff45329c0514d2cc953d3 Mon Sep 17 00:00:00 2001 From: Mikhail Voytenko Date: Tue, 10 Aug 2010 11:05:20 +0200 Subject: mav56: #163253# tread invalid path segments correctly --- comphelper/inc/comphelper/storagehelper.hxx | 2 ++ comphelper/source/misc/storagehelper.cxx | 31 +++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+) diff --git a/comphelper/inc/comphelper/storagehelper.hxx b/comphelper/inc/comphelper/storagehelper.hxx index b613ddd2c5f1..b7e5704c4d68 100644 --- a/comphelper/inc/comphelper/storagehelper.hxx +++ b/comphelper/inc/comphelper/storagehelper.hxx @@ -161,6 +161,8 @@ public: static sal_Bool IsValidZipEntryFileName( const ::rtl::OUString& aName, sal_Bool bSlashAllowed ); static sal_Bool IsValidZipEntryFileName( const sal_Unicode *pChar, sal_Int32 nLength, sal_Bool bSlashAllowed ); + + static sal_Bool PathHasSegment( const ::rtl::OUString& aPath, const ::rtl::OUString& aSegment ); }; } diff --git a/comphelper/source/misc/storagehelper.cxx b/comphelper/source/misc/storagehelper.cxx index e2557523f674..db5ba71cd876 100644 --- a/comphelper/source/misc/storagehelper.cxx +++ b/comphelper/source/misc/storagehelper.cxx @@ -452,5 +452,36 @@ sal_Bool OStorageHelper::IsValidZipEntryFileName( return sal_True; } +// ---------------------------------------------------------------------- +sal_Bool OStorageHelper::PathHasSegment( const ::rtl::OUString& aPath, const ::rtl::OUString& aSegment ) +{ + sal_Bool bResult = sal_False; + const sal_Int32 nPathLen = aPath.getLength(); + const sal_Int32 nSegLen = aSegment.getLength(); + + if ( nSegLen && nPathLen >= nSegLen ) + { + ::rtl::OUString aEndSegment( RTL_CONSTASCII_USTRINGPARAM( "/" ) ); + aEndSegment += aSegment; + + ::rtl::OUString aInternalSegment( aEndSegment ); + aInternalSegment += ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "/" ) ); + + if ( aPath.indexOf( aInternalSegment ) >= 0 ) + bResult = sal_True; + + if ( !bResult && !aPath.compareTo( aSegment, nSegLen ) ) + { + if ( nPathLen == nSegLen || aPath.getStr()[nSegLen] == (sal_Unicode)'/' ) + bResult = sal_True; + } + + if ( !bResult && nPathLen > nSegLen && aPath.copy( nPathLen - nSegLen - 1, nSegLen + 1 ).equals( aEndSegment ) ) + bResult = sal_True; + } + + return bResult; +} + } -- cgit v1.2.3 From 747ece3c0983cf226f1785896554e27448e02320 Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Wed, 11 Aug 2010 15:44:43 +0200 Subject: vcl114: fix snafu --- vcl/source/control/button.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/vcl/source/control/button.cxx b/vcl/source/control/button.cxx index ce1119481e87..db7649a90258 100644 --- a/vcl/source/control/button.cxx +++ b/vcl/source/control/button.cxx @@ -896,7 +896,8 @@ void PushButton::ImplInitSettings( BOOL bFont, // #i38498#: do not check for GetParent()->IsChildTransparentModeEnabled() // otherwise the formcontrol button will be overdrawn due to PARENTCLIPMODE_NOCLIP // for radio and checkbox this is ok as they shoud appear transparent in documents - if ( IsNativeControlSupported( CTRL_PUSHBUTTON, PART_ENTIRE_CONTROL ) || WB_FLATBUTTON ) + if ( IsNativeControlSupported( CTRL_PUSHBUTTON, PART_ENTIRE_CONTROL ) || + (GetStyle() & WB_FLATBUTTON) != 0 ) { EnableChildTransparentMode( TRUE ); SetParentClipMode( PARENTCLIPMODE_NOCLIP ); -- cgit v1.2.3 From 6bb9f5bea7037dcda3cb3e104452fb0104544bfb Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Thu, 12 Aug 2010 13:32:56 +0200 Subject: ooo33gsl05: #i113821# ensure last page renders when aborting job --- vcl/inc/vcl/print.hxx | 1 + vcl/source/gdi/print3.cxx | 32 +++++++++++++++++++++++--------- 2 files changed, 24 insertions(+), 9 deletions(-) diff --git a/vcl/inc/vcl/print.hxx b/vcl/inc/vcl/print.hxx index 96822d9bc756..0cd56e32d83d 100644 --- a/vcl/inc/vcl/print.hxx +++ b/vcl/inc/vcl/print.hxx @@ -520,6 +520,7 @@ public: SAL_DLLPRIVATE void setPrinter( const boost::shared_ptr& ); SAL_DLLPRIVATE void setOptionChangeHdl( const Link& ); SAL_DLLPRIVATE void createProgressDialog(); + SAL_DLLPRIVATE bool isProgressCanceled() const; SAL_DLLPRIVATE void setMultipage( const MultiPageSetup& ); SAL_DLLPRIVATE const MultiPageSetup& getMultipage() const; SAL_DLLPRIVATE void setLastPage( sal_Bool i_bLastPage ); diff --git a/vcl/source/gdi/print3.cxx b/vcl/source/gdi/print3.cxx index 0aeb928856fc..b3f858a06f2d 100755 --- a/vcl/source/gdi/print3.cxx +++ b/vcl/source/gdi/print3.cxx @@ -444,8 +444,7 @@ void Printer::ImplPrintJob( const boost::shared_ptr& i_pContr if( ! aDlg.Execute() ) { GDIMetaFile aPageFile; - i_pController->setLastPage( sal_True ); - i_pController->getFilteredPageFile( 0, aPageFile ); + i_pController->abortJob(); return; } if( aDlg.isPrintToFile() ) @@ -453,9 +452,7 @@ void Printer::ImplPrintJob( const boost::shared_ptr& i_pContr rtl::OUString aFile = queryFile( pController->getPrinter().get() ); if( ! aFile.getLength() ) { - GDIMetaFile aPageFile; - i_pController->setLastPage( sal_True ); - i_pController->getFilteredPageFile( 0, aPageFile ); + i_pController->abortJob(); return; } pController->setValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "LocalFileName" ) ), @@ -612,7 +609,7 @@ bool Printer::StartJob( const rtl::OUString& i_rJobName, boost::shared_ptrStartJob( pPrintFile, i_rJobName, Application::GetDisplayName(), @@ -624,11 +621,11 @@ bool Printer::StartJob( const rtl::OUString& i_rJobName, boost::shared_ptrcreateProgressDialog(); int nPages = i_pController->getFilteredPageCount(); - for( int nOuterIteration = 0; nOuterIteration < nOuterRepeatCount; nOuterIteration++ ) + for( int nOuterIteration = 0; nOuterIteration < nOuterRepeatCount && ! bAborted; nOuterIteration++ ) { - for( int nPage = 0; nPage < nPages; nPage++ ) + for( int nPage = 0; nPage < nPages && ! bAborted; nPage++ ) { - for( int nInnerIteration = 0; nInnerIteration < nInnerRepeatCount; nInnerIteration++ ) + for( int nInnerIteration = 0; nInnerIteration < nInnerRepeatCount && ! bAborted; nInnerIteration++ ) { if( nPage == nPages-1 && nOuterIteration == nOuterRepeatCount-1 && @@ -638,6 +635,11 @@ bool Printer::StartJob( const rtl::OUString& i_rJobName, boost::shared_ptrsetLastPage( sal_True ); } i_pController->printFilteredPage( nPage ); + if( i_pController->isProgressCanceled() ) + { + i_pController->abortJob(); + bAborted = true; + } } } // FIXME: duplex ? @@ -1183,6 +1185,13 @@ void PrinterController::jobFinished( view::PrintableState ) void PrinterController::abortJob() { setJobState( view::PrintableState_JOB_ABORTED ); + // applications (well, sw) depend on a page request with "IsLastPage" = true + // to free resources, else they (well, sw) will crash eventually + setLastPage( sal_True ); + delete mpImplData->mpProgress; + mpImplData->mpProgress = NULL; + GDIMetaFile aMtf; + getPageFile( 0, aMtf, false ); } void PrinterController::setLastPage( sal_Bool i_bLastPage ) @@ -1515,6 +1524,11 @@ void PrinterController::createProgressDialog() mpImplData->mpProgress->reset(); } +bool PrinterController::isProgressCanceled() const +{ + return mpImplData->mpProgress && mpImplData->mpProgress->isCanceled(); +} + void PrinterController::setMultipage( const MultiPageSetup& i_rMPS ) { mpImplData->maMultiPage = i_rMPS; -- cgit v1.2.3 From b045af077a788a6b95b2e690d58ea1712c6f3d25 Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Thu, 12 Aug 2010 16:01:40 +0200 Subject: ooo33gsl05: #i113025# fix GDIMetaFile handlng of MapMode MAP_PIXEL --- vcl/inc/vcl/gdimtf.hxx | 2 ++ vcl/source/gdi/gdimtf.cxx | 43 +++++++++++++++++++++++++++++++++++++++++++ vcl/source/gdi/metaact.cxx | 2 +- vcl/source/gdi/print3.cxx | 6 +++--- 4 files changed, 49 insertions(+), 4 deletions(-) diff --git a/vcl/inc/vcl/gdimtf.hxx b/vcl/inc/vcl/gdimtf.hxx index 06f7a0d14a2e..c168443741fc 100644 --- a/vcl/inc/vcl/gdimtf.hxx +++ b/vcl/inc/vcl/gdimtf.hxx @@ -158,6 +158,8 @@ public: sal_Bool IsEqual( const GDIMetaFile& rMtf ) const; BOOL Mirror( ULONG nMirrorFlags ); void Move( long nX, long nY ); + // additional Move method getting specifics how to handle MapMode( MAP_PIXEL ) + void Move( long nX, long nY, long nDPIX, long nDPIX ); void Scale( double fScaleX, double fScaleY ); void Scale( const Fraction& rScaleX, const Fraction& rScaleY ); void Rotate( long nAngle10 ); diff --git a/vcl/source/gdi/gdimtf.cxx b/vcl/source/gdi/gdimtf.cxx index 01b34286a086..818a31a10c0f 100644 --- a/vcl/source/gdi/gdimtf.cxx +++ b/vcl/source/gdi/gdimtf.cxx @@ -841,6 +841,49 @@ void GDIMetaFile::Move( long nX, long nY ) } } +void GDIMetaFile::Move( long nX, long nY, long nDPIX, long nDPIY ) +{ + const Size aBaseOffset( nX, nY ); + Size aOffset( aBaseOffset ); + VirtualDevice aMapVDev; + + aMapVDev.EnableOutput( FALSE ); + aMapVDev.SetReferenceDevice( nDPIX, nDPIY ); + aMapVDev.SetMapMode( GetPrefMapMode() ); + + for( MetaAction* pAct = (MetaAction*) First(); pAct; pAct = (MetaAction*) Next() ) + { + const long nType = pAct->GetType(); + MetaAction* pModAct; + + if( pAct->GetRefCount() > 1 ) + { + Replace( pModAct = pAct->Clone(), GetCurPos() ); + pAct->Delete(); + } + else + pModAct = pAct; + + if( ( META_MAPMODE_ACTION == nType ) || + ( META_PUSH_ACTION == nType ) || + ( META_POP_ACTION == nType ) ) + { + pModAct->Execute( &aMapVDev ); + if( aMapVDev.GetMapMode().GetMapUnit() == MAP_PIXEL ) + { + aOffset = aMapVDev.LogicToPixel( aBaseOffset, GetPrefMapMode() ); + MapMode aMap( aMapVDev.GetMapMode() ); + aOffset.Width() = aOffset.Width() * (double)aMap.GetScaleX(); + aOffset.Height() = aOffset.Height() * (double)aMap.GetScaleY(); + } + else + aOffset = aMapVDev.LogicToLogic( aBaseOffset, GetPrefMapMode(), aMapVDev.GetMapMode() ); + } + + pModAct->Move( aOffset.Width(), aOffset.Height() ); + } +} + // ------------------------------------------------------------------------ void GDIMetaFile::Scale( double fScaleX, double fScaleY ) diff --git a/vcl/source/gdi/metaact.cxx b/vcl/source/gdi/metaact.cxx index 752a4222bcb2..94f07b8f17d1 100644 --- a/vcl/source/gdi/metaact.cxx +++ b/vcl/source/gdi/metaact.cxx @@ -4078,7 +4078,7 @@ void MetaCommentAction::Move( long nXMove, long nYMove ) aMemStm >> aFill; PolyPolygon aPath; aFill.getPath( aPath ); - aPath.Scale( nXMove, nYMove ); + aPath.Move( nXMove, nYMove ); aFill.setPath( aPath ); aDest << aFill; } diff --git a/vcl/source/gdi/print3.cxx b/vcl/source/gdi/print3.cxx index b3f858a06f2d..375c570f1a16 100755 --- a/vcl/source/gdi/print3.cxx +++ b/vcl/source/gdi/print3.cxx @@ -958,7 +958,7 @@ PrinterController::PageSize PrinterController::getFilteredPageFile( int i_nFilte o_rMtf.WindStart(); long nDX = (aPaperSize.Width() - aPageSize.aSize.Width()) / 2; long nDY = (aPaperSize.Height() - aPageSize.aSize.Height()) / 2; - o_rMtf.Move( nDX, nDY ); + o_rMtf.Move( nDX, nDY, mpImplData->mpPrinter->ImplGetDPIX(), mpImplData->mpPrinter->ImplGetDPIY() ); o_rMtf.WindStart(); o_rMtf.SetPrefSize( aPaperSize ); aPageSize.aSize = aPaperSize; @@ -1033,7 +1033,7 @@ PrinterController::PageSize PrinterController::getFilteredPageFile( int i_nFilte long nOffY = (aSubPageSize.Height() - long(double(aPageSize.aSize.Height()) * fScale)) / 2; long nX = rMPS.nLeftMargin + nOffX + nAdvX * nCellX; long nY = rMPS.nTopMargin + nOffY + nAdvY * nCellY; - aPageFile.Move( nX, nY ); + aPageFile.Move( nX, nY, mpImplData->mpPrinter->ImplGetDPIX(), mpImplData->mpPrinter->ImplGetDPIY() ); aPageFile.WindStart(); // calculate border rectangle Rectangle aSubPageRect( Point( nX, nY ), @@ -1153,7 +1153,7 @@ void PrinterController::printFilteredPage( int i_nPage ) { Point aPageOffset( mpImplData->mpPrinter->GetPageOffset() ); aPageFile.WindStart(); - aPageFile.Move( -aPageOffset.X(), -aPageOffset.Y() ); + aPageFile.Move( -aPageOffset.X(), -aPageOffset.Y(), mpImplData->mpPrinter->ImplGetDPIX(), mpImplData->mpPrinter->ImplGetDPIY() ); } GDIMetaFile aCleanedFile; -- cgit v1.2.3 From 9e5b02a0c1e802a6afdca2d79e77a0aa00e98ba7 Mon Sep 17 00:00:00 2001 From: "Herbert Duerr [hdu]" Date: Fri, 13 Aug 2010 09:07:29 +0200 Subject: #i113776# avoid default adaptive subdivision for now --- basegfx/source/polygon/b2dtrapezoid.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/basegfx/source/polygon/b2dtrapezoid.cxx b/basegfx/source/polygon/b2dtrapezoid.cxx index 4cd63f938114..c1e0f7f6c7c1 100644 --- a/basegfx/source/polygon/b2dtrapezoid.cxx +++ b/basegfx/source/polygon/b2dtrapezoid.cxx @@ -1161,7 +1161,8 @@ namespace basegfx if(aSource.areControlPointsUsed()) { - aSource = aSource.getDefaultAdaptiveSubdivision(); + const double fPrecisionFactor = 0.25; + aSource = adaptiveSubdivideByDistance( aSource, fLineWidth * fPrecisionFactor ); } const sal_uInt32 nPointCount(aSource.count()); -- cgit v1.2.3 From 1fa6112a2d062612201c765ed3eb6e2faaba8faf Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Fri, 13 Aug 2010 11:25:17 +0200 Subject: ooo33gsl05: fix a typo --- vcl/inc/vcl/gdimtf.hxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vcl/inc/vcl/gdimtf.hxx b/vcl/inc/vcl/gdimtf.hxx index c168443741fc..636fc4a979f3 100644 --- a/vcl/inc/vcl/gdimtf.hxx +++ b/vcl/inc/vcl/gdimtf.hxx @@ -159,7 +159,7 @@ public: BOOL Mirror( ULONG nMirrorFlags ); void Move( long nX, long nY ); // additional Move method getting specifics how to handle MapMode( MAP_PIXEL ) - void Move( long nX, long nY, long nDPIX, long nDPIX ); + void Move( long nX, long nY, long nDPIX, long nDPIY ); void Scale( double fScaleX, double fScaleY ); void Scale( const Fraction& rScaleX, const Fraction& rScaleY ); void Rotate( long nAngle10 ); -- cgit v1.2.3 From 1fc79e17babe1511326f289e3539772674be9562 Mon Sep 17 00:00:00 2001 From: "Herbert Duerr [hdu]" Date: Fri, 13 Aug 2010 17:00:29 +0200 Subject: #i113604# fix some charmap refcounting issues --- vcl/aqua/source/gdi/salgdi.cxx | 10 +++++++--- vcl/os2/source/gdi/salgdi3.cxx | 1 + vcl/source/gdi/metric.cxx | 14 ++++++-------- vcl/unx/source/gdi/salgdi3.cxx | 3 ++- vcl/win/source/gdi/salgdi3.cxx | 15 +++++++++++---- 5 files changed, 27 insertions(+), 16 deletions(-) diff --git a/vcl/aqua/source/gdi/salgdi.cxx b/vcl/aqua/source/gdi/salgdi.cxx index 96569aa80120..a368c2f574a7 100644 --- a/vcl/aqua/source/gdi/salgdi.cxx +++ b/vcl/aqua/source/gdi/salgdi.cxx @@ -127,6 +127,7 @@ ImplFontCharMap* ImplMacFontData::GetImplFontCharMap() const // set the default charmap mpCharMap = ImplFontCharMap::GetDefaultMap(); + mpCharMap->AddReference(); // get the CMAP byte size ATSFontRef rFont = FMGetATSFontRefFromFont( mnFontId ); @@ -149,10 +150,11 @@ ImplFontCharMap* ImplMacFontData::GetImplFontCharMap() const // parse the CMAP CmapResult aCmapResult; - if( !ParseCMAP( &aBuffer[0], nRawLength, aCmapResult ) ) - return mpCharMap; + mpCharMap->DeReference(); + if( ParseCMAP( &aBuffer[0], nRawLength, aCmapResult ) ) + mpCharMap = new ImplFontCharMap( aCmapResult ); - mpCharMap = new ImplFontCharMap( aCmapResult ); + mpCharMap->AddReference(); return mpCharMap; } @@ -2359,6 +2361,8 @@ void AquaSalGraphics::GetGlyphWidths( const ImplFontData* pFontData, bool bVerti if( nGlyph > 0 ) rUnicodeEnc[ nUcsChar ] = nGlyph; } + + pMap->DeReference(); // TODO: add and use RAII object instead } ::CloseTTFont( pSftFont ); diff --git a/vcl/os2/source/gdi/salgdi3.cxx b/vcl/os2/source/gdi/salgdi3.cxx index e25e68ee5a4c..864fa7a1615d 100644 --- a/vcl/os2/source/gdi/salgdi3.cxx +++ b/vcl/os2/source/gdi/salgdi3.cxx @@ -592,6 +592,7 @@ void ImplOs2FontData::ReadCmapTable( HPS hPS ) const aResult.mpPairCodes, aResult.mpStartGlyphs ); else mpUnicodeMap = ImplFontCharMap::GetDefaultMap(); + mpUnicodeMap->AddReference(); } // ======================================================================= diff --git a/vcl/source/gdi/metric.cxx b/vcl/source/gdi/metric.cxx index dffc7c82caf0..2c90b2dda915 100644 --- a/vcl/source/gdi/metric.cxx +++ b/vcl/source/gdi/metric.cxx @@ -252,7 +252,7 @@ ImplFontCharMap::ImplFontCharMap( const CmapResult& rCR ) , mpGlyphIds( rCR.mpGlyphIds ) , mnRangeCount( rCR.mnRangeCount ) , mnCharCount( 0 ) -, mnRefCount( 1 ) +, mnRefCount( 0 ) { const sal_uInt32* pRangePtr = mpRangeCodes; for( int i = mnRangeCount; --i >= 0; pRangePtr += 2 ) @@ -285,7 +285,7 @@ ImplFontCharMap::~ImplFontCharMap() delete[] mpRangeCodes; delete[] mpStartGlyphs; delete[] mpGlyphIds; -} + } // ----------------------------------------------------------------------- @@ -293,9 +293,7 @@ namespace { ImplFontCharMap *GetDefaultUnicodeMap() { - if( pDefaultUnicodeImplFontCharMap ) - pDefaultUnicodeImplFontCharMap->AddReference(); - else + if( !pDefaultUnicodeImplFontCharMap ) { const sal_uInt32* pRangeCodes = aDefaultUnicodeRanges; int nCodesCount = sizeof(aDefaultUnicodeRanges) / sizeof(*pRangeCodes); @@ -303,14 +301,13 @@ namespace pDefaultUnicodeImplFontCharMap = new ImplFontCharMap( aDefaultCR ); } + pDefaultUnicodeImplFontCharMap->AddReference(); return pDefaultUnicodeImplFontCharMap; } ImplFontCharMap *GetDefaultSymbolMap() { - if( pDefaultSymbolImplFontCharMap ) - pDefaultSymbolImplFontCharMap->AddReference(); - else + if( !pDefaultSymbolImplFontCharMap ) { const sal_uInt32* pRangeCodes = aDefaultSymbolRanges; int nCodesCount = sizeof(aDefaultSymbolRanges) / sizeof(*pRangeCodes); @@ -318,6 +315,7 @@ namespace pDefaultSymbolImplFontCharMap = new ImplFontCharMap( aDefaultCR ); } + pDefaultSymbolImplFontCharMap->AddReference(); return pDefaultSymbolImplFontCharMap; } } diff --git a/vcl/unx/source/gdi/salgdi3.cxx b/vcl/unx/source/gdi/salgdi3.cxx index 16529d3ce78f..c6410e128596 100644 --- a/vcl/unx/source/gdi/salgdi3.cxx +++ b/vcl/unx/source/gdi/salgdi3.cxx @@ -1507,7 +1507,8 @@ ImplFontCharMap* X11SalGraphics::GetImplFontCharMap() const CmapResult aCmapResult; if( !mpServerFont[0]->GetFontCodeRanges( aCmapResult ) ) return NULL; - return new ImplFontCharMap( aCmapResult ); + ImplFontCharMap* pNewMap = new ImplFontCharMap( aCmapResult ); + return pNewMap; } // ---------------------------------------------------------------------------- diff --git a/vcl/win/source/gdi/salgdi3.cxx b/vcl/win/source/gdi/salgdi3.cxx index 01fecec94b2f..484771f37fee 100644 --- a/vcl/win/source/gdi/salgdi3.cxx +++ b/vcl/win/source/gdi/salgdi3.cxx @@ -535,7 +535,7 @@ bool WinGlyphFallbackSubstititution::HasMissingChars( const ImplFontData* pFace, return false; int nMatchCount = 0; - // static const int nMaxMatchCount = 1; // TODO: check more missing characters? + // static const int nMaxMatchCount = 1; // TODO: tolerate more missing characters? const sal_Int32 nStrLen = rMissingChars.getLength(); for( sal_Int32 nStrIdx = 0; nStrIdx < nStrLen; ++nStrIdx ) { @@ -543,6 +543,7 @@ bool WinGlyphFallbackSubstititution::HasMissingChars( const ImplFontData* pFace, nMatchCount += pCharMap->HasChar( uChar ); break; // for now } + pCharMap->DeReference(); const bool bHasMatches = (nMatchCount > 0); return bHasMatches; @@ -1320,6 +1321,7 @@ void ImplWinFontData::ReadCmapTable( HDC hDC ) const if( !mpUnicodeMap ) mpUnicodeMap = ImplFontCharMap::GetDefaultMap( bIsSymbolFont ); + mpUnicodeMap->AddReference(); } // ======================================================================= @@ -2882,8 +2884,6 @@ BOOL WinSalGraphics::CreateFontSubset( const rtl::OUString& rToFile, ImplDoSetFont( &aIFSD, fScale, hOldFont ); ImplWinFontData* pWinFontData = (ImplWinFontData*)aIFSD.mpFontData; - pWinFontData->UpdateFromHDC( mhDC ); -/*const*/ ImplFontCharMap* pImplFontCharMap = pWinFontData->GetImplFontCharMap(); #if OSL_DEBUG_LEVEL > 1 // get font metrics @@ -2906,6 +2906,9 @@ BOOL WinSalGraphics::CreateFontSubset( const rtl::OUString& rToFile, const RawFontData aRawCffData( mhDC, nCffTag ); if( aRawCffData.get() ) { + pWinFontData->UpdateFromHDC( mhDC ); +/*const*/ImplFontCharMap* pCharMap = pWinFontData->GetImplFontCharMap(); + long nRealGlyphIds[ 256 ]; for( int i = 0; i < nGlyphCount; ++i ) { @@ -2913,13 +2916,15 @@ BOOL WinSalGraphics::CreateFontSubset( const rtl::OUString& rToFile, // TODO: use GDI's GetGlyphIndices instead? Does it handle GSUB properly? sal_uInt32 nGlyphIdx = pGlyphIDs[i] & GF_IDXMASK; if( pGlyphIDs[i] & GF_ISCHAR ) // remaining pseudo-glyphs need to be translated - nGlyphIdx = pImplFontCharMap->GetGlyphIndex( nGlyphIdx ); + nGlyphIdx = pCharMap->GetGlyphIndex( nGlyphIdx ); if( (pGlyphIDs[i] & (GF_ROTMASK|GF_GSUB)) != 0) // TODO: vertical substitution {/*####*/} nRealGlyphIds[i] = nGlyphIdx; } + pCharMap->DeReference(); // TODO: and and use a RAII object + // provide a font subset from the CFF-table FILE* pOutFile = fopen( aToFile.GetBuffer(), "wb" ); rInfo.LoadFont( FontSubsetInfo::CFF_FONT, aRawCffData.get(), aRawCffData.size() ); @@ -3184,6 +3189,8 @@ void WinSalGraphics::GetGlyphWidths( const ImplFontData* pFont, } nChar = pMap->GetNextChar( nChar ); } + + pMap->DeReference(); // TODO: and and use a RAII object } } else if( pFont->IsEmbeddable() ) -- cgit v1.2.3 From c44ba02b8439f592a8379f770c7058b70419398f Mon Sep 17 00:00:00 2001 From: "Herbert Duerr [hdu]" Date: Mon, 16 Aug 2010 13:39:40 +0200 Subject: #i113604# allow forced garbage-collection on exit --- vcl/source/glyphs/glyphcache.cxx | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/vcl/source/glyphs/glyphcache.cxx b/vcl/source/glyphs/glyphcache.cxx index 1953ecf553c4..7181db56dd4d 100644 --- a/vcl/source/glyphs/glyphcache.cxx +++ b/vcl/source/glyphs/glyphcache.cxx @@ -78,12 +78,18 @@ GlyphCache::~GlyphCache() void GlyphCache::InvalidateAllGlyphs() { -#if 0 // TODO: implement uncaching of all glyph shapes and metrics - for( FontList::iterator it = maFontList.begin(); it != maFontList.end(); ++it ) - delete const_cast( it->second ); - maFontList.clear(); - mpCurrentGCFont = NULL; -#endif + // an application about to exit can omit garbage collecting the heap + // since it makes things slower and introduces risks if the heap was not perfect + // for debugging, for memory grinding or leak checking the env allows to force GC + const char* pEnv = getenv( "SAL_FORCE_GC_ON_EXIT" ); + if( pEnv && (*pEnv != '0') ) + { + // uncache of all glyph shapes and metrics + for( FontList::iterator it = maFontList.begin(); it != maFontList.end(); ++it ) + delete const_cast( it->second ); + maFontList.clear(); + mpCurrentGCFont = NULL; + } } // ----------------------------------------------------------------------- -- cgit v1.2.3 From 588516e12af81741174b16feb22bef6d5f5fc66e Mon Sep 17 00:00:00 2001 From: "Herbert Duerr [hdu]" Date: Mon, 16 Aug 2010 14:55:27 +0200 Subject: #i113861# prepare caching of ImplFontCharMap objects on UNX --- vcl/inc/vcl/glyphcache.hxx | 3 +-- vcl/source/glyphs/gcach_ftyp.cxx | 15 ++++++++++++++- vcl/source/glyphs/gcach_ftyp.hxx | 1 + vcl/unx/headless/svppspgraphics.cxx | 7 ++----- vcl/unx/headless/svptext.cxx | 6 ++---- vcl/unx/source/gdi/pspgraphics.cxx | 7 ++----- vcl/unx/source/gdi/salgdi3.cxx | 12 ++---------- 7 files changed, 24 insertions(+), 27 deletions(-) diff --git a/vcl/inc/vcl/glyphcache.hxx b/vcl/inc/vcl/glyphcache.hxx index a77c1626dc24..ecb591abbae4 100644 --- a/vcl/inc/vcl/glyphcache.hxx +++ b/vcl/inc/vcl/glyphcache.hxx @@ -48,7 +48,6 @@ class ImplFontOptions; namespace basegfx { class B2DPolyPolygon; } class RawBitmap; -class CmapResult; #include #include @@ -190,7 +189,7 @@ public: virtual void FetchFontMetric( ImplFontMetricData&, long& rFactor ) const = 0; virtual ULONG GetKernPairs( ImplKernPairData** ) const { return 0; } virtual int GetGlyphKernValue( int, int ) const { return 0; } - virtual bool GetFontCodeRanges( CmapResult& ) const { return false; } + virtual ImplFontCharMap* GetImplFontCharMap() const = 0; Point TransformPoint( const Point& ) const; GlyphData& GetGlyphData( int nGlyphIndex ); diff --git a/vcl/source/glyphs/gcach_ftyp.cxx b/vcl/source/glyphs/gcach_ftyp.cxx index aeb928c46608..bc0957a96659 100644 --- a/vcl/source/glyphs/gcach_ftyp.cxx +++ b/vcl/source/glyphs/gcach_ftyp.cxx @@ -1733,7 +1733,20 @@ bool FreetypeServerFont::GetGlyphBitmap8( int nGlyphIndex, RawBitmap& rRawBitmap // determine unicode ranges in font // ----------------------------------------------------------------------- -// TODO: replace with GetFontCharMap() +ImplFontCharMap* FreetypeServerFont::GetImplFontCharMap( void ) const +{ + CmapResult aCmapResult; + bool bOK = GetFontCodeRanges( aCmapResult ); + ImplFontCharMap* pIFCMap = NULL; + if( !bOK ) + pIFCMap = ImplFontCharMap::GetDefaultMap(); + else + pIFCMap = new ImplFontCharMap( aCmapResult ); + // TODO?: cache ImplFontCharMap + return pIFCMap; +} + +// TODO: merge into method GetFontCharMap() bool FreetypeServerFont::GetFontCodeRanges( CmapResult& rResult ) const { rResult.mbSymbolic = mpFontInfo->IsSymbolFont(); diff --git a/vcl/source/glyphs/gcach_ftyp.hxx b/vcl/source/glyphs/gcach_ftyp.hxx index 5ebe70bcbdf9..9b1741aea477 100644 --- a/vcl/source/glyphs/gcach_ftyp.hxx +++ b/vcl/source/glyphs/gcach_ftyp.hxx @@ -181,6 +181,7 @@ public: virtual bool NeedsArtificialItalic() const { return mbArtItalic; } virtual void FetchFontMetric( ImplFontMetricData&, long& rFactor ) const; + virtual ImplFontCharMap* GetImplFontCharMap( void ) const; virtual int GetGlyphIndex( sal_UCS4 ) const; int GetRawGlyphIndex( sal_UCS4 ) const; diff --git a/vcl/unx/headless/svppspgraphics.cxx b/vcl/unx/headless/svppspgraphics.cxx index 86f356031f52..ccced8701f83 100644 --- a/vcl/unx/headless/svppspgraphics.cxx +++ b/vcl/unx/headless/svppspgraphics.cxx @@ -685,14 +685,11 @@ void PspGraphics::DrawServerFontLayout( const ServerFontLayout& rLayout ) ImplFontCharMap* PspGraphics::GetImplFontCharMap() const { - // TODO: get ImplFontCharMap directly from fonts if( !m_pServerFont[0] ) return NULL; - CmapResult aCmapResult; - if( !m_pServerFont[0]->GetFontCodeRanges( aCmapResult ) ) - return NULL; - return new ImplFontCharMap( aCmapResult ); + ImplFontCharMap* pIFCMap = m_pServerFont[0]->GetImplFontCharMap(); + return pIFCMap; } USHORT PspGraphics::SetFont( ImplFontSelectData *pEntry, int nFallbackLevel ) diff --git a/vcl/unx/headless/svptext.cxx b/vcl/unx/headless/svptext.cxx index 34941fc777db..df3625e82643 100644 --- a/vcl/unx/headless/svptext.cxx +++ b/vcl/unx/headless/svptext.cxx @@ -277,10 +277,8 @@ ImplFontCharMap* SvpSalGraphics::GetImplFontCharMap() const if( !m_pServerFont[0] ) return NULL; - CmapResult aCmapResult; - if( !m_pServerFont[0]->GetFontCodeRanges( aCmapResult ) ) - return NULL; - return new ImplFontCharMap( aCmapResult ); + ImplFontCharMap* pIFCMap = m_pServerFont[0]->GetImplFontCharMap(); + return pIFCMap; } // --------------------------------------------------------------------------- diff --git a/vcl/unx/source/gdi/pspgraphics.cxx b/vcl/unx/source/gdi/pspgraphics.cxx index 220d7bbcae87..3f73d1021bb8 100644 --- a/vcl/unx/source/gdi/pspgraphics.cxx +++ b/vcl/unx/source/gdi/pspgraphics.cxx @@ -772,14 +772,11 @@ void PspGraphics::DrawServerFontLayout( const ServerFontLayout& rLayout ) ImplFontCharMap* PspGraphics::GetImplFontCharMap() const { - // TODO: get ImplFontCharMap directly from fonts if( !m_pServerFont[0] ) return NULL; - CmapResult aCmapResult; - if( !m_pServerFont[0]->GetFontCodeRanges( aCmapResult ) ) - return NULL; - return new ImplFontCharMap( aCmapResult ); + ImplFontCharMap* pIFCMap = m_pServerFont[0]->GetImplFontCharMap(); + return pIFCMap; } USHORT PspGraphics::SetFont( ImplFontSelectData *pEntry, int nFallbackLevel ) diff --git a/vcl/unx/source/gdi/salgdi3.cxx b/vcl/unx/source/gdi/salgdi3.cxx index c6410e128596..7e605dbee981 100644 --- a/vcl/unx/source/gdi/salgdi3.cxx +++ b/vcl/unx/source/gdi/salgdi3.cxx @@ -1496,19 +1496,11 @@ void X11SalGraphics::DrawStringUCS2MB( ExtendedFontStruct& rFont, ImplFontCharMap* X11SalGraphics::GetImplFontCharMap() const { - // TODO: get ImplFontCharMap directly from fonts if( !mpServerFont[0] ) -#if 0 // RIP XLFD fonts - if( mXFont[0] ) - // TODO?: nPairCount = mXFont[0]->GetFontCodeRanges( NULL ); -#endif return NULL; - CmapResult aCmapResult; - if( !mpServerFont[0]->GetFontCodeRanges( aCmapResult ) ) - return NULL; - ImplFontCharMap* pNewMap = new ImplFontCharMap( aCmapResult ); - return pNewMap; + ImplFontCharMap* pIFCMap = mpServerFont[0]->GetImplFontCharMap(); + return pIFCMap; } // ---------------------------------------------------------------------------- -- cgit v1.2.3 From 40f797d028c472ff7f251bc125cad4d302092e0c Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Mon, 16 Aug 2010 14:20:39 +0100 Subject: cmcfixes78: #i113910# get rid of frame effect in cairo-canvas --- canvas/source/cairo/cairo_canvashelper.cxx | 1 + 1 file changed, 1 insertion(+) diff --git a/canvas/source/cairo/cairo_canvashelper.cxx b/canvas/source/cairo/cairo_canvashelper.cxx index eec6a09fb215..60647d4f8224 100644 --- a/canvas/source/cairo/cairo_canvashelper.cxx +++ b/canvas/source/cairo/cairo_canvashelper.cxx @@ -1395,6 +1395,7 @@ namespace cairocanvas ::rtl::math::approxEqual( aMatrix.x0, 0 ) && ::rtl::math::approxEqual( aMatrix.y0, 0 ) ) cairo_set_operator( mpCairo.get(), CAIRO_OPERATOR_SOURCE ); + cairo_pattern_set_extend( cairo_get_source(mpCairo.get()), CAIRO_EXTEND_PAD ); cairo_rectangle( mpCairo.get(), 0, 0, aBitmapSize.Width, aBitmapSize.Height ); cairo_clip( mpCairo.get() ); -- cgit v1.2.3 From 7d7809aeea8923b004cd9b1982bc20a46b30d0d8 Mon Sep 17 00:00:00 2001 From: "Herbert Duerr [hdu]" Date: Tue, 17 Aug 2010 15:22:46 +0200 Subject: #i113604# allow refcounting for const ImplFontCharMap objects --- vcl/inc/vcl/impfont.hxx | 8 ++++---- vcl/source/gdi/metric.cxx | 4 ++-- vcl/win/source/gdi/salgdi3.cxx | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/vcl/inc/vcl/impfont.hxx b/vcl/inc/vcl/impfont.hxx index a1104bbf4a86..e38e1dea78d4 100644 --- a/vcl/inc/vcl/impfont.hxx +++ b/vcl/inc/vcl/impfont.hxx @@ -196,8 +196,8 @@ public: int GetIndexFromChar( sal_uInt32 ) const; sal_uInt32 GetCharFromIndex( int ) const; - void AddReference(); - void DeReference(); + void AddReference() const; + void DeReference() const; int GetGlyphIndex( sal_uInt32 ) const; @@ -213,8 +213,8 @@ private: const int* mpStartGlyphs; // range-specific mapper to glyphs const USHORT* mpGlyphIds; // individual glyphid mappings int mnRangeCount; - int mnCharCount; - int mnRefCount; + int mnCharCount; // covered codepoints + mutable int mnRefCount; }; // CmapResult is a normalized version of the many CMAP formats diff --git a/vcl/source/gdi/metric.cxx b/vcl/source/gdi/metric.cxx index 2c90b2dda915..cd9d3f5bb7e7 100644 --- a/vcl/source/gdi/metric.cxx +++ b/vcl/source/gdi/metric.cxx @@ -327,14 +327,14 @@ ImplFontCharMap* ImplFontCharMap::GetDefaultMap( bool bSymbols) // ----------------------------------------------------------------------- -void ImplFontCharMap::AddReference() +void ImplFontCharMap::AddReference( void ) const { ++mnRefCount; } // ----------------------------------------------------------------------- -void ImplFontCharMap::DeReference() +void ImplFontCharMap::DeReference( void ) const { if( --mnRefCount <= 0 ) if( (this != pDefaultUnicodeImplFontCharMap) && (this != pDefaultSymbolImplFontCharMap) ) diff --git a/vcl/win/source/gdi/salgdi3.cxx b/vcl/win/source/gdi/salgdi3.cxx index 484771f37fee..1915b8643d96 100644 --- a/vcl/win/source/gdi/salgdi3.cxx +++ b/vcl/win/source/gdi/salgdi3.cxx @@ -2907,7 +2907,7 @@ BOOL WinSalGraphics::CreateFontSubset( const rtl::OUString& rToFile, if( aRawCffData.get() ) { pWinFontData->UpdateFromHDC( mhDC ); -/*const*/ImplFontCharMap* pCharMap = pWinFontData->GetImplFontCharMap(); + const ImplFontCharMap* pCharMap = pWinFontData->GetImplFontCharMap(); long nRealGlyphIds[ 256 ]; for( int i = 0; i < nGlyphCount; ++i ) @@ -3172,7 +3172,7 @@ void WinSalGraphics::GetGlyphWidths( const ImplFontData* pFont, rUnicodeEnc.clear(); } const ImplWinFontData* pWinFont = static_cast(pFont); - ImplFontCharMap* pMap = pWinFont->GetImplFontCharMap(); + const ImplFontCharMap* pMap = pWinFont->GetImplFontCharMap(); DBG_ASSERT( pMap && pMap->GetCharCount(), "no map" ); int nCharCount = pMap->GetCharCount(); -- cgit v1.2.3 From 30ff826ddc974f37c72d2d74b3934ed691a7ef7e Mon Sep 17 00:00:00 2001 From: "Thomas Lange [tl]" Date: Tue, 17 Aug 2010 16:46:36 +0200 Subject: cws sw33bf08: #i113584#, #i113587# transliteration fixed --- .../source/transliteration/transliterationImpl.cxx | 1 - .../transliteration/transliteration_body.cxx | 273 +++++++++------------ 2 files changed, 116 insertions(+), 158 deletions(-) diff --git a/i18npool/source/transliteration/transliterationImpl.cxx b/i18npool/source/transliteration/transliterationImpl.cxx index dfadecfd5eb7..2109c310b233 100644 --- a/i18npool/source/transliteration/transliterationImpl.cxx +++ b/i18npool/source/transliteration/transliterationImpl.cxx @@ -295,7 +295,6 @@ OUString SAL_CALL TransliterationImpl::transliterate( const OUString& inStr, sal_Int32 startPos, sal_Int32 nCount, Sequence< sal_Int32 >& offset ) throw(RuntimeException) { - if (numCascade == 0) return inStr; diff --git a/i18npool/source/transliteration/transliteration_body.cxx b/i18npool/source/transliteration/transliteration_body.cxx index b58347826470..43222b7a41eb 100755 --- a/i18npool/source/transliteration/transliteration_body.cxx +++ b/i18npool/source/transliteration/transliteration_body.cxx @@ -35,6 +35,7 @@ #include #include +#include #include "characterclassificationImpl.hxx" #include "breakiteratorImpl.hxx" @@ -96,7 +97,7 @@ static sal_uInt8 lcl_getMappingTypeForToggleCase( sal_uInt8 nMappingType, sal_Un nRes = MappingTypeLowerToUpper; else { - OSL_ENSURE( nType & 0x01 /* upper case */, "uppercase character expected! 'Toggle case' failed?" ); + // should also work properly for non-upper characters like white spacs, numbers, ... nRes = MappingTypeUpperToLower; } } @@ -330,185 +331,143 @@ Transliteration_titlecase::Transliteration_titlecase() implementationName = "com.sun.star.i18n.Transliteration.Transliteration_titlecase"; } -rtl::OUString SAL_CALL Transliteration_titlecase::transliterate( - const OUString& inStr, sal_Int32 startPos, sal_Int32 nCount, - Sequence< sal_Int32 >& /*offset*/ ) - throw(RuntimeException) +#if 0 +struct LigatureData { - Reference< XMultiServiceFactory > xMSF = ::comphelper::getProcessServiceFactory(); - CharacterClassificationImpl aCharClassImpl( xMSF ); - - // possible problem: the locale is not exactly specific for each word in the text... - OUString aRes( aCharClassImpl.toTitle( inStr, startPos, nCount, aLocale ) ); - return aRes; + sal_uInt32 cChar; + sal_Char * pUtf8Text; +}; + +// available Unicode ligatures: +// http://www.unicode.org/charts +// http://www.unicode.org/charts/PDF/UFB00.pdf +static LigatureData aLigatures[] = +{ + { 0x0FB00, "ff" }, + { 0x0FB01, "fi" }, + { 0x0FB02, "fl" }, + { 0x0FB03, "ffi" }, + { 0x0FB04, "ffl" }, + { 0x0FB05, "ft" }, + { 0x0FB06, "st" }, + + { 0x0FB13, "\xD5\xB4\xD5\xB6" }, // Armenian small men now + { 0x0FB14, "\xD5\xB4\xD5\xA5" }, // Armenian small men ech + { 0x0FB15, "\xD5\xB4\xD5\xAB" }, // Armenian small men ini + { 0x0FB16, "\xD5\xBE\xD5\xB6" }, // Armenian small vew now + { 0x0FB17, "\xD5\xB4\xD5\xAD" }, // Armenian small men xeh + { 0x00000, "" } +}; + +static inline bool lcl_IsLigature( sal_uInt32 cChar ) +{ + return (0x0FB00 <= cChar && cChar <= 0x0FB06) || (0x0FB13 <= cChar && cChar <= 0x0FB17); } -Transliteration_sentencecase::Transliteration_sentencecase() +static rtl::OUString lcl_ResolveLigature( sal_uInt32 cChar ) { - nMappingType = MappingTypeToTitle; // though only to be applied to the first word... - transliterationName = "sentence(generic)"; - implementationName = "com.sun.star.i18n.Transliteration.Transliteration_sentencecase"; + rtl::OUString aRes; + if (lcl_IsLigature( cChar )) + { + LigatureData *pFound = NULL; + LigatureData *pData = aLigatures; + while (!pFound && pData->cChar != 0) + { + if (pData->cChar == cChar) + pFound = pData; + ++pData; + } + if (pFound) + aRes = rtl::OUString( pFound->pUtf8Text, strlen( pFound->pUtf8Text ), RTL_TEXTENCODING_UTF8 ); + } + else + aRes = rtl::OUString( &cChar, 1 ); + return aRes; } +#endif // if 0 -rtl::OUString SAL_CALL Transliteration_sentencecase::transliterate( +static rtl::OUString transliterate_titlecase_Impl( const OUString& inStr, sal_Int32 startPos, sal_Int32 nCount, + const Locale &rLocale, Sequence< sal_Int32 >& offset ) throw(RuntimeException) { - // inspired from Transliteration_body::transliterate - sal_Int32 nOffCount = 0, i; - bool bPoint = true; - if (useOffset) - { - for( i = 0; i < nCount; ++i ) { - sal_Unicode c = inStr.getStr()[ i + startPos ]; - if( sal_Unicode('.') == c || sal_Unicode('!') == c || sal_Unicode('?') == c ) { - bPoint = true; - nOffCount++; - } - else if( unicode::isAlpha( c ) || unicode::isDigit( c ) ) - { - const Mapping* map = 0; - if( bPoint && unicode::isLower( c )) - { - map = &casefolding::getValue(&c, 0, 1, aLocale, MappingTypeLowerToUpper); - bPoint = false; - } - else if (!bPoint && unicode::isUpper( c )) - { - map = &casefolding::getValue(&c, 0, 1, aLocale, MappingTypeUpperToLower); - } - - if(map == 0) - { - nOffCount++; - } - else - { - nOffCount += map->nmap; - } - } - else - { - nOffCount++; - } - } - } - - bPoint = true; - rtl::OUStringBuffer result; + const OUString aText( inStr.copy( startPos, nCount ) ); - if (useOffset) + OUString aRes; + if (aText.getLength() > 0) { - result.ensureCapacity(nOffCount); - if ( nOffCount != offset.getLength() ) - offset.realloc( nOffCount ); - } - - - sal_Int32 j = 0; - sal_Int32 * pArr = offset.getArray(); - for( i = 0; i < nCount; ++i ) { - sal_Unicode c = inStr.getStr()[ i + startPos ]; - if( sal_Unicode('.') == c || sal_Unicode('!') == c || sal_Unicode('?') == c ) { - bPoint = true; - result.append(c); - pArr[j++] = i + startPos; - } - else if( unicode::isAlpha( c ) || unicode::isDigit( c ) ) - { - const Mapping* map = 0; - if( bPoint && unicode::isLower( c )) - { - map = &casefolding::getValue(&c, 0, 1, aLocale, MappingTypeLowerToUpper); - } - else if (!bPoint && unicode::isUpper( c )) - { - map = &casefolding::getValue(&c, 0, 1, aLocale, MappingTypeUpperToLower); - } - - if(map == 0) - { - result.append( c ); - pArr[j++] = i + startPos; - } - else - { - for (sal_Int32 k = 0; k < map->nmap; k++) - { - result.append( map->map[k] ); - pArr[j++] = i + startPos; - } - } - bPoint = false; - } - else + Reference< XMultiServiceFactory > xMSF = ::comphelper::getProcessServiceFactory(); + CharacterClassificationImpl aCharClassImpl( xMSF ); + + // because aCharClassImpl.toTitle does not handle ligatures or ß but will raise + // an exception we need to handle the first chara manually... + + // we don't want to change surrogates by accident, thuse we use proper code point iteration + sal_Int32 nPos = 0; + sal_uInt32 cFirstChar = aText.iterateCodePoints( &nPos ); + OUString aResolvedLigature( &cFirstChar, 1 ); //lcl_ResolveLigature( cFirstChar ) ); + // toUpper can be used to properly resolve ligatures and characters like ß + aResolvedLigature = aCharClassImpl.toUpper( aResolvedLigature, 0, aResolvedLigature.getLength(), rLocale ); + // since toTitle will leave all-uppercase text unchanged we first need to + // use toLower to bring possible 2nd and following charas in lowercase + aResolvedLigature = aCharClassImpl.toLower( aResolvedLigature, 0, aResolvedLigature.getLength(), rLocale ); + sal_Int32 nResolvedLen = aResolvedLigature.getLength(); + + // now we can properly use toTitle to get the expected result for the resolved string. + // The rest of the text should just become lowercase. + aRes = aCharClassImpl.toTitle( aResolvedLigature, 0, nResolvedLen, rLocale ); + aRes += aCharClassImpl.toLower( aText, 1, aText.getLength() - 1, rLocale ); + offset.realloc( aRes.getLength() ); + + sal_Int32 *pOffset = offset.getArray(); + sal_Int32 nLen = offset.getLength(); + for (sal_Int32 i = 0; i < nLen; ++i) { - result.append( c ); - pArr[j++] = i + startPos; + sal_Int32 nIdx = 0; + if (i >= nResolvedLen) + nIdx = i - nResolvedLen + 1; + pOffset[i] = nIdx; } } - return result.makeStringAndClear(); +#if OSL_DEBUG_LEVEL > 1 + const sal_Int32 *pCOffset = offset.getConstArray(); + (void) pCOffset; +#endif + + return aRes; } -#if 0 -// TL: alternative implemntation try. But breakiterator has its problem too since -// beginOfSentence does not work as expected with '.'. See comment below. -// For the time being I will leave this code here as a from-scratch sample if the -// breakiterator works better at some point... -rtl::OUString SAL_CALL Transliteration_sentencecase::transliterate( - const OUString& inStr, sal_Int32 nStartPos, sal_Int32 nCount, - Sequence< sal_Int32 >& /*offset*/ ) + +// this function expects to be called on a word-by-word basis, +// namely that startPos points to the first char of the word +rtl::OUString SAL_CALL Transliteration_titlecase::transliterate( + const OUString& inStr, sal_Int32 startPos, sal_Int32 nCount, + Sequence< sal_Int32 >& offset ) throw(RuntimeException) { - OUString aRes( inStr.copy( nStartPos, nCount ) ); + return transliterate_titlecase_Impl( inStr, startPos, nCount, aLocale, offset ); +} - if (nStartPos >= 0 && nStartPos < inStr.getLength() && nCount > 0) - { - Reference< XMultiServiceFactory > xMSF = ::comphelper::getProcessServiceFactory(); - BreakIteratorImpl brk( xMSF ); - sal_Int32 nSentenceStart = -1, nOldSentenceStart = -1; - sal_Int32 nPos = nStartPos + nCount - 1; - while (nPos >= nStartPos && nPos != -1) - { - // possible problem: the locale is not exactly specific for each sentence in the text, - // but it is the only one we have... - nOldSentenceStart = nSentenceStart; - nSentenceStart = brk.beginOfSentence( inStr, nPos, aLocale ); - - // since the breakiterator completely ignores '.' characvters as end-of-sentence when - // the next word is lower case we need to take care of that ourself. The drawback: - // la mid-sentence abbreviation like e.g. will now be identified as end-of-sentence. :-( - // Well, at least the other product does it in the same way... - sal_Int32 nFullStopPos = inStr.lastIndexOf( (sal_Unicode)'.', nPos ); - nPos = nSentenceStart; - if (nFullStopPos > 0 && nFullStopPos > nSentenceStart) - { - Boundary aBd2 = brk.nextWord( inStr, nFullStopPos, aLocale, WordType::DICTIONARY_WORD ); - nSentenceStart = aBd2.startPos; - nPos = nFullStopPos; - } +Transliteration_sentencecase::Transliteration_sentencecase() +{ + nMappingType = MappingTypeToTitle; // though only to be applied to the first word... + transliterationName = "sentence(generic)"; + implementationName = "com.sun.star.i18n.Transliteration.Transliteration_sentencecase"; +} - if (nSentenceStart < nOldSentenceStart || nOldSentenceStart == -1) - { - // the sentence start might be a quotation mark or some kind of bracket, thus - // we need the first dictionary word starting or following this position - // Boundary aBd1 = brk.nextWord( inStr, nSentenceStart, aLocale, WordType::DICTIONARY_WORD ); - Boundary aBd2 = brk.getWordBoundary( inStr, nSentenceStart, aLocale, WordType::DICTIONARY_WORD, true ); - // OUString aWord1( inStr.copy( aBd1.startPos, aBd1.endPos - aBd1.startPos + 1 ) ); - OUString aWord2( inStr.copy( aBd2.startPos, aBd2.endPos - aBd2.startPos + 1 ) ); - } - else - break; // prevent endless loop - // continue with previous sentence - if (nPos != -1) - --nPos; - } - } - return aRes; +// this function expects to be called on a sentence-by-sentence basis, +// namely that startPos points to the first word (NOT first char!) in the sentence +rtl::OUString SAL_CALL Transliteration_sentencecase::transliterate( + const OUString& inStr, sal_Int32 startPos, sal_Int32 nCount, + Sequence< sal_Int32 >& offset ) + throw(RuntimeException) +{ + return transliterate_titlecase_Impl( inStr, startPos, nCount, aLocale, offset ); } -#endif + } } } } + -- cgit v1.2.3 From 7c84033b76922b3c843314354f8dc1bab364ed7d Mon Sep 17 00:00:00 2001 From: Christian Lippka Date: Wed, 18 Aug 2010 17:59:09 +0200 Subject: #i113857# disable right mouse button to trigger a range selection --- vcl/source/window/seleng.cxx | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/vcl/source/window/seleng.cxx b/vcl/source/window/seleng.cxx index d4ee01c26d61..322b2937b5c9 100644 --- a/vcl/source/window/seleng.cxx +++ b/vcl/source/window/seleng.cxx @@ -218,8 +218,15 @@ BOOL SelectionEngine::SelMouseButtonDown( const MouseEvent& rMEvt ) Point aPos = rMEvt.GetPosPixel(); aLastMove = rMEvt; - pWin->CaptureMouse(); - nFlags |= SELENG_IN_SEL; + if( !rMEvt.IsRight() ) + { + pWin->CaptureMouse(); + nFlags |= SELENG_IN_SEL; + } + else + { + nModifier = 0; + } switch ( nModifier ) { @@ -327,7 +334,7 @@ BOOL SelectionEngine::SelMouseButtonDown( const MouseEvent& rMEvt ) |* *************************************************************************/ -BOOL SelectionEngine::SelMouseButtonUp( const MouseEvent& /* rMEvt */ ) +BOOL SelectionEngine::SelMouseButtonUp( const MouseEvent& rMEvt ) { aWTimer.Stop(); //DbgOut("Up"); @@ -336,7 +343,11 @@ BOOL SelectionEngine::SelMouseButtonUp( const MouseEvent& /* rMEvt */ ) nFlags &= ~(SELENG_CMDEVT | SELENG_WAIT_UPEVT | SELENG_IN_SEL); return FALSE; } - pWin->ReleaseMouse(); + + if( !rMEvt.IsRight() ) + { + pWin->ReleaseMouse(); + } if( (nFlags & SELENG_WAIT_UPEVT) && !(nFlags & SELENG_CMDEVT) && eSelMode != SINGLE_SELECTION) -- cgit v1.2.3 From a37ba38fa326b3541fe20287d98a8d4fc672cb5e Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Thu, 19 Aug 2010 17:46:08 +0200 Subject: fs33a: #i113988# properly retrieve standard images --- svtools/source/graphic/provider.cxx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/svtools/source/graphic/provider.cxx b/svtools/source/graphic/provider.cxx index fbf95406a63a..f1674dcd7d4a 100644 --- a/svtools/source/graphic/provider.cxx +++ b/svtools/source/graphic/provider.cxx @@ -231,19 +231,19 @@ uno::Reference< ::graphic::XGraphic > GraphicProvider::implLoadStandardImage( co if( ( 0 == rResourceURL.getToken( 0, '/', nIndex ).compareToAscii( "private:standardimage" ) ) ) { rtl::OUString sImageName( rResourceURL.copy( nIndex ) ); - if ( sImageName.compareToAscii( "info" ) ) + if ( sImageName.equalsAscii( "info" ) ) { xRet = InfoBox::GetStandardImage().GetXGraphic(); } - else if ( sImageName.compareToAscii( "warning" ) ) + else if ( sImageName.equalsAscii( "warning" ) ) { xRet = WarningBox::GetStandardImage().GetXGraphic(); } - else if ( sImageName.compareToAscii( "error" ) ) + else if ( sImageName.equalsAscii( "error" ) ) { xRet = ErrorBox::GetStandardImage().GetXGraphic(); } - else if ( sImageName.compareToAscii( "query" ) ) + else if ( sImageName.equalsAscii( "query" ) ) { xRet = QueryBox::GetStandardImage().GetXGraphic(); } -- cgit v1.2.3 From c86fd8453e7fc925cb8f0f8ffff7990896da71ec Mon Sep 17 00:00:00 2001 From: sj Date: Thu, 19 Aug 2010 18:12:04 +0200 Subject: impress186: #i4499# added default resolution unit (metric/non-metric) depending to the tools/options setting --- svtools/source/filter.vcl/filter/exportdialog.cxx | 42 +++++++++++++++++++++-- svtools/source/filter.vcl/filter/exportdialog.hxx | 4 +++ 2 files changed, 43 insertions(+), 3 deletions(-) diff --git a/svtools/source/filter.vcl/filter/exportdialog.cxx b/svtools/source/filter.vcl/filter/exportdialog.cxx index 1e2c669afa33..36ce7b63c87d 100755 --- a/svtools/source/filter.vcl/filter/exportdialog.cxx +++ b/svtools/source/filter.vcl/filter/exportdialog.cxx @@ -76,6 +76,7 @@ #define FORMAT_SVG 16 #define FORMAT_SVM 17 +#define UNIT_DEFAULT -1 #define UNIT_INCH 0 #define UNIT_CM 1 #define UNIT_MM 2 @@ -140,6 +141,33 @@ static MapUnit GetMapUnit( sal_Int32 nUnit ) return aMapUnit; } +sal_Int32 ExportDialog::GetDefaultUnit() +{ + sal_Int32 nDefaultUnit = UNIT_CM; + switch( mrFltCallPara.eFieldUnit ) + { +// case FUNIT_NONE : +// case FUNIT_PERCENT : +// case FUNIT_CUSTOM : + default: nDefaultUnit = UNIT_CM; break; + + case FUNIT_MILE : // PASSTHROUGH INTENDED + case FUNIT_FOOT : + case FUNIT_TWIP : + case FUNIT_PICA : nDefaultUnit = UNIT_INCH; break; + + case FUNIT_KM : // PASSTHROUGH INTENDED + case FUNIT_M : + case FUNIT_100TH_MM : nDefaultUnit = UNIT_CM; break; + + case FUNIT_INCH : nDefaultUnit = UNIT_INCH; break; + case FUNIT_CM : nDefaultUnit = UNIT_CM; break; + case FUNIT_MM : nDefaultUnit = UNIT_MM; break; + case FUNIT_POINT : nDefaultUnit = UNIT_POINT; break; + } + return nDefaultUnit; +} + static basegfx::B2DRange GetShapeRangeForXShape( const uno::Reference< drawing::XShape >& rxShape, const uno::Reference< graphic::XPrimitiveFactory2D >& rxPrimitiveFactory2D, const uno::Sequence< beans::PropertyValue >& rViewInformation ) { @@ -166,6 +194,9 @@ uno::Sequence< beans::PropertyValue > ExportDialog::GetFilterData( sal_Bool bUpd if ( nUnit < 0 ) nUnit = UNIT_CM; + if ( ( mnInitialResolutionUnit == UNIT_DEFAULT ) && ( nUnit == GetDefaultUnit() ) ) + nUnit = UNIT_DEFAULT; + // updating ui configuration if ( mbIsPixelFormat ) { @@ -627,6 +658,10 @@ ExportDialog::ExportDialog( FltCallDialogParameter& rPara, aFilterConfigPath.Append( maExt ); mpFilterOptionsItem = new FilterConfigItem( aFilterConfigPath, &rPara.aFilterData ); + mnInitialResolutionUnit = mbIsPixelFormat + ? mpOptionsItem->ReadInt32( String( RTL_CONSTASCII_USTRINGPARAM( "PixelExportUnit" ) ), UNIT_DEFAULT ) + : mpOptionsItem->ReadInt32( String( RTL_CONSTASCII_USTRINGPARAM( "VectorExportUnit" ) ), UNIT_DEFAULT ); + mnMaxFilesizeForRealtimePreview = mpOptionsItem->ReadInt32( String( RTL_CONSTASCII_USTRINGPARAM( "MaxFilesizeForRealtimePreview" ) ), 0 ); maFtEstimatedSize.SetText( String( RTL_CONSTASCII_USTRINGPARAM( " \n " ) ) ); @@ -745,9 +780,10 @@ void ExportDialog::createSizeControls( vcl::RowOrColumn& rLayout ) xColumn->setMinimumSize( nIndex, aLbMax ); } - sal_Int32 nUnit = mbIsPixelFormat - ? mpOptionsItem->ReadInt32( String( RTL_CONSTASCII_USTRINGPARAM( "PixelExportUnit" ) ), UNIT_PIXEL ) - : mpOptionsItem->ReadInt32( String( RTL_CONSTASCII_USTRINGPARAM( "VectorExportUnit" ) ), UNIT_CM ); + sal_Int32 nUnit = mnInitialResolutionUnit; + if ( nUnit == UNIT_DEFAULT ) + nUnit = GetDefaultUnit(); + if ( !mbIsPixelFormat ) { maLbSizeX.RemoveEntry( UNIT_PIXEL ); // removing pixel diff --git a/svtools/source/filter.vcl/filter/exportdialog.hxx b/svtools/source/filter.vcl/filter/exportdialog.hxx index a9692e646746..20a9ac3ea832 100755 --- a/svtools/source/filter.vcl/filter/exportdialog.hxx +++ b/svtools/source/filter.vcl/filter/exportdialog.hxx @@ -156,6 +156,8 @@ private: sal_Bool mbExportSelection; sal_Bool mbPreserveAspectRatio; + sal_Int32 mnInitialResolutionUnit; + // for pixel graphics it always contains the pixel count com::sun::star::awt::Size maResolution; // it always contains the number of pixels per meter @@ -198,6 +200,8 @@ private: com::sun::star::awt::Size GetOriginalSize(); + sal_Int32 GetDefaultUnit(); + public: ExportDialog( FltCallDialogParameter& rPara, const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory > rxMgr, -- cgit v1.2.3 From 3417318f27cdc15af6bdcb3ea5b7c6bb554352ab Mon Sep 17 00:00:00 2001 From: Release Engineering Date: Fri, 20 Aug 2010 13:12:52 +0200 Subject: #i10000# supress bytecode generation --- l10ntools/scripts/xtxex | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/l10ntools/scripts/xtxex b/l10ntools/scripts/xtxex index 28529506e3a2..52baab0693d0 100755 --- a/l10ntools/scripts/xtxex +++ b/l10ntools/scripts/xtxex @@ -32,8 +32,8 @@ exit 1 fi if [ x${SOLARVER}x = xx -o x${UPDMINOREXT}x = xx ]; then - exec python $SOLARVERSION/$INPATH/bin/xtxex.py "$@" + exec python -B $SOLARVERSION/$INPATH/bin/xtxex.py "$@" else - exec python $SOLARVERSION/$INPATH/bin$UPDMINOREXT/xtxex.py "$@" + exec python -B $SOLARVERSION/$INPATH/bin$UPDMINOREXT/xtxex.py "$@" fi -- cgit v1.2.3 From fffe7fed17cdbba6d3be3ee35b21a1456dc83159 Mon Sep 17 00:00:00 2001 From: Release Engineering Date: Fri, 20 Aug 2010 13:13:16 +0200 Subject: #i10000# supress bytecode generation --- l10ntools/scripts/xhtex | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/l10ntools/scripts/xhtex b/l10ntools/scripts/xhtex index 659cd06e16d4..ad18d8c94eab 100755 --- a/l10ntools/scripts/xhtex +++ b/l10ntools/scripts/xhtex @@ -32,8 +32,8 @@ exit 1 fi if [ x${SOLARVER}x = xx -o x${UPDMINOREXT}x = xx ]; then - exec python $SOLARVERSION/$INPATH/bin/xhtex.py "$@" + exec python -B $SOLARVERSION/$INPATH/bin/xhtex.py "$@" else - exec python $SOLARVERSION/$INPATH/bin$UPDMINOREXT/xhtex.py "$@" + exec python -B $SOLARVERSION/$INPATH/bin$UPDMINOREXT/xhtex.py "$@" fi -- cgit v1.2.3 From 46bd96bc7c2f8fac93546f8aa905023a9a59f8ca Mon Sep 17 00:00:00 2001 From: Ivo Hinkelmann Date: Fri, 20 Aug 2010 16:30:57 +0200 Subject: ext004: just copy en-US file without modifications --- l10ntools/scripts/tool/xtxex.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/l10ntools/scripts/tool/xtxex.py b/l10ntools/scripts/tool/xtxex.py index 2c5f132530a6..96912754b7df 100644 --- a/l10ntools/scripts/tool/xtxex.py +++ b/l10ntools/scripts/tool/xtxex.py @@ -39,7 +39,8 @@ class Xtxex(AbstractL10nTool): def merge_file(self, inputfilename, outputfilename, parsed_file_ref, lang, is_forced_lang, sdfdata): # Special handling for en-US files if lang == "en-US": - mod_outputfilename = outputfilename.replace("_en-US",'') + mod_outputfilename = outputfilename + # mod here if needed self.copy_file(inputfilename, mod_outputfilename) return # merge usual lang -- cgit v1.2.3 From fe18bcac5f611b1bb0f3cf69abb2357a48d19106 Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Fri, 20 Aug 2010 19:47:14 +0200 Subject: ooo33gsl07: #i113898# catch a NULL ptr --- vcl/unx/gtk/a11y/atkutil.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vcl/unx/gtk/a11y/atkutil.cxx b/vcl/unx/gtk/a11y/atkutil.cxx index 13492f3d4a5c..51297109ca43 100644 --- a/vcl/unx/gtk/a11y/atkutil.cxx +++ b/vcl/unx/gtk/a11y/atkutil.cxx @@ -92,7 +92,7 @@ atk_wrapper_focus_idle_handler (gpointer data) // also emit state-changed:focused event under the same condition. { AtkObjectWrapper* wrapper_obj = ATK_OBJECT_WRAPPER (atk_obj); - if( !wrapper_obj->mpText && wrapper_obj->mpContext ) + if( wrapper_obj && !wrapper_obj->mpText && wrapper_obj->mpContext ) { uno::Any any = wrapper_obj->mpContext->queryInterface( accessibility::XAccessibleText::static_type(NULL) ); if ( typelib_TypeClass_INTERFACE == any.pType->eTypeClass && -- cgit v1.2.3 From e70c9b5e20258f3e19ce2c364f8050d019a582d1 Mon Sep 17 00:00:00 2001 From: Joachim Lingner Date: Mon, 23 Aug 2010 12:49:12 +0200 Subject: jl158 #i114008# helplinker -extlangsrc -extlangdest implemented. This allows processing of the extension help files by using the helplinker executable. --- l10ntools/source/help/HelpLinker.cxx | 117 ++++++++++++++++++++++++++++------- 1 file changed, 95 insertions(+), 22 deletions(-) diff --git a/l10ntools/source/help/HelpLinker.cxx b/l10ntools/source/help/HelpLinker.cxx index 94139f89de1e..411859bfe994 100644 --- a/l10ntools/source/help/HelpLinker.cxx +++ b/l10ntools/source/help/HelpLinker.cxx @@ -269,6 +269,8 @@ private: fs::path idxContentStylesheet; fs::path zipdir; fs::path outputFile; + std::string extsource; + std::string extdestination; std::string module; std::string lang; std::string hid; @@ -762,18 +764,9 @@ void HelpLinker::main( std::vector &args, const rtl::OUString* pOfficeHelpPath ) throw( HelpProcessingException ) { - rtl::OUString aOfficeHelpPath; - bExtensionMode = false; - if( pExtensionPath && pExtensionPath->length() > 0 && pOfficeHelpPath ) - { - helpFiles.clear(); - bExtensionMode = true; - extensionPath = *pExtensionPath; - sourceRoot = fs::path(extensionPath); - extensionDestination = *pDestination; - aOfficeHelpPath = *pOfficeHelpPath; - } + helpFiles.clear(); + if (args.size() > 0 && args[0][0] == '@') { std::vector stringList; @@ -793,10 +786,34 @@ void HelpLinker::main( std::vector &args, } size_t i = 0; - + bool bSrcOption = false; while (i < args.size()) { - if (args[i].compare("-src") == 0) + if (args[i].compare("-extlangsrc") == 0) + { + ++i; + if (i >= args.size()) + { + std::stringstream aStrStream; + aStrStream << "extension source missing" << std::endl; + throw HelpProcessingException( HELPPROCESSING_GENERAL_ERROR, aStrStream.str() ); + } + extsource = args[i]; + } + else if (args[i].compare("-extlangdest") == 0) + { + //If this argument is not provided then the location provided in -extsource will + //also be the destination + ++i; + if (i >= args.size()) + { + std::stringstream aStrStream; + aStrStream << "extension destination missing" << std::endl; + throw HelpProcessingException( HELPPROCESSING_GENERAL_ERROR, aStrStream.str() ); + } + extdestination = args[i]; + } + else if (args[i].compare("-src") == 0) { ++i; if (i >= args.size()) @@ -805,9 +822,8 @@ void HelpLinker::main( std::vector &args, aStrStream << "sourceroot missing" << std::endl; throw HelpProcessingException( HELPPROCESSING_GENERAL_ERROR, aStrStream.str() ); } - - if( !bExtensionMode ) - sourceRoot = fs::path(args[i], fs::native); + bSrcOption = true; + sourceRoot = fs::path(args[i], fs::native); } else if (args[i].compare("-sty") == 0) { @@ -933,21 +949,70 @@ void HelpLinker::main( std::vector &args, ++i; } + //We can be called from the helplinker executable or the extension manager + //In the latter case extsource is not used. + if( (pExtensionPath && pExtensionPath->length() > 0 && pOfficeHelpPath) + || !extsource.empty()) + { + bExtensionMode = true; + if (!extsource.empty()) + { + //called from helplinker.exe, pExtensionPath and pOfficeHelpPath + //should be NULL + sourceRoot = fs::path(extsource, fs::native); + extensionPath = sourceRoot.toUTF8(); + + if (extdestination.empty()) + { + std::stringstream aStrStream; + aStrStream << "-extlangdest is missing" << std::endl; + throw HelpProcessingException( HELPPROCESSING_GENERAL_ERROR, aStrStream.str() ); + } + else + { + //Convert from system path to file URL!!! + fs::path p(extdestination, fs::native); + extensionDestination = p.toUTF8(); + } + } + else + { //called from extension manager + extensionPath = *pExtensionPath; + sourceRoot = fs::path(extensionPath); + extensionDestination = *pDestination; + } + //check if -src option was used. This option must not be used + //when extension help is compiled. + if (bSrcOption) + { + std::stringstream aStrStream; + aStrStream << "-src must not be used together with -extsource missing" << std::endl; + throw HelpProcessingException( HELPPROCESSING_GENERAL_ERROR, aStrStream.str() ); + } + } + if (!bExtensionMode && zipdir.empty()) { std::stringstream aStrStream; aStrStream << "no index dir given" << std::endl; throw HelpProcessingException( HELPPROCESSING_GENERAL_ERROR, aStrStream.str() ); } - if (!bExtensionMode && idxCaptionStylesheet.empty()) + + if (!bExtensionMode && idxCaptionStylesheet.empty() + || !extsource.empty() && idxCaptionStylesheet.empty()) { + //No extension mode and extension mode using commandline + //!extsource.empty indicates extension mode using commandline + // -idxcaption paramter is required std::stringstream aStrStream; aStrStream << "no index caption stylesheet given" << std::endl; throw HelpProcessingException( HELPPROCESSING_GENERAL_ERROR, aStrStream.str() ); } - else if ( bExtensionMode ) + else if ( bExtensionMode && extsource.empty()) { - rtl::OUString aIdxCaptionPathFileURL( aOfficeHelpPath ); + //This part is used when compileExtensionHelp is called from the extensions manager. + //If extension help is compiled using helplinker in the build process + rtl::OUString aIdxCaptionPathFileURL( *pOfficeHelpPath ); aIdxCaptionPathFileURL += rtl::OUString::createFromAscii( "/idxcaption.xsl" ); rtl::OString aOStr_IdxCaptionPathFileURL( rtl::OUStringToOString @@ -956,15 +1021,23 @@ void HelpLinker::main( std::vector &args, idxCaptionStylesheet = fs::path( aStdStr_IdxCaptionPathFileURL ); } - if (!bExtensionMode && idxContentStylesheet.empty()) + + if (!bExtensionMode && idxContentStylesheet.empty() + || !extsource.empty() && idxContentStylesheet.empty()) { + //No extension mode and extension mode using commandline + //!extsource.empty indicates extension mode using commandline + // -idxcontent paramter is required std::stringstream aStrStream; aStrStream << "no index content stylesheet given" << std::endl; throw HelpProcessingException( HELPPROCESSING_GENERAL_ERROR, aStrStream.str() ); } - else if ( bExtensionMode ) + else if ( bExtensionMode && extsource.empty()) { - rtl::OUString aIdxContentPathFileURL( aOfficeHelpPath ); + //If extension help is compiled using helplinker in the build process + //then -idxcontent must be supplied + //This part is used when compileExtensionHelp is called from the extensions manager. + rtl::OUString aIdxContentPathFileURL( *pOfficeHelpPath ); aIdxContentPathFileURL += rtl::OUString::createFromAscii( "/idxcontent.xsl" ); rtl::OString aOStr_IdxContentPathFileURL( rtl::OUStringToOString -- cgit v1.2.3 From 49c3b9399521b7dd16ccba87d3bdfed1418a842b Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Mon, 23 Aug 2010 14:38:35 +0200 Subject: ooo33gsl07: #i110881# workaround compiz (mwm hints should have no effect whatsoever on fullscreen) --- vcl/unx/source/app/wmadaptor.cxx | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/vcl/unx/source/app/wmadaptor.cxx b/vcl/unx/source/app/wmadaptor.cxx index 1a116fcbe8d6..aa2e4c84ef24 100644 --- a/vcl/unx/source/app/wmadaptor.cxx +++ b/vcl/unx/source/app/wmadaptor.cxx @@ -2180,6 +2180,15 @@ void NetWMAdaptor::showFullScreen( X11SalFrame* pFrame, bool bFullScreen ) const if( m_aWMAtoms[ NET_WM_STATE_FULLSCREEN ] ) { pFrame->mbFullScreen = bFullScreen; + if( bFullScreen ) + { + if( m_aWMAtoms[ MOTIF_WM_HINTS ] ) + { + XDeleteProperty( m_pDisplay, + pFrame->GetShellWindow(), + m_aWMAtoms[ MOTIF_WM_HINTS ] ); + } + } if( pFrame->bMapped_ ) { // window already mapped, send WM a message -- cgit v1.2.3 From 45e7a1e3f6b01c1fce6056f80e4642a452a42dfd Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Mon, 23 Aug 2010 15:18:37 +0200 Subject: fs33a: expose the WB_HIDESELECTION but of the tree control at its UNO API --- svtools/inc/svtools/svtreebx.hxx | 1 + svtools/source/contnr/svtreebx.cxx | 9 +++++++++ svtools/source/uno/treecontrolpeer.cxx | 18 ++++++++++++++++++ toolkit/source/controls/tree/treecontrol.cxx | 1 + 4 files changed, 29 insertions(+) diff --git a/svtools/inc/svtools/svtreebx.hxx b/svtools/inc/svtools/svtreebx.hxx index a600b91db1c4..787e0956888f 100644 --- a/svtools/inc/svtools/svtreebx.hxx +++ b/svtools/inc/svtools/svtreebx.hxx @@ -156,6 +156,7 @@ protected: virtual void CursorMoved( SvLBoxEntry* pNewCursor ); virtual void PreparePaint( SvLBoxEntry* ); virtual void DataChanged( const DataChangedEvent& rDCEvt ); + virtual void StateChanged( StateChangedType nStateChange ); void InitSettings(BOOL bFont,BOOL bForeground,BOOL bBackground); BOOL IsCellFocusEnabled() const; diff --git a/svtools/source/contnr/svtreebx.cxx b/svtools/source/contnr/svtreebx.cxx index b11a3f12ddf3..3b1430e0df77 100644 --- a/svtools/source/contnr/svtreebx.cxx +++ b/svtools/source/contnr/svtreebx.cxx @@ -2516,6 +2516,15 @@ void SvTreeListBox::DataChanged( const DataChangedEvent& rDCEvt ) Control::DataChanged( rDCEvt ); } +void SvTreeListBox::StateChanged( StateChangedType i_nStateChange ) +{ + SvLBox::StateChanged( i_nStateChange ); + if ( ( i_nStateChange & STATE_CHANGE_STYLE ) != 0 ) + { + SetWindowBits( GetStyle() ); + } +} + void SvTreeListBox::InitSettings(BOOL bFont,BOOL bForeground,BOOL bBackground) { const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings(); diff --git a/svtools/source/uno/treecontrolpeer.cxx b/svtools/source/uno/treecontrolpeer.cxx index 7fb1a007960f..5c1f4925783a 100644 --- a/svtools/source/uno/treecontrolpeer.cxx +++ b/svtools/source/uno/treecontrolpeer.cxx @@ -1322,6 +1322,21 @@ void TreeControlPeer::setProperty( const ::rtl::OUString& PropertyName, const An switch( GetPropertyId( PropertyName ) ) { + case BASEPROPERTY_HIDEINACTIVESELECTION: + { + sal_Bool bEnabled = sal_False; + if ( aValue >>= bEnabled ) + { + WinBits nStyle = rTree.GetStyle(); + if ( bEnabled ) + nStyle |= WB_HIDESELECTION; + else + nStyle &= ~WB_HIDESELECTION; + rTree.SetStyle( nStyle ); + } + } + break; + case BASEPROPERTY_TREE_SELECTIONTYPE: { SelectionType eSelectionType; @@ -1412,6 +1427,9 @@ Any TreeControlPeer::getProperty( const ::rtl::OUString& PropertyName ) throw(Ru UnoTreeListBoxImpl& rTree = getTreeListBoxOrThrow(); switch(nPropId) { + case BASEPROPERTY_HIDEINACTIVESELECTION: + return Any( ( rTree.GetStyle() & WB_HIDESELECTION ) != 0 ? sal_True : sal_False ); + case BASEPROPERTY_TREE_SELECTIONTYPE: { SelectionType eSelectionType; diff --git a/toolkit/source/controls/tree/treecontrol.cxx b/toolkit/source/controls/tree/treecontrol.cxx index 8606792fdf2f..d56ca82bb845 100644 --- a/toolkit/source/controls/tree/treecontrol.cxx +++ b/toolkit/source/controls/tree/treecontrol.cxx @@ -76,6 +76,7 @@ UnoTreeModel::UnoTreeModel() ImplRegisterProperty( BASEPROPERTY_TREE_SHOWSROOTHANDLES ); ImplRegisterProperty( BASEPROPERTY_TREE_ROWHEIGHT ); ImplRegisterProperty( BASEPROPERTY_TREE_INVOKESSTOPNODEEDITING ); + ImplRegisterProperty( BASEPROPERTY_HIDEINACTIVESELECTION ); } UnoTreeModel::UnoTreeModel( const UnoTreeModel& rModel ) -- cgit v1.2.3 From 4cc5448ed82f13bb107695b65f39589df1e46cb9 Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Mon, 23 Aug 2010 16:32:34 +0200 Subject: ooo33gsl07: #i113253# use paper bin from user setup when appropriate --- vcl/source/gdi/print3.cxx | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/vcl/source/gdi/print3.cxx b/vcl/source/gdi/print3.cxx index 375c570f1a16..51f33ed17f6c 100755 --- a/vcl/source/gdi/print3.cxx +++ b/vcl/source/gdi/print3.cxx @@ -173,6 +173,7 @@ public: // if set, pages are centered and trimmed onto the fixed page Size maFixedPageSize; sal_Int32 mnDefaultPaperBin; + sal_Int32 mnFixedPaperBin; ImplPrinterControllerData() : mbFirstPage( sal_True ), @@ -180,7 +181,8 @@ public: mbReversePageOrder( sal_False ), meJobState( view::PrintableState_JOB_STARTED ), mpProgress( NULL ), - mnDefaultPaperBin( -1 ) + mnDefaultPaperBin( -1 ), + mnFixedPaperBin( -1 ) {} ~ImplPrinterControllerData() { delete mpProgress; } @@ -726,6 +728,7 @@ void PrinterController::setPrinter( const boost::shared_ptr& i_rPrinter setValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Name" ) ), makeAny( rtl::OUString( i_rPrinter->GetName() ) ) ); mpImplData->mnDefaultPaperBin = mpImplData->mpPrinter->GetPaperBin(); + mpImplData->mnFixedPaperBin = -1; } bool PrinterController::setupPrinter( Window* i_pParent ) @@ -733,15 +736,20 @@ bool PrinterController::setupPrinter( Window* i_pParent ) bool bRet = false; if( mpImplData->mpPrinter.get() ) { + // get old data Size aPaperSize( mpImplData->mpPrinter->PixelToLogic( mpImplData->mpPrinter->GetPaperSizePixel(), MapMode( MAP_100TH_MM ) ) ); + USHORT nPaperBin = mpImplData->mpPrinter->GetPaperBin(); + + // call driver setup bRet = mpImplData->mpPrinter->Setup( i_pParent ); if( bRet ) { - // was the papersize overridden ? if so we need to take action + // was papersize or bin overridden ? if so we need to take action Size aNewPaperSize( mpImplData->mpPrinter->PixelToLogic( mpImplData->mpPrinter->GetPaperSizePixel(), MapMode( MAP_100TH_MM ) ) ); - if( aNewPaperSize != aPaperSize ) + USHORT nNewPaperBin = mpImplData->mpPrinter->GetPaperBin(); + if( aNewPaperSize != aPaperSize || nNewPaperBin != nPaperBin ) { mpImplData->maFixedPageSize = aNewPaperSize; mpImplData->maPageCache.invalidate(); @@ -750,6 +758,7 @@ bool PrinterController::setupPrinter( Window* i_pParent ) aOverrideSize.Height = aNewPaperSize.Height(); setValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "OverridePageSize" ) ), makeAny( aOverrideSize ) ); + mpImplData->mnFixedPaperBin = nNewPaperBin; } } } @@ -1147,8 +1156,13 @@ void PrinterController::printFilteredPage( int i_nPage ) mpImplData->mpPrinter->SetMapMode( MAP_100TH_MM ); // aPageSize was filtered through mpImplData->getRealPaperSize already by getFilteredPageFile() mpImplData->mpPrinter->SetPaperSizeUser( aPageSize.aSize, ! mpImplData->isFixedPageSize() ); + if( mpImplData->mnFixedPaperBin != -1 && + mpImplData->mpPrinter->GetPaperBin() != mpImplData->mnFixedPaperBin ) + { + mpImplData->mpPrinter->SetPaperBin( mpImplData->mnFixedPaperBin ); + } - // if full paper are is meant, move the output to accomodate for pageoffset + // if full paper is meant to be used, move the output to accomodate for pageoffset if( aPageSize.bFullPaper ) { Point aPageOffset( mpImplData->mpPrinter->GetPageOffset() ); -- cgit v1.2.3 From bd31d439a08f6677b481fbd37791d7d53c971a55 Mon Sep 17 00:00:00 2001 From: Joachim Lingner Date: Mon, 23 Aug 2010 16:44:43 +0200 Subject: jl158 #i114008# HelpIndexerTool -extension ... implemented. This allows processing of the extension help files by using the java class in the build environment --- l10ntools/source/help/HelpIndexerTool.java | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/l10ntools/source/help/HelpIndexerTool.java b/l10ntools/source/help/HelpIndexerTool.java index 2a49f964d48f..a39b5399e38d 100644 --- a/l10ntools/source/help/HelpIndexerTool.java +++ b/l10ntools/source/help/HelpIndexerTool.java @@ -72,6 +72,9 @@ public class HelpIndexerTool String aSegmentName = ""; // Scan arguments + //If this tool is invoked in the build process for extensions help, + //then -extension must be set. + boolean bExtension = false; boolean bLang = false; boolean bMod = false; boolean bZipDir = false; @@ -83,7 +86,11 @@ public class HelpIndexerTool int nArgCount = args.length; for( int i = 0 ; i < nArgCount ; i++ ) { - if( "-lang".equals(args[i]) ) + if( "-extension".equals(args[i]) ) + { + bExtension = true; + } + else if( "-lang".equals(args[i]) ) { if( i + 1 < nArgCount ) { @@ -142,20 +149,21 @@ public class HelpIndexerTool bSegmentName = true; } i++; - if (!(bCfsName && bSegmentName)) - { - System.out.println("Usage: HelpIndexer -checkcfsandsegname _0 _3 (2 arguments needed)"); - System.exit( -1 ); - } + if (!(bCfsName && bSegmentName)) + { + System.out.println("Usage: HelpIndexer -checkcfsandsegname _0 _3 (2 arguments needed)"); + System.exit( -1 ); + } } } - if( !bLang || !bMod || !bZipDir || (!bOutput && !bExtensionMode) ) + if( !bLang || !bMod || !bZipDir || (!bOutput && !bExtensionMode && !bExtension) ) { if( bExtensionMode ) return; System.out.println("Usage: HelpIndexer -lang ISOLangCode -mod HelpModule -zipdir TempZipDir -o OutputZipFile"); + System.out.println("Usage: HelpIndexer -extension -lang ISOLangCode -mod HelpModule -zipdir PathToLangDir"); System.exit( -1 ); } @@ -199,7 +207,7 @@ public class HelpIndexerTool System.out.println( "Checking segment file " + aSegmentName+ ": " + (bSegmentFileOk ? "Found" : "Not found") ); } - if( bExtensionMode ) + if( bExtensionMode || bExtension) { if( !bSrcDir ) { -- cgit v1.2.3 From b628a0a0158468eb04729e6ecd98008a7f814f1f Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Tue, 24 Aug 2010 14:49:48 +0200 Subject: ooo33gsl07: #i110881# fix fullscreen mode with compiz and metacity ... again --- vcl/unx/gtk/window/gtkframe.cxx | 64 +++++++++++++++++++++++++++--------- vcl/unx/inc/plugins/gtk/gtkframe.hxx | 4 +++ 2 files changed, 52 insertions(+), 16 deletions(-) diff --git a/vcl/unx/gtk/window/gtkframe.cxx b/vcl/unx/gtk/window/gtkframe.cxx index c6ff16f8395b..e8b55ebfa895 100644 --- a/vcl/unx/gtk/window/gtkframe.cxx +++ b/vcl/unx/gtk/window/gtkframe.cxx @@ -1452,12 +1452,6 @@ void GtkSalFrame::setMinMaxSize() aHints |= GDK_HINT_MAX_SIZE; } } - if( m_bFullscreen ) - { - aGeo.max_width = m_aMaxSize.Width(); - aGeo.max_height = m_aMaxSize.Height(); - aHints |= GDK_HINT_MAX_SIZE; - } if( aHints ) gtk_window_set_geometry_hints( GTK_WINDOW(m_pWindow), NULL, @@ -1832,7 +1826,11 @@ void GtkSalFrame::ShowFullScreen( BOOL bFullScreen, sal_Int32 nScreen ) // workaround different legacy version window managers have different opinions about // _NET_WM_STATE_FULLSCREEN (Metacity <-> KWin) if( ! getDisplay()->getWMAdaptor()->isLegacyPartialFullscreen() ) + { + if( !(m_nStyle & SAL_FRAME_STYLE_SIZEABLE) ) + gtk_window_set_resizable( GTK_WINDOW(m_pWindow), TRUE ); gtk_window_fullscreen( GTK_WINDOW( m_pWindow ) ); + } if( bVisible ) Show( TRUE ); } @@ -1863,11 +1861,8 @@ void GtkSalFrame::ShowFullScreen( BOOL bFullScreen, sal_Int32 nScreen ) { if( bFullScreen ) { - if( getDisplay()->getWMAdaptor()->isLegacyPartialFullscreen() ) - { - if( !(m_nStyle & SAL_FRAME_STYLE_SIZEABLE) ) - gtk_window_set_resizable( GTK_WINDOW(m_pWindow), TRUE ); - } + if( !(m_nStyle & SAL_FRAME_STYLE_SIZEABLE) ) + gtk_window_set_resizable( GTK_WINDOW(m_pWindow), TRUE ); gtk_window_fullscreen( GTK_WINDOW(m_pWindow) ); moveToScreen( nScreen ); Size aScreenSize = pDisp->GetScreenSize( m_nScreen ); @@ -1879,11 +1874,8 @@ void GtkSalFrame::ShowFullScreen( BOOL bFullScreen, sal_Int32 nScreen ) else { gtk_window_unfullscreen( GTK_WINDOW(m_pWindow) ); - if( getDisplay()->getWMAdaptor()->isLegacyPartialFullscreen() ) - { - if( !(m_nStyle & SAL_FRAME_STYLE_SIZEABLE) ) - gtk_window_set_resizable( GTK_WINDOW(m_pWindow), FALSE ); - } + if( !(m_nStyle & SAL_FRAME_STYLE_SIZEABLE) ) + gtk_window_set_resizable( GTK_WINDOW(m_pWindow), FALSE ); moveToScreen( nScreen ); } } @@ -2849,12 +2841,52 @@ gboolean GtkSalFrame::signalFocus( GtkWidget*, GdkEventFocus* pEvent, gpointer f return FALSE; } +IMPL_LINK( GtkSalFrame, ImplDelayedFullScreenHdl, void*, EMPTYARG ) +{ + Atom nStateAtom = getDisplay()->getWMAdaptor()->getAtom(vcl_sal::WMAdaptor::NET_WM_STATE); + Atom nFSAtom = getDisplay()->getWMAdaptor()->getAtom(vcl_sal::WMAdaptor::NET_WM_STATE_FULLSCREEN ); + if( nStateAtom && nFSAtom ) + { + /* #i110881# workaround a gtk issue (see https://bugzilla.redhat.com/show_bug.cgi?id=623191#c8) + gtk_window_fullscreen can fail due to a race condition, request an additional status change + to fullscreen to be safe + */ + XEvent aEvent; + aEvent.type = ClientMessage; + aEvent.xclient.display = getDisplay()->GetDisplay(); + aEvent.xclient.window = GDK_WINDOW_XWINDOW(m_pWindow->window); + aEvent.xclient.message_type = nStateAtom; + aEvent.xclient.format = 32; + aEvent.xclient.data.l[0] = 1; + aEvent.xclient.data.l[1] = nFSAtom; + aEvent.xclient.data.l[2] = 0; + aEvent.xclient.data.l[3] = 0; + aEvent.xclient.data.l[4] = 0; + XSendEvent( getDisplay()->GetDisplay(), + getDisplay()->GetRootWindow( m_nScreen ), + False, + SubstructureNotifyMask | SubstructureRedirectMask, + &aEvent + ); + } + + return 0; +} + gboolean GtkSalFrame::signalMap( GtkWidget*, GdkEvent*, gpointer frame ) { GtkSalFrame* pThis = (GtkSalFrame*)frame; GTK_YIELD_GRAB(); + if( pThis->m_bFullscreen ) + { + /* #i110881# workaorund a gtk issue (see https://bugzilla.redhat.com/show_bug.cgi?id=623191#c8) + gtk_window_fullscreen can run into a race condition with the window's showstate + */ + Application::PostUserEvent( LINK( pThis, GtkSalFrame, ImplDelayedFullScreenHdl ) ); + } + bool bSetFocus = pThis->m_bSetFocusOnMap; pThis->m_bSetFocusOnMap = false; if( ImplGetSVData()->mbIsTestTool ) diff --git a/vcl/unx/inc/plugins/gtk/gtkframe.hxx b/vcl/unx/inc/plugins/gtk/gtkframe.hxx index 18dd476fc2c4..d47e5fb50fca 100644 --- a/vcl/unx/inc/plugins/gtk/gtkframe.hxx +++ b/vcl/unx/inc/plugins/gtk/gtkframe.hxx @@ -38,6 +38,8 @@ #include #include +#include "tools/link.hxx" + #include #include @@ -265,6 +267,8 @@ class GtkSalFrame : public SalFrame void setMinMaxSize(); void createNewWindow( XLIB_Window aParent, bool bXEmbed, int nScreen ); void askForXEmbedFocus( sal_Int32 nTimecode ); + + DECL_LINK( ImplDelayedFullScreenHdl, void* ); public: GtkSalFrame( SalFrame* pParent, ULONG nStyle ); GtkSalFrame( SystemParentData* pSysData ); -- cgit v1.2.3 From 600c6460a6ffa169ad0cc9bed4b77c545cc50f52 Mon Sep 17 00:00:00 2001 From: "Thomas Lange [tl]" Date: Tue, 24 Aug 2010 16:46:29 +0200 Subject: cws tl82: #i113785# ligatures for spell checking will no longer break words --- i18npool/source/breakiterator/breakiteratorImpl.cxx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/i18npool/source/breakiterator/breakiteratorImpl.cxx b/i18npool/source/breakiterator/breakiteratorImpl.cxx index e4e08d42df43..d22203d100c7 100644 --- a/i18npool/source/breakiterator/breakiteratorImpl.cxx +++ b/i18npool/source/breakiterator/breakiteratorImpl.cxx @@ -488,6 +488,10 @@ sal_Int16 BreakIteratorImpl::getScriptClass(sal_uInt32 currentChar) // workaround for Coptic else if ( 0x2C80 <= currentChar && 0x2CE3 >= currentChar) nRet = ScriptType::LATIN; + // work-around for ligatures (see http://www.unicode.org/charts/PDF/UFB00.pdf) + else if ((0xFB00 <= currentChar && currentChar <= 0xFB06) || + (0xFB13 <= currentChar && currentChar <= 0xFB17)) + nRet = ScriptType::LATIN; else { UBlockCode block=ublock_getCode(currentChar); sal_uInt16 i; -- cgit v1.2.3 From e301c8006b0ebebaa1059f1712ab7269a684c540 Mon Sep 17 00:00:00 2001 From: Ivo Hinkelmann Date: Wed, 25 Aug 2010 16:36:33 +0200 Subject: #i10000# removed obsolete switch --- l10ntools/scripts/localize.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/l10ntools/scripts/localize.pl b/l10ntools/scripts/localize.pl index 4b7040d6583d..7a9d8beb6f15 100644 --- a/l10ntools/scripts/localize.pl +++ b/l10ntools/scripts/localize.pl @@ -492,7 +492,7 @@ sub collectfiles{ # -e # if ( -x $command ){ if( $command ){ - if( !$bVerbose ){ $args .= " -QQ "; } + if( !$bVerbose ){ $args .= " "; } $args .= " -e -f $localizeSDF -l "; my $bFlag=""; if( $bAll ) {$args .= " en-US";} -- cgit v1.2.3 From 0f5cf8b1ece166ffb32af79b54fe46ec5dc9a6f8 Mon Sep 17 00:00:00 2001 From: Ivo Hinkelmann Date: Wed, 25 Aug 2010 19:09:27 +0200 Subject: #i10000# set dummy fields to 0 for string DB --- l10ntools/scripts/tool/sdf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/l10ntools/scripts/tool/sdf.py b/l10ntools/scripts/tool/sdf.py index 2afcbaf4bb1f..dd413b14f75f 100644 --- a/l10ntools/scripts/tool/sdf.py +++ b/l10ntools/scripts/tool/sdf.py @@ -113,7 +113,7 @@ class SdfEntity: const._TITLE_POS = 13 const._DATE_POS = 14 - def __init__(self, project="", source_file="", dummy1="", resource_type="", gid="", lid="", helpid="", platform="", dummy2="", langid="", + def __init__(self, project="", source_file="", dummy1="0", resource_type="", gid="", lid="", helpid="", platform="", dummy2="0", langid="", text="", helptext="", quickhelptext="", title="", date="2002-02-02 02:02:02"): self.project = project; self.source_file = source_file; -- cgit v1.2.3 From c2823b2321863724e0357c10f23a24cb8021073d Mon Sep 17 00:00:00 2001 From: sj Date: Wed, 25 Aug 2010 20:45:55 +0200 Subject: impress186: #i4499# fixed compile error --- svtools/source/filter.vcl/filter/exportdialog.cxx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/svtools/source/filter.vcl/filter/exportdialog.cxx b/svtools/source/filter.vcl/filter/exportdialog.cxx index 36ce7b63c87d..94e778c9be84 100755 --- a/svtools/source/filter.vcl/filter/exportdialog.cxx +++ b/svtools/source/filter.vcl/filter/exportdialog.cxx @@ -1226,23 +1226,23 @@ void ExportDialog::updatePreview() Size aSize; if ( fXRatio > 1.0 ) { - aSize.Width() = Max( maSize.Width, aFixedBitmapSize.Width() ); + aSize.Width() = ::std::max( maSize.Width, aFixedBitmapSize.Width() ); aSize.Width() /= fXRatio; } else { - aSize.Width() = Min( maSize.Width, aFixedBitmapSize.Width() ); + aSize.Width() = ::std::min( maSize.Width, aFixedBitmapSize.Width() ); aSize.Width() /= fXRatio; } if ( fYRatio > 1.0 ) { - aSize.Height() = Max( maSize.Height, aFixedBitmapSize.Height() ); + aSize.Height() = ::std::max( maSize.Height, aFixedBitmapSize.Height() ); aSize.Height() /= fYRatio; } else { - aSize.Height() = Min( maSize.Height, aFixedBitmapSize.Height() ); + aSize.Height() = ::std::min( maSize.Height, aFixedBitmapSize.Height() ); aSize.Height() /= fYRatio; } -- cgit v1.2.3 From c67e63ceaacf2af96fdc1a32584629e89bf083d8 Mon Sep 17 00:00:00 2001 From: sj Date: Thu, 26 Aug 2010 11:18:29 +0200 Subject: impress186: #i4499# fixed compile error --- svtools/source/filter.vcl/filter/exportdialog.cxx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/svtools/source/filter.vcl/filter/exportdialog.cxx b/svtools/source/filter.vcl/filter/exportdialog.cxx index 94e778c9be84..c04b587b6278 100755 --- a/svtools/source/filter.vcl/filter/exportdialog.cxx +++ b/svtools/source/filter.vcl/filter/exportdialog.cxx @@ -1226,23 +1226,23 @@ void ExportDialog::updatePreview() Size aSize; if ( fXRatio > 1.0 ) { - aSize.Width() = ::std::max( maSize.Width, aFixedBitmapSize.Width() ); + aSize.Width() = maSize.Width > aFixedBitmapSize.Width() ? maSize.Width : aFixedBitmapSize.Width(); aSize.Width() /= fXRatio; } else { - aSize.Width() = ::std::min( maSize.Width, aFixedBitmapSize.Width() ); + aSize.Width() = maSize.Width < aFixedBitmapSize.Width() ? maSize.Width : aFixedBitmapSize.Width(); aSize.Width() /= fXRatio; } if ( fYRatio > 1.0 ) { - aSize.Height() = ::std::max( maSize.Height, aFixedBitmapSize.Height() ); + aSize.Height() = maSize.Height > aFixedBitmapSize.Height() ? maSize.Height : aFixedBitmapSize.Height(); aSize.Height() /= fYRatio; } else { - aSize.Height() = ::std::min( maSize.Height, aFixedBitmapSize.Height() ); + aSize.Height() = maSize.Height < aFixedBitmapSize.Height() ? maSize.Height : aFixedBitmapSize.Height(); aSize.Height() /= fYRatio; } -- cgit v1.2.3 From d4db8f570730be85039435919ec78b119d7da3f5 Mon Sep 17 00:00:00 2001 From: Ivo Hinkelmann Date: Thu, 26 Aug 2010 13:17:12 +0200 Subject: masterfix: #i10000# modify extract date and dummy fields for string database --- l10ntools/java/jpropex/java/JPropEx.java | 7 +++++-- l10ntools/scripts/tool/sdf.py | 9 +++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/l10ntools/java/jpropex/java/JPropEx.java b/l10ntools/java/jpropex/java/JPropEx.java index be59d7f29479..ceeeb5083982 100644 --- a/l10ntools/java/jpropex/java/JPropEx.java +++ b/l10ntools/java/jpropex/java/JPropEx.java @@ -145,8 +145,11 @@ public class JPropEx //String path = makeAbs( inputFileArg ); path = path.replace( rootArg + "/" , "" ); path = path.replace("/","\\"); - return new SdfEntity( projectArg , path , "" /* dummy1 */ , resourceType , "", "" , "" , "" , "" /* dummy2 */ , - sourceLanguage , "", "" , "" , "" , "2002-02-02 02:02:02" ); + // TODO: Make this static + java.text.SimpleDateFormat dateformat = new java.text.SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + String date = dateformat.format( new Date() ); + return new SdfEntity( projectArg , path , "0" /* dummy1 */ , resourceType , "", "" , "" , "" , "0" /* dummy2 */ , + sourceLanguage , "", "" , "" , "" , date ); } private void merge() diff --git a/l10ntools/scripts/tool/sdf.py b/l10ntools/scripts/tool/sdf.py index dd413b14f75f..96afbed1452c 100644 --- a/l10ntools/scripts/tool/sdf.py +++ b/l10ntools/scripts/tool/sdf.py @@ -26,6 +26,7 @@ #************************************************************************* from pseudo import PseudoSet,PseudoOrderedDict +from time import gmtime, strftime class SdfData: _filename = ""; @@ -114,7 +115,7 @@ class SdfEntity: const._DATE_POS = 14 def __init__(self, project="", source_file="", dummy1="0", resource_type="", gid="", lid="", helpid="", platform="", dummy2="0", langid="", - text="", helptext="", quickhelptext="", title="", date="2002-02-02 02:02:02"): + text="", helptext="", quickhelptext="", title="", date=""): self.project = project; self.source_file = source_file; self.dummy1 = dummy1; @@ -129,7 +130,11 @@ class SdfEntity: self.helptext = helptext; self.quickhelptext = quickhelptext; self.title = title; - self.date = date; + if date != "": + self.date = date; + else: + self.date = strftime("%Y-%m-%d %H:%M:%S",gmtime()) + def set_properties(self, line): splitted = line.split("\t") -- cgit v1.2.3 From e2f547fffb266c661a20561a72b3f26827fa7f48 Mon Sep 17 00:00:00 2001 From: Bjoern Michaelsen Date: Thu, 26 Aug 2010 18:03:40 +0200 Subject: oooimprovement6: #i99729# collecting ruler interaction, allow .special: urls to the log --- comphelper/source/misc/uieventslogger.cxx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/comphelper/source/misc/uieventslogger.cxx b/comphelper/source/misc/uieventslogger.cxx index 710c08fdd706..738a5ec6a8d3 100644 --- a/comphelper/source/misc/uieventslogger.cxx +++ b/comphelper/source/misc/uieventslogger.cxx @@ -175,6 +175,7 @@ namespace comphelper static const OUString FN_ROTATEDLOG; static const OUString LOGROTATE_EVENTNAME; static const OUString URL_UNO; + static const OUString URL_SPECIAL; static const OUString URL_FILE; }; } @@ -209,6 +210,7 @@ namespace comphelper const OUString UiEventsLogger_Impl::LOGROTATE_EVENTNAME = OUString::createFromAscii("onOOoImprovementLogRotated"); const OUString UiEventsLogger_Impl::URL_UNO = OUString::createFromAscii(".uno:"); + const OUString UiEventsLogger_Impl::URL_SPECIAL = OUString::createFromAscii(".special:"); const OUString UiEventsLogger_Impl::URL_FILE = OUString::createFromAscii("file:"); @@ -347,7 +349,12 @@ namespace comphelper const Sequence& args) { if(!m_Active) return; - if(!url.Complete.match(URL_UNO) && !url.Complete.match(URL_FILE)) return; + if(!url.Complete.match(URL_UNO) + && !url.Complete.match(URL_FILE) + && !url.Complete.match(URL_SPECIAL)) + { + return; + } checkIdleTimeout(); Sequence logdata = Sequence(COLUMNS); -- cgit v1.2.3 From 9e685a7e47924f184d076c43acde64548cb5925d Mon Sep 17 00:00:00 2001 From: obo Date: Fri, 27 Aug 2010 11:31:33 +0200 Subject: masterfix OOO330: #i10000# unknown -B option for Python (Windows) --- l10ntools/scripts/xhtex | 9 ++++++++- l10ntools/scripts/xtxex | 8 ++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/l10ntools/scripts/xhtex b/l10ntools/scripts/xhtex index ad18d8c94eab..ca307cf2d4a4 100755 --- a/l10ntools/scripts/xhtex +++ b/l10ntools/scripts/xhtex @@ -31,9 +31,16 @@ if [ x${SOLARENV}x = xx ]; then exit 1 fi +if [ ${GUI} = "WNT" ]; then +if [ x${SOLARVER}x = xx -o x${UPDMINOREXT}x = xx ]; then + exec python $SOLARVERSION/$INPATH/bin/xhtex.py "$@" +else + exec python $SOLARVERSION/$INPATH/bin$UPDMINOREXT/xhtex.py "$@" +fi +else if [ x${SOLARVER}x = xx -o x${UPDMINOREXT}x = xx ]; then exec python -B $SOLARVERSION/$INPATH/bin/xhtex.py "$@" else exec python -B $SOLARVERSION/$INPATH/bin$UPDMINOREXT/xhtex.py "$@" fi - +fi diff --git a/l10ntools/scripts/xtxex b/l10ntools/scripts/xtxex index 52baab0693d0..fb54c1aee36c 100755 --- a/l10ntools/scripts/xtxex +++ b/l10ntools/scripts/xtxex @@ -31,9 +31,17 @@ if [ x${SOLARENV}x = xx ]; then exit 1 fi +if [ ${GUI} = "WNT" ]; then +if [ x${SOLARVER}x = xx -o x${UPDMINOREXT}x = xx ]; then + exec python $SOLARVERSION/$INPATH/bin/xtxex.py "$@" +else + exec python $SOLARVERSION/$INPATH/bin$UPDMINOREXT/xtxex.py "$@" +fi +else if [ x${SOLARVER}x = xx -o x${UPDMINOREXT}x = xx ]; then exec python -B $SOLARVERSION/$INPATH/bin/xtxex.py "$@" else exec python -B $SOLARVERSION/$INPATH/bin$UPDMINOREXT/xtxex.py "$@" fi +fi -- cgit v1.2.3 From fa4b286294a272b085c2f74e12581edc2343fc18 Mon Sep 17 00:00:00 2001 From: obo Date: Fri, 27 Aug 2010 11:31:33 +0200 Subject: masterfix OOO330: #i10000# unknown -B option for Python (Windows) --- l10ntools/scripts/xhtex | 9 ++++++++- l10ntools/scripts/xtxex | 8 ++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/l10ntools/scripts/xhtex b/l10ntools/scripts/xhtex index ad18d8c94eab..ca307cf2d4a4 100755 --- a/l10ntools/scripts/xhtex +++ b/l10ntools/scripts/xhtex @@ -31,9 +31,16 @@ if [ x${SOLARENV}x = xx ]; then exit 1 fi +if [ ${GUI} = "WNT" ]; then +if [ x${SOLARVER}x = xx -o x${UPDMINOREXT}x = xx ]; then + exec python $SOLARVERSION/$INPATH/bin/xhtex.py "$@" +else + exec python $SOLARVERSION/$INPATH/bin$UPDMINOREXT/xhtex.py "$@" +fi +else if [ x${SOLARVER}x = xx -o x${UPDMINOREXT}x = xx ]; then exec python -B $SOLARVERSION/$INPATH/bin/xhtex.py "$@" else exec python -B $SOLARVERSION/$INPATH/bin$UPDMINOREXT/xhtex.py "$@" fi - +fi diff --git a/l10ntools/scripts/xtxex b/l10ntools/scripts/xtxex index 52baab0693d0..fb54c1aee36c 100755 --- a/l10ntools/scripts/xtxex +++ b/l10ntools/scripts/xtxex @@ -31,9 +31,17 @@ if [ x${SOLARENV}x = xx ]; then exit 1 fi +if [ ${GUI} = "WNT" ]; then +if [ x${SOLARVER}x = xx -o x${UPDMINOREXT}x = xx ]; then + exec python $SOLARVERSION/$INPATH/bin/xtxex.py "$@" +else + exec python $SOLARVERSION/$INPATH/bin$UPDMINOREXT/xtxex.py "$@" +fi +else if [ x${SOLARVER}x = xx -o x${UPDMINOREXT}x = xx ]; then exec python -B $SOLARVERSION/$INPATH/bin/xtxex.py "$@" else exec python -B $SOLARVERSION/$INPATH/bin$UPDMINOREXT/xtxex.py "$@" fi +fi -- cgit v1.2.3 From e42e01e951a83646fd5e037e241cb729579704d6 Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Fri, 27 Aug 2010 12:42:07 +0200 Subject: dba33h: #i111396# fix getNatvieControlRegion --- vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx index 9d3ce6b137cd..ec92c20b54b5 100644 --- a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx +++ b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx @@ -1102,8 +1102,9 @@ BOOL GtkSalGraphics::getNativeControlRegion( ControlType nType, GtkRequisition aReq; gtk_widget_size_request( widget, &aReq ); Rectangle aEditRect = rControlRegion; + long nHeight = (aEditRect.GetHeight() > aReq.height+1) ? aEditRect.GetHeight() : aReq.height+1; aEditRect = Rectangle( aEditRect.TopLeft(), - Size( aEditRect.GetWidth(), aReq.height+1 ) ); + Size( aEditRect.GetWidth(), nHeight ) ); rNativeBoundingRegion = aEditRect; rNativeContentRegion = rNativeBoundingRegion; returnVal = TRUE; @@ -2291,11 +2292,10 @@ BOOL GtkSalGraphics::NWPaintGTKTabItem( ControlType nType, ControlPart, const ImplControlValue& aValue, const OUString& ) { - OSL_ASSERT( aValue.getType() == CTRL_TAB_ITEM ); + OSL_ASSERT( nType != CTRL_TAB_ITEM || aValue.getType() == CTRL_TAB_ITEM ); GdkPixmap * pixmap; Rectangle pixmapRect; Rectangle tabRect; - const TabitemValue * pTabitemValue = static_cast(&aValue); GtkStateType stateType; GtkShadowType shadowType; if( ! gWidgetData[ m_nScreen ].gCacheTabItems ) @@ -2311,9 +2311,8 @@ BOOL GtkSalGraphics::NWPaintGTKTabItem( ControlType nType, ControlPart, if( !aCachePage.GetSize() ) aCachePage.SetSize( 1 ); - if ( !pTabitemValue && (nType==CTRL_TAB_ITEM) ) + if ( (nType == CTRL_TAB_ITEM) && (aValue.getType() != CTRL_TAB_ITEM) ) { - std::fprintf( stderr, "NWPaintGTKTabItem() received a NULL TabitemValue. Cannot draw native tab\n" ); return( false ); } @@ -2326,6 +2325,7 @@ BOOL GtkSalGraphics::NWPaintGTKTabItem( ControlType nType, ControlPart, pixmapRect = rControlRectangle; if ( nType == CTRL_TAB_ITEM ) { + const TabitemValue * pTabitemValue = static_cast(&aValue); if ( !pTabitemValue->isFirst() ) { // GTK+ tabs overlap on the right edge (the top tab obscures the -- cgit v1.2.3 From 12c69822be95534b8a960fbd5e11379925610be0 Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Fri, 27 Aug 2010 13:43:26 +0200 Subject: dba33h: #i111396# fix getNativeControlRegion --- vcl/aqua/source/gdi/salnativewidgets.cxx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/vcl/aqua/source/gdi/salnativewidgets.cxx b/vcl/aqua/source/gdi/salnativewidgets.cxx index 6e206977b5c4..9ce2b8a5a518 100644 --- a/vcl/aqua/source/gdi/salnativewidgets.cxx +++ b/vcl/aqua/source/gdi/salnativewidgets.cxx @@ -1366,10 +1366,12 @@ BOOL AquaSalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPa w = aCtrlBoundRect.GetWidth(); if( w < 3+2*FOCUS_RING_WIDTH ) w = 3+2*FOCUS_RING_WIDTH; - h = TEXT_EDIT_HEIGHT_NORMAL; + h = TEXT_EDIT_HEIGHT_NORMAL+2*FOCUS_RING_WIDTH; + if( h < aCtrlBoundRect.GetHeight() ) + h = aCtrlBoundRect.GetHeight(); - rNativeContentRegion = Rectangle( Point( x+FOCUS_RING_WIDTH, y+FOCUS_RING_WIDTH ), Size( w-2*FOCUS_RING_WIDTH-2, h-2 ) ); - rNativeBoundingRegion = Rectangle( Point( x, y ), Size( w, h+2*FOCUS_RING_WIDTH ) ); + rNativeContentRegion = Rectangle( Point( x+FOCUS_RING_WIDTH, y+FOCUS_RING_WIDTH ), Size( w-2*(FOCUS_RING_WIDTH+1), h-2*(FOCUS_RING_WIDTH+1) ) ); + rNativeBoundingRegion = Rectangle( Point( x, y ), Size( w, h ) ); toReturn = TRUE; } -- cgit v1.2.3 From b06645b8dc544d13a46edb2635a4c97e5a782f70 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Fri, 27 Aug 2010 14:48:11 +0100 Subject: cmcfixes78: #i114148# duplicate unbuilt menuoptions.cxx in unotools thats also in svtools --- unotools/source/config/menuoptions.cxx | 561 --------------------------------- 1 file changed, 561 deletions(-) delete mode 100644 unotools/source/config/menuoptions.cxx diff --git a/unotools/source/config/menuoptions.cxx b/unotools/source/config/menuoptions.cxx deleted file mode 100644 index 2c5756c2140c..000000000000 --- a/unotools/source/config/menuoptions.cxx +++ /dev/null @@ -1,561 +0,0 @@ -/************************************************************************* - * - * 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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_unotools.hxx" -#ifndef GCC -#endif - -//_________________________________________________________________________________________________________________ -// includes -//_________________________________________________________________________________________________________________ - -#include -#include -#include -#include -#include -#include -#include - -#include -#include "itemholder1.hxx" - -//_________________________________________________________________________________________________________________ -// namespaces -//_________________________________________________________________________________________________________________ - -using namespace ::utl ; -using namespace ::rtl ; -using namespace ::osl ; -using namespace ::com::sun::star::uno ; - -//_________________________________________________________________________________________________________________ -// const -//_________________________________________________________________________________________________________________ - -#define ROOTNODE_MENU OUString(RTL_CONSTASCII_USTRINGPARAM("Office.Common/View/Menu" )) -#define DEFAULT_DONTHIDEDISABLEDENTRIES sal_False -#define DEFAULT_FOLLOWMOUSE sal_True -#define DEFAULT_MENUICONS 2 - -#define PROPERTYNAME_DONTHIDEDISABLEDENTRIES OUString(RTL_CONSTASCII_USTRINGPARAM("DontHideDisabledEntry" )) -#define PROPERTYNAME_FOLLOWMOUSE OUString(RTL_CONSTASCII_USTRINGPARAM("FollowMouse" )) -#define PROPERTYNAME_SHOWICONSINMENUES OUString(RTL_CONSTASCII_USTRINGPARAM("ShowIconsInMenues" )) -#define PROPERTYNAME_SYSTEMICONSINMENUES OUString(RTL_CONSTASCII_USTRINGPARAM("IsSystemIconsInMenus" )) - -#define PROPERTYHANDLE_DONTHIDEDISABLEDENTRIES 0 -#define PROPERTYHANDLE_FOLLOWMOUSE 1 -#define PROPERTYHANDLE_SHOWICONSINMENUES 2 -#define PROPERTYHANDLE_SYSTEMICONSINMENUES 3 - -#define PROPERTYCOUNT 4 - -#include -#include -DECLARE_LIST( LinkList, Link * ) - -//_________________________________________________________________________________________________________________ -// private declarations! -//_________________________________________________________________________________________________________________ - -class SvtMenuOptions_Impl : public ConfigItem -{ - //------------------------------------------------------------------------------------------------------------- - // private member - //------------------------------------------------------------------------------------------------------------- - - private: - LinkList aList; - sal_Bool m_bDontHideDisabledEntries ; /// cache "DontHideDisabledEntries" of Menu section - sal_Bool m_bFollowMouse ; /// cache "FollowMouse" of Menu section - sal_Int16 m_nMenuIcons ; /// cache "MenuIcons" of Menu section - - //------------------------------------------------------------------------------------------------------------- - // public methods - //------------------------------------------------------------------------------------------------------------- - - public: - - //--------------------------------------------------------------------------------------------------------- - // constructor / destructor - //--------------------------------------------------------------------------------------------------------- - - SvtMenuOptions_Impl(); - ~SvtMenuOptions_Impl(); - - void AddListener( const Link& rLink ); - void RemoveListener( const Link& rLink ); - - //--------------------------------------------------------------------------------------------------------- - // overloaded methods of baseclass - //--------------------------------------------------------------------------------------------------------- - - /*-****************************************************************************************************//** - @short called for notify of configmanager - @descr These method is called from the ConfigManager before application ends or from the - PropertyChangeListener if the sub tree broadcasts changes. You must update your - internal values. - - @seealso baseclass ConfigItem - - @param "seqPropertyNames" is the list of properties which should be updated. - @return - - - @onerror - - *//*-*****************************************************************************************************/ - - virtual void Notify( const Sequence< OUString >& seqPropertyNames ); - - /*-****************************************************************************************************//** - @short write changes to configuration - @descr These method writes the changed values into the sub tree - and should always called in our destructor to guarantee consistency of config data. - - @seealso baseclass ConfigItem - - @param - - @return - - - @onerror - - *//*-*****************************************************************************************************/ - - virtual void Commit(); - - //--------------------------------------------------------------------------------------------------------- - // public interface - //--------------------------------------------------------------------------------------------------------- - - /*-****************************************************************************************************//** - @short access method to get internal values - @descr These method give us a chance to regulate acces to ouer internal values. - It's not used in the moment - but it's possible for the feature! - - @seealso - - - @param - - @return - - - @onerror - - *//*-*****************************************************************************************************/ - - sal_Bool IsEntryHidingEnabled() const - { return m_bDontHideDisabledEntries; } - - sal_Bool IsFollowMouseEnabled() const - { return m_bFollowMouse; } - - sal_Int16 GetMenuIconsState() const - { return m_nMenuIcons; } - - void SetEntryHidingState ( sal_Bool bState ) - { - m_bDontHideDisabledEntries = bState; - SetModified(); - for ( USHORT n=0; nCall( this ); - Commit(); - } - - void SetFollowMouseState ( sal_Bool bState ) - { - m_bFollowMouse = bState; - SetModified(); - for ( USHORT n=0; nCall( this ); - Commit(); - } - - void SetMenuIconsState ( sal_Int16 bState ) - { - m_nMenuIcons = bState; - SetModified(); - for ( USHORT n=0; nCall( this ); - Commit(); - } - - //------------------------------------------------------------------------------------------------------------- - // private methods - //------------------------------------------------------------------------------------------------------------- - - private: - - /*-****************************************************************************************************//** - @short return list of fix key names of ouer configuration management which represent oue module tree - @descr These methods return a static const list of key names. We need it to get needed values from our - configuration management. - - @seealso - - - @param - - @return A list of needed configuration keys is returned. - - @onerror - - *//*-*****************************************************************************************************/ - - static Sequence< OUString > impl_GetPropertyNames(); -}; - -//_________________________________________________________________________________________________________________ -// definitions -//_________________________________________________________________________________________________________________ - -//***************************************************************************************************************** -// constructor -//***************************************************************************************************************** -SvtMenuOptions_Impl::SvtMenuOptions_Impl() - // Init baseclasses first - : ConfigItem ( ROOTNODE_MENU ) - // Init member then. - , m_bDontHideDisabledEntries ( DEFAULT_DONTHIDEDISABLEDENTRIES ) - , m_bFollowMouse ( DEFAULT_FOLLOWMOUSE ) - , m_nMenuIcons ( DEFAULT_MENUICONS ) -{ - // Use our static list of configuration keys to get his values. - Sequence< OUString > seqNames = impl_GetPropertyNames(); - Sequence< Any > seqValues = GetProperties( seqNames ) ; - - // Safe impossible cases. - // We need values from ALL configuration keys. - // Follow assignment use order of values in relation to our list of key names! - DBG_ASSERT( !(seqNames.getLength()!=seqValues.getLength()), "SvtMenuOptions_Impl::SvtMenuOptions_Impl()\nI miss some values of configuration keys!\n" ); - - sal_Bool bMenuIcons = true; - sal_Bool bSystemMenuIcons = true; - - // Copy values from list in right order to ouer internal member. - sal_Int32 nPropertyCount = seqValues.getLength() ; - sal_Int32 nProperty = 0 ; - for( nProperty=0; nProperty>= m_bDontHideDisabledEntries; - } - break; - - case PROPERTYHANDLE_FOLLOWMOUSE : { - DBG_ASSERT(!(seqValues[nProperty].getValueTypeClass()!=TypeClass_BOOLEAN), "SvtMenuOptions_Impl::SvtMenuOptions_Impl()\nWho has changed the value type of \"Office.Common\\View\\Menu\\FollowMouse\"?" ); - seqValues[nProperty] >>= m_bFollowMouse; - } - break; - case PROPERTYHANDLE_SHOWICONSINMENUES : { - DBG_ASSERT(!(seqValues[nProperty].getValueTypeClass()!=TypeClass_BOOLEAN), "SvtMenuOptions_Impl::SvtMenuOptions_Impl()\nWho has changed the value type of \"Office.Common\\View\\Menu\\ShowIconsInMenues\"?" ); - seqValues[nProperty] >>= bMenuIcons; - } - break; - case PROPERTYHANDLE_SYSTEMICONSINMENUES : { - DBG_ASSERT(!(seqValues[nProperty].getValueTypeClass()!=TypeClass_BOOLEAN), "SvtMenuOptions_Impl::SvtMenuOptions_Impl()\nWho has changed the value type of \"Office.Common\\View\\Menu\\IsSystemIconsInMenus\"?" ); - seqValues[nProperty] >>= bSystemMenuIcons; - } - break; - } - } - - m_nMenuIcons = bSystemMenuIcons ? 2 : bMenuIcons; - - EnableNotification( seqNames ); -} - -//***************************************************************************************************************** -// destructor -//***************************************************************************************************************** -SvtMenuOptions_Impl::~SvtMenuOptions_Impl() -{ - // Flush data to configuration! - // User has no chance to do that. - if( IsModified() == sal_True ) - { - Commit(); - } - - for ( USHORT n=0; n& seqPropertyNames ) -{ - // Use given list of updated properties to get his values from configuration directly! - Sequence< Any > seqValues = GetProperties( seqPropertyNames ); - // Safe impossible cases. - // We need values from ALL notified configuration keys. - DBG_ASSERT( !(seqPropertyNames.getLength()!=seqValues.getLength()), "SvtMenuOptions_Impl::Notify()\nI miss some values of configuration keys!\n" ); - - sal_Bool bMenuIcons = true; - sal_Bool bSystemMenuIcons = true; - - // Step over list of property names and get right value from coreesponding value list to set it on internal members! - sal_Int32 nCount = seqPropertyNames.getLength(); - for( sal_Int32 nProperty=0; nProperty>= m_bDontHideDisabledEntries; - } - else if( seqPropertyNames[nProperty] == PROPERTYNAME_FOLLOWMOUSE ) - { - DBG_ASSERT(!(seqValues[nProperty].getValueTypeClass()!=TypeClass_BOOLEAN), "SvtMenuOptions_Impl::Notify()\nWho has changed the value type of \"Office.Common\\View\\Menu\\FollowMouse\"?" ); - seqValues[nProperty] >>= m_bFollowMouse; - } - else if( seqPropertyNames[nProperty] == PROPERTYNAME_SHOWICONSINMENUES ) - { - DBG_ASSERT(!(seqValues[nProperty].getValueTypeClass()!=TypeClass_BOOLEAN), "SvtMenuOptions_Impl::SvtMenuOptions_Impl()\nWho has changed the value type of \"Office.Common\\View\\Menu\\ShowIconsInMenues\"?" ); - seqValues[nProperty] >>= bMenuIcons; - } - else if( seqPropertyNames[nProperty] == PROPERTYNAME_SYSTEMICONSINMENUES ) - { - DBG_ASSERT(!(seqValues[nProperty].getValueTypeClass()!=TypeClass_BOOLEAN), "SvtMenuOptions_Impl::SvtMenuOptions_Impl()\nWho has changed the value type of \"Office.Common\\View\\Menu\\IsSystemIconsInMenus\"?" ); - seqValues[nProperty] >>= bSystemMenuIcons; - } - - #if OSL_DEBUG_LEVEL > 1 - else DBG_ASSERT( sal_False, "SvtMenuOptions_Impl::Notify()\nUnkown property detected ... I can't handle these!\n" ); - #endif - } - - m_nMenuIcons = bSystemMenuIcons ? 2 : bMenuIcons; - - for ( USHORT n=0; nCall( this ); -} - -//***************************************************************************************************************** -// public method -//***************************************************************************************************************** -void SvtMenuOptions_Impl::Commit() -{ - // Get names of supported properties, create a list for values and copy current values to it. - Sequence< OUString > seqNames = impl_GetPropertyNames(); - sal_Int32 nCount = seqNames.getLength(); - Sequence< Any > seqValues ( nCount ); - for( sal_Int32 nProperty=0; nProperty SvtMenuOptions_Impl::impl_GetPropertyNames() -{ - // Build static list of configuration key names. - static const OUString pProperties[] = - { - PROPERTYNAME_DONTHIDEDISABLEDENTRIES , - PROPERTYNAME_FOLLOWMOUSE , - PROPERTYNAME_SHOWICONSINMENUES , - PROPERTYNAME_SYSTEMICONSINMENUES - }; - // Initialize return sequence with these list ... - static const Sequence< OUString > seqPropertyNames( pProperties, PROPERTYCOUNT ); - // ... and return it. - return seqPropertyNames; -} - -void SvtMenuOptions_Impl::AddListener( const Link& rLink ) -{ - aList.Insert( new Link( rLink ) ); -} - -void SvtMenuOptions_Impl::RemoveListener( const Link& rLink ) -{ - for ( USHORT n=0; nIsEntryHidingEnabled(); -} - -//***************************************************************************************************************** -// public method -//***************************************************************************************************************** -sal_Bool SvtMenuOptions::IsFollowMouseEnabled() const -{ - MutexGuard aGuard( GetOwnStaticMutex() ); - return m_pDataContainer->IsFollowMouseEnabled(); -} - -//***************************************************************************************************************** -// public method -//***************************************************************************************************************** -void SvtMenuOptions::SetEntryHidingState( sal_Bool bState ) -{ - MutexGuard aGuard( GetOwnStaticMutex() ); - m_pDataContainer->SetEntryHidingState( bState ); -} - -//***************************************************************************************************************** -// public method -//***************************************************************************************************************** -void SvtMenuOptions::SetFollowMouseState( sal_Bool bState ) -{ - MutexGuard aGuard( GetOwnStaticMutex() ); - m_pDataContainer->SetFollowMouseState( bState ); -} - -//***************************************************************************************************************** -// public method -//***************************************************************************************************************** -sal_Int16 SvtMenuOptions::GetMenuIconsState() const -{ - MutexGuard aGuard( GetOwnStaticMutex() ); - return m_pDataContainer->GetMenuIconsState(); -} - -//***************************************************************************************************************** -// public method -//***************************************************************************************************************** -void SvtMenuOptions::SetMenuIconsState( sal_Int16 bState ) -{ - MutexGuard aGuard( GetOwnStaticMutex() ); - m_pDataContainer->SetMenuIconsState( bState ); -} - -//***************************************************************************************************************** -// private method -//***************************************************************************************************************** -Mutex& SvtMenuOptions::GetOwnStaticMutex() -{ - // Initialize static mutex only for one time! - static Mutex* pMutex = NULL; - // If these method first called (Mutex not already exist!) ... - if( pMutex == NULL ) - { - // ... we must create a new one. Protect follow code with the global mutex - - // It must be - we create a static variable! - MutexGuard aGuard( Mutex::getGlobalMutex() ); - // We must check our pointer again - because it can be that another instance of ouer class will be fastr then these! - if( pMutex == NULL ) - { - // Create the new mutex and set it for return on static variable. - static Mutex aMutex; - pMutex = &aMutex; - } - } - // Return new created or already existing mutex object. - return *pMutex; -} - -void SvtMenuOptions::AddListener( const Link& rLink ) -{ - m_pDataContainer->AddListener( rLink ); -} - -void SvtMenuOptions::RemoveListener( const Link& rLink ) -{ - m_pDataContainer->RemoveListener( rLink ); -} -- cgit v1.2.3 From 5f10df484d43bf5fcec2269f503c3ee9e0d0cccd Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Fri, 27 Aug 2010 16:01:02 +0200 Subject: #dba33h: #i114147# catch an access to an empty interface --- vcl/aqua/source/a11y/aqua11yselectionwrapper.mm | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/vcl/aqua/source/a11y/aqua11yselectionwrapper.mm b/vcl/aqua/source/a11y/aqua11yselectionwrapper.mm index 53ab6dd36128..804cf108dba8 100644 --- a/vcl/aqua/source/a11y/aqua11yselectionwrapper.mm +++ b/vcl/aqua/source/a11y/aqua11yselectionwrapper.mm @@ -40,20 +40,23 @@ using namespace ::com::sun::star::uno; +(id)selectedChildrenAttributeForElement:(AquaA11yWrapper *)wrapper { Reference< XAccessibleSelection > xAccessibleSelection = [ wrapper accessibleSelection ]; - NSMutableArray * children = [ [ NSMutableArray alloc ] init ]; - - try { - sal_Int32 n = xAccessibleSelection -> getSelectedAccessibleChildCount(); - for ( sal_Int32 i=0 ; i < n ; ++i ) { - [ children addObject: [ AquaA11yFactory wrapperForAccessible: xAccessibleSelection -> getSelectedAccessibleChild( i ) ] ]; + if( xAccessibleSelection.is() ) + { + NSMutableArray * children = [ [ NSMutableArray alloc ] init ]; + try { + sal_Int32 n = xAccessibleSelection -> getSelectedAccessibleChildCount(); + for ( sal_Int32 i=0 ; i < n ; ++i ) { + [ children addObject: [ AquaA11yFactory wrapperForAccessible: xAccessibleSelection -> getSelectedAccessibleChild( i ) ] ]; + } + + return children; + + } catch ( Exception& e) + { } - - return children; - - } catch ( Exception& e) { - return nil; } + return nil; } -- cgit v1.2.3 From f677ac480835e92c90521a46b59a7d748f4566bf Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Mon, 30 Aug 2010 14:08:45 +0200 Subject: dba33h: #i114161# --- vcl/source/window/syswin.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vcl/source/window/syswin.cxx b/vcl/source/window/syswin.cxx index f3624ef56f59..f6a37658b79f 100644 --- a/vcl/source/window/syswin.cxx +++ b/vcl/source/window/syswin.cxx @@ -773,7 +773,7 @@ void SystemWindow::SetWindowStateData( const WindowStateData& rData ) BOOL bWrapped = FALSE; while( pWin ) { - if( !pWin->ImplIsRealParentPath( this ) && + if( !pWin->ImplIsRealParentPath( this ) && ( pWin != this ) && pWin->ImplGetWindow()->IsTopWindow() && pWin->mpWindowImpl->mbReallyVisible ) { SalFrameGeometry g = pWin->mpWindowImpl->mpFrame->GetGeometry(); -- cgit v1.2.3 From 5f25caeb6d38b624c345c9ea937f88d7ada5522a Mon Sep 17 00:00:00 2001 From: Kurt Zenker Date: Mon, 30 Aug 2010 20:20:51 +0200 Subject: masterfix: #i114025# WaE fixes --- vcl/source/gdi/gdimtf.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vcl/source/gdi/gdimtf.cxx b/vcl/source/gdi/gdimtf.cxx index 818a31a10c0f..d36a18a1afba 100644 --- a/vcl/source/gdi/gdimtf.cxx +++ b/vcl/source/gdi/gdimtf.cxx @@ -873,8 +873,8 @@ void GDIMetaFile::Move( long nX, long nY, long nDPIX, long nDPIY ) { aOffset = aMapVDev.LogicToPixel( aBaseOffset, GetPrefMapMode() ); MapMode aMap( aMapVDev.GetMapMode() ); - aOffset.Width() = aOffset.Width() * (double)aMap.GetScaleX(); - aOffset.Height() = aOffset.Height() * (double)aMap.GetScaleY(); + aOffset.Width() = static_cast(aOffset.Width() * (double)aMap.GetScaleX()); + aOffset.Height() = static_cast(aOffset.Height() * (double)aMap.GetScaleY()); } else aOffset = aMapVDev.LogicToLogic( aBaseOffset, GetPrefMapMode(), aMapVDev.GetMapMode() ); -- cgit v1.2.3 From 8be99a9e0f933044f92419e0f4151e7d12a5a0fb Mon Sep 17 00:00:00 2001 From: sj Date: Tue, 31 Aug 2010 10:43:12 +0200 Subject: impress198: #!73654# fixed crash (only happening on windows platform if 1 bit bitmap graphics are having a palette with more than 2 entries) --- vcl/win/source/gdi/salbmp.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vcl/win/source/gdi/salbmp.cxx b/vcl/win/source/gdi/salbmp.cxx index 444df039dd69..141c812dcd31 100644 --- a/vcl/win/source/gdi/salbmp.cxx +++ b/vcl/win/source/gdi/salbmp.cxx @@ -509,8 +509,8 @@ void WinSalBitmap::ReleaseBuffer( BitmapBuffer* pBuffer, bool bReadOnly ) { PBITMAPINFO pBI = (PBITMAPINFO) GlobalLock( mhDIB ); const USHORT nCount = pBuffer->maPalette.GetEntryCount(); - - memcpy( pBI->bmiColors, pBuffer->maPalette.ImplGetColorBuffer(), nCount * sizeof( RGBQUAD ) ); + const USHORT nDIBColorCount = ImplGetDIBColorCount( mhDIB ); + memcpy( pBI->bmiColors, pBuffer->maPalette.ImplGetColorBuffer(), Min( nDIBColorCount, nCount ) * sizeof( RGBQUAD ) ); GlobalUnlock( mhDIB ); } -- cgit v1.2.3 From ac41da2ac352859eec9961b29a5a82813a788c50 Mon Sep 17 00:00:00 2001 From: Kurt Zenker Date: Tue, 31 Aug 2010 12:21:23 +0200 Subject: masterfix: #i114215# builderror in canvas/source/vcl fixed --- canvas/source/vcl/canvashelper_texturefill.cxx | 1 + 1 file changed, 1 insertion(+) mode change 100755 => 100644 canvas/source/vcl/canvashelper_texturefill.cxx diff --git a/canvas/source/vcl/canvashelper_texturefill.cxx b/canvas/source/vcl/canvashelper_texturefill.cxx old mode 100755 new mode 100644 index 023ceb2b5005..7387b06e3e84 --- a/canvas/source/vcl/canvashelper_texturefill.cxx +++ b/canvas/source/vcl/canvashelper_texturefill.cxx @@ -704,6 +704,7 @@ namespace vclcanvas { ::basegfx::B2DRectangle aRect(0.0, 0.0, 1.0, 1.0); ::basegfx::B2DRectangle aTextureDeviceRect; + ::basegfx::B2DHomMatrix aTextureTransform; ::canvas::tools::calcTransformedRectBounds( aTextureDeviceRect, aRect, aTextureTransform ); -- cgit v1.2.3 From 6554b3de755e7b07c8d313d8bc7ae7b0c6638133 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Wed, 1 Sep 2010 12:27:38 +0200 Subject: fs33a: +i114247# sync WindowBits and Style --- svtools/source/contnr/svtreebx.cxx | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/svtools/source/contnr/svtreebx.cxx b/svtools/source/contnr/svtreebx.cxx index 3b1430e0df77..fa3cf8e734c1 100644 --- a/svtools/source/contnr/svtreebx.cxx +++ b/svtools/source/contnr/svtreebx.cxx @@ -1513,6 +1513,11 @@ void SvTreeListBox::SetWindowBits( WinBits nWinStyle ) pImp->SetWindowBits( nWinStyle ); pImp->Resize(); Invalidate(); + + if ( nWindowStyle != GetStyle() ) + { + SetStyle( nWindowStyle ); + } } void SvTreeListBox::PaintEntry( SvLBoxEntry* pEntry ) @@ -2521,7 +2526,12 @@ void SvTreeListBox::StateChanged( StateChangedType i_nStateChange ) SvLBox::StateChanged( i_nStateChange ); if ( ( i_nStateChange & STATE_CHANGE_STYLE ) != 0 ) { - SetWindowBits( GetStyle() ); + if ( GetStyle() != nWindowStyle ) + // keep in sync with our WindowBits + // TODO: SetWindowBits is weird, it should be completely replaced (in all clients) with SetStyle + // (or are there WindowBits which have a different meaning when interpreted as style? Wouldn't + // be the first time, but all of those should be fixed meanwhile ...) + SetWindowBits( GetStyle() ); } } -- cgit v1.2.3 From 4833151f7dcfcf692dfd28eb796a0baf8782f285 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Wed, 1 Sep 2010 21:56:16 +0200 Subject: dba33i: #i112694# care for mouse handlers which tamper with the tree: survive this --- svtools/source/contnr/svimpbox.cxx | 8 -------- 1 file changed, 8 deletions(-) diff --git a/svtools/source/contnr/svimpbox.cxx b/svtools/source/contnr/svimpbox.cxx index 484584828b9f..35324d551858 100644 --- a/svtools/source/contnr/svimpbox.cxx +++ b/svtools/source/contnr/svimpbox.cxx @@ -2172,14 +2172,6 @@ void SvImpLBox::MouseButtonDown( const MouseEvent& rMEvt ) SelAllDestrAnch( FALSE, TRUE ); // DeselectAll(); SetCursor( pEntry ); - DBG_ERROR( "Please report what you did to get this assertion to FS!" ); - // The entry which has been double-clicked changed - and we select it, again. - // I have situations where this behaviour does not make any sense at all - even more, it - // leads to hacks to revert it's results. - // So I'm not sure if this behaviour here is nonsense (which I believe at the moment), - // or if there are really scenarious where it dones make sense .... - // 07.12.2001 - 95727 - fs@openoffice.org - return; } if( pEntry->HasChilds() || pEntry->HasChildsOnDemand() ) -- cgit v1.2.3 From 0b78b565774f51ba9770783b5e4b5d0474307ee7 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Fri, 3 Sep 2010 14:50:14 +0200 Subject: fs33a: revert the original fix for HideInactiveSelection support in the tree list box, causing too much regressions. Fix it by using SetWindowBits instead of SetStyle --- svtools/source/contnr/svtreebx.cxx | 14 -------------- svtools/source/uno/treecontrolpeer.cxx | 6 +++--- 2 files changed, 3 insertions(+), 17 deletions(-) diff --git a/svtools/source/contnr/svtreebx.cxx b/svtools/source/contnr/svtreebx.cxx index fa3cf8e734c1..a8635c99d127 100644 --- a/svtools/source/contnr/svtreebx.cxx +++ b/svtools/source/contnr/svtreebx.cxx @@ -1513,11 +1513,6 @@ void SvTreeListBox::SetWindowBits( WinBits nWinStyle ) pImp->SetWindowBits( nWinStyle ); pImp->Resize(); Invalidate(); - - if ( nWindowStyle != GetStyle() ) - { - SetStyle( nWindowStyle ); - } } void SvTreeListBox::PaintEntry( SvLBoxEntry* pEntry ) @@ -2524,15 +2519,6 @@ void SvTreeListBox::DataChanged( const DataChangedEvent& rDCEvt ) void SvTreeListBox::StateChanged( StateChangedType i_nStateChange ) { SvLBox::StateChanged( i_nStateChange ); - if ( ( i_nStateChange & STATE_CHANGE_STYLE ) != 0 ) - { - if ( GetStyle() != nWindowStyle ) - // keep in sync with our WindowBits - // TODO: SetWindowBits is weird, it should be completely replaced (in all clients) with SetStyle - // (or are there WindowBits which have a different meaning when interpreted as style? Wouldn't - // be the first time, but all of those should be fixed meanwhile ...) - SetWindowBits( GetStyle() ); - } } void SvTreeListBox::InitSettings(BOOL bFont,BOOL bForeground,BOOL bBackground) diff --git a/svtools/source/uno/treecontrolpeer.cxx b/svtools/source/uno/treecontrolpeer.cxx index 5c1f4925783a..d1ea854cce61 100644 --- a/svtools/source/uno/treecontrolpeer.cxx +++ b/svtools/source/uno/treecontrolpeer.cxx @@ -1327,12 +1327,12 @@ void TreeControlPeer::setProperty( const ::rtl::OUString& PropertyName, const An sal_Bool bEnabled = sal_False; if ( aValue >>= bEnabled ) { - WinBits nStyle = rTree.GetStyle(); + WinBits nStyle = rTree.GetWindowBits(); if ( bEnabled ) nStyle |= WB_HIDESELECTION; else nStyle &= ~WB_HIDESELECTION; - rTree.SetStyle( nStyle ); + rTree.SetWindowBits( nStyle ); } } break; @@ -1428,7 +1428,7 @@ Any TreeControlPeer::getProperty( const ::rtl::OUString& PropertyName ) throw(Ru switch(nPropId) { case BASEPROPERTY_HIDEINACTIVESELECTION: - return Any( ( rTree.GetStyle() & WB_HIDESELECTION ) != 0 ? sal_True : sal_False ); + return Any( ( rTree.GetWindowBits() & WB_HIDESELECTION ) != 0 ? sal_True : sal_False ); case BASEPROPERTY_TREE_SELECTIONTYPE: { -- cgit v1.2.3 From 6a8fd4c76a969ac98d1aff91ff7442f43aee0006 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Fri, 3 Sep 2010 17:26:50 +0200 Subject: dba33i: #163542# VCLXWindow::OnProcessCallbacks: process window events while attempting to re-acquire the solar mutex - this prevents deadlocks with other threads trying to SendMessage into the main thread --- toolkit/inc/toolkit/helper/solarrelease.hxx | 27 ++++++++++++++++++++++++--- toolkit/source/awt/vclxwindow.cxx | 3 ++- 2 files changed, 26 insertions(+), 4 deletions(-) diff --git a/toolkit/inc/toolkit/helper/solarrelease.hxx b/toolkit/inc/toolkit/helper/solarrelease.hxx index d8938b41c220..e45a1b6ee2c3 100644 --- a/toolkit/inc/toolkit/helper/solarrelease.hxx +++ b/toolkit/inc/toolkit/helper/solarrelease.hxx @@ -41,15 +41,36 @@ namespace toolkit class ReleaseSolarMutex { sal_uInt32 mnLockCount; + const bool mbRescheduleDuringAcquire; + public: - ReleaseSolarMutex() + enum { - mnLockCount = Application::ReleaseSolarMutex(); + RescheduleDuringAcquire = true + }; + + public: + ReleaseSolarMutex( const bool i_rescheduleDuringAcquire = false ) + :mnLockCount( Application::ReleaseSolarMutex() ) + ,mbRescheduleDuringAcquire( i_rescheduleDuringAcquire ) + { + } ~ReleaseSolarMutex() { - Application::AcquireSolarMutex( mnLockCount ); + if ( mnLockCount > 0 ) + { + if ( mbRescheduleDuringAcquire ) + { + while ( !Application::GetSolarMutex().tryToAcquire() ) + { + Application::Reschedule(); + } + --mnLockCount; + } + Application::AcquireSolarMutex( mnLockCount ); + } } }; diff --git a/toolkit/source/awt/vclxwindow.cxx b/toolkit/source/awt/vclxwindow.cxx index efc2c40c6baa..1022d78a43ed 100644 --- a/toolkit/source/awt/vclxwindow.cxx +++ b/toolkit/source/awt/vclxwindow.cxx @@ -92,6 +92,7 @@ using ::com::sun::star::style::VerticalAlignment_MAKE_FIXED_SIZE; namespace WritingMode2 = ::com::sun::star::text::WritingMode2; namespace MouseWheelBehavior = ::com::sun::star::awt::MouseWheelBehavior; +using ::toolkit::ReleaseSolarMutex; //==================================================================== //= misc helpers @@ -339,7 +340,7 @@ IMPL_LINK( VCLXWindowImpl, OnProcessCallbacks, void*, EMPTYARG ) } { - ::toolkit::ReleaseSolarMutex aReleaseSolar; + ReleaseSolarMutex aReleaseSolar( ReleaseSolarMutex::RescheduleDuringAcquire ); for ( CallbackArray::const_iterator loop = aCallbacksCopy.begin(); loop != aCallbacksCopy.end(); ++loop -- cgit v1.2.3 From 741985f6fa860412496e14970b09c15cfebc732d Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Sat, 4 Sep 2010 17:24:00 +0100 Subject: cmcfixes78: #i113054# WaE --- svtools/source/uno/wizard/unowizard.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/svtools/source/uno/wizard/unowizard.cxx b/svtools/source/uno/wizard/unowizard.cxx index 9440c0e69f26..147b11aceb11 100644 --- a/svtools/source/uno/wizard/unowizard.cxx +++ b/svtools/source/uno/wizard/unowizard.cxx @@ -414,7 +414,7 @@ namespace svt { namespace uno ::osl::MutexGuard aGuard( m_aMutex ); WizardShell* pWizardImpl = dynamic_cast< WizardShell* >( m_pDialog ); - ENSURE_OR_RETURN_FALSE( pWizardImpl, "Wizard::getCurrentPage: invalid dialog implementation!" ); + ENSURE_OR_RETURN( pWizardImpl, "Wizard::getCurrentPage: invalid dialog implementation!", Reference< XWizardPage >() ); return pWizardImpl->getCurrentWizardPage(); } -- cgit v1.2.3 From 4e690b6439201fd2280081d42455d9daae70666d Mon Sep 17 00:00:00 2001 From: "Thomas Lange [tl]" Date: Mon, 6 Sep 2010 10:02:33 +0200 Subject: cws tl82: #i114160# SimplePasswordRequest and respective dialog --- comphelper/inc/comphelper/docpasswordrequest.hxx | 54 ++++++++++++++----- comphelper/source/misc/docpasswordrequest.cxx | 67 +++++++++++++++++++++++- comphelper/source/misc/makefile.mk | 0 3 files changed, 107 insertions(+), 14 deletions(-) mode change 100644 => 100755 comphelper/inc/comphelper/docpasswordrequest.hxx mode change 100644 => 100755 comphelper/source/misc/docpasswordrequest.cxx mode change 100644 => 100755 comphelper/source/misc/makefile.mk diff --git a/comphelper/inc/comphelper/docpasswordrequest.hxx b/comphelper/inc/comphelper/docpasswordrequest.hxx old mode 100644 new mode 100755 index cf04d22c7a6d..effc47392078 --- a/comphelper/inc/comphelper/docpasswordrequest.hxx +++ b/comphelper/inc/comphelper/docpasswordrequest.hxx @@ -34,8 +34,12 @@ #include #include + namespace comphelper { +class AbortContinuation; +class PasswordContinuation; + // ============================================================================ /** Selects which UNO document password request type to use. */ @@ -47,8 +51,37 @@ enum DocPasswordRequestType // ============================================================================ -class AbortContinuation; -class PasswordContinuation; +class COMPHELPER_DLLPUBLIC SimplePasswordRequest : + public ::com::sun::star::task::XInteractionRequest, + public ::cppu::OWeakObject +{ +public: + explicit SimplePasswordRequest( com::sun::star::task::PasswordRequestMode eMode ); + virtual ~SimplePasswordRequest(); + + // XInterface / OWeakObject + virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& aType ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL acquire( ) throw (); + virtual void SAL_CALL release( ) throw (); + + sal_Bool isAbort() const; + sal_Bool isPassword() const; + + ::rtl::OUString getPassword() const; + +private: + // XInteractionRequest + virtual ::com::sun::star::uno::Any SAL_CALL getRequest() throw( ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionContinuation > > SAL_CALL getContinuations() throw( ::com::sun::star::uno::RuntimeException ); + +private: + ::com::sun::star::uno::Any maRequest; + ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionContinuation > > maContinuations; + AbortContinuation * mpAbort; + PasswordContinuation * mpPassword; +}; + +// ============================================================================ /** Implements the task.XInteractionRequest interface for requesting a password string for a document. @@ -79,20 +112,15 @@ public: sal_Bool getRecommendReadOnly() const; private: - virtual ::com::sun::star::uno::Any SAL_CALL - getRequest() throw( ::com::sun::star::uno::RuntimeException ); - - virtual ::com::sun::star::uno::Sequence< - ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionContinuation > > SAL_CALL - getContinuations() throw( ::com::sun::star::uno::RuntimeException ); + // XInteractionRequest + virtual ::com::sun::star::uno::Any SAL_CALL getRequest() throw( ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionContinuation > > SAL_CALL getContinuations() throw( ::com::sun::star::uno::RuntimeException ); private: - ::com::sun::star::uno::Any maRequest; + ::com::sun::star::uno::Any maRequest; ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionContinuation > > maContinuations; - AbortContinuation* mpAbort; - PasswordContinuation* mpPassword; - - sal_Bool mbPasswordToModify; + AbortContinuation * mpAbort; + PasswordContinuation * mpPassword; }; // ============================================================================ diff --git a/comphelper/source/misc/docpasswordrequest.cxx b/comphelper/source/misc/docpasswordrequest.cxx old mode 100644 new mode 100755 index 17cdb0ae2d92..15c2e09ba0f3 --- a/comphelper/source/misc/docpasswordrequest.cxx +++ b/comphelper/source/misc/docpasswordrequest.cxx @@ -31,6 +31,7 @@ #include "comphelper/docpasswordrequest.hxx" #include #include +#include #include #include @@ -44,6 +45,7 @@ using ::com::sun::star::uno::XInterface; using ::com::sun::star::task::InteractionClassification_QUERY; using ::com::sun::star::task::DocumentMSPasswordRequest2; using ::com::sun::star::task::DocumentPasswordRequest2; +using ::com::sun::star::task::PasswordRequest; using ::com::sun::star::task::PasswordRequestMode; using ::com::sun::star::task::XInteractionAbort; using ::com::sun::star::task::XInteractionContinuation; @@ -98,11 +100,74 @@ private: // ============================================================================ +SimplePasswordRequest::SimplePasswordRequest( PasswordRequestMode eMode ) +: mpAbort( NULL ) +, mpPassword( NULL ) +{ + PasswordRequest aRequest( OUString(), Reference< XInterface >(), + InteractionClassification_QUERY, eMode ); + maRequest <<= aRequest; + + maContinuations.realloc( 2 ); + maContinuations[ 0 ].set( mpAbort = new AbortContinuation ); + maContinuations[ 1 ].set( mpPassword = new PasswordContinuation ); +} + +SimplePasswordRequest::~SimplePasswordRequest() +{ +} + +/*uno::*/Any SAL_CALL SimplePasswordRequest::queryInterface( const /*uno::*/Type& rType ) throw (RuntimeException) +{ + return ::cppu::queryInterface ( rType, + // OWeakObject interfaces + dynamic_cast< XInterface* > ( (XInteractionRequest *) this ), + static_cast< XWeak* > ( this ), + // my own interfaces + static_cast< XInteractionRequest* > ( this ) ); +} + +void SAL_CALL SimplePasswordRequest::acquire( ) throw () +{ + OWeakObject::acquire(); +} + +void SAL_CALL SimplePasswordRequest::release( ) throw () +{ + OWeakObject::release(); +} + +sal_Bool SimplePasswordRequest::isAbort() const +{ + return mpAbort->isSelected(); +} + +sal_Bool SimplePasswordRequest::isPassword() const +{ + return mpPassword->isSelected(); +} + +OUString SimplePasswordRequest::getPassword() const +{ + return mpPassword->getPassword(); +} + +Any SAL_CALL SimplePasswordRequest::getRequest() throw( RuntimeException ) +{ + return maRequest; +} + +Sequence< Reference< XInteractionContinuation > > SAL_CALL SimplePasswordRequest::getContinuations() throw( RuntimeException ) +{ + return maContinuations; +} + +// ============================================================================ + DocPasswordRequest::DocPasswordRequest( DocPasswordRequestType eType, PasswordRequestMode eMode, const OUString& rDocumentName, sal_Bool bPasswordToModify ) : mpAbort( NULL ) , mpPassword( NULL ) -, mbPasswordToModify( bPasswordToModify ) { switch( eType ) { diff --git a/comphelper/source/misc/makefile.mk b/comphelper/source/misc/makefile.mk old mode 100644 new mode 100755 -- cgit v1.2.3 From fddc07c4e769a17dd80201ad62cebb3946b5ddce Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Mon, 6 Sep 2010 09:27:11 +0100 Subject: cmcfixes78: #i113054# use rtl::ByteSequence instead of Sequence< sal_Int8 > for trivial pre-main sequences --- sax/source/tools/fastserializer.cxx | 66 +++++++++++++++++++------------------ 1 file changed, 34 insertions(+), 32 deletions(-) diff --git a/sax/source/tools/fastserializer.cxx b/sax/source/tools/fastserializer.cxx index b0318516b72c..af89761a2c86 100644 --- a/sax/source/tools/fastserializer.cxx +++ b/sax/source/tools/fastserializer.cxx @@ -27,6 +27,7 @@ #include "fastserializer.hxx" #include +#include #include #include @@ -41,6 +42,7 @@ using ::rtl::OUStringToOString; using ::com::sun::star::uno::Reference; using ::com::sun::star::uno::RuntimeException; using ::com::sun::star::uno::Sequence; +using ::com::sun::star::uno::toUnoSequence; using ::com::sun::star::xml::FastAttribute; using ::com::sun::star::xml::Attribute; using ::com::sun::star::xml::sax::SAXException; @@ -52,15 +54,15 @@ using ::com::sun::star::io::NotConnectedException; using ::com::sun::star::io::IOException; using ::com::sun::star::io::BufferSizeExceededException; -static Sequence< sal_Int8 > aClosingBracket((sal_Int8 *)">", 1); -static Sequence< sal_Int8 > aSlashAndClosingBracket((sal_Int8 *)"/>", 2); -static Sequence< sal_Int8 > aColon((sal_Int8 *)":", 1); -static Sequence< sal_Int8 > aOpeningBracket((sal_Int8 *)"<", 1); -static Sequence< sal_Int8 > aOpeningBracketAndSlash((sal_Int8 *)" aQuote((sal_Int8 *)"\"", 1); -static Sequence< sal_Int8 > aEqualSignAndQuote((sal_Int8 *)"=\"", 2); -static Sequence< sal_Int8 > aSpace((sal_Int8 *)" ", 1); -static Sequence< sal_Int8 > aXmlHeader((sal_Int8*) "\n", 56); +static rtl::ByteSequence aClosingBracket((const sal_Int8 *)">", 1); +static rtl::ByteSequence aSlashAndClosingBracket((const sal_Int8 *)"/>", 2); +static rtl::ByteSequence aColon((const sal_Int8 *)":", 1); +static rtl::ByteSequence aOpeningBracket((const sal_Int8 *)"<", 1); +static rtl::ByteSequence aOpeningBracketAndSlash((const sal_Int8 *)"\n", 56); #define HAS_NAMESPACE(x) ((x & 0xffff0000) != 0) #define NAMESPACE(x) (x >> 16) @@ -74,7 +76,7 @@ namespace sax_fastparser { { if (!mxOutputStream.is()) return; - writeBytes(aXmlHeader); + writeBytes(toUnoSequence(aXmlHeader)); } OUString FastSaxSerializer::escapeXml( const OUString& s ) @@ -116,7 +118,7 @@ namespace sax_fastparser { { if( HAS_NAMESPACE( nElement ) ) { writeBytes(mxFastTokenHandler->getUTF8Identifier(NAMESPACE(nElement))); - writeBytes(aColon); + writeBytes(toUnoSequence(aColon)); writeBytes(mxFastTokenHandler->getUTF8Identifier(TOKEN(nElement))); } else writeBytes(mxFastTokenHandler->getUTF8Identifier(nElement)); @@ -128,12 +130,12 @@ namespace sax_fastparser { if (!mxOutputStream.is()) return; - writeBytes(aOpeningBracket); + writeBytes(toUnoSequence(aOpeningBracket)); writeId(Element); writeFastAttributeList(Attribs); - writeBytes(aClosingBracket); + writeBytes(toUnoSequence(aClosingBracket)); } void SAL_CALL FastSaxSerializer::startUnknownElement( const OUString& Namespace, const OUString& Name, const Reference< XFastAttributeList >& Attribs ) @@ -142,19 +144,19 @@ namespace sax_fastparser { if (!mxOutputStream.is()) return; - writeBytes(aOpeningBracket); + writeBytes(toUnoSequence(aOpeningBracket)); if (Namespace.getLength()) { write(Namespace); - writeBytes(aColon); + writeBytes(toUnoSequence(aColon)); } write(Name); writeFastAttributeList(Attribs); - writeBytes(aClosingBracket); + writeBytes(toUnoSequence(aClosingBracket)); } void SAL_CALL FastSaxSerializer::endFastElement( ::sal_Int32 Element ) @@ -163,11 +165,11 @@ namespace sax_fastparser { if (!mxOutputStream.is()) return; - writeBytes(aOpeningBracketAndSlash); + writeBytes(toUnoSequence(aOpeningBracketAndSlash)); writeId(Element); - writeBytes(aClosingBracket); + writeBytes(toUnoSequence(aClosingBracket)); } void SAL_CALL FastSaxSerializer::endUnknownElement( const OUString& Namespace, const OUString& Name ) @@ -176,17 +178,17 @@ namespace sax_fastparser { if (!mxOutputStream.is()) return; - writeBytes(aOpeningBracketAndSlash); + writeBytes(toUnoSequence(aOpeningBracketAndSlash)); if (Namespace.getLength()) { write(Namespace); - writeBytes(aColon); + writeBytes(toUnoSequence(aColon)); } write(Name); - writeBytes(aClosingBracket); + writeBytes(toUnoSequence(aClosingBracket)); } void SAL_CALL FastSaxSerializer::singleFastElement( ::sal_Int32 Element, const Reference< XFastAttributeList >& Attribs ) @@ -195,12 +197,12 @@ namespace sax_fastparser { if (!mxOutputStream.is()) return; - writeBytes(aOpeningBracket); + writeBytes(toUnoSequence(aOpeningBracket)); writeId(Element); writeFastAttributeList(Attribs); - writeBytes(aSlashAndClosingBracket); + writeBytes(toUnoSequence(aSlashAndClosingBracket)); } void SAL_CALL FastSaxSerializer::singleUnknownElement( const OUString& Namespace, const OUString& Name, const Reference< XFastAttributeList >& Attribs ) @@ -209,19 +211,19 @@ namespace sax_fastparser { if (!mxOutputStream.is()) return; - writeBytes(aOpeningBracket); + writeBytes(toUnoSequence(aOpeningBracket)); if (Namespace.getLength()) { write(Namespace); - writeBytes(aColon); + writeBytes(toUnoSequence(aColon)); } write(Name); writeFastAttributeList(Attribs); - writeBytes(aSlashAndClosingBracket); + writeBytes(toUnoSequence(aSlashAndClosingBracket)); } void SAL_CALL FastSaxSerializer::characters( const OUString& aChars ) @@ -251,12 +253,12 @@ namespace sax_fastparser { sal_Int32 nAttrLength = aAttrSeq.getLength(); for (sal_Int32 i = 0; i < nAttrLength; i++) { - writeBytes(aSpace); + writeBytes(toUnoSequence(aSpace)); write(pAttr[i].Name); - writeBytes(aEqualSignAndQuote); + writeBytes(toUnoSequence(aEqualSignAndQuote)); write(escapeXml(pAttr[i].Value)); - writeBytes(aQuote); + writeBytes(toUnoSequence(aQuote)); } Sequence< FastAttribute > aFastAttrSeq = Attribs->getFastAttributes(); @@ -264,16 +266,16 @@ namespace sax_fastparser { sal_Int32 nFastAttrLength = aFastAttrSeq.getLength(); for (sal_Int32 j = 0; j < nFastAttrLength; j++) { - writeBytes(aSpace); + writeBytes(toUnoSequence(aSpace)); sal_Int32 nToken = pFastAttr[j].Token; writeId(nToken); - writeBytes(aEqualSignAndQuote); + writeBytes(toUnoSequence(aEqualSignAndQuote)); write(escapeXml(Attribs->getValue(pFastAttr[j].Token))); - writeBytes(aQuote); + writeBytes(toUnoSequence(aQuote)); } } -- cgit v1.2.3 From da76e1e348c547976d2e1d0a3cdf4fa55dc7a9da Mon Sep 17 00:00:00 2001 From: Tobias Krause Date: Mon, 6 Sep 2010 12:21:00 +0200 Subject: fwk156: #114339# selection listener fixed --- svtools/inc/svtools/table/tabledatawindow.hxx | 1 - svtools/source/table/tabledatawindow.cxx | 7 ++++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/svtools/inc/svtools/table/tabledatawindow.hxx b/svtools/inc/svtools/table/tabledatawindow.hxx index 9a6ece489119..829feecd5836 100644 --- a/svtools/inc/svtools/table/tabledatawindow.hxx +++ b/svtools/inc/svtools/table/tabledatawindow.hxx @@ -55,7 +55,6 @@ namespace svt { namespace table Link m_aMouseButtonDownHdl; Link m_aMouseButtonUpHdl; Link m_aSelectHdl; - RowPos m_nRowAlreadySelected; public: TableDataWindow( TableControl_Impl& _rTableControl ); inline void SetMouseButtonDownHdl( const Link& rLink ) { m_aMouseButtonDownHdl = rLink; } diff --git a/svtools/source/table/tabledatawindow.cxx b/svtools/source/table/tabledatawindow.cxx index e2e1ce5353fe..bbd7f6829369 100644 --- a/svtools/source/table/tabledatawindow.cxx +++ b/svtools/source/table/tabledatawindow.cxx @@ -45,7 +45,6 @@ namespace svt { namespace table TableDataWindow::TableDataWindow( TableControl_Impl& _rTableControl ) :Window( &_rTableControl.getAntiImpl() ) ,m_rTableControl ( _rTableControl ) - ,m_nRowAlreadySelected( -1 ) { // by default, use the background as determined by the style settings const Color aWindowColor( GetSettings().GetStyleSettings().GetFieldColor() ); @@ -110,15 +109,17 @@ namespace svt { namespace table { Point aPoint = rMEvt.GetPosPixel(); RowPos nCurRow = m_rTableControl.getCurrentRow(aPoint); + std::vector selectedRows(m_rTableControl.getSelectedRows()); if ( !m_rTableControl.getInputHandler()->MouseButtonDown( m_rTableControl, rMEvt ) ) Window::MouseButtonDown( rMEvt ); else { if(nCurRow >= 0 && m_rTableControl.getSelEngine()->GetSelectionMode() != NO_SELECTION) { - if( m_nRowAlreadySelected != nCurRow ) + bool found = std::find(selectedRows.begin(),selectedRows.end(), nCurRow) != selectedRows.end(); + + if( !found ) { - m_nRowAlreadySelected = nCurRow; m_aSelectHdl.Call( NULL ); } } -- cgit v1.2.3 From 6ed6fc0f4f2609a738d531de1545a8571bec56fc Mon Sep 17 00:00:00 2001 From: Tobias Krause Date: Mon, 6 Sep 2010 12:21:55 +0200 Subject: fwk156: #114340# keyboard navigation fixed --- svtools/source/table/defaultinputhandler.cxx | 1 + 1 file changed, 1 insertion(+) diff --git a/svtools/source/table/defaultinputhandler.cxx b/svtools/source/table/defaultinputhandler.cxx index ad8f7a7562d3..f6a58ad17efe 100644 --- a/svtools/source/table/defaultinputhandler.cxx +++ b/svtools/source/table/defaultinputhandler.cxx @@ -173,6 +173,7 @@ namespace svt { namespace table if ( ( pActions->nKeyCode == nKeyCode ) && ( pActions->nKeyModifier == rKeyCode.GetAllModifier() ) ) { bHandled = _rControl.dispatchAction( pActions->eAction ); + bHandled = true; // always handled issue #i114340 break; } } -- cgit v1.2.3 From 20aee6eb45be91a7c5bc67f9b30ebbf73e3fa769 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Mon, 6 Sep 2010 12:31:08 +0100 Subject: cmcfixes78: #i114344# fix up this odd LINUXX pointless looking thing --- vcl/util/makefile.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vcl/util/makefile.mk b/vcl/util/makefile.mk index 04bc3f13ce4d..b864b7cb2685 100644 --- a/vcl/util/makefile.mk +++ b/vcl/util/makefile.mk @@ -391,7 +391,7 @@ SHL4STDLIBS+= $(XRANDR_LIBS) .ENDIF .ENDIF -.IF "$(OS)$(CPU)" == "LINUXX" +.IF "$(OS)$(CPU)" == "LINUXX" && "$(LIBRARY_PATH)" != "" EXTRALIBPATHS+=-L$(LIBRARY_PATH) .ENDIF # "$(OS)$(CPU)" == "LINUXX" .ENDIF # "$(ENABLE_GTK)" != "" -- cgit v1.2.3 From 01cec2c62e5a0dae80762396bf89a122dc62f172 Mon Sep 17 00:00:00 2001 From: obo Date: Tue, 7 Sep 2010 10:46:05 +0200 Subject: obo50: #i114363# Don't create *.pyc files on solver --- l10ntools/prj/build.lst | 3 ++- l10ntools/prj/d.lst | 16 +++++++----- l10ntools/scripts/makefile.mk | 59 +++++++++++++++++++++++++++++++++++++++++++ l10ntools/scripts/xhtex | 8 ------ l10ntools/scripts/xtxex | 8 ------ 5 files changed, 71 insertions(+), 23 deletions(-) create mode 100644 l10ntools/scripts/makefile.mk diff --git a/l10ntools/prj/build.lst b/l10ntools/prj/build.lst index 8387154897b3..d8a2e8c00649 100644 --- a/l10ntools/prj/build.lst +++ b/l10ntools/prj/build.lst @@ -1,6 +1,7 @@ -tr l10ntools : tools LIBXSLT:libxslt BERKELEYDB:berkeleydb LUCENE:lucene NULL +tr l10ntools : tools LIBXSLT:libxslt BERKELEYDB:berkeleydb LUCENE:lucene PYTHON:python NULL tr l10ntools usr1 - all tr_mkout NULL tr l10ntools\inc nmake - all tr_inc NULL +tr l10ntools\scripts nmake - all tr_scripts NULL tr l10ntools\source nmake - all tr_src tr_inc NULL tr l10ntools\layout nmake - all rt_layout tr_src tr_inc NULL tr l10ntools\java\jpropex nmake - all tr_blah NULL diff --git a/l10ntools/prj/d.lst b/l10ntools/prj/d.lst index 53c846832fca..9d493e1e9673 100644 --- a/l10ntools/prj/d.lst +++ b/l10ntools/prj/d.lst @@ -47,14 +47,18 @@ mkdir: %_DEST%\bin%_EXT%\help\com\sun\star\help ..\scripts\localize %_DEST%\bin%_EXT%\localize ..\scripts\fast_merge.pl %_DEST%\bin%_EXT%\fast_merge.pl ..\scripts\keyidGen.pl %_DEST%\bin%_EXT%\keyidGen.pl -..\scripts\tool\const.py %_DEST%\bin%_EXT%\const.py -..\scripts\tool\l10ntool.py %_DEST%\bin%_EXT%\l10ntool.py -..\scripts\tool\xtxex.py %_DEST%\bin%_EXT%\xtxex.py -..\scripts\tool\sdf.py %_DEST%\bin%_EXT%\sdf.py -..\scripts\tool\xhtex.py %_DEST%\bin%_EXT%\xhtex.py -..\scripts\tool\pseudo.py %_DEST%\bin%_EXT%\pseudo.py ..\scripts\xtxex %_DEST%\bin%_EXT%\xtxex ..\scripts\xhtex %_DEST%\bin%_EXT%\xhtex +..\%__SRC%\bin\const.py %_DEST%\bin%_EXT%\const.py +..\%__SRC%\bin\l10ntool.py %_DEST%\bin%_EXT%\l10ntool.py +..\%__SRC%\bin\pseudo.py %_DEST%\bin%_EXT%\pseudo.py +..\%__SRC%\bin\sdf.py %_DEST%\bin%_EXT%\sdf.py +..\%__SRC%\bin\const.pyc %_DEST%\bin%_EXT%\const.pyc +..\%__SRC%\bin\l10ntool.pyc %_DEST%\bin%_EXT%\l10ntool.pyc +..\%__SRC%\bin\pseudo.pyc %_DEST%\bin%_EXT%\pseudo.pyc +..\%__SRC%\bin\sdf.pyc %_DEST%\bin%_EXT%\sdf.pyc +..\%__SRC%\bin\xhtex.py %_DEST%\bin%_EXT%\xhtex.py +..\%__SRC%\bin\xtxex.py %_DEST%\bin%_EXT%\xtxex.py ..\inc\export.hxx %_DEST%\inc%_EXT%\l10ntools\export.hxx ..\inc\l10ntools\directory.hxx %_DEST%\inc%_EXT%\l10ntools\directory.hxx diff --git a/l10ntools/scripts/makefile.mk b/l10ntools/scripts/makefile.mk new file mode 100644 index 000000000000..8bfa64e3fbad --- /dev/null +++ b/l10ntools/scripts/makefile.mk @@ -0,0 +1,59 @@ +#************************************************************************* +# +# 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 +# +# for a copy of the LGPLv3 License. +# +#************************************************************************* + +# Copy *.py files into output tree and call a script once to +# force python to create the *.pyc files. + +PRJ=.. +TARGET = l10ntools_dummy_pyc + +.INCLUDE: settings.mk + +.IF "$(SYSTEM_PYTHON)"!="YES" +PYTHON=$(AUGMENT_LIBRARY_PATH) $(WRAPCMD) $(SOLARBINDIR)/python +.ELSE # "$(SYSTEM_PYTHON)"!="YES" +PYTHON=$(AUGMENT_LIBRARY_PATH) $(WRAPCMD) python +.ENDIF # "$(SYSTEM_PYTHON)"!="YES" + +PYFILES = $(BIN)$/const.py \ + $(BIN)$/l10ntool.py \ + $(BIN)$/pseudo.py \ + $(BIN)$/sdf.py \ + $(BIN)$/xhtex.py \ + $(BIN)$/xtxex.py + +.INCLUDE: target.mk + +.IGNORE : create_pyc +ALLTAR : create_pyc +create_pyc : $(PYFILES) + @$(PYTHON) $(BIN)/xtxex.py >& /dev/null + +$(BIN)$/%.py : tool/%.py + @$(COPY) $< $@ + + diff --git a/l10ntools/scripts/xhtex b/l10ntools/scripts/xhtex index ca307cf2d4a4..d337694c589b 100755 --- a/l10ntools/scripts/xhtex +++ b/l10ntools/scripts/xhtex @@ -31,16 +31,8 @@ if [ x${SOLARENV}x = xx ]; then exit 1 fi -if [ ${GUI} = "WNT" ]; then if [ x${SOLARVER}x = xx -o x${UPDMINOREXT}x = xx ]; then exec python $SOLARVERSION/$INPATH/bin/xhtex.py "$@" else exec python $SOLARVERSION/$INPATH/bin$UPDMINOREXT/xhtex.py "$@" fi -else -if [ x${SOLARVER}x = xx -o x${UPDMINOREXT}x = xx ]; then - exec python -B $SOLARVERSION/$INPATH/bin/xhtex.py "$@" -else - exec python -B $SOLARVERSION/$INPATH/bin$UPDMINOREXT/xhtex.py "$@" -fi -fi diff --git a/l10ntools/scripts/xtxex b/l10ntools/scripts/xtxex index fb54c1aee36c..01a70ae57d80 100755 --- a/l10ntools/scripts/xtxex +++ b/l10ntools/scripts/xtxex @@ -31,17 +31,9 @@ if [ x${SOLARENV}x = xx ]; then exit 1 fi -if [ ${GUI} = "WNT" ]; then if [ x${SOLARVER}x = xx -o x${UPDMINOREXT}x = xx ]; then exec python $SOLARVERSION/$INPATH/bin/xtxex.py "$@" else exec python $SOLARVERSION/$INPATH/bin$UPDMINOREXT/xtxex.py "$@" fi -else -if [ x${SOLARVER}x = xx -o x${UPDMINOREXT}x = xx ]; then - exec python -B $SOLARVERSION/$INPATH/bin/xtxex.py "$@" -else - exec python -B $SOLARVERSION/$INPATH/bin$UPDMINOREXT/xtxex.py "$@" -fi -fi -- cgit v1.2.3 From 74729cf12e63d837a7bdad16ae0089973635d7fc Mon Sep 17 00:00:00 2001 From: Ivo Hinkelmann Date: Tue, 7 Sep 2010 19:18:26 +0200 Subject: #i10000# open file mode r+ -> r --- l10ntools/scripts/tool/xhtex.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/l10ntools/scripts/tool/xhtex.py b/l10ntools/scripts/tool/xhtex.py index c427a7feccdd..ae973aacc555 100644 --- a/l10ntools/scripts/tool/xhtex.py +++ b/l10ntools/scripts/tool/xhtex.py @@ -108,7 +108,7 @@ class Xhtex(AbstractL10nTool): def parse_file(self, filename): document = "" try: - f = open(filename,"r+") + f = open(filename,"r") document = f.read() except IOError: print "ERROR: Can not read file " + filename -- cgit v1.2.3 From 361766edb994aa0abe9ee9af2f28cf28416b0f1b Mon Sep 17 00:00:00 2001 From: "Herbert Duerr [hdu]" Date: Wed, 8 Sep 2010 11:21:23 +0200 Subject: #i114245# fix debug warnings in CTL glyph fallback --- vcl/win/source/gdi/winlayout.cxx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/vcl/win/source/gdi/winlayout.cxx b/vcl/win/source/gdi/winlayout.cxx index 806d3b420b33..bc80cbf94fb8 100755 --- a/vcl/win/source/gdi/winlayout.cxx +++ b/vcl/win/source/gdi/winlayout.cxx @@ -2203,7 +2203,9 @@ void UniscribeLayout::Simplify( bool /*bIsBase*/ ) const int k = mpGlyphs2Chars[ i ]; mpGlyphs2Chars[ j ] = k; const int nRelGlyphPos = (j++) - rVI.mnMinGlyphPos; - mpLogClusters[ k ] = static_cast(nRelGlyphPos); + if( k < 0) // extra glyphs are already mapped + continue; + mpLogClusters[ k ] = static_cast(nRelGlyphPos); } rVI.mnEndGlyphPos = j; -- cgit v1.2.3 From a3c8a0ed0c5c6be1cb5c940750222f6381608bd7 Mon Sep 17 00:00:00 2001 From: sb Date: Fri, 10 Sep 2010 13:10:07 +0200 Subject: sb129: #i113189# change UNO components to use passive registration --- canvas/prj/d.lst | 7 + canvas/source/cairo/cairocanvas.component | 37 ++ canvas/source/cairo/exports.dxp | 1 - canvas/source/cairo/makefile.mk | 8 + canvas/source/directx/directx5canvas.component | 34 ++ canvas/source/directx/directx9canvas.component | 34 ++ canvas/source/directx/exports.dxp | 1 - canvas/source/directx/gdipluscanvas.component | 37 ++ canvas/source/directx/makefile.mk | 22 + canvas/source/factory/canvasfactory.component | 34 ++ canvas/source/factory/cf_service.cxx | 8 - canvas/source/factory/makefile.mk | 7 + canvas/source/null/exports.dxp | 1 - canvas/source/simplecanvas/exports.dxp | 1 - canvas/source/simplecanvas/makefile.mk | 8 + canvas/source/simplecanvas/simplecanvas.component | 34 ++ canvas/source/vcl/exports.dxp | 1 - canvas/source/vcl/makefile.mk | 8 + canvas/source/vcl/vclcanvas.component | 37 ++ comphelper/inc/comphelper/componentmodule.hxx | 29 -- comphelper/inc/comphelper/servicedecl.hxx | 27 -- comphelper/prj/d.lst | 1 + comphelper/source/misc/componentmodule.cxx | 58 --- comphelper/source/misc/servicedecl.cxx | 31 -- comphelper/util/comphelp4.component | 70 +++ comphelper/util/exports.dxp | 1 - comphelper/util/makefile.mk | 8 + dtrans/prj/d.lst | 5 + dtrans/source/cnttype/exports.dxp | 1 - dtrans/source/cnttype/mctfentry.cxx | 29 -- dtrans/source/generic/dtrans.component | 37 ++ dtrans/source/generic/dtrans.cxx | 37 -- dtrans/source/generic/exports.dxp | 1 - dtrans/source/generic/makefile.mk | 8 + dtrans/source/os2/clipb/Os2Service.cxx | 22 - dtrans/source/os2/clipb/exports.dxp | 1 - dtrans/source/win32/clipb/exports.dxp | 1 - dtrans/source/win32/clipb/wcbentry.cxx | 29 -- dtrans/source/win32/dnd/dndentry.cxx | 33 -- dtrans/source/win32/dnd/exports.dxp | 1 - dtrans/source/win32/ftransl/exports.dxp | 1 - dtrans/source/win32/ftransl/ftranslentry.cxx | 29 -- dtrans/util/dnd.component | 37 ++ dtrans/util/exports.dxp | 1 - dtrans/util/ftransl.component | 34 ++ dtrans/util/makefile.mk | 29 ++ dtrans/util/mcnttype.component | 34 ++ dtrans/util/sysdtrans.component | 34 ++ i18npool/prj/d.lst | 2 + i18npool/source/localedata/data/makefile.mk | 212 ++------- i18npool/source/localedata/saxparser.cxx | 35 +- .../source/registerservices/registerservices.cxx | 23 - i18npool/source/search/i18nsearch.component | 34 ++ i18npool/source/search/makefile.mk | 8 + i18npool/source/search/textsearch.cxx | 19 - i18npool/util/i18npool.component | 484 +++++++++++++++++++++ i18npool/util/makefile.mk | 8 + sax/prj/d.lst | 3 + sax/source/expatwrap/makefile.mk | 11 + sax/source/expatwrap/sax.component | 37 ++ sax/source/expatwrap/sax_expat.cxx | 31 -- sax/source/fastparser/facreg.cxx | 28 -- sax/source/fastparser/fastsax.component | 37 ++ sax/source/fastparser/makefile.mk | 7 +- sot/prj/d.lst | 1 + sot/source/unoolestorage/register.cxx | 28 -- sot/util/makefile.mk | 8 + sot/util/sot.component | 34 ++ svl/prj/d.lst | 3 + svl/source/fsstor/fsfactory.cxx | 24 - svl/source/fsstor/fsstorage.component | 35 ++ svl/source/fsstor/makefile.mk | 8 + svl/source/passwordcontainer/makefile.mk | 8 + .../passwordcontainer/passwordcontainer.component | 34 ++ svl/source/passwordcontainer/passwordcontainer.cxx | 18 - svl/source/uno/registerservices.cxx | 31 -- svl/util/makefile.mk | 8 + svl/util/svl.component | 40 ++ svtools/prj/d.lst | 3 + .../hatchwindow/hatchwindowfactory.component | 38 ++ svtools/source/hatchwindow/hatchwindowfactory.cxx | 39 -- svtools/source/hatchwindow/makefile.mk | 8 + svtools/source/productregistration/makefile.mk | 8 + .../productregistration/productregistration.cxx | 19 - .../productregistration.uno.component | 34 ++ svtools/source/uno/miscservices.cxx | 49 --- svtools/util/makefile.mk | 8 + svtools/util/svt.component | 49 +++ toolkit/prj/d.lst | 1 + toolkit/source/awt/asynccallback.cxx | 6 - toolkit/source/helper/registerservices.cxx | 87 ---- toolkit/source/layout/core/factory.cxx | 27 -- toolkit/util/makefile.mk | 8 + toolkit/util/tk.component | 298 +++++++++++++ unotools/prj/d.lst | 1 + unotools/source/ucbhelper/xtempfile.cxx | 58 --- unotools/util/makefile.mk | 8 + unotools/util/utl.component | 34 ++ vcl/aqua/source/dtrans/aqua_service.cxx | 22 - vcl/prj/d.lst | 1 + vcl/source/components/factory.cxx | 56 --- vcl/util/makefile.mk | 13 + vcl/util/vcl.component | 49 +++ vcl/util/vcl.macosx.component | 49 +++ vcl/util/vcl.windows.component | 40 ++ vcl/workben/makefile.mk | 25 +- vcl/workben/svdem.cxx | 2 +- vcl/workben/svptest.cxx | 2 +- vcl/workben/vcldemo.cxx | 2 +- 109 files changed, 2108 insertions(+), 1144 deletions(-) create mode 100644 canvas/source/cairo/cairocanvas.component create mode 100644 canvas/source/directx/directx5canvas.component create mode 100644 canvas/source/directx/directx9canvas.component create mode 100644 canvas/source/directx/gdipluscanvas.component create mode 100644 canvas/source/factory/canvasfactory.component create mode 100644 canvas/source/simplecanvas/simplecanvas.component create mode 100644 canvas/source/vcl/vclcanvas.component create mode 100644 comphelper/util/comphelp4.component create mode 100644 dtrans/source/generic/dtrans.component create mode 100644 dtrans/util/dnd.component create mode 100644 dtrans/util/ftransl.component create mode 100644 dtrans/util/mcnttype.component create mode 100644 dtrans/util/sysdtrans.component mode change 100644 => 100755 i18npool/source/localedata/data/makefile.mk create mode 100644 i18npool/source/search/i18nsearch.component create mode 100644 i18npool/util/i18npool.component create mode 100644 sax/source/expatwrap/sax.component create mode 100644 sax/source/fastparser/fastsax.component create mode 100644 sot/util/sot.component create mode 100644 svl/source/fsstor/fsstorage.component create mode 100644 svl/source/passwordcontainer/passwordcontainer.component create mode 100644 svl/util/svl.component create mode 100644 svtools/source/hatchwindow/hatchwindowfactory.component create mode 100644 svtools/source/productregistration/productregistration.uno.component create mode 100644 svtools/util/svt.component create mode 100644 toolkit/util/tk.component create mode 100644 unotools/util/utl.component create mode 100644 vcl/util/vcl.component create mode 100644 vcl/util/vcl.macosx.component create mode 100644 vcl/util/vcl.windows.component diff --git a/canvas/prj/d.lst b/canvas/prj/d.lst index 986253a3b3e5..701b9967f92a 100644 --- a/canvas/prj/d.lst +++ b/canvas/prj/d.lst @@ -15,6 +15,7 @@ ..\%__SRC%\lib\canvasfactory.uno.so %_DEST%\lib%_EXT%\canvasfactory.uno.so ..\%__SRC%\lib\*.dylib %_DEST%\lib%_EXT%\*.dylib ..\%__SRC%\class\javacanvas.uno.jar %_DEST%\bin%_EXT%\javacanvas.uno.jar +..\%__SRC%\misc\cairocanvas.component %_DEST%\xml%_EXT%\cairocanvas.component mkdir: %_DEST%\inc%_EXT%\canvas\base ..\inc\canvas\base\*.hxx %_DEST%\inc%_EXT%\canvas\base\*.hxx @@ -24,3 +25,9 @@ mkdir: %_DEST%\inc%_EXT%\canvas\rendering mkdir: %_DEST%\inc%_EXT%\canvas ..\inc\canvas\*.hxx %_DEST%\inc%_EXT%\canvas\*.hxx +..\%__SRC%\misc\canvasfactory.component %_DEST%\xml%_EXT%\canvasfactory.component +..\%__SRC%\misc\directx5canvas.component %_DEST%\xml%_EXT%\directx5canvas.component +..\%__SRC%\misc\directx9canvas.component %_DEST%\xml%_EXT%\directx9canvas.component +..\%__SRC%\misc\gdipluscanvas.component %_DEST%\xml%_EXT%\gdipluscanvas.component +..\%__SRC%\misc\simplecanvas.component %_DEST%\xml%_EXT%\simplecanvas.component +..\%__SRC%\misc\vclcanvas.component %_DEST%\xml%_EXT%\vclcanvas.component diff --git a/canvas/source/cairo/cairocanvas.component b/canvas/source/cairo/cairocanvas.component new file mode 100644 index 000000000000..126ad2b44ee1 --- /dev/null +++ b/canvas/source/cairo/cairocanvas.component @@ -0,0 +1,37 @@ + + + + + + + + + + + diff --git a/canvas/source/cairo/exports.dxp b/canvas/source/cairo/exports.dxp index 9630d7e06768..f0e1c69934bc 100644 --- a/canvas/source/cairo/exports.dxp +++ b/canvas/source/cairo/exports.dxp @@ -1,3 +1,2 @@ component_getImplementationEnvironment -component_writeInfo component_getFactory diff --git a/canvas/source/cairo/makefile.mk b/canvas/source/cairo/makefile.mk index b0ff10fe96b0..040acd9ade8f 100644 --- a/canvas/source/cairo/makefile.mk +++ b/canvas/source/cairo/makefile.mk @@ -130,3 +130,11 @@ DEF1EXPORTFILE=exports.dxp # ========================================================================== .INCLUDE : target.mk + +ALLTAR : $(MISC)/cairocanvas.component + +$(MISC)/cairocanvas.component .ERRREMOVE : \ + $(SOLARENV)/bin/createcomponent.xslt cairocanvas.component + $(XSLTPROC) --nonet --stringparam uri \ + '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \ + $(SOLARENV)/bin/createcomponent.xslt cairocanvas.component diff --git a/canvas/source/directx/directx5canvas.component b/canvas/source/directx/directx5canvas.component new file mode 100644 index 000000000000..80133e724df6 --- /dev/null +++ b/canvas/source/directx/directx5canvas.component @@ -0,0 +1,34 @@ + + + + + + + + diff --git a/canvas/source/directx/directx9canvas.component b/canvas/source/directx/directx9canvas.component new file mode 100644 index 000000000000..0d395892d4cb --- /dev/null +++ b/canvas/source/directx/directx9canvas.component @@ -0,0 +1,34 @@ + + + + + + + + diff --git a/canvas/source/directx/exports.dxp b/canvas/source/directx/exports.dxp index 9630d7e06768..f0e1c69934bc 100644 --- a/canvas/source/directx/exports.dxp +++ b/canvas/source/directx/exports.dxp @@ -1,3 +1,2 @@ component_getImplementationEnvironment -component_writeInfo component_getFactory diff --git a/canvas/source/directx/gdipluscanvas.component b/canvas/source/directx/gdipluscanvas.component new file mode 100644 index 000000000000..e39e77444d59 --- /dev/null +++ b/canvas/source/directx/gdipluscanvas.component @@ -0,0 +1,37 @@ + + + + + + + + + + + diff --git a/canvas/source/directx/makefile.mk b/canvas/source/directx/makefile.mk index 4ccd5a8448b2..9547fef40cc7 100644 --- a/canvas/source/directx/makefile.mk +++ b/canvas/source/directx/makefile.mk @@ -217,3 +217,25 @@ SHL3STDLIBS += imdebug.lib .INCLUDE : target.mk +ALLTAR : \ + $(MISC)/directx5canvas.component \ + $(MISC)/directx9canvas.component \ + $(MISC)/gdipluscanvas.component + +$(MISC)/directx5canvas.component .ERRREMOVE : \ + $(SOLARENV)/bin/createcomponent.xslt directx5canvas.component + $(XSLTPROC) --nonet --stringparam uri \ + '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL2TARGETN:f)' -o $@ \ + $(SOLARENV)/bin/createcomponent.xslt directx5canvas.component + +$(MISC)/directx9canvas.component .ERRREMOVE : \ + $(SOLARENV)/bin/createcomponent.xslt directx9canvas.component + $(XSLTPROC) --nonet --stringparam uri \ + '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \ + $(SOLARENV)/bin/createcomponent.xslt directx9canvas.component + +$(MISC)/gdipluscanvas.component .ERRREMOVE : \ + $(SOLARENV)/bin/createcomponent.xslt gdipluscanvas.component + $(XSLTPROC) --nonet --stringparam uri \ + '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL3TARGETN:f)' -o $@ \ + $(SOLARENV)/bin/createcomponent.xslt gdipluscanvas.component diff --git a/canvas/source/factory/canvasfactory.component b/canvas/source/factory/canvasfactory.component new file mode 100644 index 000000000000..3896f4197d2f --- /dev/null +++ b/canvas/source/factory/canvasfactory.component @@ -0,0 +1,34 @@ + + + + + + + + diff --git a/canvas/source/factory/cf_service.cxx b/canvas/source/factory/cf_service.cxx index f949016d9f83..f4bbb57e0e7d 100644 --- a/canvas/source/factory/cf_service.cxx +++ b/canvas/source/factory/cf_service.cxx @@ -532,14 +532,6 @@ void SAL_CALL component_getImplementationEnvironment( *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; } -sal_Bool SAL_CALL component_writeInfo( - lang::XMultiServiceFactory * pServiceManager, - registry::XRegistryKey * pRegistryKey ) -{ - return ::cppu::component_writeInfoHelper( - pServiceManager, pRegistryKey, s_entries ); -} - void * SAL_CALL component_getFactory( sal_Char const * pImplName, lang::XMultiServiceFactory * pServiceManager, diff --git a/canvas/source/factory/makefile.mk b/canvas/source/factory/makefile.mk index fc6d423192d6..eee24ea8ba85 100644 --- a/canvas/source/factory/makefile.mk +++ b/canvas/source/factory/makefile.mk @@ -54,3 +54,10 @@ DEF1NAME = $(SHL1TARGET) .ENDIF .INCLUDE : target.mk +ALLTAR : $(MISC)/canvasfactory.component + +$(MISC)/canvasfactory.component .ERRREMOVE : \ + $(SOLARENV)/bin/createcomponent.xslt canvasfactory.component + $(XSLTPROC) --nonet --stringparam uri \ + '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \ + $(SOLARENV)/bin/createcomponent.xslt canvasfactory.component diff --git a/canvas/source/null/exports.dxp b/canvas/source/null/exports.dxp index 9630d7e06768..f0e1c69934bc 100644 --- a/canvas/source/null/exports.dxp +++ b/canvas/source/null/exports.dxp @@ -1,3 +1,2 @@ component_getImplementationEnvironment -component_writeInfo component_getFactory diff --git a/canvas/source/simplecanvas/exports.dxp b/canvas/source/simplecanvas/exports.dxp index 0c2e3e7cddd7..0cb5620a1603 100644 --- a/canvas/source/simplecanvas/exports.dxp +++ b/canvas/source/simplecanvas/exports.dxp @@ -1,3 +1,2 @@ component_getImplementationEnvironment -component_writeInfo component_getFactory \ No newline at end of file diff --git a/canvas/source/simplecanvas/makefile.mk b/canvas/source/simplecanvas/makefile.mk index 4d5a7e7bb3a1..8c3a9deede72 100644 --- a/canvas/source/simplecanvas/makefile.mk +++ b/canvas/source/simplecanvas/makefile.mk @@ -61,3 +61,11 @@ DEF1EXPORTFILE=exports.dxp # ========================================================================== .INCLUDE : target.mk + +ALLTAR : $(MISC)/simplecanvas.component + +$(MISC)/simplecanvas.component .ERRREMOVE : \ + $(SOLARENV)/bin/createcomponent.xslt simplecanvas.component + $(XSLTPROC) --nonet --stringparam uri \ + '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \ + $(SOLARENV)/bin/createcomponent.xslt simplecanvas.component diff --git a/canvas/source/simplecanvas/simplecanvas.component b/canvas/source/simplecanvas/simplecanvas.component new file mode 100644 index 000000000000..3a00b407375e --- /dev/null +++ b/canvas/source/simplecanvas/simplecanvas.component @@ -0,0 +1,34 @@ + + + + + + + + diff --git a/canvas/source/vcl/exports.dxp b/canvas/source/vcl/exports.dxp index 0c2e3e7cddd7..0cb5620a1603 100644 --- a/canvas/source/vcl/exports.dxp +++ b/canvas/source/vcl/exports.dxp @@ -1,3 +1,2 @@ component_getImplementationEnvironment -component_writeInfo component_getFactory \ No newline at end of file diff --git a/canvas/source/vcl/makefile.mk b/canvas/source/vcl/makefile.mk index be2fc69894a4..7d5f9658c829 100644 --- a/canvas/source/vcl/makefile.mk +++ b/canvas/source/vcl/makefile.mk @@ -83,3 +83,11 @@ DEF1EXPORTFILE=exports.dxp # ========================================================================== .INCLUDE : target.mk + +ALLTAR : $(MISC)/vclcanvas.component + +$(MISC)/vclcanvas.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \ + vclcanvas.component + $(XSLTPROC) --nonet --stringparam uri \ + '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \ + $(SOLARENV)/bin/createcomponent.xslt vclcanvas.component diff --git a/canvas/source/vcl/vclcanvas.component b/canvas/source/vcl/vclcanvas.component new file mode 100644 index 000000000000..f7e0bb8c0266 --- /dev/null +++ b/canvas/source/vcl/vclcanvas.component @@ -0,0 +1,37 @@ + + + + + + + + + + + diff --git a/comphelper/inc/comphelper/componentmodule.hxx b/comphelper/inc/comphelper/componentmodule.hxx index 660a685d0fd3..61ddddebadbf 100644 --- a/comphelper/inc/comphelper/componentmodule.hxx +++ b/comphelper/inc/comphelper/componentmodule.hxx @@ -34,7 +34,6 @@ #include #include #include -#include /** === end UNO includes === **/ #include @@ -140,28 +139,6 @@ namespace comphelper */ void registerImplementation( const ComponentDescription& _rComp ); - /** write the registration information of all known components - - Writes the registration information of all components which are currently registered into the - specified registry. - - Usually used from within component_writeInfo. - - @param_rxServiceManager - the service manager - @param _rRootKey - the registry key under which the information will be stored - @return - if the registration of all implementations was successfull, otherwise - */ - sal_Bool writeComponentInfos( - const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxServiceManager, - const ::com::sun::star::uno::Reference< ::com::sun::star::registry::XRegistryKey >& _rRootKey); - - /** version of writeComponentInfos which directly takes the arguments you got in your component_writeInfo call - */ - sal_Bool writeComponentInfos( void* pServiceManager, void* pRegistryKey ); - /** creates a Factory for the component with the given implementation name.

Usually used from within component_getFactory.

@param _rxServiceManager @@ -420,12 +397,6 @@ namespace comphelper { \ *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; \ } \ - extern "C" SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo( \ - void* pServiceManager, void* pRegistryKey ) \ - { \ - initializer_function(); \ - return module_class::getInstance().writeComponentInfos( pServiceManager, pRegistryKey ); \ - } \ extern "C" SAL_DLLPUBLIC_EXPORT void* SAL_CALL component_getFactory( \ const sal_Char* pImplementationName, void* pServiceManager, void* pRegistryKey ) \ { \ diff --git a/comphelper/inc/comphelper/servicedecl.hxx b/comphelper/inc/comphelper/servicedecl.hxx index 5d11d41831f5..adf120b3bae2 100644 --- a/comphelper/inc/comphelper/servicedecl.hxx +++ b/comphelper/inc/comphelper/servicedecl.hxx @@ -134,8 +134,6 @@ public: m_pServiceNames(pSupportedServiceNames), m_cDelim(cDelim) {} - /// @internal gets called by component_writeInfoHelper() - bool writeInfo( ::com::sun::star::registry::XRegistryKey * xKey ) const; /// @internal gets called by component_getFactoryHelper() void * getFactory( sal_Char const* pImplName ) const; @@ -323,9 +321,6 @@ struct class_ : public serviceimpl_base< detail::ServiceImpl, WithArgsT // component_... helpers with arbitrary service declarations: // -#define COMPHELPER_SERVICEDECL_writeInfo(z_, n_, unused_) \ - bRet &= BOOST_PP_CAT(s, n_).writeInfo( xRegistryKey ); - #define COMPHELPER_SERVICEDECL_getFactory(z_, n_, unused_) \ if (pRet == 0) \ pRet = BOOST_PP_CAT(s, n_).getFactory(pImplName); @@ -333,11 +328,6 @@ struct class_ : public serviceimpl_base< detail::ServiceImpl, WithArgsT /** The following preprocessor repetitions generate functions like

-        inline sal_Bool component_writeInfoHelper(
-            ::com::sun::star::lang::XMultiServiceFactory *,
-            ::com::sun::star::registry::XRegistryKey * xRegistryKey,
-            ServiceDecl const& s0, ServiceDecl const& s1, ... );
-
         inline void * component_getFactoryHelper(
             sal_Char const* pImplName,
             ::com::sun::star::lang::XMultiServiceFactory *,
@@ -351,15 +341,6 @@ struct class_ : public serviceimpl_base< detail::ServiceImpl, WithArgsT
     COMPHELPER_SERVICEDECL_COMPONENT_HELPER_MAX_ARGS; its default is 8.
 */
 #define COMPHELPER_SERVICEDECL_make(z_, n_, unused_) \
-inline sal_Bool component_writeInfoHelper( \
-    ::com::sun::star::lang::XMultiServiceFactory *, \
-    ::com::sun::star::registry::XRegistryKey * xRegistryKey, \
-    BOOST_PP_ENUM_PARAMS(n_, ServiceDecl const& s) ) \
-{ \
-    bool bRet = true; \
-    BOOST_PP_REPEAT(n_, COMPHELPER_SERVICEDECL_writeInfo, ~) \
-    return bRet; \
-} \
 inline void * component_getFactoryHelper( \
     sal_Char const* pImplName, \
     ::com::sun::star::lang::XMultiServiceFactory *, \
@@ -381,7 +362,6 @@ BOOST_PP_REPEAT_FROM_TO(1, COMPHELPER_SERVICEDECL_COMPONENT_HELPER_MAX_ARGS,
 #undef COMPHELPER_SERVICEDECL_COMPONENT_HELPER_MAX_ARGS
 #undef COMPHELPER_SERVICEDECL_make
 #undef COMPHELPER_SERVICEDECL_getFactory
-#undef COMPHELPER_SERVICEDECL_writeInfo
 
 } // namespace service_decl
 } // namespace comphelper
@@ -420,13 +400,6 @@ extern "C" \
     { \
         *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; \
     } \
- \
-    SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo( ::com::sun::star::lang::XMultiServiceFactory*    pServiceManager, \
-                                           ::com::sun::star::registry::XRegistryKey*        pRegistryKey ) \
-    { \
-        return component_writeInfoHelper( pServiceManager, pRegistryKey, \
-                                          BOOST_PP_SEQ_ENUM(varargs_) ); \
-    } \
  \
     SAL_DLLPUBLIC_EXPORT void* SAL_CALL component_getFactory( sal_Char const*                                pImplName, \
                                          ::com::sun::star::lang::XMultiServiceFactory*  pServiceManager, \
diff --git a/comphelper/prj/d.lst b/comphelper/prj/d.lst
index f4d09c54ba70..f05fcf0926dd 100644
--- a/comphelper/prj/d.lst
+++ b/comphelper/prj/d.lst
@@ -12,3 +12,4 @@ mkdir: %_DEST%\inc%_EXT%\comphelper
 mkdir: %_DEST%\inc%_EXT%\cppuhelper
 ..\inc\comphelper\extract.hxx %_DEST%\inc%_EXT%\cppuhelper\extract.hxx
 ..\version.mk  %_DEST%\inc%_EXT%\comphelper\version.mk
+..\%__SRC%\misc\comphelp4.component %_DEST%\xml%_EXT%\comphelp4.component
diff --git a/comphelper/source/misc/componentmodule.cxx b/comphelper/source/misc/componentmodule.cxx
index 63893d0f6d0d..1dfd99bfa07e 100644
--- a/comphelper/source/misc/componentmodule.cxx
+++ b/comphelper/source/misc/componentmodule.cxx
@@ -134,64 +134,6 @@ namespace comphelper
         registerImplementation( aComponent );
     }
 
-    //--------------------------------------------------------------------------
-    sal_Bool OModule::writeComponentInfos( void* pServiceManager, void* pRegistryKey )
-    {
-        Reference< XMultiServiceFactory > xFactory( static_cast< XMultiServiceFactory* >( pServiceManager ) );
-        Reference< XRegistryKey > xRegistryKey( static_cast< XRegistryKey* >( pRegistryKey ) );
-        return writeComponentInfos( xFactory, xRegistryKey );
-    }
-
-    //--------------------------------------------------------------------------
-    sal_Bool OModule::writeComponentInfos(
-            const Reference< XMultiServiceFactory >& /*_rxServiceManager*/,
-            const Reference< XRegistryKey >& _rxRootKey )
-    {
-        OSL_ENSURE( _rxRootKey.is(), "OModule::writeComponentInfos: invalid argument!" );
-
-        ::rtl::OUString sRootKey( "/", 1, RTL_TEXTENCODING_ASCII_US );
-
-        for (   ComponentDescriptions::const_iterator component = m_pImpl->m_aRegisteredComponents.begin();
-                component != m_pImpl->m_aRegisteredComponents.end();
-                ++component
-            )
-        {
-            ::rtl::OUString sMainKeyName( sRootKey );
-            sMainKeyName += component->sImplementationName;
-            sMainKeyName += ::rtl::OUString::createFromAscii( "/UNO/SERVICES" );
-
-            try
-            {
-                Reference< XRegistryKey >  xNewKey( _rxRootKey->createKey( sMainKeyName ) );
-
-                const ::rtl::OUString* pService = component->aSupportedServices.getConstArray();
-                const ::rtl::OUString* pServiceEnd = component->aSupportedServices.getConstArray() + component->aSupportedServices.getLength();
-                for ( ; pService != pServiceEnd; ++pService )
-                    xNewKey->createKey( *pService );
-
-                if ( component->sSingletonName.getLength() )
-                {
-                    OSL_ENSURE( component->aSupportedServices.getLength() == 1, "OModule::writeComponentInfos: singletons should support exactly one service, shouldn't they?" );
-
-                    ::rtl::OUString sSingletonKeyName( sRootKey );
-                    sSingletonKeyName += component->sImplementationName;
-                    sSingletonKeyName += ::rtl::OUString::createFromAscii( "/UNO/SINGLETONS/" );
-                    sSingletonKeyName += component->sSingletonName;
-
-                    xNewKey = _rxRootKey->createKey( sSingletonKeyName );
-                    xNewKey->setStringValue( component->aSupportedServices[ 0 ] );
-                }
-            }
-            catch( Exception& )
-            {
-                OSL_ASSERT( "OModule::writeComponentInfos: something went wrong while creating the keys!" );
-                return sal_False;
-            }
-        }
-
-        return sal_True;
-    }
-
     //--------------------------------------------------------------------------
     void* OModule::getComponentFactory( const sal_Char* _pImplementationName, void* _pServiceManager, void* /*_pRegistryKey*/ )
     {
diff --git a/comphelper/source/misc/servicedecl.cxx b/comphelper/source/misc/servicedecl.cxx
index 7c3dd169485d..7986407b0bd5 100644
--- a/comphelper/source/misc/servicedecl.cxx
+++ b/comphelper/source/misc/servicedecl.cxx
@@ -116,37 +116,6 @@ ServiceDecl::Factory::createInstanceWithArgumentsAndContext(
         m_rServiceDecl, args, xContext );
 }
 
-bool ServiceDecl::writeInfo( registry::XRegistryKey * xKey ) const
-{
-    bool bRet = false;
-    if (xKey != 0) {
-        rtl::OUStringBuffer buf;
-        buf.append( static_cast('/') );
-        buf.appendAscii( m_pImplName );
-        buf.appendAscii( RTL_CONSTASCII_STRINGPARAM("/UNO/SERVICES") );
-        try {
-            uno::Reference const xNewKey(
-                xKey->createKey( buf.makeStringAndClear() ) );
-
-            rtl::OString const str(m_pServiceNames);
-            sal_Int32 nIndex = 0;
-            do {
-                rtl::OString const token( str.getToken( 0, m_cDelim, nIndex ) );
-                xNewKey->createKey(
-                    rtl::OUString( token.getStr(), token.getLength(),
-                                   RTL_TEXTENCODING_ASCII_US ) );
-            }
-            while (nIndex >= 0);
-
-            bRet = true;
-        }
-        catch (registry::InvalidRegistryException const&) {
-            OSL_ENSURE( false, "### InvalidRegistryException!" );
-        }
-    }
-    return bRet;
-}
-
 void * ServiceDecl::getFactory( sal_Char const* pImplName ) const
 {
     if (rtl_str_compare(m_pImplName, pImplName) == 0) {
diff --git a/comphelper/util/comphelp4.component b/comphelper/util/comphelp4.component
new file mode 100644
index 000000000000..10d23d48bcea
--- /dev/null
+++ b/comphelper/util/comphelp4.component
@@ -0,0 +1,70 @@
+
+
+
+
+  
+    
+  
+  
+    
+  
+  
+    
+  
+  
+    
+  
+  
+    
+  
+  
+    
+  
+  
+    
+  
+  
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+  
+
diff --git a/comphelper/util/exports.dxp b/comphelper/util/exports.dxp
index 0c2e3e7cddd7..0cb5620a1603 100644
--- a/comphelper/util/exports.dxp
+++ b/comphelper/util/exports.dxp
@@ -1,3 +1,2 @@
 component_getImplementationEnvironment
-component_writeInfo
 component_getFactory
\ No newline at end of file
diff --git a/comphelper/util/makefile.mk b/comphelper/util/makefile.mk
index ae391e92abf7..62e66672a1cb 100644
--- a/comphelper/util/makefile.mk
+++ b/comphelper/util/makefile.mk
@@ -68,3 +68,11 @@ DEFLIB1NAME=$(TARGET)
 # --- Targets ----------------------------------
 
 .INCLUDE : target.mk
+
+ALLTAR : $(MISC)/comphelp4.component
+
+$(MISC)/comphelp4.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
+        comphelp4.component
+    $(XSLTPROC) --nonet --stringparam uri \
+        '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
+        $(SOLARENV)/bin/createcomponent.xslt comphelp4.component
diff --git a/dtrans/prj/d.lst b/dtrans/prj/d.lst
index a1a7c2e95480..955aa075f24b 100644
--- a/dtrans/prj/d.lst
+++ b/dtrans/prj/d.lst
@@ -7,3 +7,8 @@
 ..\source\win32\ftransl\ftransl.xml %_DEST%\xml%_EXT%\ftransl.xml
 ..\source\cnttype\mcnttype.xml %_DEST%\xml%_EXT%\mcnttype.xml
 ..\source\generic\dtrans.xml %_DEST%\xml%_EXT%\dtrans.xml
+..\%__SRC%\misc\dnd.component %_DEST%\xml%_EXT%\dnd.component
+..\%__SRC%\misc\dtrans.component %_DEST%\xml%_EXT%\dtrans.component
+..\%__SRC%\misc\ftransl.component %_DEST%\xml%_EXT%\ftransl.component
+..\%__SRC%\misc\mcnttype.component %_DEST%\xml%_EXT%\mcnttype.component
+..\%__SRC%\misc\sysdtrans.component %_DEST%\xml%_EXT%\sysdtrans.component
diff --git a/dtrans/source/cnttype/exports.dxp b/dtrans/source/cnttype/exports.dxp
index 028ac4175990..f0e1c69934bc 100644
--- a/dtrans/source/cnttype/exports.dxp
+++ b/dtrans/source/cnttype/exports.dxp
@@ -1,3 +1,2 @@
 component_getImplementationEnvironment
-component_writeInfo	
 component_getFactory
diff --git a/dtrans/source/cnttype/mctfentry.cxx b/dtrans/source/cnttype/mctfentry.cxx
index 095c9ed186ce..3d2e41201887 100644
--- a/dtrans/source/cnttype/mctfentry.cxx
+++ b/dtrans/source/cnttype/mctfentry.cxx
@@ -99,35 +99,6 @@ void SAL_CALL component_getImplementationEnvironment(
     *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
 }
 
-//-------------------------------------------------------------------------
-// component_writeInfo - to register a UNO-Service
-// to register a UNO-Service use: regcomp -register -r *.rdb -c *.dll
-// to view the registry use: regview *.rdb /SERVICES/ServiceName
-// (you must use the full services name e.g. com.sun.star.frame.FilePicker
-//-------------------------------------------------------------------------
-
-sal_Bool SAL_CALL component_writeInfo( void* /*pServiceManager*/, void* pRegistryKey )
-{
-    sal_Bool bRetVal = sal_False;
-
-    if ( pRegistryKey )
-    {
-        try
-        {
-            Reference< XRegistryKey > pXNewKey( static_cast< XRegistryKey* >( pRegistryKey ) );
-            pXNewKey->createKey( OUString( RTL_CONSTASCII_USTRINGPARAM( MIMECONTENTTYPEFACTORY_REGKEY_NAME ) ) );
-            bRetVal = sal_True;
-        }
-        catch( InvalidRegistryException& )
-        {
-            OSL_ENSURE(sal_False, "InvalidRegistryException caught");
-            bRetVal = sal_False;
-        }
-    }
-
-    return bRetVal;
-}
-
 //----------------------------------------------------------------------
 // component_getFactory
 // returns a factory to create XFilePicker-Services
diff --git a/dtrans/source/generic/dtrans.component b/dtrans/source/generic/dtrans.component
new file mode 100644
index 000000000000..69034f716907
--- /dev/null
+++ b/dtrans/source/generic/dtrans.component
@@ -0,0 +1,37 @@
+
+
+
+
+  
+    
+  
+  
+    
+  
+
diff --git a/dtrans/source/generic/dtrans.cxx b/dtrans/source/generic/dtrans.cxx
index 1e69158a6a12..4b39298f97c2 100644
--- a/dtrans/source/generic/dtrans.cxx
+++ b/dtrans/source/generic/dtrans.cxx
@@ -52,43 +52,6 @@ void SAL_CALL component_getImplementationEnvironment(const sal_Char ** ppEnvType
 
 //==================================================================================================
 
-sal_Bool SAL_CALL component_writeInfo(void * /*pServiceManager*/, void * pRegistryKey )
-{
-    if (pRegistryKey)
-    {
-        try
-        {
-            Reference< XRegistryKey > xNewKey(
-                reinterpret_cast< XRegistryKey * >( pRegistryKey )->createKey(
-                    OUString::createFromAscii("/" CLIPBOARDMANAGER_IMPLEMENTATION_NAME "/UNO/SERVICES" ) ) );
-
-            const Sequence< OUString > & rSNL = ClipboardManager_getSupportedServiceNames();
-            const OUString * pArray = rSNL.getConstArray();
-            sal_Int32 nPos;
-            for ( nPos = rSNL.getLength(); nPos--; )
-                xNewKey->createKey( pArray[nPos] );
-
-            xNewKey = reinterpret_cast< XRegistryKey * >( pRegistryKey )->createKey(
-                OUString::createFromAscii("/" GENERIC_CLIPBOARD_IMPLEMENTATION_NAME "/UNO/SERVICES" ) );
-
-            const Sequence< OUString > & rSNL2 = GenericClipboard_getSupportedServiceNames();
-            pArray = rSNL2.getConstArray();
-            for ( nPos = rSNL2.getLength(); nPos--; )
-                xNewKey->createKey( pArray[nPos] );
-
-            return sal_True;
-        }
-        catch (InvalidRegistryException &)
-        {
-            OSL_ENSURE( sal_False, "### InvalidRegistryException!" );
-        }
-    }
-
-    return sal_False;
-}
-
-//==================================================================================================
-
 void * SAL_CALL component_getFactory(
     const sal_Char * pImplName,
     void * pServiceManager,
diff --git a/dtrans/source/generic/exports.dxp b/dtrans/source/generic/exports.dxp
index 9630d7e06768..f0e1c69934bc 100644
--- a/dtrans/source/generic/exports.dxp
+++ b/dtrans/source/generic/exports.dxp
@@ -1,3 +1,2 @@
 component_getImplementationEnvironment
-component_writeInfo
 component_getFactory
diff --git a/dtrans/source/generic/makefile.mk b/dtrans/source/generic/makefile.mk
index e015400c32d9..2518b86a2d92 100644
--- a/dtrans/source/generic/makefile.mk
+++ b/dtrans/source/generic/makefile.mk
@@ -65,3 +65,11 @@ DEF1EXPORTFILE=	exports.dxp
 .ENDIF # L10N_framework
 
 .INCLUDE :	target.mk
+
+ALLTAR : $(MISC)/dtrans.component
+
+$(MISC)/dtrans.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
+        dtrans.component
+    $(XSLTPROC) --nonet --stringparam uri \
+        '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
+        $(SOLARENV)/bin/createcomponent.xslt dtrans.component
diff --git a/dtrans/source/os2/clipb/Os2Service.cxx b/dtrans/source/os2/clipb/Os2Service.cxx
index cc3e1e9a9b94..0c3e299f0299 100644
--- a/dtrans/source/os2/clipb/Os2Service.cxx
+++ b/dtrans/source/os2/clipb/Os2Service.cxx
@@ -56,28 +56,6 @@ void SAL_CALL component_getImplementationEnvironment(
     *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
 }
 
-sal_Bool SAL_CALL component_writeInfo( void* pServiceManager, void* pRegistryKey )
-{
-    sal_Bool bRetVal = sal_False;
-
-    if ( pRegistryKey )
-    {
-        try
-        {
-            Reference< XRegistryKey > pXNewKey( static_cast< XRegistryKey* >( pRegistryKey ) );
-            pXNewKey->createKey( OUString( RTL_CONSTASCII_USTRINGPARAM( OS2_CLIPBOARD_REGKEY_NAME ) ) );
-            bRetVal = sal_True;
-        }
-        catch( InvalidRegistryException& )
-        {
-            OSL_ENSURE(sal_False, "InvalidRegistryException caught");
-            bRetVal = sal_False;
-        }
-    }
-
-    return bRetVal;
-}
-
 void* SAL_CALL component_getFactory( const sal_Char* pImplName, uno_Interface* pSrvManager, uno_Interface* pRegistryKey )
 {
     void* pRet = 0;
diff --git a/dtrans/source/os2/clipb/exports.dxp b/dtrans/source/os2/clipb/exports.dxp
index f72beb0fcb31..926e49f5f1a5 100644
--- a/dtrans/source/os2/clipb/exports.dxp
+++ b/dtrans/source/os2/clipb/exports.dxp
@@ -1,4 +1,3 @@
 component_getImplementationEnvironment
-component_writeInfo	
 component_getFactory
 
diff --git a/dtrans/source/win32/clipb/exports.dxp b/dtrans/source/win32/clipb/exports.dxp
index f72beb0fcb31..926e49f5f1a5 100644
--- a/dtrans/source/win32/clipb/exports.dxp
+++ b/dtrans/source/win32/clipb/exports.dxp
@@ -1,4 +1,3 @@
 component_getImplementationEnvironment
-component_writeInfo	
 component_getFactory
 
diff --git a/dtrans/source/win32/clipb/wcbentry.cxx b/dtrans/source/win32/clipb/wcbentry.cxx
index 986e7b4c4db7..653d97194efc 100644
--- a/dtrans/source/win32/clipb/wcbentry.cxx
+++ b/dtrans/source/win32/clipb/wcbentry.cxx
@@ -97,35 +97,6 @@ void SAL_CALL component_getImplementationEnvironment(
     *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
 }
 
-//-------------------------------------------------------------------------
-// component_writeInfo - to register a UNO-Service
-// to register a UNO-Service use: regcomp -register -r *.rdb -c *.dll
-// to view the registry use: regview *.rdb /SERVICES/ServiceName
-// (you must use the full services name e.g. com.sun.star.frame.FilePicker
-//-------------------------------------------------------------------------
-
-sal_Bool SAL_CALL component_writeInfo( void* /*pServiceManager*/, void* pRegistryKey )
-{
-    sal_Bool bRetVal = sal_False;
-
-    if ( pRegistryKey )
-    {
-        try
-        {
-            Reference< XRegistryKey > pXNewKey( static_cast< XRegistryKey* >( pRegistryKey ) );
-            pXNewKey->createKey( OUString( RTL_CONSTASCII_USTRINGPARAM( WINCLIPBOARD_REGKEY_NAME ) ) );
-            bRetVal = sal_True;
-        }
-        catch( InvalidRegistryException& )
-        {
-            OSL_ENSURE(sal_False, "InvalidRegistryException caught");
-            bRetVal = sal_False;
-        }
-    }
-
-    return bRetVal;
-}
-
 //----------------------------------------------------------------------
 // component_getFactory
 // returns a factory to create XFilePicker-Services
diff --git a/dtrans/source/win32/dnd/dndentry.cxx b/dtrans/source/win32/dnd/dndentry.cxx
index 2ea9b7746def..d37fa07ba3bd 100644
--- a/dtrans/source/win32/dnd/dndentry.cxx
+++ b/dtrans/source/win32/dnd/dndentry.cxx
@@ -72,39 +72,6 @@ void SAL_CALL component_getImplementationEnvironment(
     *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
 }
 
-//-------------------------------------------------------------------------
-// component_writeInfo - to register a UNO-Service
-// to register a UNO-Service use: regcomp -register -r *.rdb -c *.dll
-// to view the registry use: regview *.rdb /SERVICES/ServiceName
-// (you must use the full services name e.g. com.sun.star.frame.FilePicker
-//-------------------------------------------------------------------------
-
-sal_Bool SAL_CALL component_writeInfo( void* /*pServiceManager*/, void* pRegistryKey )
-{
-    sal_Bool bRetVal = sal_False;
-
-    if ( pRegistryKey )
-    {
-        try
-        {
-            Reference< XRegistryKey > pXNewKey( static_cast< XRegistryKey* >( pRegistryKey ) );
-            pXNewKey->createKey( OUString( RTL_CONSTASCII_USTRINGPARAM( DNDSOURCE_REGKEY_NAME ) ) );
-            bRetVal = sal_True;
-
-            pXNewKey=  static_cast< XRegistryKey* >( pRegistryKey );
-            pXNewKey->createKey( OUString( RTL_CONSTASCII_USTRINGPARAM( DNDTARGET_REGKEY_NAME ) ) );
-            bRetVal = sal_True;
-        }
-        catch( InvalidRegistryException& )
-        {
-            OSL_ENSURE(sal_False, "InvalidRegistryException caught");
-            bRetVal = sal_False;
-        }
-    }
-
-    return bRetVal;
-}
-
 //----------------------------------------------------------------------
 // component_getFactory
 // returns a factory to create XFilePicker-Services
diff --git a/dtrans/source/win32/dnd/exports.dxp b/dtrans/source/win32/dnd/exports.dxp
index 028ac4175990..f0e1c69934bc 100644
--- a/dtrans/source/win32/dnd/exports.dxp
+++ b/dtrans/source/win32/dnd/exports.dxp
@@ -1,3 +1,2 @@
 component_getImplementationEnvironment
-component_writeInfo	
 component_getFactory
diff --git a/dtrans/source/win32/ftransl/exports.dxp b/dtrans/source/win32/ftransl/exports.dxp
index 028ac4175990..f0e1c69934bc 100644
--- a/dtrans/source/win32/ftransl/exports.dxp
+++ b/dtrans/source/win32/ftransl/exports.dxp
@@ -1,3 +1,2 @@
 component_getImplementationEnvironment
-component_writeInfo	
 component_getFactory
diff --git a/dtrans/source/win32/ftransl/ftranslentry.cxx b/dtrans/source/win32/ftransl/ftranslentry.cxx
index 01d1521b15bc..abdd27ffcdae 100644
--- a/dtrans/source/win32/ftransl/ftranslentry.cxx
+++ b/dtrans/source/win32/ftransl/ftranslentry.cxx
@@ -102,35 +102,6 @@ void SAL_CALL component_getImplementationEnvironment(
     *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
 }
 
-//-------------------------------------------------------------------------
-// component_writeInfo - to register a UNO-Service
-// to register a UNO-Service use: regcomp -register -r *.rdb -c *.dll
-// to view the registry use: regview *.rdb /SERVICES/ServiceName
-// (you must use the full services name e.g. com.sun.star.frame.FilePicker
-//-------------------------------------------------------------------------
-
-sal_Bool SAL_CALL component_writeInfo( void* /*pServiceManager*/, void* pRegistryKey )
-{
-    sal_Bool bRetVal = sal_False;
-
-    if ( pRegistryKey )
-    {
-        try
-        {
-            Reference< XRegistryKey > pXNewKey( static_cast< XRegistryKey* >( pRegistryKey ) );
-            pXNewKey->createKey( OUString( RTL_CONSTASCII_USTRINGPARAM( REGKEY_NAME ) ) );
-            bRetVal = sal_True;
-        }
-        catch( InvalidRegistryException& )
-        {
-            OSL_ENSURE(sal_False, "InvalidRegistryException caught");
-            bRetVal = sal_False;
-        }
-    }
-
-    return bRetVal;
-}
-
 //----------------------------------------------------------------------
 // component_getFactory
 // returns a factory to create XFilePicker-Services
diff --git a/dtrans/util/dnd.component b/dtrans/util/dnd.component
new file mode 100644
index 000000000000..b56fe326f04f
--- /dev/null
+++ b/dtrans/util/dnd.component
@@ -0,0 +1,37 @@
+
+
+
+
+  
+    
+  
+  
+    
+  
+
diff --git a/dtrans/util/exports.dxp b/dtrans/util/exports.dxp
index 028ac4175990..f0e1c69934bc 100644
--- a/dtrans/util/exports.dxp
+++ b/dtrans/util/exports.dxp
@@ -1,3 +1,2 @@
 component_getImplementationEnvironment
-component_writeInfo	
 component_getFactory
diff --git a/dtrans/util/ftransl.component b/dtrans/util/ftransl.component
new file mode 100644
index 000000000000..dad7d341cce7
--- /dev/null
+++ b/dtrans/util/ftransl.component
@@ -0,0 +1,34 @@
+
+
+
+
+  
+    
+  
+
diff --git a/dtrans/util/makefile.mk b/dtrans/util/makefile.mk
index 0443c131ccb6..8df69bbf1d36 100644
--- a/dtrans/util/makefile.mk
+++ b/dtrans/util/makefile.mk
@@ -180,3 +180,32 @@ DEF3EXPORTFILE=	exports.dxp
 
 .INCLUDE :  target.mk
 
+ALLTAR : \
+    $(MISC)/dnd.component \
+    $(MISC)/ftransl.component \
+    $(MISC)/mcnttype.component \
+    $(MISC)/sysdtrans.component
+
+$(MISC)/dnd.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
+        dnd.component
+    $(XSLTPROC) --nonet --stringparam uri \
+        '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL4TARGETN:f)' -o $@ \
+        $(SOLARENV)/bin/createcomponent.xslt dnd.component
+
+$(MISC)/ftransl.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
+        ftransl.component
+    $(XSLTPROC) --nonet --stringparam uri \
+        '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL2TARGETN:f)' -o $@ \
+        $(SOLARENV)/bin/createcomponent.xslt ftransl.component
+
+$(MISC)/mcnttype.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
+        mcnttype.component
+    $(XSLTPROC) --nonet --stringparam uri \
+        '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
+        $(SOLARENV)/bin/createcomponent.xslt mcnttype.component
+
+$(MISC)/sysdtrans.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
+        sysdtrans.component
+    $(XSLTPROC) --nonet --stringparam uri \
+        '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL3TARGETN:f)' -o $@ \
+        $(SOLARENV)/bin/createcomponent.xslt sysdtrans.component
diff --git a/dtrans/util/mcnttype.component b/dtrans/util/mcnttype.component
new file mode 100644
index 000000000000..f5a937a7a77a
--- /dev/null
+++ b/dtrans/util/mcnttype.component
@@ -0,0 +1,34 @@
+
+
+
+
+  
+    
+  
+
diff --git a/dtrans/util/sysdtrans.component b/dtrans/util/sysdtrans.component
new file mode 100644
index 000000000000..ec1807000b3f
--- /dev/null
+++ b/dtrans/util/sysdtrans.component
@@ -0,0 +1,34 @@
+
+
+
+
+  
+    
+  
+
diff --git a/i18npool/prj/d.lst b/i18npool/prj/d.lst
index 54aefa732b89..8d27137424a9 100644
--- a/i18npool/prj/d.lst
+++ b/i18npool/prj/d.lst
@@ -46,3 +46,5 @@ mkdir: %_DEST%\inc%_EXT%\i18npool
 ..\%__SRC%\lib\libi18npaper*.so %_DEST%\lib%_EXT%\libi18npaper*.so
 ..\%__SRC%\lib\libi18npaper*.dylib %_DEST%\lib%_EXT%\libi18npaper*.dylib
 
+..\%__SRC%\misc\i18npool.component %_DEST%\xml%_EXT%\i18npool.component
+..\%__SRC%\misc\i18nsearch.component %_DEST%\xml%_EXT%\i18nsearch.component
diff --git a/i18npool/source/localedata/data/makefile.mk b/i18npool/source/localedata/data/makefile.mk
old mode 100644
new mode 100755
index 1ac16a31fe37..20c851edecc9
--- a/i18npool/source/localedata/data/makefile.mk
+++ b/i18npool/source/localedata/data/makefile.mk
@@ -39,6 +39,14 @@ LIBTARGET=NO
 debug!=
 .ENDIF
 
+.IF "$(OS)" == "WNT"
+my_file = file:///
+.ELSE
+my_file = file://
+.END
+
+my_components = sax.inbuild
+
 # --- Settings -----------------------------------------------------
 
 .INCLUDE :  settings.mk
@@ -62,190 +70,6 @@ LINK_LOCALEDATA_ES_LIB=-l$(SHL2TARGET)
 
 # --- Files --------------------------------------------------------
 
-# Interim files generated by the saxparser executable, for dependencies
-MY_MISC_CXXFILES = \
-    $(MISC)$/localedata_af_NA.cxx  \
-    $(MISC)$/localedata_af_ZA.cxx  \
-    $(MISC)$/localedata_ak_GH.cxx  \
-    $(MISC)$/localedata_am_ET.cxx  \
-    $(MISC)$/localedata_ar_DZ.cxx  \
-    $(MISC)$/localedata_ar_EG.cxx  \
-    $(MISC)$/localedata_ar_LB.cxx  \
-    $(MISC)$/localedata_ar_SA.cxx  \
-    $(MISC)$/localedata_ar_TN.cxx  \
-    $(MISC)$/localedata_ast_ES.cxx  \
-    $(MISC)$/localedata_az_AZ.cxx  \
-    $(MISC)$/localedata_be_BY.cxx  \
-    $(MISC)$/localedata_bg_BG.cxx  \
-    $(MISC)$/localedata_bn_IN.cxx  \
-    $(MISC)$/localedata_bn_BD.cxx  \
-    $(MISC)$/localedata_br_FR.cxx  \
-    $(MISC)$/localedata_bs_BA.cxx  \
-    $(MISC)$/localedata_ca_ES.cxx  \
-    $(MISC)$/localedata_cs_CZ.cxx  \
-    $(MISC)$/localedata_cv_RU.cxx  \
-    $(MISC)$/localedata_cy_GB.cxx  \
-    $(MISC)$/localedata_da_DK.cxx  \
-    $(MISC)$/localedata_de_AT.cxx  \
-    $(MISC)$/localedata_de_CH.cxx  \
-    $(MISC)$/localedata_de_DE.cxx  \
-    $(MISC)$/localedata_de_LI.cxx  \
-    $(MISC)$/localedata_de_LU.cxx  \
-    $(MISC)$/localedata_dz_BT.cxx  \
-    $(MISC)$/localedata_ee_GH.cxx  \
-    $(MISC)$/localedata_el_GR.cxx  \
-    $(MISC)$/localedata_en_AU.cxx  \
-    $(MISC)$/localedata_en_BZ.cxx  \
-    $(MISC)$/localedata_en_CA.cxx  \
-    $(MISC)$/localedata_en_GB.cxx  \
-    $(MISC)$/localedata_en_GH.cxx  \
-    $(MISC)$/localedata_en_IE.cxx  \
-    $(MISC)$/localedata_en_IN.cxx  \
-    $(MISC)$/localedata_en_JM.cxx  \
-    $(MISC)$/localedata_en_NA.cxx  \
-    $(MISC)$/localedata_en_NZ.cxx  \
-    $(MISC)$/localedata_en_PH.cxx  \
-    $(MISC)$/localedata_en_TT.cxx  \
-    $(MISC)$/localedata_en_US.cxx  \
-    $(MISC)$/localedata_en_ZA.cxx  \
-    $(MISC)$/localedata_en_ZW.cxx  \
-    $(MISC)$/localedata_eo.cxx     \
-    $(MISC)$/localedata_es_AR.cxx  \
-    $(MISC)$/localedata_es_BO.cxx  \
-    $(MISC)$/localedata_es_CL.cxx  \
-    $(MISC)$/localedata_es_CO.cxx  \
-    $(MISC)$/localedata_es_CR.cxx  \
-    $(MISC)$/localedata_es_DO.cxx  \
-    $(MISC)$/localedata_es_EC.cxx  \
-    $(MISC)$/localedata_es_ES.cxx  \
-    $(MISC)$/localedata_es_GT.cxx  \
-    $(MISC)$/localedata_es_HN.cxx  \
-    $(MISC)$/localedata_es_MX.cxx  \
-    $(MISC)$/localedata_es_NI.cxx  \
-    $(MISC)$/localedata_es_PA.cxx  \
-    $(MISC)$/localedata_es_PE.cxx  \
-    $(MISC)$/localedata_es_PR.cxx  \
-    $(MISC)$/localedata_es_PY.cxx  \
-    $(MISC)$/localedata_es_SV.cxx  \
-    $(MISC)$/localedata_es_UY.cxx  \
-    $(MISC)$/localedata_es_VE.cxx  \
-    $(MISC)$/localedata_et_EE.cxx  \
-    $(MISC)$/localedata_eu.cxx     \
-    $(MISC)$/localedata_fa_IR.cxx  \
-    $(MISC)$/localedata_fi_FI.cxx  \
-    $(MISC)$/localedata_fo_FO.cxx  \
-    $(MISC)$/localedata_fr_BE.cxx  \
-    $(MISC)$/localedata_fr_CA.cxx  \
-    $(MISC)$/localedata_fr_CH.cxx  \
-    $(MISC)$/localedata_fr_FR.cxx  \
-    $(MISC)$/localedata_fr_LU.cxx  \
-    $(MISC)$/localedata_fr_MC.cxx  \
-    $(MISC)$/localedata_fur_IT.cxx  \
-    $(MISC)$/localedata_fy_NL.cxx  \
-    $(MISC)$/localedata_ga_IE.cxx  \
-    $(MISC)$/localedata_gl_ES.cxx  \
-    $(MISC)$/localedata_gsc_FR.cxx \
-    $(MISC)$/localedata_gu_IN.cxx  \
-    $(MISC)$/localedata_gug_PY.cxx  \
-    $(MISC)$/localedata_ha_GH.cxx  \
-    $(MISC)$/localedata_he_IL.cxx  \
-    $(MISC)$/localedata_hi_IN.cxx  \
-    $(MISC)$/localedata_hil_PH.cxx  \
-    $(MISC)$/localedata_hr_HR.cxx  \
-    $(MISC)$/localedata_hsb_DE.cxx  \
-    $(MISC)$/localedata_hu_HU.cxx  \
-    $(MISC)$/localedata_hy_AM.cxx  \
-    $(MISC)$/localedata_ia.cxx     \
-    $(MISC)$/localedata_id_ID.cxx  \
-    $(MISC)$/localedata_is_IS.cxx  \
-    $(MISC)$/localedata_it_CH.cxx  \
-    $(MISC)$/localedata_it_IT.cxx  \
-    $(MISC)$/localedata_ja_JP.cxx  \
-    $(MISC)$/localedata_ka_GE.cxx  \
-    $(MISC)$/localedata_kk_KZ.cxx  \
-    $(MISC)$/localedata_kl_GL.cxx  \
-    $(MISC)$/localedata_km_KH.cxx  \
-    $(MISC)$/localedata_kn_IN.cxx  \
-    $(MISC)$/localedata_ko_KR.cxx  \
-    $(MISC)$/localedata_ku_TR.cxx  \
-    $(MISC)$/localedata_ky_KG.cxx  \
-    $(MISC)$/localedata_la_VA.cxx  \
-    $(MISC)$/localedata_lb_LU.cxx  \
-    $(MISC)$/localedata_lg_UG.cxx  \
-    $(MISC)$/localedata_ln_CD.cxx  \
-    $(MISC)$/localedata_lo_LA.cxx  \
-    $(MISC)$/localedata_lt_LT.cxx  \
-    $(MISC)$/localedata_ltg_LV.cxx  \
-    $(MISC)$/localedata_lv_LV.cxx  \
-    $(MISC)$/localedata_mai_IN.cxx \
-    $(MISC)$/localedata_mk_MK.cxx  \
-    $(MISC)$/localedata_ml_IN.cxx  \
-    $(MISC)$/localedata_mn_MN.cxx  \
-    $(MISC)$/localedata_mr_IN.cxx  \
-    $(MISC)$/localedata_ms_MY.cxx  \
-    $(MISC)$/localedata_mt_MT.cxx  \
-    $(MISC)$/localedata_my_MM.cxx  \
-    $(MISC)$/localedata_nb_NO.cxx  \
-    $(MISC)$/localedata_ne_NP.cxx  \
-    $(MISC)$/localedata_nl_BE.cxx  \
-    $(MISC)$/localedata_nl_NL.cxx  \
-    $(MISC)$/localedata_nn_NO.cxx  \
-    $(MISC)$/localedata_no_NO.cxx  \
-    $(MISC)$/localedata_nr_ZA.cxx  \
-    $(MISC)$/localedata_nso_ZA.cxx \
-    $(MISC)$/localedata_oc_FR.cxx  \
-    $(MISC)$/localedata_om_ET.cxx  \
-    $(MISC)$/localedata_or_IN.cxx  \
-    $(MISC)$/localedata_pa_IN.cxx  \
-    $(MISC)$/localedata_pl_PL.cxx  \
-    $(MISC)$/localedata_plt_MG.cxx  \
-    $(MISC)$/localedata_pt_BR.cxx  \
-    $(MISC)$/localedata_pt_PT.cxx  \
-    $(MISC)$/localedata_ro_RO.cxx  \
-    $(MISC)$/localedata_rue_SK.cxx  \
-    $(MISC)$/localedata_ru_RU.cxx  \
-    $(MISC)$/localedata_rw_RW.cxx  \
-    $(MISC)$/localedata_sg_CF.cxx  \
-    $(MISC)$/localedata_sh_ME.cxx  \
-    $(MISC)$/localedata_sh_RS.cxx  \
-    $(MISC)$/localedata_sh_YU.cxx  \
-    $(MISC)$/localedata_shs_CA.cxx  \
-    $(MISC)$/localedata_sk_SK.cxx  \
-    $(MISC)$/localedata_sl_SI.cxx  \
-    $(MISC)$/localedata_so_SO.cxx  \
-    $(MISC)$/localedata_sr_ME.cxx  \
-    $(MISC)$/localedata_sr_RS.cxx  \
-    $(MISC)$/localedata_sr_YU.cxx  \
-    $(MISC)$/localedata_ss_ZA.cxx  \
-    $(MISC)$/localedata_st_ZA.cxx  \
-    $(MISC)$/localedata_sv_FI.cxx  \
-    $(MISC)$/localedata_sv_SE.cxx  \
-    $(MISC)$/localedata_sw_TZ.cxx  \
-    $(MISC)$/localedata_ta_IN.cxx  \
-    $(MISC)$/localedata_te_IN.cxx  \
-    $(MISC)$/localedata_tg_TJ.cxx  \
-    $(MISC)$/localedata_th_TH.cxx  \
-    $(MISC)$/localedata_ti_ER.cxx  \
-    $(MISC)$/localedata_tk_TM.cxx  \
-    $(MISC)$/localedata_tn_ZA.cxx  \
-    $(MISC)$/localedata_tpi_PG.cxx  \
-    $(MISC)$/localedata_tr_TR.cxx  \
-    $(MISC)$/localedata_ts_ZA.cxx  \
-    $(MISC)$/localedata_ug_CN.cxx  \
-    $(MISC)$/localedata_uk_UA.cxx  \
-    $(MISC)$/localedata_uz_UZ.cxx  \
-    $(MISC)$/localedata_ve_ZA.cxx  \
-    $(MISC)$/localedata_vi_VN.cxx  \
-    $(MISC)$/localedata_wa_BE.cxx  \
-    $(MISC)$/localedata_xh_ZA.cxx  \
-    $(MISC)$/localedata_zh_CN.cxx  \
-    $(MISC)$/localedata_zh_HK.cxx  \
-    $(MISC)$/localedata_zh_MO.cxx  \
-    $(MISC)$/localedata_zh_SG.cxx  \
-    $(MISC)$/localedata_zh_TW.cxx  \
-    $(MISC)$/localedata_zu_ZA.cxx
-
-
 # English Locales
 SHL1TARGET=localedata_en
 .IF "$(GUI)" == "OS2"
@@ -504,13 +328,29 @@ DEPOBJFILES= \
     $(SHL3OBJS) \
     $(SHL4OBJS)
 
+# Interim files generated by the saxparser executable, for dependencies
+MY_MISC_CXXFILES := $(foreach,i,$(DEPOBJFILES) $(MISC)/$(i:b).cxx)
+
 # --- Targets ------------------------------------------------------
 
 .INCLUDE :  target.mk
 
-$(MY_MISC_CXXFILES) : $(BIN)$/saxparser$(EXECPOST)
+$(MY_MISC_CXXFILES) : $(BIN)$/saxparser$(EXECPOST) $(MISC)/saxparser.rdb
 
 $(MISC)$/localedata_%.cxx : %.xml
-    $(AUGMENT_LIBRARY_PATH) $(WRAPCMD) $(BIN)$/saxparser $* $< $@ $(BIN)$/$(@:b).rdb $(SOLARBINDIR)$/types.rdb
+    $(AUGMENT_LIBRARY_PATH) $(WRAPCMD) $(BIN)$/saxparser $* $< $@ \
+        $(my_file)$(PWD)/$(MISC)/saxparser.rdb $(SOLARBINDIR)$/types.rdb \
+        -env:OOO_INBUILD_SHAREDLIB_DIR=$(my_file)$(SOLARSHAREDBIN)
     $(RM) $(BIN)$/$(@:b).rdb
 
+$(MISC)/saxparser.rdb .ERRREMOVE : $(SOLARENV)/bin/packcomponents.xslt \
+        $(MISC)/saxparser.input \
+        $(my_components:^"$(SOLARXMLDIR)/":+".component")
+    $(XSLTPROC) --nonet --stringparam prefix $(SOLARXMLDIR)/ -o $@ \
+        $(SOLARENV)/bin/packcomponents.xslt $(MISC)/saxparser.input
+
+$(MISC)/saxparser.input .ERRREMOVE :
+    - $(RM) $@
+    echo \
+        '$(my_components:^"":+".component")' \
+        > $@
diff --git a/i18npool/source/localedata/saxparser.cxx b/i18npool/source/localedata/saxparser.cxx
index 9787b9c810a6..5118a827b260 100644
--- a/i18npool/source/localedata/saxparser.cxx
+++ b/i18npool/source/localedata/saxparser.cxx
@@ -34,7 +34,6 @@
 
 #include "sal/main.h"
 
-#include 
 #include 
 
 #include 
@@ -339,7 +338,7 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv)
     {
         xSMgr = createRegistryServiceFactory(
             ::rtl::OUString::createFromAscii(argv[4]),
-            ::rtl::OUString::createFromAscii(argv[5]) );
+            ::rtl::OUString::createFromAscii(argv[5]), true );
     }
     catch ( Exception& )
     {
@@ -347,38 +346,6 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv)
         exit(1);
     }
 
-    Reference < XImplementationRegistration > xReg;
-    try
-    {
-        // Create registration service
-        Reference < XInterface > x = xSMgr->createInstance(
-            OUString::createFromAscii( "com.sun.star.registry.ImplementationRegistration" ) );
-        xReg = Reference<  XImplementationRegistration > ( x , UNO_QUERY );
-    }
-    catch( Exception & ) {
-        printf( "Couldn't create ImplementationRegistration service\n" );
-        exit(1);
-    }
-
-    OString sTestName;
-    try
-    {
-        // Load dll for the tested component
-        OUString aDllName =
-            OUString::createFromAscii( "sax.uno" SAL_DLLEXTENSION );
-        xReg->registerImplementation(
-            OUString::createFromAscii( "com.sun.star.loader.SharedLibrary" ),
-            aDllName,
-            Reference< XSimpleRegistry > ()  );
-    }
-    catch( Exception &e ) {
-        printf( "Couldn't raise sax.uno library!\n" );
-        printf( "%s\n" , OUStringToOString( e.Message , RTL_TEXTENCODING_ASCII_US ).getStr() );
-
-        exit(1);
-    }
-
-
     //--------------------------------
     // parser demo
     // read xml from a file and count elements
diff --git a/i18npool/source/registerservices/registerservices.cxx b/i18npool/source/registerservices/registerservices.cxx
index 280e12dfe4f7..0671e5669956 100644
--- a/i18npool/source/registerservices/registerservices.cxx
+++ b/i18npool/source/registerservices/registerservices.cxx
@@ -580,29 +580,6 @@ void SAL_CALL component_getImplementationEnvironment( const sal_Char** ppEnvType
     *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
 }
 
-sal_Bool SAL_CALL component_writeInfo( void* /*_pServiceManager*/, void* _pRegistryKey )
-{
-    if (_pRegistryKey)
-    {
-        ::com::sun::star::registry::XRegistryKey * pRegistryKey =
-            reinterpret_cast< ::com::sun::star::registry::XRegistryKey* >(
-                                _pRegistryKey );
-        ::com::sun::star::uno::Reference<
-                        ::com::sun::star::registry::XRegistryKey > xNewKey;
-
-        for( const InstancesArray* pArr = aInstances; pArr->pServiceNm; ++pArr )
-        {
-            xNewKey = pRegistryKey->createKey(
-                    ::rtl::OUString::createFromAscii( pArr->pImplementationNm )  );
-            xNewKey = xNewKey->createKey(
-                    ::rtl::OUString::createFromAscii( "/UNO/SERVICES" ) );
-            xNewKey->createKey(
-                    ::rtl::OUString::createFromAscii( pArr->pServiceNm ) );
-        }
-    }
-    return sal_True;
-}
-
 void* SAL_CALL component_getFactory( const sal_Char* sImplementationName, void* _pServiceManager, void* /*_pRegistryKey*/ )
 {
     void* pRet = NULL;
diff --git a/i18npool/source/search/i18nsearch.component b/i18npool/source/search/i18nsearch.component
new file mode 100644
index 000000000000..6288bcd7c840
--- /dev/null
+++ b/i18npool/source/search/i18nsearch.component
@@ -0,0 +1,34 @@
+
+
+
+
+  
+    
+  
+
diff --git a/i18npool/source/search/makefile.mk b/i18npool/source/search/makefile.mk
index aed976edd896..372b32a216d1 100644
--- a/i18npool/source/search/makefile.mk
+++ b/i18npool/source/search/makefile.mk
@@ -76,3 +76,11 @@ DEF1NAME=		$(SHL1TARGET)
 
 .INCLUDE :	target.mk
 
+
+ALLTAR : $(MISC)/i18nsearch.component
+
+$(MISC)/i18nsearch.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
+        i18nsearch.component
+    $(XSLTPROC) --nonet --stringparam uri \
+        '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
+        $(SOLARENV)/bin/createcomponent.xslt i18nsearch.component
diff --git a/i18npool/source/search/textsearch.cxx b/i18npool/source/search/textsearch.cxx
index dea4eca2a618..e71e0fc0cd71 100644
--- a/i18npool/source/search/textsearch.cxx
+++ b/i18npool/source/search/textsearch.cxx
@@ -987,25 +987,6 @@ void SAL_CALL component_getImplementationEnvironment(
     *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
 }
 
-sal_Bool SAL_CALL component_writeInfo(
-        void* /*_pServiceManager*/, void* _pRegistryKey )
-{
-    if (_pRegistryKey)
-    {
-        ::com::sun::star::registry::XRegistryKey * pRegistryKey =
-            reinterpret_cast< ::com::sun::star::registry::XRegistryKey* >(
-                                _pRegistryKey );
-        ::com::sun::star::uno::Reference<
-                        ::com::sun::star::registry::XRegistryKey > xNewKey;
-
-        xNewKey = pRegistryKey->createKey( getImplementationName_Static() );
-        xNewKey = xNewKey->createKey(
-                ::rtl::OUString::createFromAscii( "/UNO/SERVICES" ) );
-        xNewKey->createKey( getServiceName_Static() );
-    }
-    return sal_True;
-}
-
 void* SAL_CALL component_getFactory( const sal_Char* sImplementationName,
         void* _pServiceManager, void* /*_pRegistryKey*/ )
 {
diff --git a/i18npool/util/i18npool.component b/i18npool/util/i18npool.component
new file mode 100644
index 000000000000..d11606efb6d4
--- /dev/null
+++ b/i18npool/util/i18npool.component
@@ -0,0 +1,484 @@
+
+
+
+
+  
+    
+  
+  
+    
+  
+  
+    
+  
+  
+    
+  
+  
+    
+  
+  
+    
+  
+  
+    
+  
+  
+    
+  
+  
+    
+  
+  
+    
+  
+  
+    
+  
+  
+    
+  
+  
+    
+  
+  
+    
+  
+  
+    
+  
+  
+    
+  
+  
+    
+  
+  
+    
+  
+  
+    
+  
+  
+    
+  
+  
+    
+  
+  
+    
+  
+  
+    
+  
+  
+    
+  
+  
+    
+  
+  
+    
+  
+  
+    
+  
+  
+    
+  
+  
+    
+  
+  
+    
+  
+  
+    
+  
+  
+    
+  
+  
+    
+  
+  
+    
+  
+  
+    
+  
+  
+    
+  
+  
+    
+  
+  
+    
+  
+  
+    
+  
+  
+    
+  
+  
+    
+  
+  
+    
+  
+  
+    
+  
+  
+    
+  
+  
+    
+  
+  
+    
+  
+  
+    
+  
+  
+    
+  
+  
+    
+  
+  
+    
+  
+  
+    
+  
+  
+    
+  
+  
+    
+  
+  
+    
+  
+  
+    
+  
+  
+    
+  
+  
+    
+  
+  
+    
+  
+  
+    
+  
+  
+    
+  
+  
+    
+  
+  
+    
+  
+  
+    
+  
+  
+    
+  
+  
+    
+  
+  
+    
+  
+  
+    
+  
+  
+    
+  
+  
+    
+  
+  
+    
+  
+  
+    
+  
+  
+    
+  
+  
+    
+  
+  
+    
+  
+  
+    
+  
+  
+    
+  
+  
+    
+  
+  
+    
+  
+  
+    
+  
+  
+    
+  
+  
+    
+  
+  
+    
+  
+  
+    
+  
+  
+    
+  
+  
+    
+  
+  
+    
+  
+  
+    
+  
+  
+    
+  
+  
+    
+  
+  
+    
+  
+  
+    
+  
+  
+    
+  
+  
+    
+  
+  
+    
+  
+  
+    
+  
+  
+    
+  
+  
+    
+  
+  
+    
+  
+  
+    
+  
+  
+    
+  
+  
+    
+  
+  
+    
+  
+  
+    
+  
+  
+    
+  
+  
+    
+  
+  
+    
+  
+  
+    
+  
+  
+    
+  
+  
+    
+  
+  
+    
+  
+  
+    
+  
+  
+    
+  
+  
+    
+  
+  
+    
+  
+  
+    
+  
+  
+    
+  
+  
+    
+  
+  
+    
+  
+  
+    
+  
+  
+    
+  
+  
+    
+  
+  
+    
+  
+  
+    
+  
+  
+    
+  
+  
+    
+  
+  
+    
+  
+  
+    
+  
+  
+    
+  
+  
+    
+  
+  
+    
+  
+  
+    
+  
+  
+    
+  
+  
+    
+  
+  
+    
+  
+  
+    
+  
+  
+    
+  
+  
+    
+  
+  
+    
+  
+  
+    
+  
+  
+    
+  
+  
+    
+  
+  
+    
+  
+  
+    
+  
+  
+    
+  
+  
+    
+  
+  
+    
+  
+  
+    
+  
+  
+    
+  
+  
+    
+  
+  
+    
+  
+  
+    
+  
+
diff --git a/i18npool/util/makefile.mk b/i18npool/util/makefile.mk
index 57f802be62fe..8c9f1a83b2c0 100644
--- a/i18npool/util/makefile.mk
+++ b/i18npool/util/makefile.mk
@@ -79,3 +79,11 @@ SHL1STDLIBS= \
 # --- Targets ------------------------------------------------------------
 
 .INCLUDE :	target.mk
+
+ALLTAR : $(MISC)/i18npool.component
+
+$(MISC)/i18npool.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
+        i18npool.component
+    $(XSLTPROC) --nonet --stringparam uri \
+        '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
+        $(SOLARENV)/bin/createcomponent.xslt i18npool.component
diff --git a/sax/prj/d.lst b/sax/prj/d.lst
index 87f01348163c..76177f554909 100644
--- a/sax/prj/d.lst
+++ b/sax/prj/d.lst
@@ -2,6 +2,9 @@
 ..\%__SRC%\lib\*.so %_DEST%\lib%_EXT%\*.so
 ..\%__SRC%\lib\*.dylib %_DEST%\lib%_EXT%\*.dylib
 ..\%__SRC%\lib\*.lib %_DEST%\lib%_EXT%\*.lib
+..\%__SRC%\misc\fastsax.component %_DEST%\xml%_EXT%\fastsax.component
+..\%__SRC%\misc\sax.component %_DEST%\xml%_EXT%\sax.component
+..\%__SRC%\misc\sax.inbuild.component %_DEST%\xml%_EXT%\sax.inbuild.component
 
 mkdir: %_DEST%\inc%_EXT%\sax
 mkdir: %_DEST%\inc%_EXT%\sax\tools
diff --git a/sax/source/expatwrap/makefile.mk b/sax/source/expatwrap/makefile.mk
index bcb73b0443ac..0b2c0571ae2b 100644
--- a/sax/source/expatwrap/makefile.mk
+++ b/sax/source/expatwrap/makefile.mk
@@ -72,5 +72,16 @@ DEF1NAME=		$(SHL1TARGET)
 
 .INCLUDE :	target.mk
 
+ALLTAR : $(MISC)/sax.component $(MISC)/sax.inbuild.component
 
+$(MISC)/sax.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
+        sax.component
+    $(XSLTPROC) --nonet --stringparam uri \
+        '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
+        $(SOLARENV)/bin/createcomponent.xslt sax.component
 
+$(MISC)/sax.inbuild.component .ERRREMOVE : \
+        $(SOLARENV)/bin/createcomponent.xslt sax.component
+    $(XSLTPROC) --nonet --stringparam uri \
+        '$(COMPONENTPREFIX_INBUILD)$(SHL1TARGETN:f)' -o $@ \
+        $(SOLARENV)/bin/createcomponent.xslt sax.component
diff --git a/sax/source/expatwrap/sax.component b/sax/source/expatwrap/sax.component
new file mode 100644
index 000000000000..5e6699d9dd33
--- /dev/null
+++ b/sax/source/expatwrap/sax.component
@@ -0,0 +1,37 @@
+
+
+
+
+  
+    
+  
+  
+    
+  
+
diff --git a/sax/source/expatwrap/sax_expat.cxx b/sax/source/expatwrap/sax_expat.cxx
index 4ffebfa3590d..aaaac6bd564e 100644
--- a/sax/source/expatwrap/sax_expat.cxx
+++ b/sax/source/expatwrap/sax_expat.cxx
@@ -1034,37 +1034,6 @@ void SAL_CALL component_getImplementationEnvironment(
     *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
 }
 
-
-sal_Bool SAL_CALL component_writeInfo(
-    void * /*pServiceManager*/, void * pRegistryKey )
-{
-    if (pRegistryKey)
-    {
-        try
-        {
-            Reference< XRegistryKey > xKey(
-                reinterpret_cast< XRegistryKey * >( pRegistryKey ) );
-
-            Reference< XRegistryKey > xNewKey = xKey->createKey(
-                OUString::createFromAscii( "/" IMPLEMENTATION_NAME "/UNO/SERVICES" ) );
-            xNewKey->createKey( OUString::createFromAscii( SERVICE_NAME ) );
-
-            xNewKey = xKey->createKey( OUString::createFromAscii("/") +
-                                       SaxWriter_getImplementationName()+
-                                       OUString::createFromAscii( "/UNO/SERVICES" ) );
-            xNewKey->createKey( SaxWriter_getServiceName() );
-
-            return sal_True;
-        }
-        catch (InvalidRegistryException &)
-        {
-            OSL_ENSURE( sal_False, "### InvalidRegistryException!" );
-        }
-    }
-    return sal_False;
-}
-
-
 void * SAL_CALL component_getFactory(
     const sal_Char * pImplName, void * pServiceManager, void * /*pRegistryKey*/ )
 {
diff --git a/sax/source/fastparser/facreg.cxx b/sax/source/fastparser/facreg.cxx
index 1916a9740f1a..98a55823271e 100644
--- a/sax/source/fastparser/facreg.cxx
+++ b/sax/source/fastparser/facreg.cxx
@@ -40,34 +40,6 @@ void SAL_CALL component_getImplementationEnvironment(
     *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
 }
 
-
-sal_Bool SAL_CALL component_writeInfo(
-    void * /*pServiceManager*/, void * pRegistryKey )
-{
-    if (pRegistryKey)
-    {
-        try
-        {
-            Reference< XRegistryKey > xKey( reinterpret_cast< XRegistryKey * >( pRegistryKey ) );
-
-            Reference< XRegistryKey > xNewKey( xKey->createKey(
-                OUString::createFromAscii( "/" PARSER_IMPLEMENTATION_NAME "/UNO/SERVICES" ) ) );
-            xNewKey->createKey( OUString::createFromAscii( PARSER_SERVICE_NAME ) );
-
-            Reference< XRegistryKey > xNewKey1( xKey->createKey(
-                OUString::createFromAscii( "/" SERIALIZER_IMPLEMENTATION_NAME "/UNO/SERVICES" ) ) );
-            xNewKey1->createKey( OUString::createFromAscii( SERIALIZER_SERVICE_NAME ) );
-
-            return sal_True;
-        }
-        catch (InvalidRegistryException &)
-        {
-            OSL_ENSURE( sal_False, "### InvalidRegistryException!" );
-        }
-    }
-    return sal_False;
-}
-
 void * SAL_CALL component_getFactory( const sal_Char * pImplName, void * pServiceManager, void * /*pRegistryKey*/ )
 {
     void * pRet = 0;
diff --git a/sax/source/fastparser/fastsax.component b/sax/source/fastparser/fastsax.component
new file mode 100644
index 000000000000..a184a76d2d83
--- /dev/null
+++ b/sax/source/fastparser/fastsax.component
@@ -0,0 +1,37 @@
+
+
+
+
+  
+    
+  
+  
+    
+  
+
diff --git a/sax/source/fastparser/makefile.mk b/sax/source/fastparser/makefile.mk
index 7f70b7aee7bf..d8f9378c19b9 100644
--- a/sax/source/fastparser/makefile.mk
+++ b/sax/source/fastparser/makefile.mk
@@ -70,5 +70,10 @@ DEF1NAME=		$(SHL1TARGET)
 
 .INCLUDE :	target.mk
 
+ALLTAR : $(MISC)/fastsax.component
 
-
+$(MISC)/fastsax.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
+        fastsax.component
+    $(XSLTPROC) --nonet --stringparam uri \
+        '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
+        $(SOLARENV)/bin/createcomponent.xslt fastsax.component
diff --git a/sot/prj/d.lst b/sot/prj/d.lst
index 528b6863ef3c..10bed8c9fe5e 100644
--- a/sot/prj/d.lst
+++ b/sot/prj/d.lst
@@ -25,3 +25,4 @@ mkdir: %_DEST%\inc%_EXT%\sot
 ..\%__SRC%\bin\sot?????.dll %_DEST%\bin%_EXT%\sot?????.dll
 ..\%__SRC%\bin\sot?????.sym %_DEST%\bin%_EXT%\sot?????.sym
 ..\%__SRC%\misc\sot?????.map %_DEST%\bin%_EXT%\sot?????.map
+..\%__SRC%\misc\sot.component %_DEST%\xml%_EXT%\sot.component
diff --git a/sot/source/unoolestorage/register.cxx b/sot/source/unoolestorage/register.cxx
index 00326333546d..083a4d585ca1 100644
--- a/sot/source/unoolestorage/register.cxx
+++ b/sot/source/unoolestorage/register.cxx
@@ -69,33 +69,5 @@ SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory( const sal_Char * pImp
     return pRet;
 }
 
-SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo( void * /*pServiceManager*/, void * pRegistryKey )
-{
-    if (pRegistryKey)
-    {
-        try
-        {
-            uno::Reference< registry::XRegistryKey > xKey( reinterpret_cast< registry::XRegistryKey* >( pRegistryKey ) );
-
-            uno::Reference< registry::XRegistryKey >  xNewKey;
-
-            xNewKey = xKey->createKey( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("/") ) +
-                                        OLESimpleStorage::impl_staticGetImplementationName() +
-                                        ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "/UNO/SERVICES") )  );
-
-            const uno::Sequence< ::rtl::OUString > &rServices = OLESimpleStorage::impl_staticGetSupportedServiceNames();
-            for( sal_Int32 ind = 0; ind < rServices.getLength(); ind++ )
-                xNewKey->createKey( rServices.getConstArray()[ind] );
-
-            return sal_True;
-        }
-        catch (registry::InvalidRegistryException &)
-        {
-            OSL_ENSURE( sal_False, "### InvalidRegistryException!" );
-        }
-    }
-    return sal_False;
-}
-
 } // extern "C"
 
diff --git a/sot/util/makefile.mk b/sot/util/makefile.mk
index 60b34c356217..72d17db189be 100644
--- a/sot/util/makefile.mk
+++ b/sot/util/makefile.mk
@@ -79,3 +79,11 @@ $(MISC)$/$(SHL1TARGET).flt: makefile.mk
     @echo Making: $@
     $(TYPE) sot.flt > $@
 
+
+ALLTAR : $(MISC)/sot.component
+
+$(MISC)/sot.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
+        sot.component
+    $(XSLTPROC) --nonet --stringparam uri \
+        '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
+        $(SOLARENV)/bin/createcomponent.xslt sot.component
diff --git a/sot/util/sot.component b/sot/util/sot.component
new file mode 100644
index 000000000000..7d17c7d54475
--- /dev/null
+++ b/sot/util/sot.component
@@ -0,0 +1,34 @@
+
+
+
+
+  
+    
+  
+
diff --git a/svl/prj/d.lst b/svl/prj/d.lst
index a5c2564e81cd..d79346c16087 100644
--- a/svl/prj/d.lst
+++ b/svl/prj/d.lst
@@ -20,3 +20,6 @@ dos: sh -c "if test %OS% = MACOSX; then macosx-create-bundle %_DEST%\bin%_EXT%\b
 
 *.xml %_DEST%\xml%_EXT%\*.xml
 
+..\%__SRC%\misc\fsstorage.component %_DEST%\xml%_EXT%\fsstorage.component
+..\%__SRC%\misc\passwordcontainer.component %_DEST%\xml%_EXT%\passwordcontainer.component
+..\%__SRC%\misc\svl.component %_DEST%\xml%_EXT%\svl.component
diff --git a/svl/source/fsstor/fsfactory.cxx b/svl/source/fsstor/fsfactory.cxx
index 298b6f555e2a..62fc88f6053a 100644
--- a/svl/source/fsstor/fsfactory.cxx
+++ b/svl/source/fsstor/fsfactory.cxx
@@ -240,30 +240,6 @@ SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment (
     *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
 }
 
-SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo (
-    void * /* pServiceManager */, void * pRegistryKey)
-{
-    if (pRegistryKey)
-    {
-        uno::Reference< registry::XRegistryKey > xRegistryKey (
-            reinterpret_cast< registry::XRegistryKey*>(pRegistryKey));
-
-        uno::Reference< registry::XRegistryKey > xNewKey;
-        xNewKey = xRegistryKey->createKey(
-            ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("/") ) +
-            FSStorageFactory::impl_staticGetImplementationName() +
-            ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "/UNO/SERVICES")));
-
-        const uno::Sequence< ::rtl::OUString > aServices (
-            FSStorageFactory::impl_staticGetSupportedServiceNames());
-        for( sal_Int32 i = 0; i < aServices.getLength(); i++ )
-            xNewKey->createKey( aServices.getConstArray()[i] );
-
-        return sal_True;
-    }
-    return sal_False;
-}
-
 SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory (
     const sal_Char * pImplementationName, void * pServiceManager, void * /* pRegistryKey */)
 {
diff --git a/svl/source/fsstor/fsstorage.component b/svl/source/fsstor/fsstorage.component
new file mode 100644
index 000000000000..3ef0be825972
--- /dev/null
+++ b/svl/source/fsstor/fsstorage.component
@@ -0,0 +1,35 @@
+
+
+
+
+  
+    
+    
+  
+
diff --git a/svl/source/fsstor/makefile.mk b/svl/source/fsstor/makefile.mk
index dc91814772f9..1dd5d2307037 100644
--- a/svl/source/fsstor/makefile.mk
+++ b/svl/source/fsstor/makefile.mk
@@ -64,3 +64,11 @@ DEF1NAME=	$(SHL1TARGET)
 
 .INCLUDE : target.mk
 
+
+ALLTAR : $(MISC)/fsstorage.component
+
+$(MISC)/fsstorage.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
+        fsstorage.component
+    $(XSLTPROC) --nonet --stringparam uri \
+        '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
+        $(SOLARENV)/bin/createcomponent.xslt fsstorage.component
diff --git a/svl/source/passwordcontainer/makefile.mk b/svl/source/passwordcontainer/makefile.mk
index d9eb9615cf80..626a6ffc5830 100644
--- a/svl/source/passwordcontainer/makefile.mk
+++ b/svl/source/passwordcontainer/makefile.mk
@@ -60,3 +60,11 @@ DEF1NAME=	$(SHL1TARGET)
 
 .INCLUDE : target.mk
 
+
+ALLTAR : $(MISC)/passwordcontainer.component
+
+$(MISC)/passwordcontainer.component .ERRREMOVE : \
+        $(SOLARENV)/bin/createcomponent.xslt passwordcontainer.component
+    $(XSLTPROC) --nonet --stringparam uri \
+        '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
+        $(SOLARENV)/bin/createcomponent.xslt passwordcontainer.component
diff --git a/svl/source/passwordcontainer/passwordcontainer.component b/svl/source/passwordcontainer/passwordcontainer.component
new file mode 100644
index 000000000000..42eb47cf14dd
--- /dev/null
+++ b/svl/source/passwordcontainer/passwordcontainer.component
@@ -0,0 +1,34 @@
+
+
+
+
+  
+    
+  
+
diff --git a/svl/source/passwordcontainer/passwordcontainer.cxx b/svl/source/passwordcontainer/passwordcontainer.cxx
index 7db18c65db1f..6e92d390eea9 100644
--- a/svl/source/passwordcontainer/passwordcontainer.cxx
+++ b/svl/source/passwordcontainer/passwordcontainer.cxx
@@ -1543,24 +1543,6 @@ SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment (
     *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
 }
 
-SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo (
-    void * /* pServiceManager */, void * pRegistryKey)
-{
-    if (pRegistryKey)
-    {
-        Reference< XRegistryKey > xRegistryKey (
-            reinterpret_cast< XRegistryKey* >( pRegistryKey ));
-        Reference< XRegistryKey > xNewKey;
-
-        xNewKey = xRegistryKey->createKey(
-            ::rtl::OUString::createFromAscii( "/stardiv.svl.PasswordContainer/UNO/SERVICES" ));
-        xNewKey->createKey( ::rtl::OUString::createFromAscii("com.sun.star.task.PasswordContainer"));
-
-        return sal_True;
-    }
-    return sal_False;
-}
-
 SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory (
     const sal_Char * pImplementationName, void * pServiceManager, void * /* pRegistryKey */)
 {
diff --git a/svl/source/uno/registerservices.cxx b/svl/source/uno/registerservices.cxx
index ab01d308c2da..8edbccc2d435 100644
--- a/svl/source/uno/registerservices.cxx
+++ b/svl/source/uno/registerservices.cxx
@@ -60,37 +60,6 @@ SVL_DLLPUBLIC void SAL_CALL component_getImplementationEnvironment (
     *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
 }
 
-SVL_DLLPUBLIC sal_Bool SAL_CALL component_writeInfo (
-    void * /* _pServiceManager */, void * _pRegistryKey)
-{
-    if (_pRegistryKey)
-    {
-        Reference< css::registry::XRegistryKey > xRegistryKey (
-            reinterpret_cast< css::registry::XRegistryKey* >(_pRegistryKey));
-        Reference< css::registry::XRegistryKey > xNewKey;
-
-        xNewKey = xRegistryKey->createKey (
-            OUString::createFromAscii(
-                "/com.sun.star.uno.util.numbers.SvNumberFormatsSupplierServiceObject/UNO/SERVICES" ) );
-        xNewKey->createKey (
-            OUString::createFromAscii( "com.sun.star.util.NumberFormatsSupplier" ) );
-
-        xNewKey = xRegistryKey->createKey (
-            OUString::createFromAscii(
-                "/com.sun.star.uno.util.numbers.SvNumberFormatterServiceObject/UNO/SERVICES" ) );
-        xNewKey->createKey (
-            OUString::createFromAscii( "com.sun.star.util.NumberFormatter" ) );
-
-        xNewKey = xRegistryKey->createKey(
-            OUString::createFromAscii( "/com.sun.star.comp.svl.PathService/UNO/SERVICES" ) );
-        xNewKey->createKey (
-            OUString::createFromAscii( "com.sun.star.config.SpecialConfigManager" ) );
-
-        return sal_True;
-    }
-    return sal_False;
-}
-
 SVL_DLLPUBLIC void* SAL_CALL component_getFactory (
     const sal_Char * pImplementationName, void * _pServiceManager, void * /* _pRegistryKey*/)
 {
diff --git a/svl/util/makefile.mk b/svl/util/makefile.mk
index 3cb87dcd33ad..7cb493ae0d94 100644
--- a/svl/util/makefile.mk
+++ b/svl/util/makefile.mk
@@ -120,3 +120,11 @@ ALL: $(SLB)$/svl.lib \
 
 .INCLUDE :	target.mk
 
+
+ALLTAR : $(MISC)/svl.component
+
+$(MISC)/svl.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
+        svl.component
+    $(XSLTPROC) --nonet --stringparam uri \
+        '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
+        $(SOLARENV)/bin/createcomponent.xslt svl.component
diff --git a/svl/util/svl.component b/svl/util/svl.component
new file mode 100644
index 000000000000..4af1a31f5782
--- /dev/null
+++ b/svl/util/svl.component
@@ -0,0 +1,40 @@
+
+
+
+
+  
+    
+  
+  
+    
+  
+  
+    
+  
+
diff --git a/svtools/prj/d.lst b/svtools/prj/d.lst
index b46ddef72311..7b9c6a1957e3 100644
--- a/svtools/prj/d.lst
+++ b/svtools/prj/d.lst
@@ -38,3 +38,6 @@ dos: sh -c "if test %OS% = MACOSX; then macosx-create-bundle %_DEST%\bin%_EXT%\b
 
 *.xml %_DEST%\xml%_EXT%\*.xml
 
+..\%__SRC%\misc\hatchwindowfactory.component %_DEST%\xml%_EXT%\hatchwindowfactory.component
+..\%__SRC%\misc\productregistration.uno.component %_DEST%\xml%_EXT%\productregistration.uno.component
+..\%__SRC%\misc\svt.component %_DEST%\xml%_EXT%\svt.component
diff --git a/svtools/source/hatchwindow/hatchwindowfactory.component b/svtools/source/hatchwindow/hatchwindowfactory.component
new file mode 100644
index 000000000000..153fc8796281
--- /dev/null
+++ b/svtools/source/hatchwindow/hatchwindowfactory.component
@@ -0,0 +1,38 @@
+
+
+
+
+  
+    
+  
+  
+    
+    
+  
+
diff --git a/svtools/source/hatchwindow/hatchwindowfactory.cxx b/svtools/source/hatchwindow/hatchwindowfactory.cxx
index f8dbddff3761..0eec027167c2 100644
--- a/svtools/source/hatchwindow/hatchwindowfactory.cxx
+++ b/svtools/source/hatchwindow/hatchwindowfactory.cxx
@@ -112,45 +112,6 @@ SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment (
     *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
 }
 
-SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo (
-    void * /* pServiceManager */, void * pRegistryKey)
-{
-    if (pRegistryKey)
-    {
-        uno::Reference< registry::XRegistryKey> xRegistryKey (
-            reinterpret_cast< registry::XRegistryKey* >(pRegistryKey));
-        uno::Reference< registry::XRegistryKey> xNewKey;
-
-        // OHatchWindowFactory registration
-
-        xNewKey = xRegistryKey->createKey (
-            ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("/") ) +
-            OHatchWindowFactory::impl_staticGetImplementationName() +
-            ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "/UNO/SERVICES") ) );
-
-        uno::Sequence< ::rtl::OUString > aServices =
-            OHatchWindowFactory::impl_staticGetSupportedServiceNames();
-        for (sal_Int32 i = 0, n = aServices.getLength(); i < n; i++ )
-            xNewKey->createKey( aServices.getConstArray()[i] );
-
-
-        // ODocumentCloser registration
-
-        xNewKey = xRegistryKey->createKey (
-            ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("/") ) +
-            ODocumentCloser::impl_staticGetImplementationName() +
-            ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "/UNO/SERVICES") ) );
-
-        aServices = ODocumentCloser::impl_staticGetSupportedServiceNames();
-        for (sal_Int32 i = 0, n = aServices.getLength(); i < n; i++ )
-            xNewKey->createKey( aServices.getConstArray()[i] );
-
-
-        return sal_True;
-    }
-    return sal_False;
-}
-
 SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory (
     const sal_Char * pImplementationName, void * pServiceManager, void * /* pRegistryKey */)
 {
diff --git a/svtools/source/hatchwindow/makefile.mk b/svtools/source/hatchwindow/makefile.mk
index 316e4ab1bfe2..3c736bc4e66a 100644
--- a/svtools/source/hatchwindow/makefile.mk
+++ b/svtools/source/hatchwindow/makefile.mk
@@ -63,3 +63,11 @@ DEF1NAME=	$(SHL1TARGET)
 
 .INCLUDE : target.mk
 
+
+ALLTAR : $(MISC)/hatchwindowfactory.component
+
+$(MISC)/hatchwindowfactory.component .ERRREMOVE : \
+        $(SOLARENV)/bin/createcomponent.xslt hatchwindowfactory.component
+    $(XSLTPROC) --nonet --stringparam uri \
+        '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
+        $(SOLARENV)/bin/createcomponent.xslt hatchwindowfactory.component
diff --git a/svtools/source/productregistration/makefile.mk b/svtools/source/productregistration/makefile.mk
index a26e8feca753..b6e119601697 100644
--- a/svtools/source/productregistration/makefile.mk
+++ b/svtools/source/productregistration/makefile.mk
@@ -76,3 +76,11 @@ RESLIB1SRSFILES=\
 
 .INCLUDE : target.mk
 
+
+ALLTAR : $(MISC)/productregistration.uno.component
+
+$(MISC)/productregistration.uno.component .ERRREMOVE : \
+        $(SOLARENV)/bin/createcomponent.xslt productregistration.uno.component
+    $(XSLTPROC) --nonet --stringparam uri \
+        '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
+        $(SOLARENV)/bin/createcomponent.xslt productregistration.uno.component
diff --git a/svtools/source/productregistration/productregistration.cxx b/svtools/source/productregistration/productregistration.cxx
index 39629f5c3f77..cb3a9b7a7702 100644
--- a/svtools/source/productregistration/productregistration.cxx
+++ b/svtools/source/productregistration/productregistration.cxx
@@ -461,25 +461,6 @@ SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment (
     *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
 }
 
-SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo (
-    void * /* pServiceManager */, void * pRegistryKey)
-{
-    if (pRegistryKey)
-    {
-        Reference< XRegistryKey > xRegistryKey (
-            reinterpret_cast< XRegistryKey* >( pRegistryKey ));
-        Reference< XRegistryKey > xNewKey;
-
-        xNewKey = xRegistryKey->createKey(
-            OUString::createFromAscii( "/" PRODREG_IMPLNAME "/UNO/SERVICES" ));
-        xNewKey->createKey(
-            OUString::createFromAscii( PRODREG_SERVNAME ));
-
-        return sal_True;
-    }
-    return sal_False;
-}
-
 SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory (
     const sal_Char * pImplementationName, void * pServiceManager, void * /* pRegistryKey */)
 {
diff --git a/svtools/source/productregistration/productregistration.uno.component b/svtools/source/productregistration/productregistration.uno.component
new file mode 100644
index 000000000000..da2cfd37c483
--- /dev/null
+++ b/svtools/source/productregistration/productregistration.uno.component
@@ -0,0 +1,34 @@
+
+
+
+
+  
+    
+  
+
diff --git a/svtools/source/uno/miscservices.cxx b/svtools/source/uno/miscservices.cxx
index e16a1ecb56dc..34984976bf07 100644
--- a/svtools/source/uno/miscservices.cxx
+++ b/svtools/source/uno/miscservices.cxx
@@ -101,55 +101,6 @@ SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment (
     *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
 }
 
-SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo (
-    void * pServiceManager, void * _pRegistryKey )
-{
-    if (_pRegistryKey)
-    {
-        Reference< XRegistryKey > xRegistryKey (
-            reinterpret_cast< XRegistryKey* >( _pRegistryKey ));
-        Reference< XRegistryKey > xNewKey;
-        uno::Sequence< ::rtl::OUString >            aServices;
-
-        xNewKey = xRegistryKey->createKey (
-            OUString::createFromAscii( "/com.sun.star.comp.svtools.OAddressBookSourceDialogUno/UNO/SERVICES" ) );
-        xNewKey->createKey(
-            OUString::createFromAscii( "com.sun.star.ui.AddressBookSourceDialog" ) );
-
-        xNewKey = xRegistryKey->createKey (
-            OUString::createFromAscii( "/com.sun.star.svtools.SvFilterOptionsDialog/UNO/SERVICES" ) );
-        xNewKey->createKey (
-            OUString::createFromAscii( "com.sun.star.ui.dialogs.FilterOptionsDialog" ) );
-
-        // GraphicProvider
-        xNewKey = reinterpret_cast< registry::XRegistryKey * >( _pRegistryKey )->createKey(
-                    ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("/") ) +
-                    GraphicProvider::getImplementationName_Static() +
-                    ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "/UNO/SERVICES") ) );
-
-        aServices = GraphicProvider::getSupportedServiceNames_Static();
-        int i;
-        for( i = 0; i < aServices.getLength(); i++ )
-            xNewKey->createKey( aServices.getConstArray()[ i ] );
-
-        // GraphicRendererVCL
-        xNewKey = reinterpret_cast< registry::XRegistryKey * >( _pRegistryKey )->createKey(
-                    ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("/") ) +
-                    GraphicRendererVCL::getImplementationName_Static() +
-                    ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "/UNO/SERVICES") ) );
-
-        aServices = ( GraphicRendererVCL::getSupportedServiceNames_Static() );
-        for( i = 0; i < aServices.getLength(); i++ )
-            xNewKey->createKey( aServices.getConstArray()[ i ] );
-
-        if ( !component_writeInfoHelper( reinterpret_cast< lang::XMultiServiceFactory* >( pServiceManager ), reinterpret_cast< registry::XRegistryKey* >( _pRegistryKey ), serviceDecl ) )
-            return false;
-
-        return ::cppu::component_writeInfoHelper( pServiceManager, _pRegistryKey, s_aServiceEntries );
-    }
-    return sal_False;
-}
-
 SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory (
     const sal_Char * pImplementationName, void * _pServiceManager, void * pRegistryKey)
 {
diff --git a/svtools/util/makefile.mk b/svtools/util/makefile.mk
index f9c14a540410..27b46488a16c 100644
--- a/svtools/util/makefile.mk
+++ b/svtools/util/makefile.mk
@@ -190,3 +190,11 @@ ALL: $(SLB)$/svt.lib \
 .INCLUDE :	target.mk
 
 
+
+ALLTAR : $(MISC)/svt.component
+
+$(MISC)/svt.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
+        svt.component
+    $(XSLTPROC) --nonet --stringparam uri \
+        '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
+        $(SOLARENV)/bin/createcomponent.xslt svt.component
diff --git a/svtools/util/svt.component b/svtools/util/svt.component
new file mode 100644
index 000000000000..e15970547a38
--- /dev/null
+++ b/svtools/util/svt.component
@@ -0,0 +1,49 @@
+
+
+
+
+  
+    
+  
+  
+    
+  
+  
+    
+  
+  
+    
+  
+  
+    
+  
+  
+    
+  
+
diff --git a/toolkit/prj/d.lst b/toolkit/prj/d.lst
index 375485c96e4d..01eb5026e401 100644
--- a/toolkit/prj/d.lst
+++ b/toolkit/prj/d.lst
@@ -63,3 +63,4 @@ mkdir: %_DEST%\inc%_EXT%\layout\vcl
 ..\source\layout\vcl\*.hxx  %_DEST%\inc%_EXT%\layout\vcl\*.hxx
 
 ..\%__SRC%\bin\*-layout.zip %_DEST%\pck%_EXT%\*.*
+..\%__SRC%\misc\tk.component %_DEST%\xml%_EXT%\tk.component
diff --git a/toolkit/source/awt/asynccallback.cxx b/toolkit/source/awt/asynccallback.cxx
index 593feb582274..9e5334b2d28c 100644
--- a/toolkit/source/awt/asynccallback.cxx
+++ b/toolkit/source/awt/asynccallback.cxx
@@ -191,9 +191,3 @@ void * SAL_CALL comp_AsyncCallback_component_getFactory(
     return ::cppu::component_getFactoryHelper(
         implName, serviceManager, registryKey, entries);
 }
-
-sal_Bool SAL_CALL comp_AsyncCallback_component_writeInfo(
-    void * serviceManager, void * registryKey)
-{
-    return ::cppu::component_writeInfoHelper(serviceManager, registryKey, entries);
-}
diff --git a/toolkit/source/helper/registerservices.cxx b/toolkit/source/helper/registerservices.cxx
index aedf4024f2b9..477032538af8 100644
--- a/toolkit/source/helper/registerservices.cxx
+++ b/toolkit/source/helper/registerservices.cxx
@@ -205,10 +205,8 @@ extern ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL
 extern ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL DefaultGridColumnModel_CreateInstance( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& );
 extern ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL GridColumn_CreateInstance( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& );
 
-extern sal_Bool SAL_CALL comp_AsyncCallback_component_writeInfo( void * serviceManager, void * registryKey );
 extern void * SAL_CALL comp_AsyncCallback_component_getFactory( const char * implName, void * serviceManager, void * registryKey );
 
-extern sal_Bool SAL_CALL comp_Layout_component_writeInfo( void * serviceManager, void * registryKey );
 extern void * SAL_CALL comp_Layout_component_getFactory( const char * implName, void * serviceManager, void * registryKey );
 
 extern "C"
@@ -219,91 +217,6 @@ TOOLKIT_DLLPUBLIC void SAL_CALL component_getImplementationEnvironment( const sa
     *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
 }
 
-TOOLKIT_DLLPUBLIC sal_Bool SAL_CALL component_writeInfo( void* _pServiceManager, void* _pRegistryKey )
-{
-    if (_pRegistryKey)
-    {
-        ::com::sun::star::uno::Reference< ::com::sun::star::registry::XRegistryKey > xRegistryKey =
-            static_cast< ::com::sun::star::registry::XRegistryKey* >( _pRegistryKey );
-
-        registerServices( xRegistryKey, "VCLXToolkit", szServiceName_Toolkit, szServiceName2_Toolkit );
-        registerServices( xRegistryKey, "VCLXPopupMenu", szServiceName_PopupMenu, szServiceName2_PopupMenu );
-        registerServices( xRegistryKey, "VCLXMenuBar", szServiceName_MenuBar, szServiceName2_MenuBar );
-        registerServices( xRegistryKey, "VCLXPointer", szServiceName_Pointer, szServiceName2_Pointer );
-        registerServices( xRegistryKey, "UnoControlContainer", szServiceName_UnoControlContainer, szServiceName2_UnoControlContainer );
-        registerServices( xRegistryKey, "UnoControlContainerModel", szServiceName_UnoControlContainerModel, szServiceName2_UnoControlContainerModel );
-        registerServices( xRegistryKey, "StdTabController", szServiceName_TabController, szServiceName2_TabController );
-        registerServices( xRegistryKey, "StdTabControllerModel", szServiceName_TabControllerModel, szServiceName2_TabControllerModel );
-        registerServices( xRegistryKey, "UnoDialogControl", szServiceName_UnoControlDialog, szServiceName2_UnoControlDialog );
-        registerServices( xRegistryKey, "UnoControlDialogModel", szServiceName_UnoControlDialogModel, szServiceName2_UnoControlDialogModel );
-        registerServices( xRegistryKey, "UnoEditControl", szServiceName_UnoControlEdit, szServiceName2_UnoControlEdit );
-        registerServices( xRegistryKey, "UnoControlEditModel", szServiceName_UnoControlEditModel, szServiceName2_UnoControlEditModel );
-        registerServices( xRegistryKey, "UnoDateFieldControl", szServiceName_UnoControlDateField, szServiceName2_UnoControlDateField );
-        registerServices( xRegistryKey, "UnoControlDateFieldModel", szServiceName_UnoControlDateFieldModel, szServiceName2_UnoControlDateFieldModel );
-        registerServices( xRegistryKey, "UnoTimeFieldControl", szServiceName_UnoControlTimeField, szServiceName2_UnoControlTimeField );
-        registerServices( xRegistryKey, "UnoControlTimeFieldModel", szServiceName_UnoControlTimeFieldModel, szServiceName2_UnoControlTimeFieldModel );
-        registerServices( xRegistryKey, "UnoNumericFieldControl", szServiceName_UnoControlNumericField, szServiceName2_UnoControlNumericField );
-        registerServices( xRegistryKey, "UnoControlNumericFieldModel", szServiceName_UnoControlNumericFieldModel, szServiceName2_UnoControlNumericFieldModel );
-        registerServices( xRegistryKey, "UnoCurrencyFieldControl", szServiceName_UnoControlCurrencyField, szServiceName2_UnoControlCurrencyField );
-        registerServices( xRegistryKey, "UnoControlCurrencyFieldModel", szServiceName_UnoControlCurrencyFieldModel, szServiceName2_UnoControlCurrencyFieldModel );
-        registerServices( xRegistryKey, "UnoPatternFieldControl", szServiceName_UnoControlPatternField, szServiceName2_UnoControlPatternField );
-        registerServices( xRegistryKey, "UnoControlPatternFieldModel", szServiceName_UnoControlPatternFieldModel, szServiceName2_UnoControlPatternFieldModel );
-        registerServices( xRegistryKey, "UnoFormattedFieldControl", szServiceName_UnoControlFormattedField, szServiceName2_UnoControlFormattedField );
-        registerServices( xRegistryKey, "UnoControlFormattedFieldModel", szServiceName_UnoControlFormattedFieldModel, szServiceName2_UnoControlFormattedFieldModel );
-        registerServices( xRegistryKey, "UnoFileControl", szServiceName_UnoControlFileControl, szServiceName2_UnoControlFileControl );
-        registerServices( xRegistryKey, "UnoControlFileControlModel", szServiceName_UnoControlFileControlModel, szServiceName2_UnoControlFileControlModel );
-        registerServices( xRegistryKey, "UnoButtonControl", szServiceName_UnoControlButton, szServiceName2_UnoControlButton );
-        registerServices( xRegistryKey, "UnoControlButtonModel", szServiceName_UnoControlButtonModel, szServiceName2_UnoControlButtonModel );
-        registerServices( xRegistryKey, "UnoImageControlControl", szServiceName_UnoControlImageButton, szServiceName2_UnoControlImageButton );
-        registerServices( xRegistryKey, "UnoControlImageControlModel", szServiceName_UnoControlImageButtonModel, szServiceName2_UnoControlImageButtonModel );
-        registerServices( xRegistryKey, "UnoImageControlControl", szServiceName_UnoControlImageControl, szServiceName2_UnoControlImageControl );
-        registerServices( xRegistryKey, "UnoControlImageControlModel", szServiceName_UnoControlImageControlModel, szServiceName2_UnoControlImageControlModel );
-        registerServices( xRegistryKey, "UnoRadioButtonControl", szServiceName_UnoControlRadioButton, szServiceName2_UnoControlRadioButton );
-        registerServices( xRegistryKey, "UnoControlRadioButtonModel", szServiceName_UnoControlRadioButtonModel, szServiceName2_UnoControlRadioButtonModel );
-        registerServices( xRegistryKey, "UnoCheckBoxControl", szServiceName_UnoControlCheckBox, szServiceName2_UnoControlCheckBox );
-        registerServices( xRegistryKey, "UnoControlCheckBoxModel", szServiceName_UnoControlCheckBoxModel, szServiceName2_UnoControlCheckBoxModel );
-        registerServices( xRegistryKey, "UnoListBoxControl", szServiceName_UnoControlListBox, szServiceName2_UnoControlListBox );
-        registerServices( xRegistryKey, "UnoControlListBoxModel", szServiceName_UnoControlListBoxModel, szServiceName2_UnoControlListBoxModel );
-        registerServices( xRegistryKey, "UnoComboBoxControl", szServiceName_UnoControlComboBox, szServiceName2_UnoControlComboBox );
-        registerServices( xRegistryKey, "UnoControlComboBoxModel", szServiceName_UnoControlComboBoxModel, szServiceName2_UnoControlComboBoxModel );
-        registerServices( xRegistryKey, "UnoFixedTextControl", szServiceName_UnoControlFixedText, szServiceName2_UnoControlFixedText );
-        registerServices( xRegistryKey, "UnoControlFixedTextModel", szServiceName_UnoControlFixedTextModel, szServiceName2_UnoControlFixedTextModel );
-        registerServices( xRegistryKey, "UnoGroupBoxControl", szServiceName_UnoControlGroupBox, szServiceName2_UnoControlGroupBox );
-        registerServices( xRegistryKey, "UnoControlGroupBoxModel", szServiceName_UnoControlGroupBoxModel, szServiceName2_UnoControlGroupBoxModel );
-        registerServices( xRegistryKey, "UnoProgressBarControl", szServiceName_UnoControlProgressBar, szServiceName2_UnoControlProgressBar );
-        registerServices( xRegistryKey, "UnoControlProgressBarModel", szServiceName_UnoControlProgressBarModel, szServiceName2_UnoControlProgressBarModel );
-        registerServices( xRegistryKey, "UnoScrollBarControl", szServiceName_UnoControlScrollBar, szServiceName2_UnoControlScrollBar );
-        registerServices( xRegistryKey, "UnoControlScrollBarModel", szServiceName_UnoControlScrollBarModel, szServiceName2_UnoControlScrollBarModel );
-        registerServices( xRegistryKey, "UnoSpinButtonModel", szServiceName_UnoSpinButtonModel );
-        registerServices( xRegistryKey, "UnoSpinButtonControl", szServiceName_UnoSpinButtonControl );
-        registerServices( xRegistryKey, "UnoFixedLineControl", szServiceName_UnoControlFixedLine, szServiceName2_UnoControlFixedLine );
-        registerServices( xRegistryKey, "UnoControlFixedLineModel", szServiceName_UnoControlFixedLineModel, szServiceName2_UnoControlFixedLineModel );
-        registerServices( xRegistryKey, "VCLXPrinterServer", szServiceName_PrinterServer, szServiceName2_PrinterServer );
-        registerServices( xRegistryKey, "UnoRoadmapControl", szServiceName_UnoControlRoadmap, szServiceName2_UnoControlRoadmap );
-        registerServices( xRegistryKey, "UnoControlRoadmapModel", szServiceName_UnoControlRoadmapModel, szServiceName2_UnoControlRoadmapModel );
-        registerServices( xRegistryKey, "TreeControl", szServiceName_TreeControl );
-        registerServices( xRegistryKey, "TreeControlModel", szServiceName_TreeControlModel );
-        registerServices( xRegistryKey, "MutableTreeDataModel", szServiceName_MutableTreeDataModel );
-        registerServices( xRegistryKey, "UnoSimpleAnimationControlModel", szServiceName_UnoSimpleAnimationControlModel, szServiceName2_UnoSimpleAnimationControlModel );
-        registerServices( xRegistryKey, "UnoSimpleAnimationControl", szServiceName_UnoSimpleAnimationControl, szServiceName2_UnoSimpleAnimationControl );
-        registerServices( xRegistryKey, "UnoThrobberControlModel", szServiceName_UnoThrobberControlModel, szServiceName2_UnoThrobberControlModel );
-        registerServices( xRegistryKey, "UnoThrobberControl", szServiceName_UnoThrobberControl, szServiceName2_UnoThrobberControl );
-        registerServices( xRegistryKey, "UnoFixedHyperlinkControl", szServiceName_UnoControlFixedHyperlink );
-        registerServices( xRegistryKey, "UnoControlFixedHyperlinkModel", szServiceName_UnoControlFixedHyperlinkModel );
-        registerServices( xRegistryKey, "GridControl", szServiceName_GridControl );
-        registerServices( xRegistryKey, "GridControlModel", szServiceName_GridControlModel );
-        registerServices( xRegistryKey, "DefaultGridDataModel", szServiceName_DefaultGridDataModel );
-        registerServices( xRegistryKey, "DefaultGridColumnModel", szServiceName_DefaultGridColumnModel );
-        registerServices( xRegistryKey, "GridColumn", szServiceName_GridColumn );
-
-        comp_AsyncCallback_component_writeInfo( _pServiceManager, _pRegistryKey );
-        comp_Layout_component_writeInfo( _pServiceManager, _pRegistryKey );
-
-        return sal_True;
-    }
-    return sal_False;
-}
-
 TOOLKIT_DLLPUBLIC void* SAL_CALL component_getFactory( const sal_Char* sImplementationName, void* _pServiceManager, void* _pRegistryKey )
 {
     void* pRet = NULL;
diff --git a/toolkit/source/layout/core/factory.cxx b/toolkit/source/layout/core/factory.cxx
index db9616a8cc77..1390d9405f71 100644
--- a/toolkit/source/layout/core/factory.cxx
+++ b/toolkit/source/layout/core/factory.cxx
@@ -57,33 +57,6 @@ void * SAL_CALL comp_Layout_component_getFactory( const char * pImplName, void *
         return pRet;
     }
 
-sal_Bool SAL_CALL comp_Layout_component_writeInfo( void * /*serviceManager*/, void * pRegistryKey )
-    {
-        if ( pRegistryKey )
-        {
-            try
-            {
-                uno::Reference< registry::XRegistryKey > xKey( reinterpret_cast< registry::XRegistryKey* >( pRegistryKey ) );
-                uno::Reference< registry::XRegistryKey >  xNewKey;
-
-                xNewKey = xKey->createKey( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("/") ) +
-                                           LayoutFactory::impl_staticGetImplementationName() +
-                                           ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "/UNO/SERVICES") )  );
-
-                const uno::Sequence< ::rtl::OUString > aServices = LayoutFactory::impl_staticGetSupportedServiceNames();
-                for ( sal_Int32 i = 0; i < aServices.getLength(); i++ )
-                    xNewKey->createKey( aServices.getConstArray()[i] );
-
-                return sal_True;
-            }
-            catch (registry::InvalidRegistryException &)
-        {
-            OSL_ENSURE( sal_False, "### InvalidRegistryException!" );
-        }
-        }
-        return sal_False;
-    }
-
 // Component registration
 ::rtl::OUString SAL_CALL LayoutFactory::impl_staticGetImplementationName()
 {
diff --git a/toolkit/util/makefile.mk b/toolkit/util/makefile.mk
index 48d534a8a9b3..2e9adce4f6bd 100644
--- a/toolkit/util/makefile.mk
+++ b/toolkit/util/makefile.mk
@@ -83,3 +83,11 @@ RESLIB1SRSFILES=$(RES1FILELIST)
 
 # --- Footer -------------------------------------------------------------
 .INCLUDE :	target.mk
+
+ALLTAR : $(MISC)/tk.component
+
+$(MISC)/tk.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
+        tk.component
+    $(XSLTPROC) --nonet --stringparam uri \
+        '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
+        $(SOLARENV)/bin/createcomponent.xslt tk.component
diff --git a/toolkit/util/tk.component b/toolkit/util/tk.component
new file mode 100644
index 000000000000..e782283c39eb
--- /dev/null
+++ b/toolkit/util/tk.component
@@ -0,0 +1,298 @@
+
+
+
+
+  
+    
+  
+  
+    
+    
+  
+  
+    
+  
+  
+    
+  
+  
+    
+  
+  
+    
+  
+  
+    
+  
+  
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+  
+  
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+  
+  
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+
diff --git a/unotools/prj/d.lst b/unotools/prj/d.lst
index ad8a764055b2..38cafd0cc1f8 100644
--- a/unotools/prj/d.lst
+++ b/unotools/prj/d.lst
@@ -9,3 +9,4 @@
 mkdir: %_DEST%\inc%_EXT%\unotools
 ..\inc\unotools\*.hxx %_DEST%\inc%_EXT%\unotools\*.hxx
 ..\inc\unotools\unotoolsdllapi.h %_DEST%\inc%_EXT%\unotools\unotoolsdllapi.h
+..\%__SRC%\misc\utl.component %_DEST%\xml%_EXT%\utl.component
diff --git a/unotools/source/ucbhelper/xtempfile.cxx b/unotools/source/ucbhelper/xtempfile.cxx
index 023211dc3527..525596fae854 100644
--- a/unotools/source/ucbhelper/xtempfile.cxx
+++ b/unotools/source/ucbhelper/xtempfile.cxx
@@ -28,12 +28,6 @@
 #include 
 #include 
 #include 
-#ifndef _COM_SUN_STAR_REGISTRY_XREGISTRYKEY_HPP
-#include 
-#endif
-#ifndef _COM_SUN_STAR_BEANS_PROPERTYATTRIBUTE_HPP
-#include 
-#endif
 #include 
 #include 
 #include 
@@ -489,43 +483,6 @@ throw ( ::css::uno::RuntimeException )
     return ::cppu::createSingleComponentFactory( XTempFile_createInstance, getImplementationName_Static(), getSupportedServiceNames_Static() );
 }
 
-static sal_Bool writeInfo( void * pRegistryKey,
-                          const ::rtl::OUString & rImplementationName,
-                          ::css::uno::Sequence< ::rtl::OUString > const & rServiceNames )
-{
-    ::rtl::OUString aKeyName( RTL_CONSTASCII_USTRINGPARAM ( "/" ) );
-    aKeyName += rImplementationName;
-    aKeyName += ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "/UNO/SERVICES" ) );
-
-    ::css::uno::Reference< ::css::registry::XRegistryKey > xKey;
-    try
-    {
-        xKey = static_cast< ::css::registry::XRegistryKey * >(
-                                    pRegistryKey )->createKey( aKeyName );
-    }
-    catch ( ::css::registry::InvalidRegistryException const & )
-    {
-    }
-
-    if ( !xKey.is() )
-        return sal_False;
-
-    sal_Bool bSuccess = sal_True;
-
-    for ( sal_Int32 n = 0; n < rServiceNames.getLength(); ++n )
-    {
-        try
-        {
-            xKey->createKey( rServiceNames[ n ] );
-        }
-        catch ( ::css::registry::InvalidRegistryException const & )
-        {
-            bSuccess = sal_False;
-            break;
-        }
-    }
-    return bSuccess;
-}
 // C functions to implement this as a component
 
 extern "C" SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment(
@@ -534,21 +491,6 @@ extern "C" SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnviron
     *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
 }
 
-/**
- * This function creates an implementation section in the registry and another subkey
- * for each supported service.
- * @param pServiceManager generic uno interface providing a service manager
- * @param pRegistryKey generic uno interface providing registry key to write
- */
-extern "C" SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo( void* /*pServiceManager*/, void* pRegistryKey )
-{
-    return pRegistryKey &&
-    writeInfo (pRegistryKey,
-        OTempFileService::getImplementationName_Static(),
-        OTempFileService::getSupportedServiceNames_Static() );
-}
-
-
 /**
  * This function is called to get service factories for an implementation.
  * @param pImplName name of implementation
diff --git a/unotools/util/makefile.mk b/unotools/util/makefile.mk
index 8e725d2de2fa..343e56f04169 100644
--- a/unotools/util/makefile.mk
+++ b/unotools/util/makefile.mk
@@ -94,3 +94,11 @@ $(MISC)$/$(SHL1TARGET).flt: makefile.mk
     @echo UpdateToConfig				>> $@
         @echo _Impl >> $@
 
+
+ALLTAR : $(MISC)/utl.component
+
+$(MISC)/utl.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
+        utl.component
+    $(XSLTPROC) --nonet --stringparam uri \
+        '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
+        $(SOLARENV)/bin/createcomponent.xslt utl.component
diff --git a/unotools/util/utl.component b/unotools/util/utl.component
new file mode 100644
index 000000000000..8c8198741f55
--- /dev/null
+++ b/unotools/util/utl.component
@@ -0,0 +1,34 @@
+
+
+
+
+  
+    
+  
+
diff --git a/vcl/aqua/source/dtrans/aqua_service.cxx b/vcl/aqua/source/dtrans/aqua_service.cxx
index 571bea2e554f..57ef1f11175c 100644
--- a/vcl/aqua/source/dtrans/aqua_service.cxx
+++ b/vcl/aqua/source/dtrans/aqua_service.cxx
@@ -58,28 +58,6 @@ void SAL_CALL component_getImplementationEnvironment(
     *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
 }
 
-sal_Bool SAL_CALL component_writeInfo( void* pServiceManager, void* pRegistryKey )
-{
-    sal_Bool bRetVal = sal_False;
-
-    if ( pRegistryKey )
-    {
-        try
-        {
-            Reference< XRegistryKey > pXNewKey( static_cast< XRegistryKey* >( pRegistryKey ) );
-            pXNewKey->createKey( OUString( RTL_CONSTASCII_USTRINGPARAM( AQUA_CLIPBOARD_REGKEY_NAME ) ) );
-            bRetVal = sal_True;
-        }
-        catch( InvalidRegistryException& )
-        {
-            OSL_ENSURE(sal_False, "InvalidRegistryException caught");
-            bRetVal = sal_False;
-        }
-    }
-
-    return bRetVal;
-}
-
 void* SAL_CALL component_getFactory( const sal_Char* pImplName, uno_Interface* pSrvManager, uno_Interface* pRegistryKey )
 {
     void* pRet = 0;
diff --git a/vcl/prj/d.lst b/vcl/prj/d.lst
index 38c025b5a5af..77f7f84ebccd 100644
--- a/vcl/prj/d.lst
+++ b/vcl/prj/d.lst
@@ -153,3 +153,4 @@ mkdir: %_DEST%\inc%_EXT%\vcl
 ..\inc\vcl\helper.hxx %_DEST%\inc%_EXT%\vcl\helper.hxx
 ..\inc\vcl\strhelper.hxx %_DEST%\inc%_EXT%\vcl\strhelper.hxx
 ..\inc\vcl\lazydelete.hxx %_DEST%\inc%_EXT%\vcl\lazydelete.hxx
+..\%__SRC%\misc\vcl.component %_DEST%\xml%_EXT%\vcl.component
diff --git a/vcl/source/components/factory.cxx b/vcl/source/components/factory.cxx
index 6bed493cacde..c4debea79001 100644
--- a/vcl/source/components/factory.cxx
+++ b/vcl/source/components/factory.cxx
@@ -84,62 +84,6 @@ extern "C" {
         *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
     }
 
-    VCL_DLLPUBLIC sal_Bool SAL_CALL component_writeInfo( void* /*pServiceManager*/, void* pXUnoKey )
-    {
-        if( pXUnoKey )
-        {
-            try
-            {
-                Reference< ::com::sun::star::registry::XRegistryKey > xKey( reinterpret_cast< ::com::sun::star::registry::XRegistryKey* >( pXUnoKey ) );
-
-                OUStringBuffer aImplName(64);
-                aImplName.appendAscii( "/" );
-                aImplName.append( vcl_session_getImplementationName() );
-                aImplName.appendAscii( "/UNO/SERVICES/" );
-                aImplName.append( vcl_session_getSupportedServiceNames()[0] );
-                xKey->createKey( aImplName.makeStringAndClear() );
-
-                aImplName.appendAscii( "/" );
-                aImplName.append( vcl::DisplayAccess_getImplementationName() );
-                aImplName.appendAscii( "/UNO/SERVICES/" );
-                aImplName.append( vcl::DisplayAccess_getSupportedServiceNames()[0] );
-                xKey->createKey( aImplName.makeStringAndClear() );
-
-                aImplName.appendAscii( "/" );
-                aImplName.append( vcl::FontIdentificator_getImplementationName() );
-                aImplName.appendAscii( "/UNO/SERVICES/" );
-                aImplName.append( vcl::FontIdentificator_getSupportedServiceNames()[0] );
-                xKey->createKey( aImplName.makeStringAndClear() );
-
-                #if defined UNX
-                aImplName.appendAscii( "/" );
-                aImplName.append( vcl::Clipboard_getImplementationName() );
-                aImplName.appendAscii( "/UNO/SERVICES/" );
-                aImplName.append( vcl::Clipboard_getSupportedServiceNames()[0] );
-                xKey->createKey( aImplName.makeStringAndClear() );
-
-                aImplName.appendAscii( "/" );
-                aImplName.append( vcl::DragSource_getImplementationName() );
-                aImplName.appendAscii( "/UNO/SERVICES/" );
-                aImplName.append( vcl::DragSource_getSupportedServiceNames()[0] );
-                xKey->createKey( aImplName.makeStringAndClear() );
-
-                aImplName.appendAscii( "/" );
-                aImplName.append( vcl::DropTarget_getImplementationName() );
-                aImplName.appendAscii( "/UNO/SERVICES/" );
-                aImplName.append( vcl::DropTarget_getSupportedServiceNames()[0] );
-                xKey->createKey( aImplName.makeStringAndClear() );
-                #endif
-
-                return sal_True;
-            }
-            catch( ::com::sun::star::registry::InvalidRegistryException& )
-            {
-            }
-        }
-        return sal_False;
-    }
-
     VCL_DLLPUBLIC void* SAL_CALL component_getFactory(
         const sal_Char* pImplementationName,
         void* pXUnoSMgr,
diff --git a/vcl/util/makefile.mk b/vcl/util/makefile.mk
index 04bc3f13ce4d..13dd5ce5fdcb 100644
--- a/vcl/util/makefile.mk
+++ b/vcl/util/makefile.mk
@@ -464,3 +464,16 @@ SHL6STDLIBS+= $(XRANDR_LIBS)
 
 .INCLUDE :  target.mk
 
+ALLTAR : $(MISC)/vcl.component
+
+.IF "$(OS)" == "MACOSX"
+my_platform = .macosx
+.ELIF "$(OS)" == "WNT"
+my_platform = .windows
+.END
+
+$(MISC)/vcl.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
+        vcl.component
+    $(XSLTPROC) --nonet --stringparam uri \
+        '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
+        $(SOLARENV)/bin/createcomponent.xslt vcl$(my_platform).component
diff --git a/vcl/util/vcl.component b/vcl/util/vcl.component
new file mode 100644
index 000000000000..da20fc916c32
--- /dev/null
+++ b/vcl/util/vcl.component
@@ -0,0 +1,49 @@
+
+
+
+
+  
+    
+  
+  
+    
+  
+  
+    
+  
+  
+    
+  
+  
+    
+  
+  
+    
+  
+
diff --git a/vcl/util/vcl.macosx.component b/vcl/util/vcl.macosx.component
new file mode 100644
index 000000000000..3aabcd8c7050
--- /dev/null
+++ b/vcl/util/vcl.macosx.component
@@ -0,0 +1,49 @@
+
+
+
+
+  
+    
+  
+  
+    
+  
+  
+    
+  
+  
+    
+  
+  
+    
+  
+  
+    
+  
+
diff --git a/vcl/util/vcl.windows.component b/vcl/util/vcl.windows.component
new file mode 100644
index 000000000000..72f7ace9f251
--- /dev/null
+++ b/vcl/util/vcl.windows.component
@@ -0,0 +1,40 @@
+
+
+
+
+  
+    
+  
+  
+    
+  
+  
+    
+  
+
diff --git a/vcl/workben/makefile.mk b/vcl/workben/makefile.mk
index 67c0289cc24f..e9841b8bf6f4 100644
--- a/vcl/workben/makefile.mk
+++ b/vcl/workben/makefile.mk
@@ -34,6 +34,8 @@ TARGETTYPE=GUI
 
 ENABLE_EXCEPTIONS=TRUE
 
+my_components = i18npool i18nsearch
+
 # --- Settings -----------------------------------------------------
 
 .INCLUDE :	settings.mk
@@ -136,16 +138,19 @@ APP5STDLIBS+=-lsocket
 .ENDIF
 
 .INCLUDE :	target.mk
-.IF "$(L10N_framework)"==""
 
-ALLTAR : $(BIN)$/applicat.rdb
+ALLTAR : $(BIN)/applicat.rdb $(BIN)/types.rdb
 
+$(BIN)/applicat.rdb .ERRREMOVE : $(SOLARENV)/bin/packcomponents.xslt \
+        $(MISC)/applicat.input $(my_components:^"$(SOLARXMLDIR)/":+".component")
+    $(XSLTPROC) --nonet --stringparam prefix $(SOLARXMLDIR)/ -o $@ \
+        $(SOLARENV)/bin/packcomponents.xslt $(MISC)/applicat.input
 
-$(BIN)$/applicat.rdb : makefile.mk $(UNOUCRRDB)
-    rm -f $@
-    $(GNUCOPY) $(UNOUCRRDB) $@
-     cd $(BIN) && \
-         $(REGCOMP) -register -r applicat.rdb \
-             -c i18nsearch.uno$(DLLPOST) \
-             -c i18npool.uno$(DLLPOST)
-.ENDIF
+$(MISC)/applicat.input .ERRREMOVE :
+    - $(RM) $@
+    echo \
+        '$(my_components:^"":+".component")' \
+        > $@
+
+$(BIN)/types.rdb : $(SOLARBINDIR)/types.rdb
+    $(COPY) $< $@
diff --git a/vcl/workben/svdem.cxx b/vcl/workben/svdem.cxx
index 5822f4024a59..297660d4b8df 100644
--- a/vcl/workben/svdem.cxx
+++ b/vcl/workben/svdem.cxx
@@ -55,7 +55,7 @@ SAL_IMPLEMENT_MAIN()
     tools::extendApplicationEnvironment();
 
     Reference< XMultiServiceFactory > xMS;
-    xMS = cppu::createRegistryServiceFactory( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "applicat.rdb" ) ), sal_True );
+    xMS = cppu::createRegistryServiceFactory( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "types.rdb" ) ), rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "applicat.rdb" ) ), sal_True );
 
     InitVCL( xMS );
     ::Main();
diff --git a/vcl/workben/svptest.cxx b/vcl/workben/svptest.cxx
index cc7c0f2b0cce..8f901d1c200b 100644
--- a/vcl/workben/svptest.cxx
+++ b/vcl/workben/svptest.cxx
@@ -61,7 +61,7 @@ SAL_IMPLEMENT_MAIN()
     tools::extendApplicationEnvironment();
 
     Reference< XMultiServiceFactory > xMS;
-    xMS = cppu::createRegistryServiceFactory( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "applicat.rdb" ) ), sal_True );
+    xMS = cppu::createRegistryServiceFactory( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "types.rdb" ) ), rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "applicat.rdb" ) ), sal_True );
 
     InitVCL( xMS );
     ::Main();
diff --git a/vcl/workben/vcldemo.cxx b/vcl/workben/vcldemo.cxx
index 41ca76144e5c..dafd546b3d68 100644
--- a/vcl/workben/vcldemo.cxx
+++ b/vcl/workben/vcldemo.cxx
@@ -60,7 +60,7 @@ SAL_IMPLEMENT_MAIN()
     tools::extendApplicationEnvironment();
 
     Reference< XMultiServiceFactory > xMS;
-    xMS = cppu::createRegistryServiceFactory( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "applicat.rdb" ) ), sal_True );
+    xMS = cppu::createRegistryServiceFactory( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "types.rdb" ) ), rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "applicat.rdb" ) ), sal_True );
 
     InitVCL( xMS );
     ::Main();
-- 
cgit v1.2.3


From 6dbee27b977b6cc7a208ca5fa6a3c88eba5d9b22 Mon Sep 17 00:00:00 2001
From: "Herbert Duerr [hdu]" 
Date: Mon, 13 Sep 2010 16:24:13 +0200
Subject: #i114460 workaround a bad printing problem with graphite layouted
 text

---
 vcl/unx/source/gdi/pspgraphics.cxx | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/vcl/unx/source/gdi/pspgraphics.cxx b/vcl/unx/source/gdi/pspgraphics.cxx
index d3eb103b9dd6..feffdc1adbb6 100644
--- a/vcl/unx/source/gdi/pspgraphics.cxx
+++ b/vcl/unx/source/gdi/pspgraphics.cxx
@@ -694,7 +694,7 @@ void PspServerFontLayout::InitFont() const
 static void DrawPrinterLayout( const SalLayout& rLayout, ::psp::PrinterGfx& rGfx, bool bIsPspServerFontLayout )
 {
     const int nMaxGlyphs = 200;
-    sal_GlyphId aGlyphAry[ nMaxGlyphs ];
+    sal_uInt32 aGlyphAry[ nMaxGlyphs ]; // TODO: use sal_GlyphId
     sal_Int32   aWidthAry[ nMaxGlyphs ];
     sal_Int32   aIdxAry  [ nMaxGlyphs ];
     sal_Unicode aUnicodes[ nMaxGlyphs ];
@@ -720,15 +720,20 @@ static void DrawPrinterLayout( const SalLayout& rLayout, ::psp::PrinterGfx& rGfx
 #ifdef ENABLE_GRAPHITE
         else if (pGrLayout)
         {
+        #if 0 // HACK: disabled for now due to #i114460#, see #desc12 there
+              // TODO: get rid of glyph->string mapping altogether for printing
+          // TODO: fix GraphiteServerFontLayout's returned aCharPosAry
+          // TODO: fix PrinterGfx's caching?
             pText = pGrLayout->getTextPtr();
             nMinCharPos = pGrLayout->getMinCharPos();
             nMaxCharPos = pGrLayout->getMaxCharPos();
+    #endif
         }
 #endif
     }
     for( int nStart = 0;; )
     {
-        int nGlyphCount = rLayout.GetNextGlyphs( nMaxGlyphs, aGlyphAry, aPos, nStart, aWidthAry, bIsPspServerFontLayout ? aCharPosAry : NULL );
+        int nGlyphCount = rLayout.GetNextGlyphs( nMaxGlyphs, aGlyphAry, aPos, nStart, aWidthAry, pText ? aCharPosAry : NULL );
         if( !nGlyphCount )
             break;
 
@@ -738,7 +743,7 @@ static void DrawPrinterLayout( const SalLayout& rLayout, ::psp::PrinterGfx& rGfx
             nXOffset += aWidthAry[ i ];
             aIdxAry[ i ] = nXOffset / nUnitsPerPixel;
             sal_Int32 nGlyphIdx = aGlyphAry[i] & (GF_IDXMASK | GF_ROTMASK);
-            if( bIsPspServerFontLayout )
+            if( pText )
                 aUnicodes[i] = (aCharPosAry[i] >= nMinCharPos && aCharPosAry[i] <= nMaxCharPos) ? pText[ aCharPosAry[i] ] : 0;
             else
                 aUnicodes[i] = (aGlyphAry[i] & GF_ISCHAR) ? nGlyphIdx : 0;
-- 
cgit v1.2.3


From 2881adacaa7005d5047f508f3ed8737e5c6efa1b Mon Sep 17 00:00:00 2001
From: sb 
Date: Tue, 14 Sep 2010 09:15:02 +0200
Subject: sb129: #i113189# adapted tests; improved subsequenttests

---
 sax/source/expatwrap/makefile.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sax/source/expatwrap/makefile.mk b/sax/source/expatwrap/makefile.mk
index 0b2c0571ae2b..6e1348c0d403 100644
--- a/sax/source/expatwrap/makefile.mk
+++ b/sax/source/expatwrap/makefile.mk
@@ -83,5 +83,5 @@ $(MISC)/sax.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
 $(MISC)/sax.inbuild.component .ERRREMOVE : \
         $(SOLARENV)/bin/createcomponent.xslt sax.component
     $(XSLTPROC) --nonet --stringparam uri \
-        '$(COMPONENTPREFIX_INBUILD)$(SHL1TARGETN:f)' -o $@ \
+        '$(COMPONENTPREFIX_INBUILD_NATIVE)$(SHL1TARGETN:f)' -o $@ \
         $(SOLARENV)/bin/createcomponent.xslt sax.component
-- 
cgit v1.2.3


From feb350f647dadd245aed53cc034142c757cec691 Mon Sep 17 00:00:00 2001
From: "Herbert Duerr [hdu]" 
Date: Tue, 14 Sep 2010 17:08:29 +0200
Subject: #i113861# cache ImplFontCharMap objects on UNX too

---
 vcl/source/glyphs/gcach_ftyp.cxx | 39 ++++++++++++++++++++++++++-------------
 vcl/source/glyphs/gcach_ftyp.hxx |  6 +++++-
 2 files changed, 31 insertions(+), 14 deletions(-)

diff --git a/vcl/source/glyphs/gcach_ftyp.cxx b/vcl/source/glyphs/gcach_ftyp.cxx
index bc0957a96659..88ebf76a1d03 100644
--- a/vcl/source/glyphs/gcach_ftyp.cxx
+++ b/vcl/source/glyphs/gcach_ftyp.cxx
@@ -301,6 +301,7 @@ FtFontInfo::FtFontInfo( const ImplDevFontAttributes& rDevFontAttributes,
     mnSynthetic( nSynthetic ),
     mnFontId( nFontId ),
     maDevFontAttributes( rDevFontAttributes ),
+    mpFontCharMap( NULL ),
     mpChar2Glyph( NULL ),
     mpGlyph2Char( NULL ),
     mpExtraKernInfo( pExtraKernInfo )
@@ -318,6 +319,8 @@ FtFontInfo::FtFontInfo( const ImplDevFontAttributes& rDevFontAttributes,
 
 FtFontInfo::~FtFontInfo()
 {
+    if( mpFontCharMap )
+        mpFontCharMap->DeReference();
     delete mpExtraKernInfo;
     delete mpChar2Glyph;
     delete mpGlyph2Char;
@@ -1733,29 +1736,39 @@ bool FreetypeServerFont::GetGlyphBitmap8( int nGlyphIndex, RawBitmap& rRawBitmap
 // determine unicode ranges in font
 // -----------------------------------------------------------------------
 
-ImplFontCharMap* FreetypeServerFont::GetImplFontCharMap( void ) const
+/*const*/ ImplFontCharMap* FreetypeServerFont::GetImplFontCharMap( void ) const
 {
-    CmapResult aCmapResult;
-    bool bOK = GetFontCodeRanges( aCmapResult );
-    ImplFontCharMap* pIFCMap = NULL;
-    if( !bOK )
-        pIFCMap = ImplFontCharMap::GetDefaultMap();
-    else
-        pIFCMap = new ImplFontCharMap( aCmapResult );
-    // TODO?: cache ImplFontCharMap
-    return pIFCMap;
+    const ImplFontCharMap* pIFCMap = mpFontInfo->GetImplFontCharMap();
+    return const_cast(pIFCMap); // TODO: make all GetImplFontCharMap()'s const-correct
+}
+
+const ImplFontCharMap* FtFontInfo::GetImplFontCharMap( void )
+{
+    // check if the charmap is already cached
+    if( !mpFontCharMap )
+    {
+        CmapResult aCmapResult;
+        bool bOK = GetFontCodeRanges( aCmapResult );
+        if( bOK )
+            mpFontCharMap = new ImplFontCharMap( aCmapResult );
+        else
+                mpFontCharMap = ImplFontCharMap::GetDefaultMap();
+    }
+
+    mpFontCharMap->AddReference();
+    return mpFontCharMap;
 }
 
 // TODO: merge into method GetFontCharMap()
-bool FreetypeServerFont::GetFontCodeRanges( CmapResult& rResult ) const
+bool FtFontInfo::GetFontCodeRanges( CmapResult& rResult ) const
 {
-    rResult.mbSymbolic = mpFontInfo->IsSymbolFont();
+    rResult.mbSymbolic = IsSymbolFont();
 
     // TODO: is the full CmapResult needed on platforms calling this?
     if( FT_IS_SFNT( maFaceFT ) )
     {
         ULONG nLength = 0;
-        const unsigned char* pCmap = mpFontInfo->GetTable( "cmap", &nLength );
+        const unsigned char* pCmap = GetTable( "cmap", &nLength );
         if( pCmap && (nLength > 0) )
             if( ParseCMAP( pCmap, nLength, rResult ) )
                 return true;
diff --git a/vcl/source/glyphs/gcach_ftyp.hxx b/vcl/source/glyphs/gcach_ftyp.hxx
index 9b1741aea477..a7d3f0af132c 100644
--- a/vcl/source/glyphs/gcach_ftyp.hxx
+++ b/vcl/source/glyphs/gcach_ftyp.hxx
@@ -94,6 +94,9 @@ public:
     int                   GetGlyphIndex( sal_UCS4 cChar ) const;
     void                  CacheGlyphIndex( sal_UCS4 cChar, int nGI ) const;
 
+    bool                  GetFontCodeRanges( CmapResult& ) const;
+    const ImplFontCharMap* GetImplFontCharMap( void );
+
     bool                  HasExtraKerning() const;
     int                   GetExtraKernPairs( ImplKernPairData** ) const;
     int                   GetExtraGlyphKernValue( int nLeftGlyph, int nRightGlyph ) const;
@@ -108,6 +111,8 @@ private:
     sal_IntPtr      mnFontId;
     ImplDevFontAttributes maDevFontAttributes;
 
+    const ImplFontCharMap* mpFontCharMap;
+
     // cache unicode->glyphid mapping because looking it up is expensive
     // TODO: change to hash_multimap when a use case requires a m:n mapping
     typedef ::std::hash_map Int2IntMap;
@@ -204,7 +209,6 @@ protected:
 
     int                         ApplyGlyphTransform( int nGlyphFlags, FT_GlyphRec_*, bool ) const;
     virtual void                InitGlyphData( int nGlyphIndex, GlyphData& ) const;
-    virtual bool                GetFontCodeRanges( CmapResult& ) const;
     bool                        ApplyGSUB( const ImplFontSelectData& );
     virtual ServerFontLayoutEngine* GetLayoutEngine();
 
-- 
cgit v1.2.3


From 8aad539fa223e3c3b5128668fc0ab734cbdd3281 Mon Sep 17 00:00:00 2001
From: sb 
Date: Wed, 15 Sep 2010 11:45:04 +0200
Subject: sb129: #i113189# cleaned up makefile rules; deliver services.input to
 have it modifiable for special one-off products

---
 i18npool/source/localedata/data/makefile.mk | 3 +--
 vcl/workben/makefile.mk                     | 3 +--
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/i18npool/source/localedata/data/makefile.mk b/i18npool/source/localedata/data/makefile.mk
index 20c851edecc9..1034de7f11bf 100755
--- a/i18npool/source/localedata/data/makefile.mk
+++ b/i18npool/source/localedata/data/makefile.mk
@@ -349,8 +349,7 @@ $(MISC)/saxparser.rdb .ERRREMOVE : $(SOLARENV)/bin/packcomponents.xslt \
     $(XSLTPROC) --nonet --stringparam prefix $(SOLARXMLDIR)/ -o $@ \
         $(SOLARENV)/bin/packcomponents.xslt $(MISC)/saxparser.input
 
-$(MISC)/saxparser.input .ERRREMOVE :
-    - $(RM) $@
+$(MISC)/saxparser.input :
     echo \
         '$(my_components:^"":+".component")' \
         > $@
diff --git a/vcl/workben/makefile.mk b/vcl/workben/makefile.mk
index e9841b8bf6f4..abd0c23a3607 100644
--- a/vcl/workben/makefile.mk
+++ b/vcl/workben/makefile.mk
@@ -146,8 +146,7 @@ $(BIN)/applicat.rdb .ERRREMOVE : $(SOLARENV)/bin/packcomponents.xslt \
     $(XSLTPROC) --nonet --stringparam prefix $(SOLARXMLDIR)/ -o $@ \
         $(SOLARENV)/bin/packcomponents.xslt $(MISC)/applicat.input
 
-$(MISC)/applicat.input .ERRREMOVE :
-    - $(RM) $@
+$(MISC)/applicat.input :
     echo \
         '$(my_components:^"":+".component")' \
         > $@
-- 
cgit v1.2.3


From 34c6b390e191e8aca888ccc52351fc469f59b663 Mon Sep 17 00:00:00 2001
From: "Herbert Duerr [hdu]" 
Date: Wed, 15 Sep 2010 12:01:51 +0200
Subject: #i113861# shared ImplFontCharMap objects better be constant

---
 vcl/aqua/inc/salgdi.h               | 6 +++---
 vcl/aqua/source/gdi/salgdi.cxx      | 4 ++--
 vcl/inc/vcl/glyphcache.hxx          | 2 +-
 vcl/inc/vcl/metric.hxx              | 4 ++--
 vcl/inc/vcl/salgdi.hxx              | 2 +-
 vcl/os2/inc/salgdi.h                | 4 ++--
 vcl/os2/source/gdi/salgdi3.cxx      | 8 ++++----
 vcl/source/gdi/metric.cxx           | 4 +++-
 vcl/source/gdi/outdev3.cxx          | 2 +-
 vcl/source/glyphs/gcach_ftyp.cxx    | 4 ++--
 vcl/source/glyphs/gcach_ftyp.hxx    | 2 +-
 vcl/unx/headless/svpgdi.hxx         | 2 +-
 vcl/unx/headless/svppspgraphics.cxx | 4 ++--
 vcl/unx/headless/svppspgraphics.hxx | 2 +-
 vcl/unx/headless/svptext.cxx        | 4 ++--
 vcl/unx/inc/pspgraphics.h           | 2 +-
 vcl/unx/inc/salgdi.h                | 2 +-
 vcl/unx/source/gdi/pspgraphics.cxx  | 4 ++--
 vcl/unx/source/gdi/salgdi3.cxx      | 4 ++--
 vcl/win/inc/salgdi.h                | 2 +-
 vcl/win/source/gdi/salgdi3.cxx      | 4 ++--
 21 files changed, 37 insertions(+), 35 deletions(-)

diff --git a/vcl/aqua/inc/salgdi.h b/vcl/aqua/inc/salgdi.h
index a3d6c2793aae..17c4aa7acd44 100644
--- a/vcl/aqua/inc/salgdi.h
+++ b/vcl/aqua/inc/salgdi.h
@@ -59,7 +59,7 @@ public:
     virtual ImplFontEntry*  CreateFontInstance( ImplFontSelectData& ) const;
     virtual sal_IntPtr      GetFontId() const;
 
-    ImplFontCharMap*        GetImplFontCharMap() const;
+    const ImplFontCharMap*  GetImplFontCharMap() const;
     bool                    HasChar( sal_uInt32 cChar ) const;
 
     void                    ReadOs2Table() const;
@@ -68,7 +68,7 @@ public:
 
 private:
     const ATSUFontID            mnFontId;
-    mutable ImplFontCharMap*    mpCharMap;
+    mutable const ImplFontCharMap*  mpCharMap;
     mutable bool                mbOs2Read;       // true if OS2-table related info is valid
     mutable bool                mbHasOs2Table;
     mutable bool                mbCmapEncodingRead; // true if cmap encoding of Mac font is read
@@ -281,7 +281,7 @@ public:
     // return only PairCount if (pKernPairs == NULL)
     virtual ULONG           GetKernPairs( ULONG nPairs, ImplKernPairData* pKernPairs );
     // get the repertoire of the current font
-    virtual ImplFontCharMap* GetImplFontCharMap() const;
+    virtual const ImplFontCharMap* GetImplFontCharMap() const;
     // graphics must fill supplied font list
     virtual void            GetDevFontList( ImplDevFontList* );
     // graphics should call ImplAddDevFontSubstitute on supplied
diff --git a/vcl/aqua/source/gdi/salgdi.cxx b/vcl/aqua/source/gdi/salgdi.cxx
index a368c2f574a7..f8f0c9ff7901 100644
--- a/vcl/aqua/source/gdi/salgdi.cxx
+++ b/vcl/aqua/source/gdi/salgdi.cxx
@@ -116,7 +116,7 @@ inline FourCharCode GetTag(const char aTagName[5])
 static unsigned GetUShort( const unsigned char* p ){return((p[0]<<8)+p[1]);}
 static unsigned GetUInt( const unsigned char* p ) { return((p[0]<<24)+(p[1]<<16)+(p[2]<<8)+p[3]);}
 
-ImplFontCharMap* ImplMacFontData::GetImplFontCharMap() const
+const ImplFontCharMap* ImplMacFontData::GetImplFontCharMap() const
 {
     if( mpCharMap )
     {
@@ -1986,7 +1986,7 @@ USHORT AquaSalGraphics::SetFont( ImplFontSelectData* pReqFont, int nFallbackLeve
 
 // -----------------------------------------------------------------------
 
-ImplFontCharMap* AquaSalGraphics::GetImplFontCharMap() const
+const ImplFontCharMap* AquaSalGraphics::GetImplFontCharMap() const
 {
     if( !mpMacFontData )
         return ImplFontCharMap::GetDefaultMap();
diff --git a/vcl/inc/vcl/glyphcache.hxx b/vcl/inc/vcl/glyphcache.hxx
index ecb591abbae4..0e77d5dd6bc4 100644
--- a/vcl/inc/vcl/glyphcache.hxx
+++ b/vcl/inc/vcl/glyphcache.hxx
@@ -189,7 +189,7 @@ public:
     virtual void                FetchFontMetric( ImplFontMetricData&, long& rFactor ) const = 0;
     virtual ULONG               GetKernPairs( ImplKernPairData** ) const      { return 0; }
     virtual int                 GetGlyphKernValue( int, int ) const           { return 0; }
-    virtual ImplFontCharMap*    GetImplFontCharMap() const = 0;
+    virtual const ImplFontCharMap* GetImplFontCharMap() const = 0;
     Point                       TransformPoint( const Point& ) const;
 
     GlyphData&                  GetGlyphData( int nGlyphIndex );
diff --git a/vcl/inc/vcl/metric.hxx b/vcl/inc/vcl/metric.hxx
index eae6b38c5f9d..6328890c1749 100644
--- a/vcl/inc/vcl/metric.hxx
+++ b/vcl/inc/vcl/metric.hxx
@@ -95,7 +95,7 @@ public:
 class VCL_DLLPUBLIC FontCharMap
 {
 private:
-    ImplFontCharMap*    mpImpl;
+    const ImplFontCharMap* mpImpl;
 
 public:
                         FontCharMap();
@@ -118,7 +118,7 @@ public:
 
 private:
     friend class OutputDevice;
-    void                Reset( ImplFontCharMap* pNewMap = NULL );
+    void                Reset( const ImplFontCharMap* pNewMap = NULL );
 
     // prevent assignment and copy construction
                         FontCharMap( const FontCharMap& );
diff --git a/vcl/inc/vcl/salgdi.hxx b/vcl/inc/vcl/salgdi.hxx
index cbe3581bedc4..d8276406746e 100644
--- a/vcl/inc/vcl/salgdi.hxx
+++ b/vcl/inc/vcl/salgdi.hxx
@@ -239,7 +239,7 @@ public:
     // return only PairCount if (pKernPairs == NULL)
     virtual ULONG           GetKernPairs( ULONG nMaxPairCount, ImplKernPairData* ) = 0;
     // get the repertoire of the current font
-    virtual ImplFontCharMap* GetImplFontCharMap() const = 0;
+    virtual const ImplFontCharMap* GetImplFontCharMap() const = 0;
     // graphics must fill supplied font list
     virtual void            GetDevFontList( ImplDevFontList* ) = 0;
     // graphics should call ImplAddDevFontSubstitute on supplied
diff --git a/vcl/os2/inc/salgdi.h b/vcl/os2/inc/salgdi.h
index cf05ff15d7e2..94b2b98b4183 100644
--- a/vcl/os2/inc/salgdi.h
+++ b/vcl/os2/inc/salgdi.h
@@ -74,7 +74,7 @@ public:
     bool                    AliasSymbolsHigh() const    { return mbAliasSymbolsHigh; }
     bool                    AliasSymbolsLow() const     { return mbAliasSymbolsLow; }
 
-    ImplFontCharMap*        GetImplFontCharMap() const;
+    const ImplFontCharMap*  GetImplFontCharMap() const;
 
 private:
     sal_IntPtr              mnId;
@@ -82,7 +82,7 @@ private:
     mutable bool                    mbHasKoreanRange;
     mutable bool                    mbHasCJKSupport;
 
-    mutable ImplFontCharMap*        mpUnicodeMap;
+    mutable const ImplFontCharMap*  mpUnicodeMap;
 
     // TODO: get rid of the members below needed to work with the Win9x non-unicode API
     BYTE*                   mpFontCharSets;     // all Charsets for the current font (used on W98 for kerning)
diff --git a/vcl/os2/source/gdi/salgdi3.cxx b/vcl/os2/source/gdi/salgdi3.cxx
index 864fa7a1615d..5e94c0bd3a8b 100644
--- a/vcl/os2/source/gdi/salgdi3.cxx
+++ b/vcl/os2/source/gdi/salgdi3.cxx
@@ -434,7 +434,7 @@ bool ImplOs2FontData::IsGSUBstituted( sal_Ucs cChar ) const
 
 // -----------------------------------------------------------------------
 
-ImplFontCharMap* ImplOs2FontData::GetImplFontCharMap() const
+const ImplFontCharMap* ImplOs2FontData::GetImplFontCharMap() const
 {
     mpUnicodeMap->AddReference();
     return mpUnicodeMap;
@@ -1000,10 +1000,10 @@ ULONG Os2SalGraphics::GetKernPairs( ULONG nPairs, ImplKernPairData* pKernPairs )
 
 // -----------------------------------------------------------------------
 
-static ImplFontCharMap* pOs2DefaultImplFontCharMap = NULL;
+static const ImplFontCharMap* pOs2DefaultImplFontCharMap = NULL;
 static const sal_uInt32 pOs2DefaultRangeCodes[] = {0x0020,0x00FF};
 
-ImplFontCharMap* Os2SalGraphics::GetImplFontCharMap() const
+const ImplFontCharMap* Os2SalGraphics::GetImplFontCharMap() const
 {
     if( !mpOs2FontData[0] )
         return ImplFontCharMap::GetDefaultMap();
@@ -1706,7 +1706,7 @@ void Os2SalGraphics::GetGlyphWidths( const ImplFontData* pFont,
                 rUnicodeEnc.clear();
             }
             const ImplOs2FontData* pWinFont = static_cast(pFont);
-            ImplFontCharMap* pMap = pWinFont->GetImplFontCharMap();
+            const ImplFontCharMap* pMap = pWinFont->GetImplFontCharMap();
             DBG_ASSERT( pMap && pMap->GetCharCount(), "no map" );
 
             int nCharCount = pMap->GetCharCount();
diff --git a/vcl/source/gdi/metric.cxx b/vcl/source/gdi/metric.cxx
index cd9d3f5bb7e7..222eb0ab1447 100644
--- a/vcl/source/gdi/metric.cxx
+++ b/vcl/source/gdi/metric.cxx
@@ -34,6 +34,8 @@
 #include 
 #include 
 
+#include 
+
 // =======================================================================
 
 ImplFontMetric::ImplFontMetric()
@@ -857,7 +859,7 @@ int FontCharMap::CountCharsInRange( sal_uInt32 cMin, sal_uInt32 cMax ) const
 
 // -----------------------------------------------------------------------
 
-void FontCharMap::Reset( ImplFontCharMap* pNewMap )
+void FontCharMap::Reset( const ImplFontCharMap* pNewMap )
 {
     if( pNewMap == NULL )
     {
diff --git a/vcl/source/gdi/outdev3.cxx b/vcl/source/gdi/outdev3.cxx
index c4185a77382e..e629c0c0e0d8 100644
--- a/vcl/source/gdi/outdev3.cxx
+++ b/vcl/source/gdi/outdev3.cxx
@@ -8006,7 +8006,7 @@ BOOL OutputDevice::GetFontCharMap( FontCharMap& rFontCharMap ) const
     }
     else            // need to cache
     {
-        ImplFontCharMap* pNewMap = mpGraphics->GetImplFontCharMap();
+        const ImplFontCharMap* pNewMap = mpGraphics->GetImplFontCharMap();
         rFontCharMap.Reset( pNewMap );
 
         // manage cache round-robin and insert data
diff --git a/vcl/source/glyphs/gcach_ftyp.cxx b/vcl/source/glyphs/gcach_ftyp.cxx
index 88ebf76a1d03..cf872049b6a2 100644
--- a/vcl/source/glyphs/gcach_ftyp.cxx
+++ b/vcl/source/glyphs/gcach_ftyp.cxx
@@ -1736,10 +1736,10 @@ bool FreetypeServerFont::GetGlyphBitmap8( int nGlyphIndex, RawBitmap& rRawBitmap
 // determine unicode ranges in font
 // -----------------------------------------------------------------------
 
-/*const*/ ImplFontCharMap* FreetypeServerFont::GetImplFontCharMap( void ) const
+const ImplFontCharMap* FreetypeServerFont::GetImplFontCharMap( void ) const
 {
     const ImplFontCharMap* pIFCMap = mpFontInfo->GetImplFontCharMap();
-    return const_cast(pIFCMap); // TODO: make all GetImplFontCharMap()'s const-correct
+    return pIFCMap;
 }
 
 const ImplFontCharMap* FtFontInfo::GetImplFontCharMap( void )
diff --git a/vcl/source/glyphs/gcach_ftyp.hxx b/vcl/source/glyphs/gcach_ftyp.hxx
index a7d3f0af132c..d760ce1d1fed 100644
--- a/vcl/source/glyphs/gcach_ftyp.hxx
+++ b/vcl/source/glyphs/gcach_ftyp.hxx
@@ -186,7 +186,7 @@ public:
     virtual bool                NeedsArtificialItalic() const { return mbArtItalic; }
 
     virtual void                FetchFontMetric( ImplFontMetricData&, long& rFactor ) const;
-    virtual ImplFontCharMap*    GetImplFontCharMap( void ) const;
+    virtual const ImplFontCharMap* GetImplFontCharMap( void ) const;
 
     virtual int                 GetGlyphIndex( sal_UCS4 ) const;
     int                         GetRawGlyphIndex( sal_UCS4 ) const;
diff --git a/vcl/unx/headless/svpgdi.hxx b/vcl/unx/headless/svpgdi.hxx
index 1ad9eca9d272..93ec080d0136 100644
--- a/vcl/unx/headless/svpgdi.hxx
+++ b/vcl/unx/headless/svpgdi.hxx
@@ -88,7 +88,7 @@ public:
     virtual USHORT         SetFont( ImplFontSelectData*, int nFallbackLevel );
     virtual void            GetFontMetric( ImplFontMetricData*, int nFallbackLevel );
     virtual ULONG           GetKernPairs( ULONG nPairs, ImplKernPairData* pKernPairs );
-    virtual ImplFontCharMap* GetImplFontCharMap() const;
+    virtual const ImplFontCharMap* GetImplFontCharMap() const;
     virtual void            GetDevFontList( ImplDevFontList* );
     virtual void            GetDevFontSubstList( OutputDevice* );
     virtual bool            AddTempDevFont( ImplDevFontList*, const String& rFileURL, const String& rFontName );
diff --git a/vcl/unx/headless/svppspgraphics.cxx b/vcl/unx/headless/svppspgraphics.cxx
index ccced8701f83..c7b1f4f41fca 100644
--- a/vcl/unx/headless/svppspgraphics.cxx
+++ b/vcl/unx/headless/svppspgraphics.cxx
@@ -683,12 +683,12 @@ void PspGraphics::DrawServerFontLayout( const ServerFontLayout& rLayout )
     DrawPrinterLayout( rLayout, *m_pPrinterGfx, true );
 }
 
-ImplFontCharMap* PspGraphics::GetImplFontCharMap() const
+const ImplFontCharMap* PspGraphics::GetImplFontCharMap() const
 {
     if( !m_pServerFont[0] )
         return NULL;
 
-    ImplFontCharMap* pIFCMap = m_pServerFont[0]->GetImplFontCharMap();
+    const ImplFontCharMap* pIFCMap = m_pServerFont[0]->GetImplFontCharMap();
     return pIFCMap;
 }
 
diff --git a/vcl/unx/headless/svppspgraphics.hxx b/vcl/unx/headless/svppspgraphics.hxx
index 987923eb40ff..138198239621 100644
--- a/vcl/unx/headless/svppspgraphics.hxx
+++ b/vcl/unx/headless/svppspgraphics.hxx
@@ -107,7 +107,7 @@ public:
     virtual USHORT          SetFont( ImplFontSelectData*, int nFallbackLevel );
     virtual void            GetFontMetric( ImplFontMetricData*, int nFallbackLevel );
     virtual ULONG           GetKernPairs( ULONG nPairs, ImplKernPairData* pKernPairs );
-    virtual ImplFontCharMap* GetImplFontCharMap() const;
+    virtual const ImplFontCharMap* GetImplFontCharMap() const;
     virtual void            GetDevFontList( ImplDevFontList* );
     virtual void            GetDevFontSubstList( OutputDevice* );
     virtual bool            AddTempDevFont( ImplDevFontList*, const String& rFileURL, const String& rFontName );
diff --git a/vcl/unx/headless/svptext.cxx b/vcl/unx/headless/svptext.cxx
index df3625e82643..dff1fd4d6ca7 100644
--- a/vcl/unx/headless/svptext.cxx
+++ b/vcl/unx/headless/svptext.cxx
@@ -272,12 +272,12 @@ ULONG SvpSalGraphics::GetKernPairs( ULONG nPairs, ImplKernPairData* pKernPairs )
 
 // ---------------------------------------------------------------------------
 
-ImplFontCharMap* SvpSalGraphics::GetImplFontCharMap() const
+const ImplFontCharMap* SvpSalGraphics::GetImplFontCharMap() const
 {
     if( !m_pServerFont[0] )
         return NULL;
 
-    ImplFontCharMap* pIFCMap = m_pServerFont[0]->GetImplFontCharMap();
+    const ImplFontCharMap* pIFCMap = m_pServerFont[0]->GetImplFontCharMap();
     return pIFCMap;
 }
 
diff --git a/vcl/unx/inc/pspgraphics.h b/vcl/unx/inc/pspgraphics.h
index a91029e34580..d4f5a9f156e0 100644
--- a/vcl/unx/inc/pspgraphics.h
+++ b/vcl/unx/inc/pspgraphics.h
@@ -104,7 +104,7 @@ public:
     virtual USHORT          SetFont( ImplFontSelectData*, int nFallbackLevel );
     virtual void            GetFontMetric( ImplFontMetricData*, int nFallbackLevel );
     virtual ULONG           GetKernPairs( ULONG nMaxPairs, ImplKernPairData* );
-    virtual ImplFontCharMap* GetImplFontCharMap() const;
+    virtual const ImplFontCharMap* GetImplFontCharMap() const;
     virtual void            GetDevFontList( ImplDevFontList* );
     virtual void            GetDevFontSubstList( OutputDevice* );
     virtual bool            AddTempDevFont( ImplDevFontList*, const String& rFileURL, const String& rFontName );
diff --git a/vcl/unx/inc/salgdi.h b/vcl/unx/inc/salgdi.h
index 33e6be054d48..b5fdce50eee9 100644
--- a/vcl/unx/inc/salgdi.h
+++ b/vcl/unx/inc/salgdi.h
@@ -255,7 +255,7 @@ public:
     virtual USHORT          SetFont( ImplFontSelectData*, int nFallbackLevel );
     virtual void            GetFontMetric( ImplFontMetricData*, int nFallbackLevel );
     virtual ULONG           GetKernPairs( ULONG nMaxPairs, ImplKernPairData* );
-    virtual ImplFontCharMap* GetImplFontCharMap() const;
+    virtual const ImplFontCharMap* GetImplFontCharMap() const;
     virtual void            GetDevFontList( ImplDevFontList* );
     virtual void            GetDevFontSubstList( OutputDevice* );
     virtual bool            AddTempDevFont( ImplDevFontList*, const String& rFileURL, const String& rFontName );
diff --git a/vcl/unx/source/gdi/pspgraphics.cxx b/vcl/unx/source/gdi/pspgraphics.cxx
index 3f73d1021bb8..082780cee510 100644
--- a/vcl/unx/source/gdi/pspgraphics.cxx
+++ b/vcl/unx/source/gdi/pspgraphics.cxx
@@ -770,12 +770,12 @@ void PspGraphics::DrawServerFontLayout( const ServerFontLayout& rLayout )
     DrawPrinterLayout( rLayout, *m_pPrinterGfx, true );
 }
 
-ImplFontCharMap* PspGraphics::GetImplFontCharMap() const
+const ImplFontCharMap* PspGraphics::GetImplFontCharMap() const
 {
     if( !m_pServerFont[0] )
         return NULL;
 
-    ImplFontCharMap* pIFCMap = m_pServerFont[0]->GetImplFontCharMap();
+    const ImplFontCharMap* pIFCMap = m_pServerFont[0]->GetImplFontCharMap();
     return pIFCMap;
 }
 
diff --git a/vcl/unx/source/gdi/salgdi3.cxx b/vcl/unx/source/gdi/salgdi3.cxx
index 7e605dbee981..62e575ebc5ef 100644
--- a/vcl/unx/source/gdi/salgdi3.cxx
+++ b/vcl/unx/source/gdi/salgdi3.cxx
@@ -1494,12 +1494,12 @@ void X11SalGraphics::DrawStringUCS2MB( ExtendedFontStruct& rFont,
 
 //--------------------------------------------------------------------------
 
-ImplFontCharMap* X11SalGraphics::GetImplFontCharMap() const
+const ImplFontCharMap* X11SalGraphics::GetImplFontCharMap() const
 {
     if( !mpServerFont[0] )
         return NULL;
 
-    ImplFontCharMap* pIFCMap = mpServerFont[0]->GetImplFontCharMap();
+    const ImplFontCharMap* pIFCMap = mpServerFont[0]->GetImplFontCharMap();
     return pIFCMap;
 }
 
diff --git a/vcl/win/inc/salgdi.h b/vcl/win/inc/salgdi.h
index 5b8cfb099756..95e16e5646dc 100755
--- a/vcl/win/inc/salgdi.h
+++ b/vcl/win/inc/salgdi.h
@@ -82,7 +82,7 @@ public:
     bool                    SupportsGraphite() const    { return mbHasGraphiteSupport; }
 #endif
 
-    ImplFontCharMap*        GetImplFontCharMap() const;
+    const ImplFontCharMap*  GetImplFontCharMap() const;
     const Ucs2SIntMap* GetEncodingVector() const { return mpEncodingVector; }
     void SetEncodingVector( const Ucs2SIntMap* pNewVec ) const
     {
diff --git a/vcl/win/source/gdi/salgdi3.cxx b/vcl/win/source/gdi/salgdi3.cxx
index 1915b8643d96..b279d188d9e9 100644
--- a/vcl/win/source/gdi/salgdi3.cxx
+++ b/vcl/win/source/gdi/salgdi3.cxx
@@ -1207,7 +1207,7 @@ bool ImplWinFontData::IsGSUBstituted( sal_UCS4 cChar ) const
 
 // -----------------------------------------------------------------------
 
-ImplFontCharMap* ImplWinFontData::GetImplFontCharMap() const
+const ImplFontCharMap* ImplWinFontData::GetImplFontCharMap() const
 {
     if( !mpUnicodeMap )
         return NULL;
@@ -2062,7 +2062,7 @@ ULONG WinSalGraphics::GetKernPairs( ULONG nPairs, ImplKernPairData* pKernPairs )
 
 // -----------------------------------------------------------------------
 
-ImplFontCharMap* WinSalGraphics::GetImplFontCharMap() const
+const ImplFontCharMap* WinSalGraphics::GetImplFontCharMap() const
 {
     if( !mpWinFontData[0] )
         return ImplFontCharMap::GetDefaultMap();
-- 
cgit v1.2.3


From d4dbc31173487a97e4b022f0bb9dae25440856a8 Mon Sep 17 00:00:00 2001
From: "Herbert Duerr [hdu]" 
Date: Wed, 15 Sep 2010 14:51:27 +0200
Subject: #i113861# for platforms where ImplFontCharMap objects are cached in
 lower layers the cache in OutputDevice is no longer beneficial

---
 vcl/source/gdi/outdev3.cxx | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/vcl/source/gdi/outdev3.cxx b/vcl/source/gdi/outdev3.cxx
index e629c0c0e0d8..4fd008ffa3d1 100644
--- a/vcl/source/gdi/outdev3.cxx
+++ b/vcl/source/gdi/outdev3.cxx
@@ -7987,7 +7987,7 @@ BOOL OutputDevice::GetFontCharMap( FontCharMap& rFontCharMap ) const
     if( !mpFontEntry )
         return FALSE;
 
-    // a little font charmap cache helps considerably
+#ifdef ENABLE_IFC_CACHE    // a little font charmap cache helps considerably
     static const int NMAXITEMS = 16;
     static int nUsedItems = 0, nCurItem = 0;
 
@@ -8005,10 +8005,12 @@ BOOL OutputDevice::GetFontCharMap( FontCharMap& rFontCharMap ) const
         rFontCharMap.Reset( aCache[i].maCharMap.mpImpl );
     }
     else            // need to cache
+#endif // ENABLE_IFC_CACHE
     {
         const ImplFontCharMap* pNewMap = mpGraphics->GetImplFontCharMap();
         rFontCharMap.Reset( pNewMap );
 
+#ifdef ENABLE_IFC_CACHE
         // manage cache round-robin and insert data
         CharMapCacheItem& rItem = aCache[ nCurItem ];
         rItem.mpFontData = pFontData;
@@ -8019,6 +8021,7 @@ BOOL OutputDevice::GetFontCharMap( FontCharMap& rFontCharMap ) const
 
         if( ++nUsedItems >= NMAXITEMS )
             nUsedItems = NMAXITEMS;
+#endif // ENABLE_IFC_CACHE
     }
 
     if( rFontCharMap.IsDefaultMap() )
-- 
cgit v1.2.3


From 614f61017e5ad1b2cdb12f906f8aa928bd2d0877 Mon Sep 17 00:00:00 2001
From: "Herbert Duerr [hdu]" 
Date: Wed, 15 Sep 2010 15:28:09 +0200
Subject: #i113861# make ImplFontCharMap ref-counting consistent on all
 platforms

---
 vcl/aqua/source/gdi/salgdi.cxx   | 12 ++++++------
 vcl/os2/source/gdi/salgdi3.cxx   |  1 -
 vcl/source/gdi/metric.cxx        |  4 ++--
 vcl/source/glyphs/gcach_ftyp.cxx | 18 +++++++++---------
 vcl/win/source/gdi/salgdi3.cxx   |  4 +++-
 5 files changed, 20 insertions(+), 19 deletions(-)

diff --git a/vcl/aqua/source/gdi/salgdi.cxx b/vcl/aqua/source/gdi/salgdi.cxx
index f8f0c9ff7901..ac6fca5afb74 100644
--- a/vcl/aqua/source/gdi/salgdi.cxx
+++ b/vcl/aqua/source/gdi/salgdi.cxx
@@ -118,12 +118,9 @@ static unsigned GetUInt( const unsigned char* p ) { return((p[0]<<24)+(p[1]<<16)
 
 const ImplFontCharMap* ImplMacFontData::GetImplFontCharMap() const
 {
+    // return the cached charmap
     if( mpCharMap )
-    {
-        // return the cached charmap
-        mpCharMap->AddReference();
         return mpCharMap;
-    }
 
     // set the default charmap
     mpCharMap = ImplFontCharMap::GetDefaultMap();
@@ -150,11 +147,14 @@ const ImplFontCharMap* ImplMacFontData::GetImplFontCharMap() const
 
     // parse the CMAP
     CmapResult aCmapResult;
-    mpCharMap->DeReference();
     if( ParseCMAP( &aBuffer[0], nRawLength, aCmapResult ) )
+    {
+        // create the matching charmap
+        mpCharMap->DeReference();
         mpCharMap = new ImplFontCharMap( aCmapResult );
+        mpCharMap->AddReference();
+    }
 
-    mpCharMap->AddReference();
     return mpCharMap;
 }
 
diff --git a/vcl/os2/source/gdi/salgdi3.cxx b/vcl/os2/source/gdi/salgdi3.cxx
index 5e94c0bd3a8b..0e4cb1d58b0f 100644
--- a/vcl/os2/source/gdi/salgdi3.cxx
+++ b/vcl/os2/source/gdi/salgdi3.cxx
@@ -436,7 +436,6 @@ bool ImplOs2FontData::IsGSUBstituted( sal_Ucs cChar ) const
 
 const ImplFontCharMap* ImplOs2FontData::GetImplFontCharMap() const
 {
-    mpUnicodeMap->AddReference();
     return mpUnicodeMap;
 }
 
diff --git a/vcl/source/gdi/metric.cxx b/vcl/source/gdi/metric.cxx
index 222eb0ab1447..e0a944584721 100644
--- a/vcl/source/gdi/metric.cxx
+++ b/vcl/source/gdi/metric.cxx
@@ -301,9 +301,9 @@ namespace
             int nCodesCount = sizeof(aDefaultUnicodeRanges) / sizeof(*pRangeCodes);
             CmapResult aDefaultCR( false, pRangeCodes, nCodesCount/2 );
             pDefaultUnicodeImplFontCharMap = new ImplFontCharMap( aDefaultCR );
+            pDefaultUnicodeImplFontCharMap->AddReference();
         }
 
-        pDefaultUnicodeImplFontCharMap->AddReference();
         return pDefaultUnicodeImplFontCharMap;
     }
 
@@ -315,9 +315,9 @@ namespace
             int nCodesCount = sizeof(aDefaultSymbolRanges) / sizeof(*pRangeCodes);
             CmapResult aDefaultCR( true, pRangeCodes, nCodesCount/2 );
             pDefaultSymbolImplFontCharMap = new ImplFontCharMap( aDefaultCR );
+            pDefaultSymbolImplFontCharMap->AddReference();
         }
 
-        pDefaultSymbolImplFontCharMap->AddReference();
         return pDefaultSymbolImplFontCharMap;
     }
 }
diff --git a/vcl/source/glyphs/gcach_ftyp.cxx b/vcl/source/glyphs/gcach_ftyp.cxx
index cf872049b6a2..75c8c605dcd7 100644
--- a/vcl/source/glyphs/gcach_ftyp.cxx
+++ b/vcl/source/glyphs/gcach_ftyp.cxx
@@ -1745,16 +1745,16 @@ const ImplFontCharMap* FreetypeServerFont::GetImplFontCharMap( void ) const
 const ImplFontCharMap* FtFontInfo::GetImplFontCharMap( void )
 {
     // check if the charmap is already cached
-    if( !mpFontCharMap )
-    {
-        CmapResult aCmapResult;
-        bool bOK = GetFontCodeRanges( aCmapResult );
-        if( bOK )
-            mpFontCharMap = new ImplFontCharMap( aCmapResult );
-        else
-                mpFontCharMap = ImplFontCharMap::GetDefaultMap();
-    }
+    if( mpFontCharMap )
+        return mpFontCharMap;
 
+    // get the charmap and cache it
+    CmapResult aCmapResult;
+    bool bOK = GetFontCodeRanges( aCmapResult );
+    if( bOK )
+        mpFontCharMap = new ImplFontCharMap( aCmapResult );
+    else
+               mpFontCharMap = ImplFontCharMap::GetDefaultMap();
     mpFontCharMap->AddReference();
     return mpFontCharMap;
 }
diff --git a/vcl/win/source/gdi/salgdi3.cxx b/vcl/win/source/gdi/salgdi3.cxx
index b279d188d9e9..c8e0210196e6 100644
--- a/vcl/win/source/gdi/salgdi3.cxx
+++ b/vcl/win/source/gdi/salgdi3.cxx
@@ -533,6 +533,7 @@ bool WinGlyphFallbackSubstititution::HasMissingChars( const ImplFontData* pFace,
     // avoid fonts with unknown CMAP subtables for glyph fallback
     if( !pCharMap || pCharMap->IsDefaultMap() )
         return false;
+        pCharMap->AddReference();
 
     int nMatchCount = 0;
     // static const int nMaxMatchCount = 1; // TODO: tolerate more missing characters?
@@ -1211,7 +1212,6 @@ const ImplFontCharMap* ImplWinFontData::GetImplFontCharMap() const
 {
     if( !mpUnicodeMap )
         return NULL;
-    mpUnicodeMap->AddReference();
     return mpUnicodeMap;
 }
 
@@ -2908,6 +2908,7 @@ BOOL WinSalGraphics::CreateFontSubset( const rtl::OUString& rToFile,
     {
         pWinFontData->UpdateFromHDC( mhDC );
         const ImplFontCharMap* pCharMap = pWinFontData->GetImplFontCharMap();
+        pCharMap->AddReference();
 
         long nRealGlyphIds[ 256 ];
         for( int i = 0; i < nGlyphCount; ++i )
@@ -3174,6 +3175,7 @@ void WinSalGraphics::GetGlyphWidths( const ImplFontData* pFont,
             const ImplWinFontData* pWinFont = static_cast(pFont);
             const ImplFontCharMap* pMap = pWinFont->GetImplFontCharMap();
             DBG_ASSERT( pMap && pMap->GetCharCount(), "no map" );
+            pMap->AddReference();
 
             int nCharCount = pMap->GetCharCount();
             sal_uInt32 nChar = pMap->GetFirstChar();
-- 
cgit v1.2.3


From ad848b3c6384cc8e284e349d0b3725142d42e5dc Mon Sep 17 00:00:00 2001
From: "Herbert Duerr [hdu]" 
Date: Wed, 15 Sep 2010 15:31:50 +0200
Subject: #i113861# support forced-GC in FreetypeManager destructor

---
 vcl/source/glyphs/gcach_ftyp.cxx | 23 +++++++++++++++++++----
 1 file changed, 19 insertions(+), 4 deletions(-)

diff --git a/vcl/source/glyphs/gcach_ftyp.cxx b/vcl/source/glyphs/gcach_ftyp.cxx
index 75c8c605dcd7..601e46411cd8 100644
--- a/vcl/source/glyphs/gcach_ftyp.cxx
+++ b/vcl/source/glyphs/gcach_ftyp.cxx
@@ -523,10 +523,25 @@ void* FreetypeServerFont::GetFtFace() const
 
 FreetypeManager::~FreetypeManager()
 {
-// This crashes on Solaris 10
-// TODO: check which versions have this problem
-//
-// FT_Error rcFT = FT_Done_FreeType( aLibFT );
+    // an application about to exit can omit garbage collecting the heap
+    // since it makes things slower and introduces risks if the heap was not perfect
+    // for debugging, for memory grinding or leak checking the env allows to force GC
+    const char* pEnv = getenv( "SAL_FORCE_GC_ON_EXIT" );
+    if( pEnv && (*pEnv != '0') )
+    {
+        // cleanup container of fontinfos
+        for( FontList::const_iterator it = maFontList.begin(); it != maFontList.end(); ++it )
+        {
+            FtFontInfo* pInfo = (*it).second;
+            delete pInfo;
+        }
+        maFontList.clear();
+
+#if 0   // FT_Done_FreeType crashes on Solaris 10
+    // TODO: check which versions have this problem
+    FT_Error rcFT = FT_Done_FreeType( aLibFT );
+#endif
+    }
 }
 
 // -----------------------------------------------------------------------
-- 
cgit v1.2.3


From bdab146f1c8d8a873fdddff203a6b2ef29022eaf Mon Sep 17 00:00:00 2001
From: Ivo Hinkelmann 
Date: Wed, 15 Sep 2010 15:40:28 +0200
Subject: masterfix OOO330: #i10000# store lid in gid

---
 l10ntools/java/jpropex/java/JPropEx.java | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/l10ntools/java/jpropex/java/JPropEx.java b/l10ntools/java/jpropex/java/JPropEx.java
index ceeeb5083982..f068f93ad18b 100644
--- a/l10ntools/java/jpropex/java/JPropEx.java
+++ b/l10ntools/java/jpropex/java/JPropEx.java
@@ -126,8 +126,8 @@ public class JPropEx
         {
             key         = (String)      e.nextElement();
             currentStr  = (SdfEntity)   dolly.clone();
-            // Set the new LID and the string text
-            currentStr.setLid( key );
+            // Set the new GID and the string text
+            currentStr.setGid( key );
             value            = prop.getProperty( key , "" );
             //if( value.equals("") )  System.err.println("Warning: in file "+inputFileArg+" the string with the key "+key+" has a empty string!");
             str = (prop.getProperty( key )).replaceAll("\t" , " " );    // remove tab
@@ -211,7 +211,7 @@ public class JPropEx
             key          = (String) e.nextElement();
             sourceString = sourceProp.getProperty( key );
             curStr       = (SdfEntity) dolly.clone();
-            curStr.setLid( key );
+            curStr.setGid( key );
             for( Enumeration lang = langs.elements(); lang.hasMoreElements(); ) // merge in every language
             {
                 curEntity   = (SdfEntity) curStr.clone();
@@ -221,12 +221,12 @@ public class JPropEx
                 if( mergedEntity == null )
                 {
                     // in case there is no translation then fallback to the en-US source string
-                    ( (java.util.Properties) props.get( curLang )).setProperty( curEntity.getLid() , sourceString  );
+                    ( (java.util.Properties) props.get( curLang )).setProperty( curEntity.getGid() , sourceString  );
                 }
                 else
                 {
                     // Set the merged text from the sdf file
-                    ( (java.util.Properties) props.get( curLang )).setProperty( mergedEntity.getLid() , mergedEntity.getText() );  // TODO: Quoting ???
+                    ( (java.util.Properties) props.get( curLang )).setProperty( mergedEntity.getGid() , mergedEntity.getText() );  // TODO: Quoting ???
                 }
             }
 
-- 
cgit v1.2.3


From fefb3b04bc2d2aa45083bbc6ad65fc8851e86e13 Mon Sep 17 00:00:00 2001
From: "Herbert Duerr [hdu]" 
Date: Wed, 15 Sep 2010 15:58:41 +0200
Subject: #i113861# fix ref-counts of default-charmaps

---
 vcl/source/gdi/metric.cxx | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/vcl/source/gdi/metric.cxx b/vcl/source/gdi/metric.cxx
index e0a944584721..123f6444b509 100644
--- a/vcl/source/gdi/metric.cxx
+++ b/vcl/source/gdi/metric.cxx
@@ -53,6 +53,7 @@ ImplFontMetric::ImplFontMetric()
 
 inline void ImplFontMetric::AddReference()
 {
+    // TODO: disable refcounting on the default maps?
     ++mnRefCount;
 }
 
@@ -60,6 +61,7 @@ inline void ImplFontMetric::AddReference()
 
 inline void ImplFontMetric::DeReference()
 {
+    // TODO: disable refcounting on the default maps?
     if( --mnRefCount <= 0 )
         delete this;
 }
@@ -301,9 +303,9 @@ namespace
             int nCodesCount = sizeof(aDefaultUnicodeRanges) / sizeof(*pRangeCodes);
             CmapResult aDefaultCR( false, pRangeCodes, nCodesCount/2 );
             pDefaultUnicodeImplFontCharMap = new ImplFontCharMap( aDefaultCR );
-            pDefaultUnicodeImplFontCharMap->AddReference();
         }
 
+        pDefaultUnicodeImplFontCharMap->AddReference();
         return pDefaultUnicodeImplFontCharMap;
     }
 
@@ -315,9 +317,9 @@ namespace
             int nCodesCount = sizeof(aDefaultSymbolRanges) / sizeof(*pRangeCodes);
             CmapResult aDefaultCR( true, pRangeCodes, nCodesCount/2 );
             pDefaultSymbolImplFontCharMap = new ImplFontCharMap( aDefaultCR );
-            pDefaultSymbolImplFontCharMap->AddReference();
         }
 
+        pDefaultSymbolImplFontCharMap->AddReference();
         return pDefaultSymbolImplFontCharMap;
     }
 }
@@ -331,6 +333,7 @@ ImplFontCharMap* ImplFontCharMap::GetDefaultMap( bool bSymbols)
 
 void ImplFontCharMap::AddReference( void ) const
 {
+    // TODO: disable refcounting on the default maps?
     ++mnRefCount;
 }
 
@@ -833,7 +836,9 @@ bool ParseCMAP( const unsigned char* pCmap, int nLength, CmapResult& rResult )
 
 FontCharMap::FontCharMap()
 :   mpImpl( ImplFontCharMap::GetDefaultMap() )
-{}
+{
+    mpImpl->AddReference();
+}
 
 // -----------------------------------------------------------------------
 
@@ -861,17 +866,12 @@ int FontCharMap::CountCharsInRange( sal_uInt32 cMin, sal_uInt32 cMax ) const
 
 void FontCharMap::Reset( const ImplFontCharMap* pNewMap )
 {
+    mpImpl->DeReference();
     if( pNewMap == NULL )
-    {
-        mpImpl->DeReference();
         mpImpl = ImplFontCharMap::GetDefaultMap();
-    }
     else if( pNewMap != mpImpl )
-    {
-        mpImpl->DeReference();
         mpImpl = pNewMap;
-        mpImpl->AddReference();
-    }
+    mpImpl->AddReference();
 }
 
 // -----------------------------------------------------------------------
-- 
cgit v1.2.3


From f29edc2d1e63bf31d6b65198280c0a185560c8d7 Mon Sep 17 00:00:00 2001
From: "Herbert Duerr [hdu]" 
Date: Thu, 16 Sep 2010 10:36:50 +0200
Subject: #i113861# minor cleanup in WinSalGraphics header

---
 vcl/win/inc/salgdi.h | 25 ++++++++++++++-----------
 1 file changed, 14 insertions(+), 11 deletions(-)

diff --git a/vcl/win/inc/salgdi.h b/vcl/win/inc/salgdi.h
index 95e16e5646dc..c877bd493b1f 100755
--- a/vcl/win/inc/salgdi.h
+++ b/vcl/win/inc/salgdi.h
@@ -1,5 +1,5 @@
 /*************************************************************************
- *
+ nSalGraphics::GetImplFontCharMap*
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * Copyright 2000, 2010 Oracle and/or its affiliates.
@@ -57,10 +57,10 @@ class ImplFontAttrCache;
 class ImplWinFontData : public ImplFontData
 {
 public:
-                            ImplWinFontData( const ImplDevFontAttributes&,
+    explicit                ImplWinFontData( const ImplDevFontAttributes&,
                                 int nFontHeight, WIN_BYTE eWinCharSet,
                                 WIN_BYTE nPitchAndFamily  );
-                            ~ImplWinFontData();
+    virtual                 ~ImplWinFontData();
 
     virtual ImplFontData*   Clone() const;
     virtual ImplFontEntry*  CreateFontInstance( ImplFontSelectData& ) const;
@@ -127,9 +127,9 @@ public:
 #endif // GNG_VERT_HACK
 };
 
-// -------------------
-// - SalGraphicsData -
-// -------------------
+// ------------------
+// - WinSalGraphics -
+// ------------------
 
 class WinSalGraphics : public SalGraphics
 {
@@ -179,7 +179,7 @@ public:
     HFONT                   ImplDoSetFont( ImplFontSelectData* i_pFont, float& o_rFontScale, HFONT& o_rOldFont );
 
 public:
-    WinSalGraphics();
+    explicit WinSalGraphics();
     virtual ~WinSalGraphics();
 
 protected:
@@ -287,7 +287,7 @@ public:
     // return only PairCount if (pKernPairs == NULL)
     virtual ULONG           GetKernPairs( ULONG nPairs, ImplKernPairData* pKernPairs );
     // get the repertoire of the current font
-    virtual ImplFontCharMap* GetImplFontCharMap() const;
+    virtual const ImplFontCharMap* GetImplFontCharMap() const;
     // graphics must fill supplied font list
     virtual void            GetDevFontList( ImplDevFontList* );
     // graphics should call ImplAddDevFontSubstitute on supplied
@@ -359,11 +359,11 @@ public:
 };
 
 // Init/Deinit Graphics
-void    ImplSalInitGraphics( WinSalGraphics* mpData );
-void    ImplSalDeInitGraphics( WinSalGraphics* mpData );
+void    ImplSalInitGraphics( WinSalGraphics* );
+void    ImplSalDeInitGraphics( WinSalGraphics* );
 void    ImplUpdateSysColorEntries();
 int     ImplIsSysColorEntry( SalColor nSalColor );
-void    ImplGetLogFontFromFontSelect( HDC hDC, const ImplFontSelectData*,
+void    ImplGetLogFontFromFontSelect( HDC, const ImplFontSelectData*,
             LOGFONTW&, bool bTestVerticalAvail );
 
 // -----------
@@ -397,7 +397,10 @@ inline bool ImplWinFontData::HasChar( sal_uInt32 cChar ) const
         cChar -= 0xF000;
     else if( mbAliasSymbolsHigh && (cChar <= 0xFF) )
         cChar += 0xF000;
+    else
+        return false;
     return mpUnicodeMap->HasChar( cChar );
 }
 
 #endif // _SV_SALGDI_H
+
-- 
cgit v1.2.3


From 8248abe7458e344d54166d47fe12fb802cba765f Mon Sep 17 00:00:00 2001
From: "Herbert Duerr [hdu]" 
Date: Thu, 16 Sep 2010 11:17:25 +0200
Subject: #i113861# cleanup minor commit snafus

---
 vcl/source/gdi/metric.cxx | 4 ++--
 vcl/win/inc/salgdi.h      | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/vcl/source/gdi/metric.cxx b/vcl/source/gdi/metric.cxx
index 123f6444b509..6d225ad7e0dc 100644
--- a/vcl/source/gdi/metric.cxx
+++ b/vcl/source/gdi/metric.cxx
@@ -303,9 +303,9 @@ namespace
             int nCodesCount = sizeof(aDefaultUnicodeRanges) / sizeof(*pRangeCodes);
             CmapResult aDefaultCR( false, pRangeCodes, nCodesCount/2 );
             pDefaultUnicodeImplFontCharMap = new ImplFontCharMap( aDefaultCR );
+            pDefaultUnicodeImplFontCharMap->AddReference();
         }
 
-        pDefaultUnicodeImplFontCharMap->AddReference();
         return pDefaultUnicodeImplFontCharMap;
     }
 
@@ -317,9 +317,9 @@ namespace
             int nCodesCount = sizeof(aDefaultSymbolRanges) / sizeof(*pRangeCodes);
             CmapResult aDefaultCR( true, pRangeCodes, nCodesCount/2 );
             pDefaultSymbolImplFontCharMap = new ImplFontCharMap( aDefaultCR );
+            pDefaultSymbolImplFontCharMap->AddReference();
         }
 
-        pDefaultSymbolImplFontCharMap->AddReference();
         return pDefaultSymbolImplFontCharMap;
     }
 }
diff --git a/vcl/win/inc/salgdi.h b/vcl/win/inc/salgdi.h
index c877bd493b1f..f592f53ae29c 100755
--- a/vcl/win/inc/salgdi.h
+++ b/vcl/win/inc/salgdi.h
@@ -1,5 +1,5 @@
 /*************************************************************************
- nSalGraphics::GetImplFontCharMap*
+ *
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * Copyright 2000, 2010 Oracle and/or its affiliates.
-- 
cgit v1.2.3


From bdf75c7d9bce985ed10a9c41d03420f33ce82142 Mon Sep 17 00:00:00 2001
From: "Philipp Lohmann [pl]" 
Date: Mon, 20 Sep 2010 19:49:18 +0200
Subject: ooo33gsl09: #i114311# fix a q Q imbalance

---
 vcl/source/gdi/pdfwriter_impl.cxx | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx
index 7b7f3bbcb4d3..580161da8a4e 100644
--- a/vcl/source/gdi/pdfwriter_impl.cxx
+++ b/vcl/source/gdi/pdfwriter_impl.cxx
@@ -8499,6 +8499,7 @@ void PDFWriterImpl::beginRedirect( SvStream* pStream, const Rectangle& rTargetRe
 {
     push( PUSH_ALL );
 
+    // force reemitting clip region
     clearClipRegion();
     updateGraphicsState();
 
@@ -8542,7 +8543,10 @@ SvStream* PDFWriterImpl::endRedirect()
     }
 
     pop();
-    // force reemitting colors
+    // force reemitting colors and clip region
+    clearClipRegion();
+    m_aCurrentPDFState.m_bClipRegion = m_aGraphicsStack.front().m_bClipRegion;
+    m_aCurrentPDFState.m_aClipRegion = m_aGraphicsStack.front().m_aClipRegion;
     m_aCurrentPDFState.m_aLineColor = Color( COL_TRANSPARENT );
     m_aCurrentPDFState.m_aFillColor = Color( COL_TRANSPARENT );
 
-- 
cgit v1.2.3


From dd488a6edbf07578b9ec7c7c0978c2ebe2149836 Mon Sep 17 00:00:00 2001
From: Tobias Krause 
Date: Wed, 22 Sep 2010 11:43:32 +0200
Subject: ooo33gsl09: #i114639# label by editbox is now found even a docking
 window is docked.

---
 vcl/source/window/dlgctrl.cxx | 101 +++++++++++++++++++++++++-----------------
 1 file changed, 61 insertions(+), 40 deletions(-)

diff --git a/vcl/source/window/dlgctrl.cxx b/vcl/source/window/dlgctrl.cxx
index 64f2b7e0d2a1..055b7e9fe80b 100644
--- a/vcl/source/window/dlgctrl.cxx
+++ b/vcl/source/window/dlgctrl.cxx
@@ -1058,29 +1058,10 @@ static sal_Unicode getAccel( const String& rStr )
     return nChar;
 }
 
-Window* Window::GetLabelFor() const
+static Window* ImplGetLabelFor( Window* pFrameWindow, WindowType nMyType, Window* pLabel, sal_Unicode nAccel )
 {
-    if ( mpWindowImpl->mbDisableAccessibleLabelForRelation )
-        return NULL;
-
     Window* pWindow = NULL;
-    Window* pFrameWindow = ImplGetFrameWindow();
-
-    WinBits nFrameStyle = pFrameWindow->GetStyle();
-    if( ! ( nFrameStyle & WB_DIALOGCONTROL )
-        || ( nFrameStyle & WB_NODIALOGCONTROL )
-        )
-        return NULL;
-
-    if ( mpWindowImpl->mpRealParent )
-        pWindow = mpWindowImpl->mpRealParent->GetParentLabelFor( this );
-
-    if( pWindow )
-        return pWindow;
 
-    sal_Unicode nAccel = getAccel( GetText() );
-
-    WindowType nMyType = GetType();
     if( nMyType == WINDOW_FIXEDTEXT     ||
         nMyType == WINDOW_FIXEDLINE     ||
         nMyType == WINDOW_GROUPBOX )
@@ -1092,7 +1073,7 @@ Window* Window::GetLabelFor() const
         // get index, form start and form end
         USHORT nIndex=0, nFormStart=0, nFormEnd=0;
         pSWindow = ::ImplFindDlgCtrlWindow( pFrameWindow,
-                                           const_cast(this),
+                                           pLabel,
                                            nIndex,
                                            nFormStart,
                                            nFormEnd );
@@ -1139,32 +1120,39 @@ Window* Window::GetLabelFor() const
     return pWindow;
 }
 
-// -----------------------------------------------------------------------
-
-Window* Window::GetLabeledBy() const
+Window* Window::GetLabelFor() const
 {
-    if ( mpWindowImpl->mbDisableAccessibleLabeledByRelation )
+    if ( mpWindowImpl->mbDisableAccessibleLabelForRelation )
         return NULL;
 
     Window* pWindow = NULL;
     Window* pFrameWindow = ImplGetFrameWindow();
 
+    WinBits nFrameStyle = pFrameWindow->GetStyle();
+    if( ! ( nFrameStyle & WB_DIALOGCONTROL )
+        || ( nFrameStyle & WB_NODIALOGCONTROL )
+        )
+        return NULL;
+
     if ( mpWindowImpl->mpRealParent )
-        pWindow = mpWindowImpl->mpRealParent->GetParentLabeledBy( this );
+        pWindow = mpWindowImpl->mpRealParent->GetParentLabelFor( this );
 
     if( pWindow )
         return pWindow;
 
-    // #i62723#, #104191# checkboxes and radiobuttons are not supposed to have labels
-    if( GetType() == WINDOW_CHECKBOX || GetType() == WINDOW_RADIOBUTTON )
-        return NULL;
+    sal_Unicode nAccel = getAccel( GetText() );
 
-//    if( ! ( GetType() == WINDOW_FIXEDTEXT     ||
-//            GetType() == WINDOW_FIXEDLINE     ||
-//            GetType() == WINDOW_GROUPBOX ) )
-    // #i100833# MT 2010/02: Group box and fixed lines can also lable a fixed text.
-    // See tools/options/print for example.
-    WindowType nMyType = GetType();
+    pWindow = ImplGetLabelFor( pFrameWindow, GetType(), const_cast(this), nAccel );
+    if( ! pWindow && mpWindowImpl->mpRealParent )
+        pWindow = ImplGetLabelFor( mpWindowImpl->mpRealParent, GetType(), const_cast(this), nAccel );
+    return pWindow;
+}
+
+// -----------------------------------------------------------------------
+
+static Window* ImplGetLabeledBy( Window* pFrameWindow, WindowType nMyType, Window* pLabeled )
+{
+    Window* pWindow = NULL;
     if ( (nMyType != WINDOW_GROUPBOX) && (nMyType != WINDOW_FIXEDLINE) )
     {
         // search for a control that labels this window
@@ -1176,16 +1164,16 @@ Window* Window::GetLabeledBy() const
         // get form start and form end and index of this control
         USHORT nIndex, nFormStart, nFormEnd;
         Window* pSWindow = ::ImplFindDlgCtrlWindow( pFrameWindow,
-                                                    const_cast(this),
+                                                    pLabeled,
                                                     nIndex,
                                                     nFormStart,
                                                     nFormEnd );
         if( pSWindow && nIndex != nFormStart )
         {
-            if( GetType() == WINDOW_PUSHBUTTON      ||
-                GetType() == WINDOW_HELPBUTTON      ||
-                GetType() == WINDOW_OKBUTTON        ||
-                GetType() == WINDOW_CANCELBUTTON )
+            if( nMyType == WINDOW_PUSHBUTTON        ||
+                nMyType == WINDOW_HELPBUTTON        ||
+                nMyType == WINDOW_OKBUTTON      ||
+                nMyType == WINDOW_CANCELBUTTON )
             {
                 nFormStart = nIndex-1;
             }
@@ -1217,6 +1205,39 @@ Window* Window::GetLabeledBy() const
     return pWindow;
 }
 
+Window* Window::GetLabeledBy() const
+{
+    if ( mpWindowImpl->mbDisableAccessibleLabeledByRelation )
+        return NULL;
+
+    Window* pWindow = NULL;
+    Window* pFrameWindow = ImplGetFrameWindow();
+
+    if ( mpWindowImpl->mpRealParent )
+    {
+        pWindow = mpWindowImpl->mpRealParent->GetParentLabeledBy( this );
+
+        if( pWindow )
+            return pWindow;
+    }
+
+    // #i62723#, #104191# checkboxes and radiobuttons are not supposed to have labels
+    if( GetType() == WINDOW_CHECKBOX || GetType() == WINDOW_RADIOBUTTON )
+        return NULL;
+
+//    if( ! ( GetType() == WINDOW_FIXEDTEXT     ||
+//            GetType() == WINDOW_FIXEDLINE     ||
+//            GetType() == WINDOW_GROUPBOX ) )
+    // #i100833# MT 2010/02: Group box and fixed lines can also lable a fixed text.
+    // See tools/options/print for example.
+
+    pWindow = ImplGetLabeledBy( pFrameWindow, GetType(), const_cast(this) );
+    if( ! pWindow && mpWindowImpl->mpRealParent )
+        pWindow = ImplGetLabeledBy( mpWindowImpl->mpRealParent, GetType(), const_cast(this) );
+
+    return pWindow;
+}
+
 // -----------------------------------------------------------------------
 
 KeyEvent Window::GetActivationKey() const
-- 
cgit v1.2.3


From 68d5cd211845483adb0c37fb05f58d37bfd21052 Mon Sep 17 00:00:00 2001
From: Hans-Joachim Lankenau 
Date: Tue, 28 Sep 2010 16:20:49 +0200
Subject: ause123: #163579# cleanup baseline usage

---
 vcl/util/makefile.mk | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/vcl/util/makefile.mk b/vcl/util/makefile.mk
index 04bc3f13ce4d..4ddbb3d8ccfb 100644
--- a/vcl/util/makefile.mk
+++ b/vcl/util/makefile.mk
@@ -391,9 +391,6 @@ SHL4STDLIBS+= $(XRANDR_LIBS)
 .ENDIF
 .ENDIF
 
-.IF "$(OS)$(CPU)" == "LINUXX"
-EXTRALIBPATHS+=-L$(LIBRARY_PATH)
-.ENDIF # "$(OS)$(CPU)" == "LINUXX"
 .ENDIF # "$(ENABLE_GTK)" != ""
 
 # KDE plugin
-- 
cgit v1.2.3