From 3c1d4742e649fe9c8aed8c2817fe3e1f3364f298 Mon Sep 17 00:00:00 2001 From: Armin Le Grand Date: Mon, 14 Jul 2014 19:09:11 +0000 Subject: Resync to trunk, windows non-pro build --- svtools/bmpmaker/bmp.cxx | 2 +- svtools/inc/svtools/acceleratorexecute.hxx | 4 +- svtools/inc/svtools/accessibletable.hxx | 2 +- svtools/inc/svtools/brwbox.hxx | 8 +-- svtools/inc/svtools/contextmenuhelper.hxx | 2 +- svtools/inc/svtools/dialogcontrolling.hxx | 2 +- svtools/inc/svtools/fmtfield.hxx | 2 +- svtools/inc/svtools/genericunodialog.hxx | 2 +- svtools/inc/svtools/grfmgr.hxx | 24 ++++++++- svtools/inc/svtools/helpagentwindow.hxx | 2 +- svtools/inc/svtools/menuoptions.hxx | 2 +- svtools/inc/svtools/miscopt.hxx | 2 +- svtools/inc/svtools/optionsdrawinglayer.hxx | 2 +- svtools/inc/svtools/stringtransfer.hxx | 2 +- svtools/inc/svtools/svlbitm.hxx | 2 +- svtools/inc/svtools/svtdata.hxx | 4 +- svtools/inc/svtools/table/tablemodel.hxx | 2 +- svtools/inc/svtools/textview.hxx | 2 +- svtools/inc/svtools/valueset.hxx | 2 +- svtools/inc/svtools/wizardmachine.hxx | 6 +-- svtools/source/brwbox/brwbox1.cxx | 2 +- svtools/source/brwbox/brwbox2.cxx | 4 +- svtools/source/brwbox/editbrowsebox.cxx | 2 +- svtools/source/config/itemholder2.hxx | 2 +- svtools/source/config/test/test.cxx | 2 +- svtools/source/contnr/contentenumeration.hxx | 6 +-- svtools/source/contnr/fileview.cxx | 2 +- svtools/source/control/roadmap.cxx | 3 +- svtools/source/filter/filter.cxx | 11 ++-- svtools/source/graphic/grfmgr.cxx | 49 ++++++++++++++++++ svtools/source/graphic/grfmgr2.cxx | 75 +++++++++++++++++++++++++++- svtools/source/svrtf/svparser.cxx | 4 +- svtools/source/uno/wizard/unowizard.cxx | 2 +- svtools/source/uno/wizard/wizardshell.cxx | 5 +- svtools/source/uno/wizard/wizardshell.hxx | 6 --- 35 files changed, 196 insertions(+), 55 deletions(-) (limited to 'svtools') diff --git a/svtools/bmpmaker/bmp.cxx b/svtools/bmpmaker/bmp.cxx index 1d22765e8cb7..eb66f89dc058 100644 --- a/svtools/bmpmaker/bmp.cxx +++ b/svtools/bmpmaker/bmp.cxx @@ -161,7 +161,7 @@ void BmpApp::ShowUsage() Message( String( RTL_CONSTASCII_USTRINGPARAM( "Usage:" ) ), EXIT_NOERROR ); Message( String( RTL_CONSTASCII_USTRINGPARAM( " bmp srs_inputfile output_dir lang_dir lang_num -i input_dir [-i input_dir ][-f err_file]" ) ), EXIT_NOERROR ); Message( String( RTL_CONSTASCII_USTRINGPARAM( "Options:" ) ), EXIT_NOERROR ); - Message( String( RTL_CONSTASCII_USTRINGPARAM( " -i ... name of directory to be searched for input files [multiple occurence is possible]" ) ), EXIT_NOERROR ); + Message( String( RTL_CONSTASCII_USTRINGPARAM( " -i ... name of directory to be searched for input files [multiple occurrence is possible]" ) ), EXIT_NOERROR ); Message( String( RTL_CONSTASCII_USTRINGPARAM( " -f name of file, output should be written to" ) ), EXIT_NOERROR ); Message( String( RTL_CONSTASCII_USTRINGPARAM( "Examples:" ) ), EXIT_NOERROR ); Message( String( RTL_CONSTASCII_USTRINGPARAM( " bmp /home/test.srs /home/out enus 01 -i /home/res -f /home/out/bmp.err" ) ), EXIT_NOERROR ); diff --git a/svtools/inc/svtools/acceleratorexecute.hxx b/svtools/inc/svtools/acceleratorexecute.hxx index 3f180ef7481a..68e38dce0458 100644 --- a/svtools/inc/svtools/acceleratorexecute.hxx +++ b/svtools/inc/svtools/acceleratorexecute.hxx @@ -99,7 +99,7 @@ struct TMutexInit Because exceution of an accelerator command can be dangerous (in case it force an office shutdown for key "ALT+F4"!) all internal dispatches are done asynchronous. - Menas that the trigger call doesnt wait till the dispatch + Menas that the trigger call doesn't wait till the dispatch is finished. You can call very often. All requests will be queued internal and dispatched ASAP. @@ -171,7 +171,7 @@ class SVT_DLLPUBLIC AcceleratorExecute : private TMutexInit => All currently queued events will be finished. The helper kills itself afterwards. A shutdown of the environment will be recognized ... The helper stop its - work immediatly then! + work immediately then! */ static AcceleratorExecute* createAcceleratorHelper(); diff --git a/svtools/inc/svtools/accessibletable.hxx b/svtools/inc/svtools/accessibletable.hxx index 4bd30a25a176..0b92a956e756 100644 --- a/svtools/inc/svtools/accessibletable.hxx +++ b/svtools/inc/svtools/accessibletable.hxx @@ -83,7 +83,7 @@ public: @param eObjType The type to ask for @param _nPosition - The position of a tablecell (index position), header bar colum/row cell + The position of a tablecell (index position), header bar column/row cell @return The description of the specified object. */ diff --git a/svtools/inc/svtools/brwbox.hxx b/svtools/inc/svtools/brwbox.hxx index c36a0fe55a21..2c4415e45072 100644 --- a/svtools/inc/svtools/brwbox.hxx +++ b/svtools/inc/svtools/brwbox.hxx @@ -591,7 +591,7 @@ public: void RowModified( long nRow, sal_uInt16 nColId = USHRT_MAX ); void RowInserted( long nRow, long nNumRows = 1, sal_Bool bDoPaint = sal_True, sal_Bool bKeepSelection = sal_False ); - // miscellanous + // miscellaneous void ReserveControlArea( sal_uInt16 nWidth = USHRT_MAX ); Rectangle GetControlArea() const; sal_Bool ProcessKey( const KeyEvent& rEvt ); @@ -702,7 +702,7 @@ public: @param _nRowId the current row @param _nColId - teh column id + the column id @param _bOnScreen when the rectangle should be calculated OnScreen @return @@ -790,7 +790,7 @@ public: @param eObjType The type to ask for @param _nPosition - The position of a tablecell (index position), header bar colum/row cell + The position of a tablecell (index position), header bar column/row cell @return The name of the specified object. */ @@ -800,7 +800,7 @@ public: @param eObjType The type to ask for @param _nPosition - The position of a tablecell (index position), header bar colum/row cell + The position of a tablecell (index position), header bar column/row cell @return The description of the specified object. */ diff --git a/svtools/inc/svtools/contextmenuhelper.hxx b/svtools/inc/svtools/contextmenuhelper.hxx index 1611e71744ae..37e56a809693 100644 --- a/svtools/inc/svtools/contextmenuhelper.hxx +++ b/svtools/inc/svtools/contextmenuhelper.hxx @@ -100,7 +100,7 @@ class SVT_DLLPUBLIC ContextMenuHelper bool associateUIConfigurationManagers(); // resets associations to create associations again on-demand. - // Usefull for implementations which recycle frames. Normal + // Useful for implementations which recycle frames. Normal // implementations can profit from caching and should set // auto refresh on ctor to false (default). void resetAssociations() diff --git a/svtools/inc/svtools/dialogcontrolling.hxx b/svtools/inc/svtools/dialogcontrolling.hxx index f4a54a711ccf..694de04016dc 100644 --- a/svtools/inc/svtools/dialogcontrolling.hxx +++ b/svtools/inc/svtools/dialogcontrolling.hxx @@ -110,7 +110,7 @@ namespace svt */ void addDependentWindow( Window& _rWindow ); - /** resets the controller so that no actions happend anymore. + /** resets the controller so that no actions happened anymore. The instances is disfunctional after this method has been called. */ diff --git a/svtools/inc/svtools/fmtfield.hxx b/svtools/inc/svtools/fmtfield.hxx index 4db1a3b3515f..9ef8a37df9d3 100644 --- a/svtools/inc/svtools/fmtfield.hxx +++ b/svtools/inc/svtools/fmtfield.hxx @@ -42,7 +42,7 @@ typedef sal_uInt16 FORMAT_CHANGE_TYPE; #define FCT_KEYONLY 0x00 // only a new key was set -#define FCT_FORMATTER 0x01 // a new formatter weas set, usually implies a change of the key, too +#define FCT_FORMATTER 0x01 // a new formatter was set, usually implies a change of the key, too #define FCT_PRECISION 0x02 // a new precision was set #define FCT_THOUSANDSSEP 0x03 // the thousands separator setting changed diff --git a/svtools/inc/svtools/genericunodialog.hxx b/svtools/inc/svtools/genericunodialog.hxx index 339f6e9a7dcb..ce86d5b3fb47 100644 --- a/svtools/inc/svtools/genericunodialog.hxx +++ b/svtools/inc/svtools/genericunodialog.hxx @@ -75,7 +75,7 @@ namespace svt ,public ::comphelper::OPropertyContainer { private: - ::osl::Mutex m_aExecutionMutex; /// acess safety for execute/cancel + ::osl::Mutex m_aExecutionMutex; /// access safety for execute/cancel protected: Dialog* m_pDialog; /// the dialog to execute diff --git a/svtools/inc/svtools/grfmgr.hxx b/svtools/inc/svtools/grfmgr.hxx index 94b8b10cb0e8..52902c0722b6 100644 --- a/svtools/inc/svtools/grfmgr.hxx +++ b/svtools/inc/svtools/grfmgr.hxx @@ -207,7 +207,10 @@ private: Timer* mpSwapOutTimer; GrfSimpleCacheObj* mpSimpleCache; sal_uLong mnAnimationLoopCount; - void* mpDummy1; + + // a unique increasing ID to be able to say which data change is older + sal_uLong mnDataChangeTimeStamp; + void* mpDummy2; sal_Bool mbAutoSwapped : 1; sal_Bool mbTransparent : 1; @@ -299,6 +302,10 @@ private: DECL_LINK( ImplAutoSwapOutHdl, void* ); + // Handle evtl. needed AfterDataChanges, needs to be called when new + // graphic data is swapped in/added to the GraphicManager + void ImplAfterDataChange(); + protected: virtual void GraphicManagerDestroyed(); @@ -479,6 +486,12 @@ public: double fTopCrop, double fRightCrop, double fBottomCrop) const; + + // read access + sal_uLong GetDataChangeTimeStamp() const { return mnDataChangeTimeStamp; } + + // restart SwapOut timer; this is like touching in a cache to reset to the full timeout value + void restartSwapOutTimer() const; }; // ------------------ @@ -543,6 +556,15 @@ private: ByteString SVT_DLLPRIVATE ImplGetUniqueID( const GraphicObject& rObj ) const; + // This method allows to check memory footprint for all currently swapped in GraphicObjects on this GraphicManager + // which are based on Bitmaps. This is needed on 32Bit systems and only does something on those systems. The problem + // to solve is that normally the SwapOut is timer-driven, but even with short timer settings there are situations + // where this does not trigger - or in other words: A maximum limitation for GraphicManagers was not in place before. + // For 32Bit systems this leads to situations where graphics will be missing. This method will actively swap out + // the longest swapped in graphics until a maximum memory boundary (derived from user settings in tools/options/memory) + // is no longer exceeded + void ImplCheckSizeOfSwappedInGraphics(); + public: GraphicManager( sal_uLong nCacheSize = 10000000UL, sal_uLong nMaxObjCacheSize = 2400000UL ); diff --git a/svtools/inc/svtools/helpagentwindow.hxx b/svtools/inc/svtools/helpagentwindow.hxx index 8f3f1ed12867..b09280c3e407 100644 --- a/svtools/inc/svtools/helpagentwindow.hxx +++ b/svtools/inc/svtools/helpagentwindow.hxx @@ -61,7 +61,7 @@ namespace svt /// returns the preferred size of the window const Size& getPreferredSizePixel() const { return m_aPreferredSize; } - // callback handler maintainance + // callback handler maintenance void setCallback(IHelpAgentCallback* _pCB) { m_pCallback = _pCB; } IHelpAgentCallback* getCallback() const { return m_pCallback; } diff --git a/svtools/inc/svtools/menuoptions.hxx b/svtools/inc/svtools/menuoptions.hxx index 5b52df8a7e53..9a2a3dfce44c 100644 --- a/svtools/inc/svtools/menuoptions.hxx +++ b/svtools/inc/svtools/menuoptions.hxx @@ -39,7 +39,7 @@ /*-************************************************************************************************************//** @short forward declaration to our private date container implementation @descr We use these class as internal member to support small memory requirements. - You can create the container if it is neccessary. The class which use these mechanism + You can create the container if it is necessary. The class which use these mechanism is faster and smaller then a complete implementation! *//*-*************************************************************************************************************/ diff --git a/svtools/inc/svtools/miscopt.hxx b/svtools/inc/svtools/miscopt.hxx index 605f0280c64b..63e43caada06 100644 --- a/svtools/inc/svtools/miscopt.hxx +++ b/svtools/inc/svtools/miscopt.hxx @@ -41,7 +41,7 @@ /*-************************************************************************************************************//** @short forward declaration to our private date container implementation @descr We use these class as internal member to support small memory requirements. - You can create the container if it is neccessary. The class which use these mechanism + You can create the container if it is necessary. The class which use these mechanism is faster and smaller then a complete implementation! *//*-*************************************************************************************************************/ diff --git a/svtools/inc/svtools/optionsdrawinglayer.hxx b/svtools/inc/svtools/optionsdrawinglayer.hxx index 439728e7ddf4..4ac490d3aaf5 100644 --- a/svtools/inc/svtools/optionsdrawinglayer.hxx +++ b/svtools/inc/svtools/optionsdrawinglayer.hxx @@ -41,7 +41,7 @@ /*-************************************************************************************************************//** @short forward declaration to our private date container implementation @descr We use these class as internal member to support small memory requirements. - You can create the container if it is neccessary. The class which use these mechanism + You can create the container if it is necessary. The class which use these mechanism is faster and smaller then a complete implementation! *//*-*************************************************************************************************************/ diff --git a/svtools/inc/svtools/stringtransfer.hxx b/svtools/inc/svtools/stringtransfer.hxx index 281f40b54fe0..905ddaff1d78 100644 --- a/svtools/inc/svtools/stringtransfer.hxx +++ b/svtools/inc/svtools/stringtransfer.hxx @@ -62,7 +62,7 @@ namespace svt SVT_DLLPUBLIC static void CopyString( const ::rtl::OUString& _rContent, Window* _pWindow = NULL ); /** extracts a string from the system clipboard given - @return if the extraction was successfull, i.e. if the clipboard contained a string content + @return if the extraction was successful, i.e. if the clipboard contained a string content */ SVT_DLLPUBLIC static sal_Bool PasteString( ::rtl::OUString& _rContent, Window* _pWindow = NULL ); diff --git a/svtools/inc/svtools/svlbitm.hxx b/svtools/inc/svtools/svlbitm.hxx index 1948efe28220..4744242d902f 100644 --- a/svtools/inc/svtools/svlbitm.hxx +++ b/svtools/inc/svtools/svlbitm.hxx @@ -95,7 +95,7 @@ public: Image aBmps[24]; // Indizes siehe Konstanten BMP_ .... void SetDefaultImages( const Control* pControlForSettings = NULL ); - // set images acording to the color scheeme of the Control + // set images according to the color scheeme of the Control // pControlForSettings == NULL: settings are taken from Application sal_Bool HasDefaultImages( void ) const; }; diff --git a/svtools/inc/svtools/svtdata.hxx b/svtools/inc/svtools/svtdata.hxx index 6eb8d71ab1ac..00c40bdbd83c 100644 --- a/svtools/inc/svtools/svtdata.hxx +++ b/svtools/inc/svtools/svtdata.hxx @@ -47,7 +47,7 @@ private: public: ResMgr * GetResMgr(const ::com::sun::star::lang::Locale aLocale); - ResMgr * GetResMgr(); // VCL dependant, only available in SVT, not in SVL! + ResMgr * GetResMgr(); // VCL dependent, only available in SVT, not in SVL! static ImpSvtData & GetSvtData(); }; @@ -58,7 +58,7 @@ class SVT_DLLPUBLIC SvtResId: public ResId public: SvtResId(sal_uInt16 nId, const ::com::sun::star::lang::Locale aLocale); SvtResId(sal_uInt16 nId); - // VCL dependant, only available in SVT, not in SVL! + // VCL dependent, only available in SVT, not in SVL! }; #endif // _SVTOOLS_SVTDATA_HXX diff --git a/svtools/inc/svtools/table/tablemodel.hxx b/svtools/inc/svtools/table/tablemodel.hxx index da3d5681ba28..29b878403ec2 100644 --- a/svtools/inc/svtools/table/tablemodel.hxx +++ b/svtools/inc/svtools/table/tablemodel.hxx @@ -189,7 +189,7 @@ namespace svt { namespace table /** sets a new column ID @return - if setting the new ID was successfull. A possible error + if setting the new ID was successful. A possible error conditions is if you try to set an ID which is already used by another column within the same table. diff --git a/svtools/inc/svtools/textview.hxx b/svtools/inc/svtools/textview.hxx index 46a9cf0e6047..a3a2447ac669 100644 --- a/svtools/inc/svtools/textview.hxx +++ b/svtools/inc/svtools/textview.hxx @@ -205,7 +205,7 @@ public: /** Drag and Drop, deleting and selection regards all text that has an attribute - TEXTATTR_PROTECTED set as one entitity. Drag and dropped text is automatically + TEXTATTR_PROTECTED set as one entity. Drag and dropped text is automatically attibuted as protected. */ void SupportProtectAttribute(sal_Bool bSupport); diff --git a/svtools/inc/svtools/valueset.hxx b/svtools/inc/svtools/valueset.hxx index f52710c78f64..ffe6366b5bee 100644 --- a/svtools/inc/svtools/valueset.hxx +++ b/svtools/inc/svtools/valueset.hxx @@ -436,7 +436,7 @@ public: private: /** Determine whether RTL (right to left writing) is active. For this - method to return two conditions have to be fullfilled: + method to return two conditions have to be fulfilled:
  1. RTL is active for the whole application.
  2. RTL is enabled for the control.
@return diff --git a/svtools/inc/svtools/wizardmachine.hxx b/svtools/inc/svtools/wizardmachine.hxx index b60d8246271d..6efe937eb179 100644 --- a/svtools/inc/svtools/wizardmachine.hxx +++ b/svtools/inc/svtools/wizardmachine.hxx @@ -288,7 +288,7 @@ namespace svt method is able to determine the next state without actually having the page of the current state. @return - if and only if traveling was successfull + if and only if traveling was successful @see skipUntil @see skipBackwardUntil @@ -304,7 +304,7 @@ namespace svt The skipped states appear in the state history, so travelPrevious will make use of them. @return - if and only if traveling was successfull + if and only if traveling was successful @see skip @see skipBackwardUntil @@ -322,7 +322,7 @@ namespace svt you from this. @return - if and only if traveling was successfull + if and only if traveling was successful @see skipUntil @see skip diff --git a/svtools/source/brwbox/brwbox1.cxx b/svtools/source/brwbox/brwbox1.cxx index 863dc4c03a83..24e3c0829aef 100644 --- a/svtools/source/brwbox/brwbox1.cxx +++ b/svtools/source/brwbox/brwbox1.cxx @@ -441,7 +441,7 @@ void BrowseBox::FreezeColumn( sal_uInt16 nItemId, sal_Bool bFreeze ) // to be moved? if ( nItemPos != FrozenColCount()-1 ) { - // move to the leftmost scrollable colum + // move to the leftmost scrollable column sal_uInt16 nFirstScrollable = FrozenColCount(); BrowserColumn *pColumn = pCols->GetObject(nItemPos); pCols->Remove( (sal_uLong) nItemPos ); diff --git a/svtools/source/brwbox/brwbox2.cxx b/svtools/source/brwbox/brwbox2.cxx index 9bbcfc6b8a2f..53a4adc56903 100644 --- a/svtools/source/brwbox/brwbox2.cxx +++ b/svtools/source/brwbox/brwbox2.cxx @@ -1028,7 +1028,7 @@ void BrowseBox::ImplPaintData(OutputDevice& _rOut, const Rectangle& _rRect, sal_ { // clip the column's output to the field area if (_bForeignDevice) - { // (not neccessary if painting onto the data window) + { // (not necessary if painting onto the data window) Size aFieldSize(pCol->Width(), nDataRowHeigt); if (aPos.X() + aFieldSize.Width() > aOverallAreaBRPos.X()) @@ -1535,7 +1535,7 @@ void BrowseBox::MouseButtonDown( const MouseEvent& rEvt ) } } - // event occured out of data area + // event occurred out of data area if ( rEvt.IsRight() ) pDataWin->Command( CommandEvent( Point( 1, LONG_MAX ), COMMAND_CONTEXTMENU, sal_True ) ); diff --git a/svtools/source/brwbox/editbrowsebox.cxx b/svtools/source/brwbox/editbrowsebox.cxx index d7ea003a7fb1..b57069c4407f 100644 --- a/svtools/source/brwbox/editbrowsebox.cxx +++ b/svtools/source/brwbox/editbrowsebox.cxx @@ -943,7 +943,7 @@ namespace svt { Window& rWindow = GetDataWindow(); // don't paint too much - // update the status immediatly if possible + // update the status immediately if possible if ((nEditRow >= 0) && (GetBrowserFlags() & EBBF_NO_HANDLE_COLUMN_CONTENT) == 0) { Rectangle aRect = GetFieldRectPixel(nEditRow, 0, sal_False ); diff --git a/svtools/source/config/itemholder2.hxx b/svtools/source/config/itemholder2.hxx index 5ab71d70d896..042ba4256437 100644 --- a/svtools/source/config/itemholder2.hxx +++ b/svtools/source/config/itemholder2.hxx @@ -35,7 +35,7 @@ // namespaces #ifdef css -#error "Cant use css as namespace alias." +#error "Can't use css as namespace alias." #else #define css ::com::sun::star #endif diff --git a/svtools/source/config/test/test.cxx b/svtools/source/config/test/test.cxx index a414fc080e5b..10a624f9fcfc 100644 --- a/svtools/source/config/test/test.cxx +++ b/svtools/source/config/test/test.cxx @@ -149,7 +149,7 @@ void TestApplication::Main() // Init global servicemanager and set it for external services. ::comphelper::setProcessServiceFactory( TestApplication::getUNOServiceManager() ); - // Control sucess of operation. + // Control success of operation. OSL_ENSURE( !(::comphelper::getProcessServiceFactory()!=TestApplication::getUNOServiceManager()), "TestApplication::Main()\nGlobal servicemanager not right initialized.\n" ); /**-*********************************************************************************************************** diff --git a/svtools/source/contnr/contentenumeration.hxx b/svtools/source/contnr/contentenumeration.hxx index f3a71739cf2f..585cd257ab41 100644 --- a/svtools/source/contnr/contentenumeration.hxx +++ b/svtools/source/contnr/contentenumeration.hxx @@ -48,7 +48,7 @@ namespace svt { private: ::rtl::OUString maFilename; // only filename in upper case - for compare purposes - ::rtl::OUString maTitle; // -> be carefull when changing maTitle to update maFilename only when new + ::rtl::OUString maTitle; // -> be careful when changing maTitle to update maFilename only when new ::rtl::OUString maLowerTitle; @@ -135,8 +135,8 @@ namespace svt //==================================================================== enum EnumerationResult { - SUCCESS, /// the enumration was successfull - ERROR, /// the enumration was unsuccessfull + SUCCESS, /// the enumration was successful + ERROR, /// the enumration was unsuccessful RUNNING /// the enumeration is still running, and the maximum wait time has passed }; diff --git a/svtools/source/contnr/fileview.cxx b/svtools/source/contnr/fileview.cxx index fb14fe2a9d02..d2027be8d1e0 100644 --- a/svtools/source/contnr/fileview.cxx +++ b/svtools/source/contnr/fileview.cxx @@ -1430,7 +1430,7 @@ sal_Bool SvtFileView::GetParentURL( String& rParentURL ) const } catch( Exception const & ) { - // perhaps an unkown url protocol (e.g. "private:newdoc") + // perhaps an unknown url protocol (e.g. "private:newdoc") } return bRet; diff --git a/svtools/source/control/roadmap.cxx b/svtools/source/control/roadmap.cxx index 5178b69796a1..ad4c75af574e 100644 --- a/svtools/source/control/roadmap.cxx +++ b/svtools/source/control/roadmap.cxx @@ -766,7 +766,8 @@ namespace svt SetFont( aFont ); RoadmapTypes::ItemId curItemID = GetCurrentRoadmapItemID(); RoadmapItem* pLabelItem = GetByID( curItemID ); - pLabelItem->ToggleBackgroundColor(rStyleSettings.GetHighlightColor()); + if ( pLabelItem != NULL ) + pLabelItem->ToggleBackgroundColor(rStyleSettings.GetHighlightColor()); Invalidate(); } } diff --git a/svtools/source/filter/filter.cxx b/svtools/source/filter/filter.cxx index 7b474884d1e2..71f3f90f29e7 100644 --- a/svtools/source/filter/filter.cxx +++ b/svtools/source/filter/filter.cxx @@ -1630,8 +1630,8 @@ sal_uInt16 GraphicFilter::ImportGraphic( Graphic& rGraphic, const String& rPath, if( !ImportXPM( rIStream, rGraphic ) ) nStatus = GRFILTER_FILTERERROR; } - else if( aFilterName.EqualsIgnoreCaseAscii( IMP_BMP ) || - aFilterName.EqualsIgnoreCaseAscii( IMP_SVMETAFILE ) ) + else if ( aFilterName.EqualsIgnoreCaseAscii( IMP_BMP ) + || aFilterName.EqualsIgnoreCaseAscii( IMP_SVMETAFILE ) ) { // SV interne Importfilter fuer Bitmaps und MetaFiles rIStream >> rGraphic; @@ -1642,8 +1642,11 @@ sal_uInt16 GraphicFilter::ImportGraphic( Graphic& rGraphic, const String& rPath, } else { - // #15508# added BMP type (checked, works) - eLinkType = GFX_LINK_TYPE_NATIVE_BMP; + if ( aFilterName.EqualsIgnoreCaseAscii( IMP_BMP ) ) + { + // #15508# added BMP type (checked, works) + eLinkType = GFX_LINK_TYPE_NATIVE_BMP; + } } } else if( aFilterName.EqualsIgnoreCaseAscii( IMP_WMF ) || diff --git a/svtools/source/graphic/grfmgr.cxx b/svtools/source/graphic/grfmgr.cxx index 417a5676d47e..8e087ccafb80 100644 --- a/svtools/source/graphic/grfmgr.cxx +++ b/svtools/source/graphic/grfmgr.cxx @@ -74,6 +74,21 @@ struct GrfSimpleCacheObj // - GraphicObject - // ----------------- +// unique increasing ID for being able to detect the GraphicObject with the +// oldest last data changes +static sal_uLong aIncrementingTimeOfLastDataChange = 1; + +void GraphicObject::ImplAfterDataChange() +{ + // set unique timestamp ID of last data change + mnDataChangeTimeStamp = aIncrementingTimeOfLastDataChange++; + + // check memory footprint of all GraphicObjects managed and evtl. take action + GetGraphicManager().ImplCheckSizeOfSwappedInGraphics(); +} + +// ----------------------------------------------------------------------------- + GraphicObject::GraphicObject( const GraphicManager* pMgr ) : mpLink ( NULL ), mpUserData ( NULL ) @@ -169,6 +184,9 @@ void GraphicObject::ImplConstruct() mbAutoSwapped = sal_False; mbIsInSwapIn = sal_False; mbIsInSwapOut = sal_False; + + // Init with a unique, increasing ID + mnDataChangeTimeStamp = aIncrementingTimeOfLastDataChange++; } // ----------------------------------------------------------------------------- @@ -286,6 +304,9 @@ void GraphicObject::ImplAutoSwapIn() if( !mbAutoSwapped && mpMgr ) mpMgr->ImplGraphicObjectWasSwappedIn( *this ); } + + // Handle evtl. needed AfterDataChanges + ImplAfterDataChange(); } } @@ -910,6 +931,9 @@ void GraphicObject::SetGraphic( const Graphic& rGraphic, const GraphicObject* pC if( mpSwapOutTimer ) mpSwapOutTimer->Start(); + + // Handle evtl. needed AfterDataChanges + ImplAfterDataChange(); } // ----------------------------------------------------------------------------- @@ -1251,7 +1275,9 @@ sal_Bool GraphicObject::SwapIn() bRet = sal_True; } else if( mpMgr && mpMgr->ImplFillSwappedGraphicObject( *this, maGraphic ) ) + { bRet = sal_True; + } else { bRet = maGraphic.SwapIn(); @@ -1261,8 +1287,13 @@ sal_Bool GraphicObject::SwapIn() } if( bRet ) + { ImplAssignGraphicData(); + // Handle evtl. needed AfterDataChanges + ImplAfterDataChange(); + } + return bRet; } @@ -1278,7 +1309,9 @@ sal_Bool GraphicObject::SwapIn( SvStream* pIStm ) bRet = sal_True; } else if( mpMgr && mpMgr->ImplFillSwappedGraphicObject( *this, maGraphic ) ) + { bRet = sal_True; + } else { bRet = maGraphic.SwapIn( pIStm ); @@ -1288,8 +1321,13 @@ sal_Bool GraphicObject::SwapIn( SvStream* pIStm ) } if( bRet ) + { ImplAssignGraphicData(); + // + ImplAfterDataChange(); + } + return bRet; } @@ -1449,4 +1487,15 @@ basegfx::B2DVector GraphicObject::calculateCropScaling( return basegfx::B2DVector(fFactorX,fFactorY); } +// ------------------------------------------------------------------------ +// restart SwapOut timer + +void GraphicObject::restartSwapOutTimer() const +{ + if( mpSwapOutTimer && mpSwapOutTimer->IsActive() ) + { + mpSwapOutTimer->Start(); + } +} + // eof diff --git a/svtools/source/graphic/grfmgr2.cxx b/svtools/source/graphic/grfmgr2.cxx index c599a1d3f48d..5cac068d0603 100644 --- a/svtools/source/graphic/grfmgr2.cxx +++ b/svtools/source/graphic/grfmgr2.cxx @@ -295,9 +295,82 @@ ByteString GraphicManager::ImplGetUniqueID( const GraphicObject& rObj ) const // ----------------------------------------------------------------------------- +namespace +{ + struct simpleSortByDataChangeTimeStamp + { + bool operator() (GraphicObject* p1, GraphicObject* p2) const + { + return p1->GetDataChangeTimeStamp() < p2->GetDataChangeTimeStamp(); + } + }; +} // end of anonymous namespace + +void GraphicManager::ImplCheckSizeOfSwappedInGraphics() +{ + // only necessary for 32bit systems + if(SAL_TYPES_SIZEOFPOINTER <= 4) + { + // get the currently used memory footprint of all swapped in bitmap graphics + // of this graphic manager. Remember candidates in a vector. The size in bytes is + // already available, thus this loop is not expensive to execute + sal_uLong nUsedSize(0); + GraphicObject* pObj = 0; + std::vector< GraphicObject* > aCandidates; + + for(pObj = (GraphicObject*)maObjList.First(); pObj; pObj = (GraphicObject*)maObjList.Next()) + { + if(pObj->meType == GRAPHIC_BITMAP && !pObj->IsSwappedOut() && pObj->GetSizeBytes()) + { + aCandidates.push_back(pObj); + nUsedSize += pObj->GetSizeBytes(); + } + } + + // detect maximum allowed memory footprint. Use the user-settings of MaxCacheSize (defaulted + // to 20MB) and add a decent multiplicator (expecrimented to find one). Limit to + // a useful maximum for 32Bit address space + + // default is 20MB, so allow 200MB initially + static sal_uLong aMultiplicator(10); + + // max at 500MB; I experimented with 800 for debug and 750 for non-debug settings (pics start + // missing when AOO reaches a mem footprint of 1.5GB) but some secure left over space for + // app activity is needed + static sal_uLong aMaxSize32Bit(500 * 1024 * 1024); + + // calc max allowed cache size + const sal_uLong nMaxCacheSize(::std::min(GetMaxCacheSize() * aMultiplicator, aMaxSize32Bit)); + + if(nUsedSize >= nMaxCacheSize && !aCandidates.empty()) + { + // if we use more currently, sort by last DataChangeTimeStamp + // sort by DataChangeTimeStamp so that the oldest get removed first + ::std::sort(aCandidates.begin(), aCandidates.end(), simpleSortByDataChangeTimeStamp()); + + for(sal_uInt32 a(0); nUsedSize >= nMaxCacheSize && a < aCandidates.size(); a++) + { + // swap out until we have no more or the goal to use less than nMaxCacheSize + // is reached + pObj = aCandidates[a]; + const sal_uLong nSizeBytes(pObj->GetSizeBytes()); + + // do not swap out when we have less than 16KB data objects + if(nSizeBytes >= (16 * 1024)) + { + pObj->FireSwapOutRequest(); + nUsedSize = (nSizeBytes < nUsedSize) ? nUsedSize - nSizeBytes : 0; + } + } + } + } +} + +// ----------------------------------------------------------------------------- + sal_Bool GraphicManager::ImplFillSwappedGraphicObject( const GraphicObject& rObj, Graphic& rSubstitute ) { - return( mpCache->FillSwappedGraphicObject( rObj, rSubstitute ) ); + return mpCache->FillSwappedGraphicObject(rObj, rSubstitute); } // ----------------------------------------------------------------------------- diff --git a/svtools/source/svrtf/svparser.cxx b/svtools/source/svrtf/svparser.cxx index a8626d5f5c45..faaa0e8a29d7 100644 --- a/svtools/source/svrtf/svparser.cxx +++ b/svtools/source/svrtf/svparser.cxx @@ -288,7 +288,7 @@ sal_Unicode SvParser::GetNextChar() &nInfo, &nCvtBytes); if( (nInfo&RTL_TEXTTOUNICODE_INFO_SRCBUFFERTOSMALL) != 0 ) { - // The conversion wasn't successfull because we haven't + // The conversion wasn't successful because we haven't // read enough characters. if( pImplData->hContext != (rtl_TextToUnicodeContext)1 ) { @@ -377,7 +377,7 @@ sal_Unicode SvParser::GetNextChar() } else if( 1 == nChars && 0 == nInfo ) { - // The conversion was successfull + // The conversion was successful DBG_ASSERT( nCvtBytes == 1, "no all bytes have been converted!" ); c = cUC; diff --git a/svtools/source/uno/wizard/unowizard.cxx b/svtools/source/uno/wizard/unowizard.cxx index 845adfc9fa7d..b1da984af319 100644 --- a/svtools/source/uno/wizard/unowizard.cxx +++ b/svtools/source/uno/wizard/unowizard.cxx @@ -228,7 +228,7 @@ namespace svt { namespace uno //-------------------------------------------------------------------- Dialog* Wizard::createDialog( Window* i_pParent ) { - WizardShell* pDialog( new WizardShell( i_pParent, this, m_xController, m_aWizardSteps ) ); + WizardShell* pDialog( new WizardShell( i_pParent, m_xController, m_aWizardSteps ) ); pDialog->SetHelpId( lcl_getHelpId( m_sHelpURL ) ); pDialog->setTitleBase( m_sTitle ); return pDialog; diff --git a/svtools/source/uno/wizard/wizardshell.cxx b/svtools/source/uno/wizard/wizardshell.cxx index 51d85e6b8630..a78503e1f7e4 100644 --- a/svtools/source/uno/wizard/wizardshell.cxx +++ b/svtools/source/uno/wizard/wizardshell.cxx @@ -72,14 +72,13 @@ namespace svt { namespace uno //= WizardShell //================================================================================================================== //------------------------------------------------------------------------------------------------------------------ - WizardShell::WizardShell( Window* i_pParent, const Reference< XWizard >& i_rWizard, const Reference< XWizardController >& i_rController, + WizardShell::WizardShell( Window* i_pParent, const Reference< XWizardController >& i_rController, const Sequence< Sequence< sal_Int16 > >& i_rPaths ) :WizardShell_Base( i_pParent, WB_MOVEABLE | WB_CLOSEABLE ) - ,m_xWizard( i_rWizard ) ,m_xController( i_rController ) ,m_nFirstPageID( lcl_determineFirstPageID( i_rPaths ) ) { - ENSURE_OR_THROW( m_xWizard.is() && m_xController.is(), "invalid wizard/controller" ); + ENSURE_OR_THROW( m_xController.is(), "invalid controller" ); // declare the paths for ( sal_Int32 i=0; i& i_rWizard, const ::com::sun::star::uno::Reference< ::com::sun::star::ui::dialogs::XWizardController >& i_rController, const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< sal_Int16 > >& i_rPaths ); @@ -70,10 +69,6 @@ namespace svt { namespace uno virtual IWizardPageController* getPageController( TabPage* _pCurrentPage ) const; - // attribute access - const ::com::sun::star::uno::Reference< ::com::sun::star::ui::dialogs::XWizard >& - getWizard() const { return m_xWizard; } - static sal_Int16 convertCommitReasonToTravelType( const CommitPageReason i_eReason ); // operations @@ -131,7 +126,6 @@ namespace svt { namespace uno private: typedef ::std::map< TabPage*, PWizardPageController > Page2ControllerMap; - const ::com::sun::star::uno::Reference< ::com::sun::star::ui::dialogs::XWizard > m_xWizard; const ::com::sun::star::uno::Reference< ::com::sun::star::ui::dialogs::XWizardController > m_xController; const sal_Int16 m_nFirstPageID; Page2ControllerMap m_aPageControllers; -- cgit