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 d1ac59dc184e4d009562acde272f9ccf1e0590ad Author: mseidel <msei...@apache.org> AuthorDate: Sat Feb 8 18:38:19 2025 +0100 Fix typos (1nd, 3nd, abnove) (cherry picked from commit f7cce9f13b8d7bb1b4ee93730cd2ffcdcdb028b5) --- main/connectivity/source/cpool/ZPoolCollection.cxx | 18 ++- .../examples/DevelopersGuide/Database/sdbcx.java | 95 +++++++------- main/vcl/source/gdi/print2.cxx | 138 +++++++++------------ 3 files changed, 115 insertions(+), 136 deletions(-) diff --git a/main/connectivity/source/cpool/ZPoolCollection.cxx b/main/connectivity/source/cpool/ZPoolCollection.cxx index ac5b4ddb67..9a1b8662c9 100644 --- a/main/connectivity/source/cpool/ZPoolCollection.cxx +++ b/main/connectivity/source/cpool/ZPoolCollection.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_connectivity.hxx" #include "ZPoolCollection.hxx" @@ -458,7 +456,7 @@ Any OPoolCollection::getNodeValue(const ::rtl::OUString& _rPath,const Reference< if (xDirectAccess.is() && xDirectAccess->hasByName(_rPath) ) { aReturn = xDirectAccess->getByName(_rPath); - } + } else if (xHierarchyAccess.is()) { aReturn = xHierarchyAccess->getByHierarchicalName(_rPath); @@ -466,7 +464,7 @@ Any OPoolCollection::getNodeValue(const ::rtl::OUString& _rPath,const Reference< } catch(NoSuchElementException& e) { - OSL_UNUSED( e ); // make compiler happy + OSL_UNUSED( e ); // make compiler happy OSL_ENSURE(sal_False, ::rtl::OString("::getNodeValue: caught a NoSuchElementException while trying to open ") += ::rtl::OString(e.Message.getStr(), e.Message.getLength(), RTL_TEXTENCODING_ASCII_US) @@ -541,7 +539,7 @@ void SAL_CALL OPoolCollection::propertyChange( const ::com::sun::star::beans::Pr { ::rtl::OUString sThisDriverName; getNodeValue(getDriverNameNodeName(),evt.Source) >>= sThisDriverName; - // 1nd relase the driver + // First release the driver // look if we already have a proxy for this driver MapDriver2DriverRefIterator aLookup = m_aDriverProxies.begin(); while( aLookup != m_aDriverProxies.end()) @@ -574,4 +572,4 @@ m_xDesktop.clear(); } // ----------------------------------------------------------------------------- - +/* vim: set noet sw=4 ts=4: */ diff --git a/main/odk/examples/DevelopersGuide/Database/sdbcx.java b/main/odk/examples/DevelopersGuide/Database/sdbcx.java index 9984ae0360..3b1382a34d 100644 --- a/main/odk/examples/DevelopersGuide/Database/sdbcx.java +++ b/main/odk/examples/DevelopersGuide/Database/sdbcx.java @@ -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. - * + * *************************************************************/ - - import java.io.*; import com.sun.star.lang.XComponent; @@ -32,37 +30,37 @@ import com.sun.star.container.XIndexAccess; import com.sun.star.sdbc.*; import com.sun.star.sdbcx.*; import com.sun.star.lang.XMultiServiceFactory; - + public class sdbcx { private XMultiServiceFactory xORB; private static XConnection con; private XTablesSupplier xTabSup; - - public static XMultiServiceFactory rSmgr; + + public static XMultiServiceFactory rSmgr; public static void main(String argv[]) throws java.lang.Exception { try{ rSmgr = connect("socket,host=localhost,port=8100"); - sdbcx test = new sdbcx(rSmgr); - test.createConnection(); - test.displayTableProperties(); - // now we dispose the connection to close it - XComponent xComponent = (XComponent)UnoRuntime.queryInterface(XComponent.class,con); - if(xComponent != null) - { - xComponent.dispose(); - System.out.println("Connection disposed!"); - } - } + sdbcx test = new sdbcx(rSmgr); + test.createConnection(); + test.displayTableProperties(); + // now we dispose the connection to close it + XComponent xComponent = (XComponent)UnoRuntime.queryInterface(XComponent.class,con); + if(xComponent != null) + { + xComponent.dispose(); + System.out.println("Connection disposed!"); + } + } catch(com.sun.star.uno.Exception e) { System.out.println(e); e.printStackTrace(); } System.exit(0); - } - public static XMultiServiceFactory connect( String connectStr ) + } + public static XMultiServiceFactory connect( String connectStr ) throws com.sun.star.uno.Exception, com.sun.star.uno.RuntimeException, java.lang.Exception { @@ -71,14 +69,14 @@ public class sdbcx com.sun.star.comp.helper.Bootstrap.createSimpleServiceManager(); // create a connector, so that it can contact the office - Object xUrlResolver = xLocalServiceManager.createInstance( "com.sun.star.bridge.UnoUrlResolver" ); + Object xUrlResolver = xLocalServiceManager.createInstance( "com.sun.star.bridge.UnoUrlResolver" ); XUnoUrlResolver urlResolver = (XUnoUrlResolver)UnoRuntime.queryInterface( - XUnoUrlResolver.class, xUrlResolver ); + XUnoUrlResolver.class, xUrlResolver ); Object rInitialObject = urlResolver.resolve( "uno:" + connectStr + ";urp;StarOffice.NamingService" ); XNamingService rName = (XNamingService)UnoRuntime.queryInterface( - XNamingService.class, rInitialObject ); + XNamingService.class, rInitialObject ); XMultiServiceFactory xMSF = null; if( rName != null ) { @@ -97,7 +95,7 @@ public class sdbcx { xORB = rSmgr; } - + public void createConnection() throws com.sun.star.uno.Exception { // create the Driver with the implementation name @@ -107,7 +105,7 @@ public class sdbcx xDriver = (XDriver)UnoRuntime.queryInterface(XDriver.class,aDriver); if(xDriver != null) { - // first create the needed url + // first create the needed URL String adabasURL = "sdbc:adabas::MYDB0"; // second create the necessary properties com.sun.star.beans.PropertyValue [] adabasProps = new com.sun.star.beans.PropertyValue[] @@ -115,9 +113,8 @@ public class sdbcx new com.sun.star.beans.PropertyValue("user",0,"test1",com.sun.star.beans.PropertyState.DIRECT_VALUE), new com.sun.star.beans.PropertyValue("password",0,"test1",com.sun.star.beans.PropertyState.DIRECT_VALUE) }; - // - - // now create a connection to adabas + + // now create a connection to Adabas con = xDriver.connect(adabasURL,adabasProps); if(con != null) { @@ -165,7 +162,7 @@ public class sdbcx } //########################################################### - // 15. example + // 15. example // print all columns of a XColumnsSupplier //########################################################### public static void printColumns(XColumnsSupplier xColumnsSup) throws com.sun.star.uno.Exception,SQLException @@ -179,7 +176,7 @@ public class sdbcx System.out.println(" " + aColumnNames[i]); } //########################################################### - // 16. example + // 16. example // print all keys inclusive the columns of a key //########################################################### public static void printKeys(XColumnsSupplier xColumnsSup) throws com.sun.star.uno.Exception,SQLException @@ -196,12 +193,12 @@ public class sdbcx XPropertySet xProp = (XPropertySet)UnoRuntime.queryInterface(XPropertySet.class,key); System.out.println(" " + xProp.getPropertyValue("Name")); XColumnsSupplier xKeyColumnsSup = ( XColumnsSupplier ) UnoRuntime.queryInterface(XColumnsSupplier.class,xProp); - printColumns(xKeyColumnsSup); + printColumns(xKeyColumnsSup); } } } //########################################################### - // 17. example + // 17. example // print all keys inclusive the columns of a key //########################################################### public static void printIndexes(XColumnsSupplier xColumnsSup) throws com.sun.star.uno.Exception,SQLException @@ -218,16 +215,16 @@ public class sdbcx System.out.println(" " + aIndexNames[i]); Object index = xIndexs.getByName(aIndexNames[i]); XColumnsSupplier xIndexColumnsSup = (XColumnsSupplier)UnoRuntime.queryInterface(XColumnsSupplier.class,index); - printColumns(xIndexColumnsSup); + printColumns(xIndexColumnsSup); } } } //########################################################### - // 18. example + // 18. example // column properties //########################################################### - public static void printColumnProperties(Object column) throws com.sun.star.uno.Exception,SQLException + public static void printColumnProperties(Object column) throws com.sun.star.uno.Exception,SQLException { System.out.println("Example printColumnProperties"); XPropertySet xProp = (XPropertySet)UnoRuntime.queryInterface(XPropertySet.class,column); @@ -249,7 +246,7 @@ public class sdbcx } //########################################################### - // 19. example + // 19. example // index properties //########################################################### public static void printIndexProperties(Object index) throws com.sun.star.uno.Exception,SQLException @@ -264,7 +261,7 @@ public class sdbcx } //########################################################### - // 20. example + // 20. example // key properties //########################################################### public static void printKeyProperties(Object key) throws com.sun.star.uno.Exception,SQLException @@ -279,7 +276,7 @@ public class sdbcx } //########################################################### - // 21. example + // 21. example // print all groups and the users with their privileges who belong to this group //########################################################### public static void printGroups(XTablesSupplier xTabSup) throws com.sun.star.uno.Exception,SQLException @@ -313,7 +310,7 @@ public class sdbcx } //########################################################### - // 22. example + // 22. example // create the table salesmen //########################################################### public static void createTableSalesMen(XNameAccess xTables) throws com.sun.star.uno.Exception,SQLException @@ -337,29 +334,29 @@ public class sdbcx xCol.setPropertyValue("Type",new Integer(DataType.INTEGER)); xCol.setPropertyValue("IsNullable",new Integer(ColumnValue.NO_NULLS)); xAppend.appendByDescriptor(xCol); - // 2nd only set the properties which differs + // only set the properties which differs xCol.setPropertyValue("Name","FIRSTNAME"); xCol.setPropertyValue("Type",new Integer(DataType.VARCHAR)); xCol.setPropertyValue("IsNullable",new Integer(ColumnValue.NULLABLE)); xCol.setPropertyValue("Precision",new Integer(50)); xAppend.appendByDescriptor(xCol); - // 3nd only set the properties which differs + // only set the properties which differs xCol.setPropertyValue("Name","LASTNAME"); xCol.setPropertyValue("Precision",new Integer(100)); xAppend.appendByDescriptor(xCol); - // 4nd only set the properties which differs + // only set the properties which differs xCol.setPropertyValue("Name","STREET"); xCol.setPropertyValue("Precision",new Integer(50)); xAppend.appendByDescriptor(xCol); - // 5nd only set the properties which differs + // only set the properties which differs xCol.setPropertyValue("Name","STATE"); xAppend.appendByDescriptor(xCol); - // 6nd only set the properties which differs + // only set the properties which differs xCol.setPropertyValue("Name","ZIP"); xCol.setPropertyValue("Type",new Integer(DataType.INTEGER)); xCol.setPropertyValue("Precision",new Integer(10)); // default value integer xAppend.appendByDescriptor(xCol); - // 7nd only set the properties which differs + // only set the properties which differs xCol.setPropertyValue("Name","BIRTHDATE"); xCol.setPropertyValue("Type",new Integer(DataType.DATE)); xCol.setPropertyValue("Precision",new Integer(10)); // default value integer @@ -379,7 +376,7 @@ public class sdbcx xKeyCol.setPropertyValue("Name","SNR"); // append the key column xKeyColAppend.appendByDescriptor(xKeyCol); - // apend the key + // append the key xKeyAppend.appendByDescriptor(xKey); // the last step is to append the new table to the tables collection XAppend xTableAppend = (XAppend)UnoRuntime.queryInterface(XAppend.class,xTabFac); @@ -388,7 +385,7 @@ public class sdbcx } //########################################################### - // 23. example + // 23. example // create a user //########################################################### public static void createUser(XNameAccess xUsers) throws com.sun.star.uno.Exception,SQLException diff --git a/main/vcl/source/gdi/print2.cxx b/main/vcl/source/gdi/print2.cxx index 83865a203f..cc75a58e85 100644 --- a/main/vcl/source/gdi/print2.cxx +++ b/main/vcl/source/gdi/print2.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_vcl.hxx" @@ -65,19 +63,19 @@ typedef ::std::list< Component > ComponentList; // List of (intersecting) actions, plus overall bounds struct ConnectedComponents { - ConnectedComponents() : - aComponentList(), - aBounds(), - aBgColor(COL_WHITE), - bIsSpecial(false), - bIsFullyTransparent(false) - {} - - ComponentList aComponentList; - Rectangle aBounds; - Color aBgColor; - bool bIsSpecial; - bool bIsFullyTransparent; + ConnectedComponents() : + aComponentList(), + aBounds(), + aBgColor(COL_WHITE), + bIsSpecial(false), + bIsFullyTransparent(false) + {} + + ComponentList aComponentList; + Rectangle aBounds; + Color aBgColor; + bool bIsSpecial; + bool bIsFullyTransparent; }; typedef ::std::list< ConnectedComponents > ConnectedComponentsList; @@ -275,16 +273,16 @@ static void ImplConvertTransparentAction( GDIMetaFile& o_rMtf, // Returns true, if given action creates visible (i.e. non-transparent) output static bool ImplIsNotTransparent( const MetaAction& rAct, const OutputDevice& rOut ) { - const bool bLineTransparency( rOut.IsLineColor() ? rOut.GetLineColor().GetTransparency() == 255 : true ); - const bool bFillTransparency( rOut.IsFillColor() ? rOut.GetFillColor().GetTransparency() == 255 : true ); - bool bRet( false ); + const bool bLineTransparency( rOut.IsLineColor() ? rOut.GetLineColor().GetTransparency() == 255 : true ); + const bool bFillTransparency( rOut.IsFillColor() ? rOut.GetFillColor().GetTransparency() == 255 : true ); + bool bRet( false ); switch( rAct.GetType() ) { case META_POINT_ACTION: - if( !bLineTransparency ) - bRet = true; - break; + if( !bLineTransparency ) + bRet = true; + break; case META_LINE_ACTION: if( !bLineTransparency ) @@ -376,37 +374,37 @@ static bool ImplIsNotTransparent( const MetaAction& rAct, const OutputDevice& rO case META_TEXTRECT_ACTION: case META_STRETCHTEXT_ACTION: case META_TEXTLINE_ACTION: - // all other actions: generate non-transparent output - bRet = true; - break; + // all other actions: generate non-transparent output + bRet = true; + break; default: - break; + break; } - return bRet; + return bRet; } // #i10613# Extracted from ImplCheckRect::ImplCreate static Rectangle ImplCalcActionBounds( const MetaAction& rAct, const OutputDevice& rOut ) { - Rectangle aActionBounds; + Rectangle aActionBounds; switch( rAct.GetType() ) { case META_PIXEL_ACTION: aActionBounds = Rectangle( static_cast<const MetaPixelAction&>(rAct).GetPoint(), Size( 1, 1 ) ); - break; + break; case META_POINT_ACTION: - aActionBounds = Rectangle( static_cast<const MetaPointAction&>(rAct).GetPoint(), Size( 1, 1 ) ); - break; + aActionBounds = Rectangle( static_cast<const MetaPointAction&>(rAct).GetPoint(), Size( 1, 1 ) ); + break; case META_LINE_ACTION: { const MetaLineAction& rMetaLineAction = static_cast<const MetaLineAction&>(rAct); - aActionBounds = Rectangle( rMetaLineAction.GetStartPoint(), rMetaLineAction.GetEndPoint() ); - aActionBounds.Justify(); + aActionBounds = Rectangle( rMetaLineAction.GetStartPoint(), rMetaLineAction.GetEndPoint() ); + aActionBounds.Justify(); const long nLineWidth(rMetaLineAction.GetLineInfo().GetWidth()); if(nLineWidth) { @@ -416,12 +414,12 @@ static Rectangle ImplCalcActionBounds( const MetaAction& rAct, const OutputDevic aActionBounds.Right() += nHalfLineWidth; aActionBounds.Bottom() += nHalfLineWidth; } - break; + break; } case META_RECT_ACTION: - aActionBounds = static_cast<const MetaRectAction&>(rAct).GetRect(); - break; + aActionBounds = static_cast<const MetaRectAction&>(rAct).GetRect(); + break; case META_ROUNDRECT_ACTION: aActionBounds = Polygon( static_cast<const MetaRoundRectAction&>(rAct).GetRect(), @@ -430,7 +428,7 @@ static Rectangle ImplCalcActionBounds( const MetaAction& rAct, const OutputDevic break; case META_ELLIPSE_ACTION: - { + { const Rectangle& rRect = static_cast<const MetaEllipseAction&>(rAct).GetRect(); aActionBounds = Polygon( rRect.Center(), rRect.GetWidth() >> 1, @@ -733,10 +731,8 @@ bool OutputDevice::RemoveTransparenciesFromMetaFile( const GDIMetaFile& rInMtf, // algorithm was designed by AF. // - // - // STAGE 1: Detect background - // ========================== - // + // STAGE 1: Detect background + // ========================== // Receives uniform background content, and is _not_ merged // nor checked for intersection against other aCCList elements @@ -751,7 +747,7 @@ bool OutputDevice::RemoveTransparenciesFromMetaFile( const GDIMetaFile& rInMtf, int nLastBgAction, nActionNum; // weed out page-filling background objects (if they are - // uniformly coloured). Keeping them outside the other + // uniformly colored). Keeping them outside the other // connected components often prevents whole-page bitmap // generation. bool bStillBackground=true; // true until first non-bg action @@ -853,7 +849,7 @@ bool OutputDevice::RemoveTransparenciesFromMetaFile( const GDIMetaFile& rInMtf, pCurrAct=const_cast<GDIMetaFile&>(rInMtf).NextAction(); ++nActionNum; } - + // clean up aMapModeVDev sal_uInt32 nCount = aMapModeVDev.GetGCStackDepth(); while( nCount-- ) @@ -879,10 +875,8 @@ bool OutputDevice::RemoveTransparenciesFromMetaFile( const GDIMetaFile& rInMtf, ++nActionNum; } - // - // STAGE 2: Generate connected components list - // =========================================== - // + // STAGE 2: Generate connected components list + // =========================================== // iterate over all actions (start where background action // search left off) @@ -893,7 +887,7 @@ bool OutputDevice::RemoveTransparenciesFromMetaFile( const GDIMetaFile& rInMtf, // execute action to get correct MapModes etc. pCurrAct->Execute( &aMapModeVDev ); - // cache bounds of current action + // cache bounds of current action const Rectangle aBBCurrAct( ImplCalcActionBounds(*pCurrAct, aMapModeVDev) ); // accumulate collected bounds here, initialize with current action @@ -907,10 +901,8 @@ bool OutputDevice::RemoveTransparenciesFromMetaFile( const GDIMetaFile& rInMtf, bool bTreatSpecial( false ); ConnectedComponents aTotalComponents; - // - // STAGE 2.1: Search for intersecting cc entries - // ============================================= - // + // STAGE 2.1: Search for intersecting cc entries + // ============================================= // if aBBCurrAct is empty, it will intersect with no // aCCList member. Thus, we can save the check. @@ -1002,10 +994,8 @@ bool OutputDevice::RemoveTransparenciesFromMetaFile( const GDIMetaFile& rInMtf, while( bSomeComponentsChanged ); } - // - // STAGE 2.2: Determine special state for cc element - // ================================================= - // + // STAGE 2.2: Determine special state for cc element + // ================================================= // now test whether the whole connected component must be // treated specially (i.e. rendered as a bitmap): if the @@ -1058,7 +1048,7 @@ bool OutputDevice::RemoveTransparenciesFromMetaFile( const GDIMetaFile& rInMtf, } else { - // #107169# Fixes abnove now ensure that _no_ + // #107169# Fixes above now ensure that _no_ // object in the list is fully transparent. Thus, // if the component list is not empty above, we // must assume that we have to treat this @@ -1073,10 +1063,8 @@ bool OutputDevice::RemoveTransparenciesFromMetaFile( const GDIMetaFile& rInMtf, } - // - // STAGE 2.3: Add newly generated CC list element - // ============================================== - // + // STAGE 2.3: Add newly generated CC list element + // ============================================== // set new bounds and add action to list aTotalComponents.aBounds = aTotalBounds; @@ -1123,10 +1111,8 @@ bool OutputDevice::RemoveTransparenciesFromMetaFile( const GDIMetaFile& rInMtf, } } - // - // STAGE 3.1: Output background mtf actions (if there are any) - // =========================================================== - // + // STAGE 3.1: Output background mtf actions (if there are any) + // =========================================================== ComponentList::iterator aCurrAct( aBackgroundComponent.aComponentList.begin() ); const ComponentList::iterator aLastAct( aBackgroundComponent.aComponentList.end() ); @@ -1138,10 +1124,8 @@ bool OutputDevice::RemoveTransparenciesFromMetaFile( const GDIMetaFile& rInMtf, } - // - // STAGE 3.2: Generate banded bitmaps for special regions - // ==================================================== - // + // STAGE 3.2: Generate banded bitmaps for special regions + // ==================================================== Point aPageOffset; Size aTmpSize( GetOutputSizePixel() ); @@ -1314,11 +1298,9 @@ bool OutputDevice::RemoveTransparenciesFromMetaFile( const GDIMetaFile& rInMtf, nCount = aMapModeVDev.GetGCStackDepth(); while( nCount-- ) aMapModeVDev.Pop(); - - // - // STAGE 4: Copy actions to output metafile - // ======================================== - // + + // STAGE 4: Copy actions to output metafile + // ======================================== // iterate over all actions and duplicate the ones not in a // special aCCList member into rOutMtf @@ -1589,3 +1571,5 @@ void Printer::DrawGradientEx( OutputDevice* pOut, const PolyPolygon& rPolyPoly, else pOut->DrawGradient( rPolyPoly, rGradient ); } + +/* vim: set noet sw=4 ts=4: */