This is an automated email from the ASF dual-hosted git repository. mseidel pushed a commit to branch trunk in repository https://gitbox.apache.org/repos/asf/openoffice.git
The following commit(s) were added to refs/heads/trunk by this push: new 07ec2dae6a Fixed typos, cleanup 07ec2dae6a is described below commit 07ec2dae6a42189124ed7f901d54c35a0555ec96 Author: mseidel <msei...@apache.org> AuthorDate: Sat Oct 12 20:34:58 2024 +0200 Fixed typos, cleanup --- main/l10ntools/inc/treeconfig.hxx | 43 ++-- main/sal/qa/rtl/logfile/rtl_logfile.cxx | 33 ++- .../source/sdr/overlay/overlaymanagerbuffered.cxx | 265 ++++++++++----------- main/vos/inc/vos/refobj.hxx | 19 +- 4 files changed, 177 insertions(+), 183 deletions(-) diff --git a/main/l10ntools/inc/treeconfig.hxx b/main/l10ntools/inc/treeconfig.hxx index 509bdf6cdf..23d9c6925c 100644 --- a/main/l10ntools/inc/treeconfig.hxx +++ b/main/l10ntools/inc/treeconfig.hxx @@ -1,5 +1,5 @@ /************************************************************** - * + * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information @@ -7,16 +7,16 @@ * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. - * + * *************************************************************/ #include <vector> @@ -24,26 +24,29 @@ #include "inireader.hxx" -namespace transex3{ +namespace transex3 +{ class Treeconfig { - private: - INIreader inireader; - INImap map; - bool has_config_file; - void getCurrentDir( string& dir ); - bool isConfigFilePresent(); - - public: - - Treeconfig() : has_config_file( false ) { parseConfig(); } - // read the config file, returns true in case a config file had been found - bool parseConfig(); - // returns a string vector containing all active repositories, returns true in case we are deep inside - // of a source tree. This could affect the behaviour of the tool - bool getActiveRepositories( vector<string>& active_repos); + private: + INIreader inireader; + INImap map; + bool has_config_file; + void getCurrentDir( string& dir ); + bool isConfigFilePresent(); + + public: + + Treeconfig() : has_config_file( false ) { parseConfig(); } + // read the config file, returns true in case a config file had been found + bool parseConfig(); + // returns a string vector containing all active repositories, returns true in case we are deep inside + // of a source tree. This could affect the behavior of the tool + bool getActiveRepositories( vector<string>& active_repos); }; } + +/* vim: set noet sw=4 ts=4: */ diff --git a/main/sal/qa/rtl/logfile/rtl_logfile.cxx b/main/sal/qa/rtl/logfile/rtl_logfile.cxx index 6bd9ce2be3..85272f5e99 100644 --- a/main/sal/qa/rtl/logfile/rtl_logfile.cxx +++ b/main/sal/qa/rtl/logfile/rtl_logfile.cxx @@ -1,5 +1,5 @@ /************************************************************** - * + * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information @@ -7,29 +7,24 @@ * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. - * + * *************************************************************/ - - - // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sal.hxx" // LLA: // this file is converted to use with testshl2 // original was placed in sal/test/textenc.cxx - -// ----------------------------------------------------------------------------- #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -45,7 +40,7 @@ // #include <osl/module.hxx> // #endif #include <osl/file.hxx> -#if ( defined WNT ) // Windows +#if ( defined WNT ) // Windows #include <tchar.h> #endif @@ -69,11 +64,11 @@ inline void printUString( const ::rtl::OUString & str, const sal_Char * msg = "" inline ::rtl::OUString getTempPath( void ) { #ifdef UNX - rtl::OUString suDirURL(rtl::OUString::createFromAscii("file:///tmp/")); + rtl::OUString suDirURL(rtl::OUString::createFromAscii("file:///tmp/")); #else /* Windows */ - rtl::OUString suDirURL(rtl::OUString::createFromAscii("file:///c:/temp/")); + rtl::OUString suDirURL(rtl::OUString::createFromAscii("file:///c:/temp/")); #endif - return suDirURL; + return suDirURL; } /** if the file exist @@ -109,7 +104,7 @@ inline ::rtl::OUString getCurrentPID( ) /* * LLA: * check if logfile is create - * be careful with relative logfiles they will create near the source, maybe it's no write access to it. + * be careful with relative logfiles they will create near the source, maybe it has no write access to it. * use absolute path to logfile instead. */ namespace rtl_logfile @@ -196,7 +191,7 @@ namespace rtl_logfile RTL_LOGFILE_CONTEXT_TRACE2 ( foo , "trace %d %d" , 1 , 2 ); RTL_LOGFILE_CONTEXT_TRACE3 ( foo , "trace %d %d %d" , 1 , 2 , 3); // TODO: assertion test! - } + } } // namespace rtl_logfile @@ -220,7 +215,7 @@ public: ::osl::FileBase::RC nError1; nError1 = osl::File::remove( suFilePath ); #ifdef WNT - printf("Please remove logfile* manully! Error is Permision denied!"); + printf("Please remove logfile* manually! Error is: Permission denied!"); #endif } catch (...) @@ -234,6 +229,8 @@ GlobalObject theGlobalObject; int main(int argc, char **argv) { - ::testing::InitGoogleTest(&argc, argv); - return RUN_ALL_TESTS(); + ::testing::InitGoogleTest(&argc, argv); + return RUN_ALL_TESTS(); } + +/* vim: set noet sw=4 ts=4: */ diff --git a/main/svx/source/sdr/overlay/overlaymanagerbuffered.cxx b/main/svx/source/sdr/overlay/overlaymanagerbuffered.cxx index 2d2dacda0f..69e63aab7d 100644 --- a/main/svx/source/sdr/overlay/overlaymanagerbuffered.cxx +++ b/main/svx/source/sdr/overlay/overlaymanagerbuffered.cxx @@ -1,5 +1,5 @@ /************************************************************** - * + * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information @@ -7,16 +7,16 @@ * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. - * + * *************************************************************/ // MARKER(update_precomp.py): autogen include statement, do not remove @@ -33,8 +33,6 @@ #include <vcl/cursor.hxx> #include <vcl/dibtools.hxx> -////////////////////////////////////////////////////////////////////////////// - namespace sdr { namespace overlay @@ -122,32 +120,32 @@ namespace sdr ((OverlayManagerBuffered*)this)->maBufferDevice.EnableMapMode(false); // local region - RectangleVector aRectangles; - rRegionPixel.GetRegionRectangles(aRectangles); + RectangleVector aRectangles; + rRegionPixel.GetRegionRectangles(aRectangles); - for(RectangleVector::const_iterator aRectIter(aRectangles.begin()); aRectIter != aRectangles.end(); aRectIter++) - { + for(RectangleVector::const_iterator aRectIter(aRectangles.begin()); aRectIter != aRectangles.end(); aRectIter++) + { #ifdef DBG_UTIL - // #i72754# possible graphical region test only with non-pro - static bool bDoPaintForVisualControl(false); - - if(bDoPaintForVisualControl) - { - getOutputDevice().SetLineColor(COL_LIGHTGREEN); - getOutputDevice().SetFillColor(); - getOutputDevice().DrawRect(*aRectIter); - } + // #i72754# possible graphical region test only with non-pro + static bool bDoPaintForVisualControl(false); + + if(bDoPaintForVisualControl) + { + getOutputDevice().SetLineColor(COL_LIGHTGREEN); + getOutputDevice().SetFillColor(); + getOutputDevice().DrawRect(*aRectIter); + } #endif - // restore the area - const Point aTopLeft(aRectIter->TopLeft()); - const Size aSize(aRectIter->GetSize()); + // restore the area + const Point aTopLeft(aRectIter->TopLeft()); + const Size aSize(aRectIter->GetSize()); - getOutputDevice().DrawOutDev( - aTopLeft, aSize, // destination - aTopLeft, aSize, // source - maBufferDevice); - } + getOutputDevice().DrawOutDev( + aTopLeft, aSize, // destination + aTopLeft, aSize, // source + maBufferDevice); + } //Region aRegionPixel(rRegionPixel); //RegionHandle aRegionHandle(aRegionPixel.BeginEnumRects()); @@ -164,17 +162,17 @@ namespace sdr // getOutputDevice().SetFillColor(); // getOutputDevice().DrawRect(aRegionRectanglePixel); // } -#endif // +#endif // // // restore the area // const Point aTopLeft(aRegionRectanglePixel.TopLeft()); // const Size aSize(aRegionRectanglePixel.GetSize()); - // + // // getOutputDevice().DrawOutDev( // aTopLeft, aSize, // destination // aTopLeft, aSize, // source // maBufferDevice); //} - // + // //aRegionPixel.EndEnumRects(aRegionHandle); // restore MapModes @@ -201,7 +199,7 @@ namespace sdr Region aPaintRegionPixel = rWindow.LogicToPixel(rWindow.GetPaintRegion()); aRegion.Intersect(aPaintRegionPixel); - // #i72754# Make sure content is completetly rendered, the window + // #i72754# Make sure content is completely rendered, the window // will be used as source of a DrawOutDev soon rWindow.Flush(); } @@ -217,60 +215,60 @@ namespace sdr maBufferDevice.EnableMapMode(false); // prepare to iterate over the rectangles from the region in pixels - RectangleVector aRectangles; - aRegion.GetRegionRectangles(aRectangles); + RectangleVector aRectangles; + aRegion.GetRegionRectangles(aRectangles); - for(RectangleVector::const_iterator aRectIter(aRectangles.begin()); aRectIter != aRectangles.end(); aRectIter++) - { - // for each rectangle, save the area - const Point aTopLeft(aRectIter->TopLeft()); - const Size aSize(aRectIter->GetSize()); + for(RectangleVector::const_iterator aRectIter(aRectangles.begin()); aRectIter != aRectangles.end(); aRectIter++) + { + // for each rectangle, save the area + const Point aTopLeft(aRectIter->TopLeft()); + const Size aSize(aRectIter->GetSize()); - maBufferDevice.DrawOutDev( - aTopLeft, aSize, // destination - aTopLeft, aSize, // source - rSource); + maBufferDevice.DrawOutDev( + aTopLeft, aSize, // destination + aTopLeft, aSize, // source + rSource); #ifdef DBG_UTIL - // #i72754# possible graphical region test only with non-pro - static bool bDoPaintForVisualControl(false); - - if(bDoPaintForVisualControl) - { - const bool bMapModeWasEnabledTest(getOutputDevice().IsMapModeEnabled()); - - getOutputDevice().EnableMapMode(false); - getOutputDevice().SetLineColor(COL_LIGHTRED); - getOutputDevice().SetFillColor(); - getOutputDevice().DrawRect(*aRectIter); - getOutputDevice().EnableMapMode(bMapModeWasEnabledTest); - } - - static bool bDoSaveForVisualControl(false); - - if(bDoSaveForVisualControl) - { - const Bitmap aBitmap(maBufferDevice.GetBitmap(aTopLeft, aSize)); - SvFileStream aNew((const String&)String(ByteString( "c:\\test.bmp" ), RTL_TEXTENCODING_UTF8), STREAM_WRITE|STREAM_TRUNC); - WriteDIB(aBitmap, aNew, false, true); - } + // #i72754# possible graphical region test only with non-pro + static bool bDoPaintForVisualControl(false); + + if(bDoPaintForVisualControl) + { + const bool bMapModeWasEnabledTest(getOutputDevice().IsMapModeEnabled()); + + getOutputDevice().EnableMapMode(false); + getOutputDevice().SetLineColor(COL_LIGHTRED); + getOutputDevice().SetFillColor(); + getOutputDevice().DrawRect(*aRectIter); + getOutputDevice().EnableMapMode(bMapModeWasEnabledTest); + } + + static bool bDoSaveForVisualControl(false); + + if(bDoSaveForVisualControl) + { + const Bitmap aBitmap(maBufferDevice.GetBitmap(aTopLeft, aSize)); + SvFileStream aNew((const String&)String(ByteString( "c:\\test.bmp" ), RTL_TEXTENCODING_UTF8), STREAM_WRITE|STREAM_TRUNC); + WriteDIB(aBitmap, aNew, false, true); + } #endif - } + } //RegionHandle aRegionHandle(aRegion.BeginEnumRects()); //Rectangle aRegionRectanglePixel; - // + // //while(aRegion.GetEnumRects(aRegionHandle, aRegionRectanglePixel)) //{ // // for each rectangle, save the area // Point aTopLeft(aRegionRectanglePixel.TopLeft()); // Size aSize(aRegionRectanglePixel.GetSize()); - // + // // maBufferDevice.DrawOutDev( // aTopLeft, aSize, // destination // aTopLeft, aSize, // source // rSource); - // + // #ifdef DBG_U//TIL // // #i72754# possible graphical region test only with non-pro // static bool bDoPaintForVisualControl(false); @@ -283,7 +281,7 @@ namespace sdr // getOutputDevice().DrawRect(aRegionRectanglePixel); // getOutputDevice().EnableMapMode(bMapModeWasEnabledTest); // } - // + // // static bool bDoSaveForVisualControl(false); // if(bDoSaveForVisualControl) // { @@ -291,9 +289,9 @@ namespace sdr // SvFileStream aNew((const String&)String(ByteString( "c:\\test.bmp" ), RTL_TEXTENCODING_UTF8), STREAM_WRITE|STREAM_TRUNC); // aNew << aBitmap; // } -#endif // +#endif // //} - // + // //aRegion.EndEnumRects(aRegionHandle); // restore MapModes @@ -309,26 +307,26 @@ namespace sdr if(!maBufferRememberedRangePixel.isEmpty()) { // logic size for impDrawMember call - basegfx::B2DRange aBufferRememberedRangeLogic( - maBufferRememberedRangePixel.getMinX(), maBufferRememberedRangePixel.getMinY(), + basegfx::B2DRange aBufferRememberedRangeLogic( + maBufferRememberedRangePixel.getMinX(), maBufferRememberedRangePixel.getMinY(), maBufferRememberedRangePixel.getMaxX(), maBufferRememberedRangePixel.getMaxY()); - aBufferRememberedRangeLogic.transform(getOutputDevice().GetInverseViewTransformation()); + aBufferRememberedRangeLogic.transform(getOutputDevice().GetInverseViewTransformation()); - // prepare cursor handling - const bool bTargetIsWindow(OUTDEV_WINDOW == rmOutputDevice.GetOutDevType()); - bool bCursorWasEnabled(false); + // prepare cursor handling + const bool bTargetIsWindow(OUTDEV_WINDOW == rmOutputDevice.GetOutDevType()); + bool bCursorWasEnabled(false); - // #i80730# switch off VCL cursor during overlay refresh + // #i80730# switch off VCL cursor during overlay refresh if(bTargetIsWindow) { Window& rWindow = static_cast< Window& >(rmOutputDevice); Cursor* pCursor = rWindow.GetCursor(); - if(pCursor && pCursor->IsVisible()) - { - pCursor->Hide(); - bCursorWasEnabled = true; - } + if(pCursor && pCursor->IsVisible()) + { + pCursor->Hide(); + bCursorWasEnabled = true; + } } if(DoRefreshWithPreRendering()) @@ -430,12 +428,12 @@ namespace sdr // VCL hack for transparent child windows // Problem is e.g. a radiobuttion form control in life mode. The used window - // is a transparence vcl childwindow. This flag only allows the parent window to + // is a transparent vcl childwindow. This flag only allows the parent window to // paint into the child windows area, but there is no mechanism which takes // care for a repaint of the child window. A transparent child window is NOT - // a window which always keeps it's content consistent over the parent, but it's + // a window which always keeps its content consistent over the parent, but it's // more like just a paint flag for the parent. - // To get the update, the windows in question are updated manulally here. + // To get the update, the windows in question are updated manually here. if(bTargetIsWindow) { Window& rWindow = static_cast< Window& >(rmOutputDevice); @@ -464,17 +462,17 @@ namespace sdr } } - // #i80730# restore visibility of VCL cursor + // #i80730# restore visibility of VCL cursor if(bCursorWasEnabled) - { + { Window& rWindow = static_cast< Window& >(rmOutputDevice); Cursor* pCursor = rWindow.GetCursor(); - if(pCursor) - { - // check if cursor still exists. It may have been deleted from someone - pCursor->Show(); - } + if(pCursor) + { + // check if cursor still exists. It may have been deleted from someone + pCursor->Show(); + } } // forget remembered Region @@ -485,7 +483,7 @@ namespace sdr } OverlayManagerBuffered::OverlayManagerBuffered( - OutputDevice& rOutputDevice, + OutputDevice& rOutputDevice, bool bRefreshWithPreRendering) : OverlayManager(rOutputDevice), mbRefreshWithPreRendering(bRefreshWithPreRendering) @@ -544,44 +542,44 @@ namespace sdr void OverlayManagerBuffered::invalidateRange(const basegfx::B2DRange& rRange) { - if(!rRange.isEmpty()) - { - // buffered output, do not invalidate but use the timer - // to trigger a timer event for refresh - maBufferTimer.Start(); - - // add the discrete range to the remembered region - // #i75163# use double precision and floor/ceil rounding to get overlapped pixel region, even - // when the given logic region has a width/height of 0.0. This does NOT work with LogicToPixel - // since it just transforms the top left and bottom right points equally without taking - // discrete pixel coverage into account. An empty B2DRange and thus empty logic Rectangle translated - // to an also empty discrete pixel rectangle - what is wrong. - basegfx::B2DRange aDiscreteRange(rRange); - aDiscreteRange.transform(getOutputDevice().GetViewTransformation()); - - if(maDrawinglayerOpt.IsAntiAliasing()) - { - // assume AA needs one pixel more and invalidate one pixel more - const double fDiscreteOne(getDiscreteOne()); - const basegfx::B2IPoint aTopLeft( - (sal_Int32)floor(aDiscreteRange.getMinX() - fDiscreteOne), - (sal_Int32)floor(aDiscreteRange.getMinY() - fDiscreteOne)); - const basegfx::B2IPoint aBottomRight( - (sal_Int32)ceil(aDiscreteRange.getMaxX() + fDiscreteOne), - (sal_Int32)ceil(aDiscreteRange.getMaxY() + fDiscreteOne)); - - maBufferRememberedRangePixel.expand(aTopLeft); - maBufferRememberedRangePixel.expand(aBottomRight); - } - else - { - const basegfx::B2IPoint aTopLeft((sal_Int32)floor(aDiscreteRange.getMinX()), (sal_Int32)floor(aDiscreteRange.getMinY())); - const basegfx::B2IPoint aBottomRight((sal_Int32)ceil(aDiscreteRange.getMaxX()), (sal_Int32)ceil(aDiscreteRange.getMaxY())); - - maBufferRememberedRangePixel.expand(aTopLeft); - maBufferRememberedRangePixel.expand(aBottomRight); - } - } + if(!rRange.isEmpty()) + { + // buffered output, do not invalidate but use the timer + // to trigger a timer event for refresh + maBufferTimer.Start(); + + // add the discrete range to the remembered region + // #i75163# use double precision and floor/ceil rounding to get overlapped pixel region, even + // when the given logic region has a width/height of 0.0. This does NOT work with LogicToPixel + // since it just transforms the top left and bottom right points equally without taking + // discrete pixel coverage into account. An empty B2DRange and thus empty logic Rectangle translated + // to an also empty discrete pixel rectangle - what is wrong. + basegfx::B2DRange aDiscreteRange(rRange); + aDiscreteRange.transform(getOutputDevice().GetViewTransformation()); + + if(maDrawinglayerOpt.IsAntiAliasing()) + { + // assume AA needs one pixel more and invalidate one pixel more + const double fDiscreteOne(getDiscreteOne()); + const basegfx::B2IPoint aTopLeft( + (sal_Int32)floor(aDiscreteRange.getMinX() - fDiscreteOne), + (sal_Int32)floor(aDiscreteRange.getMinY() - fDiscreteOne)); + const basegfx::B2IPoint aBottomRight( + (sal_Int32)ceil(aDiscreteRange.getMaxX() + fDiscreteOne), + (sal_Int32)ceil(aDiscreteRange.getMaxY() + fDiscreteOne)); + + maBufferRememberedRangePixel.expand(aTopLeft); + maBufferRememberedRangePixel.expand(aBottomRight); + } + else + { + const basegfx::B2IPoint aTopLeft((sal_Int32)floor(aDiscreteRange.getMinX()), (sal_Int32)floor(aDiscreteRange.getMinY())); + const basegfx::B2IPoint aBottomRight((sal_Int32)ceil(aDiscreteRange.getMaxX()), (sal_Int32)ceil(aDiscreteRange.getMaxY())); + + maBufferRememberedRangePixel.expand(aTopLeft); + maBufferRememberedRangePixel.expand(aBottomRight); + } + } } void OverlayManagerBuffered::SetRefreshWithPreRendering(bool bNew) @@ -594,5 +592,4 @@ namespace sdr } // end of namespace overlay } // end of namespace sdr -////////////////////////////////////////////////////////////////////////////// -// eof +/* vim: set noet sw=4 ts=4: */ diff --git a/main/vos/inc/vos/refobj.hxx b/main/vos/inc/vos/refobj.hxx index 132c6cfd2d..d4cfb6ddea 100644 --- a/main/vos/inc/vos/refobj.hxx +++ b/main/vos/inc/vos/refobj.hxx @@ -1,5 +1,5 @@ /************************************************************** - * + * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information @@ -7,28 +7,25 @@ * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. - * + * *************************************************************/ - - - #ifndef _VOS_REFOBJ_HXX_ #define _VOS_REFOBJ_HXX_ /** ORefObj<T> - template type to implement handle/body behaviour + template type to implement handle/body behavior with reference-counting. */ @@ -45,7 +42,7 @@ class ORefObj : public IReference { public: ORefObj(const T& Obj); - + inline ~ORefObj(); virtual RefCount SAL_CALL acquire() @@ -67,7 +64,7 @@ public: T& SAL_CALL getObj(); protected: - T m_Obj; + T m_Obj; ORefCount m_RefCount; private: @@ -80,6 +77,6 @@ private: } - #endif // _VOS_REF_HXX_ +/* vim: set noet sw=4 ts=4: */