This is an automated email from the ASF dual-hosted git repository. mseidel pushed a commit to branch AOO42X in repository https://gitbox.apache.org/repos/asf/openoffice.git
commit ebdd2c59b84f88c9468e657a3530b322d8640ece Author: mseidel <msei...@apache.org> AuthorDate: Sun Feb 2 01:27:17 2025 +0100 Fixed typos, cleanup (cherry picked from commit 922709c981a892574cf33806b25c024a3e6c51ed) --- .../source/processor2d/vclpixelprocessor2d.cxx | 113 ++++++++++----------- main/sal/rtl/source/tres.c | 19 ++-- main/svtools/inc/svtools/fileview.hxx | 73 ++++++------- 3 files changed, 100 insertions(+), 105 deletions(-) diff --git a/main/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx b/main/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx index d8798c804c..1179243cb5 100644 --- a/main/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx +++ b/main/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx @@ -1,5 +1,5 @@ /************************************************************** - * + * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information @@ -7,20 +7,18 @@ * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. - * + * *************************************************************/ - - // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_drawinglayer.hxx" @@ -75,33 +73,33 @@ namespace drawinglayer // prepare maCurrentTransformation matrix with viewTransformation to target directly to pixels maCurrentTransformation = rViewInformation.getObjectToViewTransformation(); - // prepare output directly to pixels - mpOutputDevice->Push(PUSH_MAPMODE); - mpOutputDevice->SetMapMode(); + // prepare output directly to pixels + mpOutputDevice->Push(PUSH_MAPMODE); + mpOutputDevice->SetMapMode(); - // react on AntiAliasing settings - if(getOptionsDrawinglayer().IsAntiAliasing()) - { - mpOutputDevice->SetAntialiasing(mpOutputDevice->GetAntialiasing() | ANTIALIASING_ENABLE_B2DDRAW); - } - else - { - mpOutputDevice->SetAntialiasing(mpOutputDevice->GetAntialiasing() & ~ANTIALIASING_ENABLE_B2DDRAW); - } - } + // react on AntiAliasing settings + if(getOptionsDrawinglayer().IsAntiAliasing()) + { + mpOutputDevice->SetAntialiasing(mpOutputDevice->GetAntialiasing() | ANTIALIASING_ENABLE_B2DDRAW); + } + else + { + mpOutputDevice->SetAntialiasing(mpOutputDevice->GetAntialiasing() & ~ANTIALIASING_ENABLE_B2DDRAW); + } + } VclPixelProcessor2D::~VclPixelProcessor2D() { - // restore MapMode - mpOutputDevice->Pop(); + // restore MapMode + mpOutputDevice->Pop(); - // restore AntiAliasing - mpOutputDevice->SetAntialiasing(mpOutputDevice->GetAntialiasing() & ~ANTIALIASING_ENABLE_B2DDRAW); + // restore AntiAliasing + mpOutputDevice->SetAntialiasing(mpOutputDevice->GetAntialiasing() & ~ANTIALIASING_ENABLE_B2DDRAW); } - bool VclPixelProcessor2D::tryDrawPolyPolygonColorPrimitive2DDirect(const drawinglayer::primitive2d::PolyPolygonColorPrimitive2D& rSource, double fTransparency) - { - basegfx::B2DPolyPolygon aLocalPolyPolygon(rSource.getB2DPolyPolygon()); + bool VclPixelProcessor2D::tryDrawPolyPolygonColorPrimitive2DDirect(const drawinglayer::primitive2d::PolyPolygonColorPrimitive2D& rSource, double fTransparency) + { + basegfx::B2DPolyPolygon aLocalPolyPolygon(rSource.getB2DPolyPolygon()); if(!aLocalPolyPolygon.count()) { @@ -115,7 +113,7 @@ namespace drawinglayer mpOutputDevice->SetLineColor(); aLocalPolyPolygon.transform(maCurrentTransformation); mpOutputDevice->DrawTransparent( - aLocalPolyPolygon, + aLocalPolyPolygon, fTransparency); return true; @@ -139,8 +137,8 @@ namespace drawinglayer // try drawing; if it did not work, use standard fallback if(mpOutputDevice->TryDrawPolyLineDirect( - aLocalPolygon, - 0.0, + aLocalPolygon, + 0.0, fTransparency)) { return true; @@ -171,10 +169,10 @@ namespace drawinglayer { // apply LineStyle basegfx::tools::applyLineDashing( - aLocalPolygon, - rSource.getStrokeAttribute().getDotDashArray(), - &aHairLinePolyPolygon, - 0, + aLocalPolygon, + rSource.getStrokeAttribute().getDotDashArray(), + &aHairLinePolyPolygon, + 0, rSource.getStrokeAttribute().getFullDotDashLen()); } @@ -214,8 +212,8 @@ namespace drawinglayer bHasPoints = true; if(mpOutputDevice->TryDrawPolyLineDirect( - aSingle, - fLineWidth, + aSingle, + fLineWidth, fTransparency, rSource.getLineAttribute().getLineJoin(), rSource.getLineAttribute().getLineCap())) @@ -248,8 +246,8 @@ namespace drawinglayer const primitive2d::WrongSpellPrimitive2D& rWrongSpellPrimitive = static_cast< const primitive2d::WrongSpellPrimitive2D& >(rCandidate); if(!renderWrongSpellPrimitive2D( - rWrongSpellPrimitive, - *mpOutputDevice, + rWrongSpellPrimitive, + *mpOutputDevice, maCurrentTransformation, maBColorModifierStack)) { @@ -280,10 +278,10 @@ namespace drawinglayer { process(rCandidate.get2DDecomposition(getViewInformation2D())); } - + // restore DrawMode mpOutputDevice->SetDrawMode(nOriginalDrawMode); - + break; } case PRIMITIVE2D_ID_TEXTDECORATEDPORTIONPRIMITIVE2D : @@ -453,12 +451,12 @@ namespace drawinglayer // use new Metafile decomposition process(rCandidate.get2DDecomposition(getViewInformation2D())); - + if(bForceLineSnap) { mpOutputDevice->SetAntialiasing(nOldAntiAliase); } - + break; } case PRIMITIVE2D_ID_MASKPRIMITIVE2D : @@ -492,7 +490,7 @@ namespace drawinglayer bool bDrawTransparentUsed(false); // since DEV300 m33 DrawTransparent is supported in VCL (for some targets - // natively), so i am now enabling this shortcut + // natively), so I am now enabling this shortcut static bool bAllowUsingDrawTransparent(true); if(bAllowUsingDrawTransparent && 1 == rContent.getLength()) @@ -521,7 +519,7 @@ namespace drawinglayer // do no tallow by default - problem is that self-overlapping parts of this geometry will // not be in a all-same transparency but will already alpha-cover themselves with blending. // This is not what the UnifiedTransparencePrimitive2D defines: It requires all it's - // content to be uniformely transparent. + // content to be uniformly transparent. // For hairline the effect is pretty minimal, but still not correct. static bool bAllowed(false); @@ -537,8 +535,8 @@ namespace drawinglayer // do no tallow by default - problem is that self-overlapping parts of this geometry will // not be in a all-same transparency but will already alpha-cover themselves with blending. // This is not what the UnifiedTransparencePrimitive2D defines: It requires all it's - // content to be uniformely transparent. - // To check, acitvate and draw a wide transparent self-crossing line/curve + // content to be uniformly transparent. + // To check, activate and draw a wide transparent self-crossing line/curve static bool bAllowed(false); bDrawTransparentUsed = bAllowed && tryDrawPolygonStrokePrimitive2DDirect(*pPoStroke, rUniTransparenceCandidate.getTransparence()); @@ -614,17 +612,17 @@ namespace drawinglayer // it does not need to be painted at all. uno::Reference< awt::XWindow2 > xControlWindow(rXControl, uno::UNO_QUERY_THROW); const bool bControlIsVisibleAsChildWindow(rXControl->getPeer().is() && xControlWindow->isVisible()); - + if(!bControlIsVisibleAsChildWindow) { // draw it. Do not forget to use the evtl. offsetted origin of the target device, // e.g. when used with mask/transparence buffer device const Point aOrigin(mpOutputDevice->GetMapMode().GetOrigin()); xControlView->draw( - aOrigin.X() + basegfx::fround(aTopLeftPixel.getX()), + aOrigin.X() + basegfx::fround(aTopLeftPixel.getX()), aOrigin.Y() + basegfx::fround(aTopLeftPixel.getY())); } - + // restore original graphics xControlView->setGraphics(xOriginalGraphics); } @@ -634,7 +632,7 @@ namespace drawinglayer // #i116763# removing since there is a good alternative when the xControlView // is not found and it is allowed to happen // DBG_UNHANDLED_EXCEPTION(); - + // process recursively and use the decomposition as Bitmap process(rCandidate.get2DDecomposition(getViewInformation2D())); } @@ -675,8 +673,8 @@ namespace drawinglayer } else { - // Lines with 1 and 2 pixel width without AA need special treatment since their vsiualisation - // as filled polygons is geometrically corret but looks wrong since polygon filling avoids + // Lines with 1 and 2 pixel width without AA need special treatment since their visualization + // as filled polygons is geometrically correct but looks wrong since polygon filling avoids // the right and bottom pixels. The used method evaluates that and takes the correct action, // including calling recursively with decomposition if line is wide enough RenderPolygonStrokePrimitive2D(rPolygonStrokePrimitive2D); @@ -693,19 +691,19 @@ namespace drawinglayer if(bForceIgnoreHatchSmoothing || getOptionsDrawinglayer().IsAntiAliasing()) { - // if AA is used (or ignore smoothing is on), there is no need to smooth + // if AA is used (or ignore smoothing is on), there is no need to smooth // hatch painting, use decomposition process(rCandidate.get2DDecomposition(getViewInformation2D())); } else { - // without AA, use VCL to draw the hatch. It snaps hatch distances to the next pixel - // and forces hatch distance to be >= 3 pixels to make the hatch display look smoother. + // without AA, use VCL to draw the hatch. It snaps hatch distances to the next pixel + // and forces hatch distance to be >= 3 pixels to make the hatch display look smoother. // This is wrong in principle, but looks nicer. This could also be done here directly // without VCL usage if needed const primitive2d::FillHatchPrimitive2D& rFillHatchPrimitive = static_cast< const primitive2d::FillHatchPrimitive2D& >(rCandidate); const attribute::FillHatchAttribute& rFillHatchAttributes = rFillHatchPrimitive.getFillHatch(); - + // create hatch polygon in range size and discrete coordinates basegfx::B2DRange aHatchRange(rFillHatchPrimitive.getOutputRange()); aHatchRange.transform(maCurrentTransformation); @@ -715,7 +713,7 @@ namespace drawinglayer { // #i111846# background fill is active; draw fill polygon const basegfx::BColor aPolygonColor(maBColorModifierStack.getModifiedColor(rFillHatchPrimitive.getBColor())); - + mpOutputDevice->SetFillColor(Color(aPolygonColor)); mpOutputDevice->SetLineColor(); mpOutputDevice->DrawPolygon(aHatchPolygon); @@ -837,5 +835,4 @@ namespace drawinglayer } // end of namespace processor2d } // end of namespace drawinglayer -////////////////////////////////////////////////////////////////////////////// -// eof +/* vim: set noet sw=4 ts=4: */ diff --git a/main/sal/rtl/source/tres.c b/main/sal/rtl/source/tres.c index 2a81700891..892c1fc17d 100644 --- a/main/sal/rtl/source/tres.c +++ b/main/sal/rtl/source/tres.c @@ -1,5 +1,5 @@ /************************************************************** - * + * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information @@ -7,20 +7,18 @@ * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. - * + * *************************************************************/ - - #include <stdio.h> #include <rtl/tres.h> #include <osl/diagnose.h> @@ -158,7 +156,7 @@ static rtl_TestResult_vtable trVTable = * create and initialize data struct for TestResult * * @param const sal_Char* meth = name of the method (entryname) - * @param sal_uInt32 flags = bitmap of comandline and status flags + * @param sal_uInt32 flags = bitmap of commandline and status flags * * @return rtl_TestResult* = pointer to a new allocated testresult struct */ @@ -321,7 +319,7 @@ rtl_CmpState* SAL_CALL rtl_tres_create_cmpstate( * rtl_tres_destroy * free allocated memory of testresult data struct * - * @param rtl_TestResult* pThis_ = ponter to a valid testresult struct + * @param rtl_TestResult* pThis_ = pointer to a valid testresult struct */ void SAL_CALL rtl_tres_destroy( rtl_TestResult* pThis_ ) { @@ -332,7 +330,7 @@ void SAL_CALL rtl_tres_destroy( rtl_TestResult* pThis_ ) if ( pData->m_state ) rtl_tres_destroy_funcstates( pData->m_state ); - /* free allocted memory and reinitialize to zero */ + /* free allocated memory and reinitialize to zero */ /* to be able to prevent dangling pointer access*/ free( pData ); pData = NULL; } @@ -454,7 +452,7 @@ static sal_Bool SAL_CALL rtl_tres_state( /* indicate this state as substate */ rtl_tres_setbit( pFunc, rtl_tres_Flag_SUB ); - /* indicate prvious state as passed if no masterstate */ + /* indicate previous state as passed if no masterstate */ if ( pFunc->m_prev != pData->m_state ) rtl_tres_setbit( pFunc->m_prev, rtl_tres_Flag_PASSED ); } @@ -679,4 +677,3 @@ rtl_cmpstate SAL_CALL rtl_tres_getnextcmpstate( rtl_cmpstate cstate) // } //} // </method_logPrintf> */ - diff --git a/main/svtools/inc/svtools/fileview.hxx b/main/svtools/inc/svtools/fileview.hxx index 7245e4cb35..22e334cc89 100644 --- a/main/svtools/inc/svtools/fileview.hxx +++ b/main/svtools/inc/svtools/fileview.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,19 +7,18 @@ * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. - * + * *************************************************************/ - #ifndef _SVT_FILEVIEW_HXX #define _SVT_FILEVIEW_HXX @@ -54,30 +53,30 @@ class IUrlFilter; /// the result of an action in the FileView enum FileViewResult { - eSuccess, - eFailure, - eTimeout, - eStillRunning + eSuccess, + eFailure, + eTimeout, + eStillRunning }; /// describes parameters for doing an action on the FileView asynchronously struct FileViewAsyncAction { - sal_uInt32 nMinTimeout; /// minimum time to wait for a result, in milliseconds - sal_uInt32 nMaxTimeout; /// maximum time to wait for a result, in milliseconds, until eTimeout is returned - Link aFinishHandler; /// the handler to be called when the action is finished. Called in every case, no matter of the result - - FileViewAsyncAction() - { - nMinTimeout = nMaxTimeout = 0; - } + sal_uInt32 nMinTimeout; /// minimum time to wait for a result, in milliseconds + sal_uInt32 nMaxTimeout; /// maximum time to wait for a result, in milliseconds, until eTimeout is returned + Link aFinishHandler; /// the handler to be called when the action is finished. Called in every case, no matter of the result + + FileViewAsyncAction() + { + nMinTimeout = nMaxTimeout = 0; + } }; class SVT_DLLPUBLIC SvtFileView : public Control { private: - SvtFileView_Impl* mpImp; - + SvtFileView_Impl* mpImp; + ::com::sun::star::uno::Sequence< ::rtl::OUString > mpBlackList; SVT_DLLPRIVATE void OpenFolder( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aContents ); @@ -93,20 +92,20 @@ public: SvtFileView( Window* pParent, const ResId& rResId, sal_Int8 nFlags ); ~SvtFileView(); - const String& GetViewURL() const; + const String& GetViewURL() const; String GetURL( SvLBoxEntry* pEntry ) const; String GetCurrentURL() const; - sal_Bool GetParentURL( String& _rParentURL ) const; + sal_Bool GetParentURL( String& _rParentURL ) const; sal_Bool CreateNewFolder( const String& rNewFolder ); void SetHelpId( const rtl::OString& rHelpId ); const rtl::OString& GetHelpId( ) const; void SetSizePixel( const Size& rNewSize ); - using Window::SetPosSizePixel; + using Window::SetPosSizePixel; virtual void SetPosSizePixel( const Point& rNewPos, const Size& rNewSize ); - /** initialize the view with the content of a folder given by URL, and aply an immediate filter + /** initialize the view with the content of a folder given by URL, and apply an immediate filter @param rFolderURL the URL of the folder whose content is to be read @@ -127,7 +126,7 @@ public: const String& rFolderURL, const String& rFilter, const FileViewAsyncAction* pAsyncDescriptor ); - /** initialze the view with a sequence of contents, which have already been obtained elsewhere + /** initialize the view with a sequence of contents, which have already been obtained elsewhere This method will never return <member>eStillRunning</member>, since it will fill the view synchronously @@ -136,7 +135,7 @@ public: /** initializes the view with the content of a folder given by an UCB content */ - sal_Bool Initialize( const ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XContent>& _xContent, + sal_Bool Initialize( const ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XContent>& _xContent, const String& rFilter ); /** reads the current content of the current folder again, and applies the given filter to it @@ -178,12 +177,12 @@ public: const FileViewAsyncAction* pAsyncDescriptor ); - void SetNoSelection(); + void SetNoSelection(); void ResetCursor(); void SetSelectHdl( const Link& rHdl ); void SetDoubleClickHdl( const Link& rHdl ); - void SetOpenDoneHdl( const Link& rHdl ); + void SetOpenDoneHdl( const Link& rHdl ); sal_uLong GetSelectionCount() const; SvLBoxEntry* FirstSelected() const; @@ -191,8 +190,8 @@ public: void EnableAutoResize(); void SetFocus(); - void EnableContextMenu( sal_Bool bEnable ); - void EnableDelete( sal_Bool bEnable ); + void EnableContextMenu( sal_Bool bEnable ); + void EnableDelete( sal_Bool bEnable ); void EnableNameReplacing( sal_Bool bEnable = sal_True ); // translate folder names or display doc-title instead of file name // EnableContextMenu( sal_True )/EnableDelete(sal_True) disable name replacing! @@ -201,13 +200,13 @@ public: String GetConfigString() const; void SetConfigString( const String& rCfgStr ); - void SetUrlFilter( const IUrlFilter* _pFilter ); - const IUrlFilter* GetUrlFilter( ) const; + void SetUrlFilter( const IUrlFilter* _pFilter ); + const IUrlFilter* GetUrlFilter( ) const; - void EndInplaceEditing( bool _bCancel ); + void EndInplaceEditing( bool _bCancel ); protected: - virtual void StateChanged( StateChangedType nStateChange ); + virtual void StateChanged( StateChangedType nStateChange ); }; // struct SvtContentEntry ------------------------------------------------ @@ -246,7 +245,7 @@ class SVT_DLLPUBLIC QueryDeleteDlg_Impl : public ModalDialog PushButton _aNoButton; CancelButton _aCancelButton; - QueryDeleteResult_Impl _eResult; + QueryDeleteResult_Impl _eResult; private: @@ -257,10 +256,12 @@ public: QueryDeleteDlg_Impl( Window* pParent, const String& rName ); - void EnableAllButton() { _aAllButton.Enable( sal_True ); } - QueryDeleteResult_Impl GetResult() const { return _eResult; } + void EnableAllButton() { _aAllButton.Enable( sal_True ); } + QueryDeleteResult_Impl GetResult() const { return _eResult; } }; } #endif // _SVT_FILEVIEW_HXX + +/* vim: set noet sw=4 ts=4: */