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
The following commit(s) were added to refs/heads/AOO42X by this push: new 5db5960c40 Fixed typos (unknown) and some other, removed whitespace 5db5960c40 is described below commit 5db5960c40cc44ae4d788bc20e4a27b6e250e12e Author: mseidel <msei...@apache.org> AuthorDate: Mon May 22 19:12:57 2023 +0200 Fixed typos (unknown) and some other, removed whitespace (cherry picked from commit 95e2fe77240256cfc0711c47019d8b74a6327be0) --- main/embeddedobj/test/Container1/EmbedContApp.java | 165 ++++++------ main/filter/source/msfilter/msdffimp.cxx | 132 +++++----- main/sal/qa/rtl/process/rtl_Process.cxx | 72 +++--- main/setup_native/scripts/admin.pl | 286 ++++++++++----------- main/solenv/bin/modules/installer/ziplist.pm | 244 +++++++++--------- 5 files changed, 452 insertions(+), 447 deletions(-) diff --git a/main/embeddedobj/test/Container1/EmbedContApp.java b/main/embeddedobj/test/Container1/EmbedContApp.java index 50a8b84707..f8be1a693e 100644 --- a/main/embeddedobj/test/Container1/EmbedContApp.java +++ b/main/embeddedobj/test/Container1/EmbedContApp.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,18 +7,20 @@ * 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. - * + * *************************************************************/ + + package embeddedobj.test; import java.awt.*; @@ -118,7 +120,7 @@ public class EmbedContApp extends Applet private Menu m_aFileMenu; private Menu m_aObjectMenu; private Toolkit m_aToolkit; - + private Image m_aImage; private Object m_oImageLock; @@ -157,19 +159,19 @@ public class EmbedContApp extends Applet private final byte CONVERT_LINK_TO_OBJECT = 10; private final byte ACTIVATE_INPLACE = 11; private final byte DEACTIVATE = 12; - + // Methods public EmbedContApp( Frame aFrame, XMultiServiceFactory xServiceFactory ) - { + { m_aFrame = aFrame; m_xServiceFactory = xServiceFactory; } - - public void init() + + public void init() { resize( 800, 600 ); - setBackground( Color.gray ); - + setBackground( Color.gray ); + m_aToolkit = Toolkit.getDefaultToolkit(); try { @@ -227,10 +229,10 @@ public class EmbedContApp extends Applet aItem = new SaveMenuItem(); m_aFileMenu.add( aItem ); - + aItem = new SaveAsMenuItem(); m_aFileMenu.add( aItem ); - + // Object menu m_aObjectMenu = new Menu( "Object", true ); aMenuBar.add( m_aObjectMenu ); @@ -264,7 +266,7 @@ public class EmbedContApp extends Applet m_aNativeView.resize( 800, 600 ); this.add( m_aNativeView ); - // Handle mouse clicks in our window. + // Handle mouse clicks in our window. // addMouseListener( this ); } @@ -335,13 +337,13 @@ public class EmbedContApp extends Applet { // for now nothing to do } - + // XInplaceClient public boolean canInplaceActivate() { return true; } - + public void onInplaceActivate() { // TODO @@ -352,13 +354,13 @@ public class EmbedContApp extends Applet if ( m_aBitmapPainter != null ) m_aBitmapPainter.stopPainting(); } - + public void onUIActivate() { // TODO // prepare for UI activate } - + public void onInplaceDeactivate() { // TODO @@ -369,7 +371,7 @@ public class EmbedContApp extends Applet if ( m_aBitmapPainter != null ) m_aBitmapPainter.startPainting(); } - + public void onUIDeactivate() { // TODO @@ -385,7 +387,7 @@ public class EmbedContApp extends Applet return null; } - + public XInplaceUIWindow getDocumentWindow() { // TODO @@ -395,7 +397,7 @@ public class EmbedContApp extends Applet return null; } - + public com.sun.star.awt.Rectangle getPosRect() { // provide position rectangle to the object @@ -435,14 +437,14 @@ public class EmbedContApp extends Applet return new com.sun.star.awt.Rectangle( 10, 10, 110, 110 ); } - + public void translateAccelerators( com.sun.star.awt.KeyEvent[] aKeys ) { // TODO // an accelerator table for object // ui activation related } - + public void scrollObj( com.sun.star.awt.Size aOffset ) { // TODO @@ -460,7 +462,7 @@ public class EmbedContApp extends Applet // such a position change make sense only when object is // either inplace or ui active if ( nState == EmbedStates.EMBED_INPLACE_ACTIVE - || nState == EmbedStates.EMBED_UI_ACTIVE ) + || nState == EmbedStates.EMBED_UI_ACTIVE ) { XInplaceObject xInplObj = (XInplaceObject)UnoRuntime.queryInterface( XInplaceObject.class, m_xEmbedObj ); if ( xInplObj != null ) @@ -482,7 +484,7 @@ public class EmbedContApp extends Applet else System.out.println( "Who asks to change visual area?!!" ); } - + // XJob public Object execute( NamedValue[] pValues ) { @@ -545,7 +547,7 @@ public class EmbedContApp extends Applet // load from specified file loadFileURI( aAction.m_sParam ); - + if ( m_xEmbedObj != null ) { try { @@ -556,7 +558,7 @@ public class EmbedContApp extends Applet System.out.println( "Exception in OpenFileMenuItem: " + ex ); } } - + generateNewImage(); repaint(); } @@ -565,7 +567,7 @@ public class EmbedContApp extends Applet if ( m_xStorage != null && m_xEmbedObj != null ) { // if has persistence store there - // if not it is and error, SaveAs had to be used + // if not it is and error, SaveAs had to be used if ( m_bOwnFile ) { @@ -573,10 +575,10 @@ public class EmbedContApp extends Applet { try { saveObject(); - + if ( m_bLinkObj ) storeLinkToStorage(); - + XTransactedObject xTransact = (XTransactedObject)UnoRuntime.queryInterface( XTransactedObject.class, m_xStorage ); if ( xTransact != null ) @@ -600,18 +602,18 @@ public class EmbedContApp extends Applet } else if ( aAction.m_nID == NEW_OBJECT ) { - // remove current object an init a new one + // remove current object and init a new one clearObjectAndStorage(); - + if ( aAction.m_sParam != null ) { m_xStorage = createTempStorage(); - + if ( m_xStorage != null ) m_xEmbedObj = createEmbedObject( aAction.m_sParam ); else System.out.println( "Can't create temporary storage!" ); - + if ( m_xEmbedObj != null ) { try { @@ -623,7 +625,7 @@ public class EmbedContApp extends Applet } } } - + generateNewImage(); repaint(); } @@ -634,10 +636,10 @@ public class EmbedContApp extends Applet // create object from specified file m_xStorage = createTempStorage(); - + if ( m_xStorage != null ) m_xEmbedObj = loadEmbedObject( aAction.m_sParam ); - + if ( m_xEmbedObj != null ) { try { @@ -658,10 +660,10 @@ public class EmbedContApp extends Applet clearObjectAndStorage(); m_xStorage = createTempStorage(); - + // create object from specified file m_xEmbedObj = createLinkObject( aAction.m_sParam ); - + if ( m_xEmbedObj != null ) { m_aLinkURI = aAction.m_sParam; @@ -675,7 +677,7 @@ public class EmbedContApp extends Applet System.out.println( "Exception in LinkObjectMenuItem:" + ex ); } } - + generateNewImage(); repaint(); } @@ -686,7 +688,7 @@ public class EmbedContApp extends Applet System.out.println( "The object is not a link!" ); continue; } - + if ( m_xEmbedObj != null ) { if ( m_xStorage != null ) @@ -696,7 +698,7 @@ public class EmbedContApp extends Applet m_xStorage ); if ( xNameAccess != null && xNameAccess.hasByName( "LinkName" ) ) m_xStorage.removeElement( "LinkName" ); - + XLinkageSupport xLinkage = (XLinkageSupport)UnoRuntime.queryInterface( XLinkageSupport.class, m_xEmbedObj ); if ( xLinkage != null ) @@ -762,11 +764,11 @@ public class EmbedContApp extends Applet } else { - System.out.println( "Unknoun action is requested: " + aAction.m_nID + "\n" ); + System.out.println( "Unknown action is requested: " + aAction.m_nID + "\n" ); } } } - + m_aActionsList.clear(); synchronized( m_oInHandlerLock ) @@ -795,7 +797,7 @@ public class EmbedContApp extends Applet } } } - + public void SaveAsOperation() { if ( m_xStorage != null && m_xEmbedObj != null ) @@ -839,12 +841,12 @@ public class EmbedContApp extends Applet super.destroy(); } - + public void update( Graphics g ) { paint( g ); } - + public void paint( Graphics g ) { super.paint( g ); @@ -880,7 +882,7 @@ public class EmbedContApp extends Applet aBitmapSize = m_xBitmap.getSize(); System.out.println( "The visual area is Width = " + aBitmapSize.Width + "; Height = " + aBitmapSize.Height ); - + com.sun.star.awt.Rectangle aRect = new com.sun.star.awt.Rectangle( 10, 10, @@ -904,7 +906,7 @@ public class EmbedContApp extends Applet m_xEmbedObj.changeState( EmbedStates.EMBED_RUNNING ); nState = EmbedStates.EMBED_RUNNING; } - + if ( nState == EmbedStates.EMBED_UI_ACTIVE || nState == EmbedStates.EMBED_INPLACE_ACTIVE || nState == EmbedStates.EMBED_ACTIVE || nState == EmbedStates.EMBED_RUNNING ) { @@ -973,12 +975,12 @@ public class EmbedContApp extends Applet actionRegister( ACTIVATE_OUTPLACE, null ); } } - + public void mousePressed( MouseEvent e ){}; public void mouseEntered( MouseEvent e ){}; public void mouseExited( MouseEvent e ){}; public void mouseReleased( MouseEvent e ){}; - + // classes class NewMenuItem extends MenuItem implements ActionListener // Menu New { @@ -987,7 +989,7 @@ public class EmbedContApp extends Applet super( "New", new MenuShortcut( KeyEvent.VK_A )); addActionListener( this ); } - + public void actionPerformed( ActionEvent e ) { actionRegister( NEW_DOCUMENT, null ); @@ -1001,7 +1003,7 @@ public class EmbedContApp extends Applet super( "SaveAs..." ); addActionListener( this ); } - + public void actionPerformed( ActionEvent e ) { // open SaveAs dialog and store @@ -1017,7 +1019,7 @@ public class EmbedContApp extends Applet super( "Open", new MenuShortcut( KeyEvent.VK_C )); addActionListener( this ); } - + public void actionPerformed( ActionEvent e ) { // open OpenFile dialog and load doc @@ -1044,7 +1046,7 @@ public class EmbedContApp extends Applet super( "Save", new MenuShortcut( KeyEvent.VK_D )); addActionListener( this ); } - + public void actionPerformed( ActionEvent e ) { // if has persistence store there @@ -1062,7 +1064,7 @@ public class EmbedContApp extends Applet return; } - + actionRegister( SAVE, null ); } else @@ -1082,7 +1084,7 @@ public class EmbedContApp extends Applet super( "Create", new MenuShortcut( KeyEvent.VK_N )); addActionListener( this ); } - + public void actionPerformed( ActionEvent e ) { Object[] possibleValues = { "com.sun.star.comp.Writer.TextDocument", @@ -1093,11 +1095,11 @@ public class EmbedContApp extends Applet "com.sun.star.comp.Draw.DrawingDocument", "com.sun.star.comp.Math.FormulaDocument", "BitmapImage" }; - + String selectedValue = (String)JOptionPane.showInputDialog( null, "DocumentType", "Select", - JOptionPane.INFORMATION_MESSAGE, null, - possibleValues, possibleValues[0] ); - + JOptionPane.INFORMATION_MESSAGE, null, + possibleValues, possibleValues[0] ); + actionRegister( NEW_OBJECT, selectedValue ); } } @@ -1109,7 +1111,7 @@ public class EmbedContApp extends Applet super( "Load from file", new MenuShortcut( KeyEvent.VK_L )); addActionListener( this ); } - + public void actionPerformed( ActionEvent e ) { // open OpenFile dialog and load doc @@ -1136,7 +1138,7 @@ public class EmbedContApp extends Applet super( "Create link", new MenuShortcut( KeyEvent.VK_M )); addActionListener( this ); } - + public void actionPerformed( ActionEvent e ) { // open OpenFile dialog and load doc @@ -1163,7 +1165,7 @@ public class EmbedContApp extends Applet super( "Convert link to embed", new MenuShortcut( KeyEvent.VK_M )); addActionListener( this ); } - + public void actionPerformed( ActionEvent e ) { actionRegister( CONVERT_LINK_TO_OBJECT, null ); @@ -1177,7 +1179,7 @@ public class EmbedContApp extends Applet super( "Activate outplace", new MenuShortcut( KeyEvent.VK_A )); addActionListener( this ); } - + public void actionPerformed( ActionEvent e ) { actionRegister( ACTIVATE_OUTPLACE, null ); @@ -1191,7 +1193,7 @@ public class EmbedContApp extends Applet super( "Activate inplace", new MenuShortcut( KeyEvent.VK_I )); addActionListener( this ); } - + public void actionPerformed( ActionEvent e ) { actionRegister( ACTIVATE_INPLACE, null ); @@ -1205,7 +1207,7 @@ public class EmbedContApp extends Applet super( "Deactivate", new MenuShortcut( KeyEvent.VK_D )); addActionListener( this ); } - + public void actionPerformed( ActionEvent e ) { actionRegister( DEACTIVATE, null ); @@ -1230,42 +1232,42 @@ public class EmbedContApp extends Applet int[] pTempClassID = { 0xB2, 0x1A, 0x0A, 0x7C, 0xE4, 0x03, 0x41, 0xFE, 0x95, 0x62, 0xBD, 0x13, 0xEA, 0x6F, 0x15, 0xA0 }; for ( int ind = 0; ind < 16; ind++ ) - pClassID[ind] = (byte)pTempClassID[ind]; + pClassID[ind] = (byte)pTempClassID[ind]; } else if ( aServiceName.equals( "com.sun.star.comp.Writer.WebDocument" ) ) { int[] pTempClassID = { 0xA8, 0xBB, 0xA6, 0x0C, 0x7C, 0x60, 0x45, 0x50, 0x91, 0xCE, 0x39, 0xC3, 0x90, 0x3F, 0xAC, 0x5E }; for ( int ind = 0; ind < 16; ind++ ) - pClassID[ind] = (byte)pTempClassID[ind]; + pClassID[ind] = (byte)pTempClassID[ind]; } else if ( aServiceName.equals( "com.sun.star.comp.Calc.SpreadsheetDocument" ) ) { int[] pTempClassID = { 0x47, 0xBB, 0xB4, 0xCB, 0xCE, 0x4C, 0x4E, 0x80, 0xA5, 0x91, 0x42, 0xD9, 0xAE, 0x74, 0x95, 0x0F }; for ( int ind = 0; ind < 16; ind++ ) - pClassID[ind] = (byte)pTempClassID[ind]; + pClassID[ind] = (byte)pTempClassID[ind]; } else if ( aServiceName.equals( "com.sun.star.comp.Draw.PresentationDocument" ) ) { int[] pTempClassID = { 0x91, 0x76, 0xE4, 0x8A, 0x63, 0x7A, 0x4D, 0x1F, 0x80, 0x3B, 0x99, 0xD9, 0xBF, 0xAC, 0x10, 0x47 }; for ( int ind = 0; ind < 16; ind++ ) - pClassID[ind] = (byte)pTempClassID[ind]; + pClassID[ind] = (byte)pTempClassID[ind]; } else if ( aServiceName.equals( "com.sun.star.comp.Draw.DrawingDocument" ) ) { int[] pTempClassID = { 0x4B, 0xAB, 0x89, 0x70, 0x8A, 0x3B, 0x45, 0xB3, 0x99, 0x1C, 0xCB, 0xEE, 0xAC, 0x6B, 0xD5, 0xE3 }; for ( int ind = 0; ind < 16; ind++ ) - pClassID[ind] = (byte)pTempClassID[ind]; + pClassID[ind] = (byte)pTempClassID[ind]; } else if ( aServiceName.equals( "com.sun.star.comp.Math.FormulaDocument" ) ) { int[] pTempClassID = { 0x07, 0x8B, 0x7A, 0xBA, 0x54, 0xFC, 0x45, 0x7F, 0x85, 0x51, 0x61, 0x47, 0xE7, 0x76, 0xA9, 0x97 }; for ( int ind = 0; ind < 16; ind++ ) - pClassID[ind] = (byte)pTempClassID[ind]; + pClassID[ind] = (byte)pTempClassID[ind]; } else if ( aServiceName.equals( "BitmapImage" ) ) { @@ -1445,7 +1447,7 @@ public class EmbedContApp extends Applet { JOptionPane.showMessageDialog( m_aFrame, e, "Exception in createTempStorage():", JOptionPane.ERROR_MESSAGE ); } - + return xTempStorage; } @@ -1500,7 +1502,7 @@ public class EmbedContApp extends Applet { JOptionPane.showMessageDialog( m_aFrame, e, "Exception in saveStorageToFileURI():", JOptionPane.ERROR_MESSAGE ); } - + } public void loadFileURI( String aFileURI ) @@ -1535,7 +1537,7 @@ public class EmbedContApp extends Applet if ( xNameAccess.hasByName( "LinkName" ) && xTargetStorage.isStreamElement( "LinkName" ) ) { /* - // OOo links will not be tested until they have correct persistence + // AOO links will not be tested until they have correct persistence XStream xLinkStream = xTargetStorage.openStreamElement( "LinkName", ElementModes.ELEMENT_READ ); if ( xLinkStream != null ) { @@ -1592,15 +1594,15 @@ public class EmbedContApp extends Applet if ( xLinkOutStream != null && xTruncate != null ) { xTruncate.truncate(); - + char[] aLinkChar = m_aLinkURI.toCharArray(); byte[] aLinkBytes = new byte[ aLinkChar.length ]; for ( int ind = 0; ind < aLinkChar.length; ind++ ) aLinkBytes[ind] = (byte)aLinkChar[ind]; - + xLinkOutStream.writeBytes( aLinkBytes ); xLinkOutStream.closeOutput(); - + XComponent xComponent = (XComponent) UnoRuntime.queryInterface( XComponent.class, xLinkStream ); if ( xComponent != null ) @@ -1625,7 +1627,7 @@ public class EmbedContApp extends Applet e, "Exception in storeLinkToStorage:", JOptionPane.ERROR_MESSAGE ); - + } } } @@ -1697,7 +1699,7 @@ public class EmbedContApp extends Applet // it is not really required for testing application clearObjectAndStorage(); - + if ( m_aBitmapPainter != null ) { m_aBitmapPainter.disconnectListener(); @@ -1705,4 +1707,3 @@ public class EmbedContApp extends Applet } } } - diff --git a/main/filter/source/msfilter/msdffimp.cxx b/main/filter/source/msfilter/msdffimp.cxx index 0468058029..1cc07e7762 100644 --- a/main/filter/source/msfilter/msdffimp.cxx +++ b/main/filter/source/msfilter/msdffimp.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. - * + * *************************************************************/ @@ -30,7 +30,7 @@ #include <limits.h> #include <vector> #include <osl/endian.h> -#include <tools/solar.h> // UINTXX +#include <tools/solar.h> // UINTXX #include <rtl/math.hxx> #include <sot/clsids.hxx> @@ -159,7 +159,7 @@ static sal_uInt32 nMSOleObjCntr = 0; void Impl_OlePres::Write( SvStream & rStm ) { WriteClipboardFormat( rStm, FORMAT_GDIMETAFILE ); - rStm << (sal_Int32)(nJobLen +4); // immer leeres TargetDevice + rStm << (sal_Int32)(nJobLen +4); // immer leeres TargetDevice if( nJobLen ) rStm.Write( pJob, nJobLen ); rStm << (sal_uInt32)nAspect; @@ -800,7 +800,7 @@ static basegfx::B2DPolygon GetLineArrow( const sal_Int32 nLineWidth, const MSO_L { basegfx::B2DPolygon aRetval; // 70 100mm = 2pt = 40 twip. In MS, line width less than 2pt has the same size arrow as 2pt - //If the unit is twip. Make all use this unit especailly the critical value 70/40. + //If the unit is twip. Make all use this unit especially the critical value 70/40. sal_Int32 nLineWidthCritical = bScaleArrow ? 40 : 70; double fLineWidth = nLineWidth < nLineWidthCritical ? nLineWidthCritical : nLineWidth;; double fLenghtMul, fWidthMul; @@ -1102,7 +1102,7 @@ struct ShadeColor Color aColor; double fDist; - ShadeColor( const Color& rC, double fR ) : aColor( rC ), fDist( fR ) {}; + ShadeColor( const Color& rC, double fR ) : aColor( rC ), fDist( fR ) {}; }; void GetShadeColors( const SvxMSDffManager& rManager, const DffPropertyReader& rProperties, SvStream& rIn, std::vector< ShadeColor >& rShadeColors ) @@ -1164,7 +1164,7 @@ void ApplyRectangularGradientAsBitmap( const SvxMSDffManager& rManager, SvStream { double fX = static_cast< double >( nX ) / aBitmapSizePixel.Width(); double fY = static_cast< double >( nY ) / aBitmapSizePixel.Height(); - + double fD, fDist; if ( fX < fFocusX ) { @@ -1202,7 +1202,7 @@ void ApplyRectangularGradientAsBitmap( const SvxMSDffManager& rManager, SvStream } if ( fD != 0.0 ) fDist /= fD; - + std::vector< ShadeColor >::const_iterator aIter( rShadeColors.begin() ); double fA = 0.0; Color aColorA = aIter->aColor; @@ -1227,7 +1227,7 @@ void ApplyRectangularGradientAsBitmap( const SvxMSDffManager& rManager, SvStream } } aIter++; - } + } double fRed = aColorA.GetRed(), fGreen = aColorA.GetGreen(), fBlue = aColorA.GetBlue(); double fD1 = fB - fA; if ( fD1 != 0.0 ) @@ -1260,7 +1260,7 @@ void ApplyRectangularGradientAsBitmap( const SvxMSDffManager& rManager, SvStream aQuantErrNextScan[ nX - 1 ].fBlue += 3.0 * fErr / 16.0; aQuantErrNextScan[ nX ].fBlue += 5.0 * fErr / 16.0; aQuantErrNextScan[ nX + 1 ].fBlue += 1.0 * fErr / 16.0; -*/ +*/ if ( nRed < 0 ) nRed = 0; if ( nRed > 255 ) @@ -1304,7 +1304,7 @@ void ApplyRectangularGradientAsBitmap( const SvxMSDffManager& rManager, SvStream if ( bRotateWithShape ) { aBitmap.Rotate( nFix16Angle / 10, rShadeColors[ 0 ].aColor ); - + sal_uLong nMirrorFlags = BMP_MIRROR_NONE; if ( rObjData.nSpFlags & SP_FFLIPV ) nMirrorFlags |= BMP_MIRROR_VERT; @@ -1373,7 +1373,7 @@ void DffPropertyReader::ApplyFillAttributes( SvStream& rIn, SfxItemSet& rSet, co double dBackTrans = 1.0; if (IsProperty(DFF_Prop_fillOpacity)) { - dTrans = GetPropertyValue(DFF_Prop_fillOpacity) / 65536.0; + dTrans = GetPropertyValue(DFF_Prop_fillOpacity) / 65536.0; if ( eXFill != XFILL_GRADIENT ) { dTrans = dTrans * 100; @@ -1408,10 +1408,10 @@ void DffPropertyReader::ApplyFillAttributes( SvStream& rIn, SfxItemSet& rSet, co if ( eMSO_FillType == mso_fillPattern ) { Color aCol1( COL_WHITE ), aCol2( COL_WHITE ); - + if ( IsProperty( DFF_Prop_fillColor ) ) aCol1 = rManager.MSO_CLR_ToColor( GetPropertyValue( DFF_Prop_fillColor ), DFF_Prop_fillColor ); - + if ( IsProperty( DFF_Prop_fillBackColor ) ) aCol2 = rManager.MSO_CLR_ToColor( GetPropertyValue( DFF_Prop_fillBackColor ), DFF_Prop_fillBackColor ); @@ -2335,7 +2335,7 @@ void DffPropertyReader::ApplyCustomShapeGeometryAttributes( SvStream& rIn, SfxIt case 0x0: { //It is msopathEscapeExtension which is transformed into LINETO. - //If issue happens, I think this part can be comment so that it will be taken as unknow command. + //If issue happens, I think this part can be comment so that it will be taken as unknown command. //When export, origin data will be export without any change. nCommand = EnhancedCustomShapeSegmentCommand::LINETO; if ( !nCnt ) @@ -2713,7 +2713,7 @@ void DffPropertyReader::ApplyAttributes( SvStream& rIn, SfxItemSet& rSet, DffObj // #124477# Found no reason not to set shadow, esp. since it is applied to evtl. existing text // and will lead to an error of in PPT someone used text and added the object shadow to the - // object carryintg that text. I found no cases where this leads to problems (the old bugtracker + // object carrying that text. I found no cases where this leads to problems (the old bugtracker // task #160376# from sj is unfortunately no longer available). Keeping the code for now // to allow easy fallback when this shows problems in the future if(bCheckShadow) @@ -2744,7 +2744,7 @@ void DffPropertyReader::ApplyAttributes( SvStream& rIn, SfxItemSet& rSet, DffObj break; // case mso_fillBackground : default: - nFillFlags &=~0x10; // no fillstyle used + nFillFlags &=~0x10; // no fillstyle used break; } } @@ -2896,8 +2896,8 @@ void DffPropertyReader::ImportGradientColor( SfxItemSet& aSet,MSO_FillType eMSO_ while ( nAngle < 0 ) nAngle += 3600; XGradientStyle eGrad = XGRAD_LINEAR; - - sal_Int32 nFocus = GetPropertyValue( DFF_Prop_fillFocus, 0 ); + + sal_Int32 nFocus = GetPropertyValue( DFF_Prop_fillFocus, 0 ); if ( !nFocus ) nChgColors ^= 1; else if ( nFocus < 0 )//If it is a negative focus, the color will be swapped @@ -2905,7 +2905,7 @@ void DffPropertyReader::ImportGradientColor( SfxItemSet& aSet,MSO_FillType eMSO_ nFocus = -nFocus; nChgColors ^= 1; } - + if( nFocus > 40 && nFocus < 60 ) { eGrad = XGRAD_AXIAL;//A axial gradient other than linear @@ -2915,7 +2915,7 @@ void DffPropertyReader::ImportGradientColor( SfxItemSet& aSet,MSO_FillType eMSO_ //Core function does no need them. They serves for rect gradient(CenterXY). sal_uInt16 nFocusX = (sal_uInt16)nFocus; sal_uInt16 nFocusY = (sal_uInt16)nFocus; - + switch( eMSO_FillType ) { case mso_fillShadeShape : @@ -2928,10 +2928,10 @@ void DffPropertyReader::ImportGradientColor( SfxItemSet& aSet,MSO_FillType eMSO_ case mso_fillShadeCenter : { eGrad = XGRAD_RECT; - //A MS fillTo prop specifies the relative position of the left boundary + //A MS fillTo prop specifies the relative position of the left boundary //of the center rectangle in a concentric shaded fill. Use 100 or 0 to keep fidelity nFocusX=(GetPropertyValue( DFF_Prop_fillToRight, 0 )==0x10000) ? 100 : 0; - nFocusY=(GetPropertyValue( DFF_Prop_fillToBottom,0 )==0x10000) ? 100 : 0; + nFocusY=(GetPropertyValue( DFF_Prop_fillToBottom,0 )==0x10000) ? 100 : 0; nChgColors ^= 1; } break; @@ -2939,7 +2939,7 @@ void DffPropertyReader::ImportGradientColor( SfxItemSet& aSet,MSO_FillType eMSO_ } Color aCol1( rManager.MSO_CLR_ToColor( GetPropertyValue( DFF_Prop_fillColor, COL_WHITE ), DFF_Prop_fillColor ) ); - Color aCol2( rManager.MSO_CLR_ToColor( GetPropertyValue( DFF_Prop_fillBackColor, COL_WHITE ), DFF_Prop_fillBackColor ) ); + Color aCol2( rManager.MSO_CLR_ToColor( GetPropertyValue( DFF_Prop_fillBackColor, COL_WHITE ), DFF_Prop_fillBackColor ) ); if ( nChgColors ) { //Swap start and end color @@ -2951,21 +2951,21 @@ void DffPropertyReader::ImportGradientColor( SfxItemSet& aSet,MSO_FillType eMSO_ dTrans = dBackTrans; dBackTrans = dTemp; } - + //Construct gradient item XGradient aGrad( aCol2, aCol1, eGrad, nAngle, nFocusX, nFocusY ); //Intensity has been merged into color. So here just set is as 100 aGrad.SetStartIntens( 100 ); aGrad.SetEndIntens( 100 ); aSet.Put( XFillGradientItem( String(), aGrad ) ); - //Construct tranparency item. This item can coodinate with both solid and gradient. + //Construct transparency item. This item can coordinate with both solid and gradient. if ( dTrans < 1.0 || dBackTrans < 1.0 ) { sal_uInt8 nStartCol = (sal_uInt8)( (1 - dTrans )* 255 ); sal_uInt8 nEndCol = (sal_uInt8)( ( 1- dBackTrans ) * 255 ); aCol1 = Color(nStartCol, nStartCol, nStartCol); aCol2 = Color(nEndCol, nEndCol, nEndCol); - + XGradient aGrad2( aCol2 , aCol1 , eGrad, nAngle, nFocusX, nFocusY ); aSet.Put( XFillFloatTransparenceItem( String(), aGrad2 ) ); } @@ -3360,13 +3360,13 @@ FASTBOOL SvxMSDffManager::SeekToRec( SvStream& rSt, sal_uInt16 nRecId, sal_uLong rSt >> aHd; // check potential error reading and if seeking to the end of record is possible at all. - // It is probably cheaper instead of doing the file seek operation + // It is probably cheaper instead of doing the file seek operation if ( rSt.GetError() || ( aHd.GetRecEndFilePos() > nMaxFilePos ) ) { bRet= sal_False; break; } - + if ( aHd.nRecType == nRecId ) { if ( nSkipCount ) @@ -3430,10 +3430,10 @@ FASTBOOL SvxMSDffManager::GetColorFromPalette( sal_uInt16 /* nNum */, Color& rCo // sj: the documentation is not complete, especially in ppt the normal rgb for text // color is written as 0xfeRRGGBB, this can't be explained by the documentation, nearly -// every bit in the upper code is set -> so there seems to be a special handling for +// every bit in the upper code is set -> so there seems to be a special handling for // ppt text colors, i decided not to fix this in MSO_CLR_ToColor because of possible -// side effects, instead MSO_TEXT_CLR_ToColor is called for PPT text colors, to map -// the color code to something that behaves like the other standard color codes used by +// side effects, instead MSO_TEXT_CLR_ToColor is called for PPT text colors, to map +// the color code to something that behaves like the other standard color codes used by // fill and line color Color SvxMSDffManager::MSO_TEXT_CLR_ToColor( sal_uInt32 nColorCode ) const { @@ -3457,11 +3457,11 @@ Color SvxMSDffManager::MSO_CLR_ToColor( sal_uInt32 nColorCode, sal_uInt16 nConte Color aColor( mnDefaultColor ); // Fuer Textfarben: Header ist 0xfeRRGGBB - if ( ( nColorCode & 0xfe000000 ) == 0xfe000000 ) // sj: it needs to be checked if 0xfe is used in + if ( ( nColorCode & 0xfe000000 ) == 0xfe000000 ) // sj: it needs to be checked if 0xfe is used in nColorCode &= 0x00ffffff; // other cases than ppt text -> if not this code can be removed sal_uInt8 nUpper = (sal_uInt8)( nColorCode >> 24 ); - + // sj: below change from 0x1b to 0x19 was done because of i84812 (0x02 -> rgb color), // now I have some problems to fix i104685 (there the color value is 0x02000000 whichs requires // a 0x2 scheme color to be displayed properly), the color docu seems to be incomplete @@ -3670,7 +3670,7 @@ Color SvxMSDffManager::MSO_CLR_ToColor( sal_uInt32 nColorCode, sal_uInt16 nConte } } else if ( ( nUpper & 4 ) && ( ( nColorCode & 0xfffff8 ) == 0 ) ) - { // case of nUpper == 4 powerpoint takes this as agrument for a colorschemecolor + { // case of nUpper == 4 powerpoint takes this as argument for a colorschemecolor GetColorFromPalette( nUpper, aColor ); } else // hart attributiert, eventuell mit Hinweis auf SYSTEMRGB @@ -3969,7 +3969,7 @@ SdrObject* SvxMSDffManager::ImportGraphic( SvStream& rSt, SfxItemSet& rSet, cons } if ( bGrfRead ) { - // the writer is doing it's own cropping, so this part affects only impress and calc + // the writer is doing its own cropping, so this part affects only Impress and Calc if ( GetSvxMSDffSettings() & SVXMSDFF_SETTINGS_CROP_BITMAPS ) lcl_ApplyCropping( *this, ( rObjData.nSpFlags & SP_FOLESHAPE ) == 0 ? &rSet : NULL, aGraf ); @@ -4312,10 +4312,10 @@ SdrObject* SvxMSDffManager::ImportShape( const DffRecordHeader& rHd, SvStream& r rSt >> nPID; if ( rSt.GetError() != 0 ) break; - rSt >> nUDData; + rSt >> nUDData; if ( rSt.GetError() != 0 ) break; - if ( nPID == 447 ) // + if ( nPID == 447 ) { mbRotateGranientFillWithAngle = nUDData & 0x20; break; @@ -4352,7 +4352,7 @@ SdrObject* SvxMSDffManager::ImportShape( const DffRecordHeader& rHd, SvStream& r aObjData.bOpt = maShapeRecords.SeekToContent( rSt, DFF_msofbtOPT, SEEK_FROM_CURRENT_AND_RESTART ); if ( aObjData.bOpt ) { - maShapeRecords.Current()->SeekToBegOfRecord( rSt ); + maShapeRecords.Current()->SeekToBegOfRecord( rSt ); #ifdef DBG_AUTOSHAPE ReadPropSet( rSt, pClientData, (sal_uInt32)aObjData.eShapeType ); #else @@ -4375,13 +4375,13 @@ SdrObject* SvxMSDffManager::ImportShape( const DffRecordHeader& rHd, SvStream& r aObjData.bChildAnchor = maShapeRecords.SeekToContent( rSt, DFF_msofbtChildAnchor, SEEK_FROM_CURRENT_AND_RESTART ); if ( aObjData.bChildAnchor ) { - sal_Int32 l, o, r, u; - rSt >> l >> o >> r >> u; - Scale( l ); - Scale( o ); - Scale( r ); - Scale( u ); - aObjData.aChildAnchor = Rectangle( l, o, r, u ); + sal_Int32 l, o, r, u; + rSt >> l >> o >> r >> u; + Scale( l ); + Scale( o ); + Scale( r ); + Scale( u ); + aObjData.aChildAnchor = Rectangle( l, o, r, u ); if ( !rGlobalChildRect.IsEmpty() && !rClientRect.IsEmpty() && rGlobalChildRect.GetWidth() && rGlobalChildRect.GetHeight() ) { double fl = l; @@ -4409,7 +4409,7 @@ SdrObject* SvxMSDffManager::ImportShape( const DffRecordHeader& rHd, SvStream& r aObjData.aBoundRect = Rectangle( Point(), Size( 1, 1 ) ); Rectangle aTextRect; - if ( !aObjData.aBoundRect.IsEmpty() ) + if ( !aObjData.aBoundRect.IsEmpty() ) { // Rotation auf BoundingBox anwenden, BEVOR ien Objekt generiert wurde if( mnFix16Angle ) { @@ -4548,7 +4548,7 @@ SdrObject* SvxMSDffManager::ImportShape( const DffRecordHeader& rHd, SvStream& r } if ( GetPropertyValue( DFF_Prop_gtextFStrikethrough, 0 ) & 0x1000 ) // SJ: Font Kerning On ? aSet.Put( SvxKerningItem( 1, EE_CHAR_KERNING ) ); - + // #119496# the resize autoshape to fit text attr of word art in MS PPT is always false aSet.Put( SdrTextAutoGrowHeightItem( sal_False ) ); aSet.Put( SdrTextAutoGrowWidthItem( sal_False ) ); @@ -4602,7 +4602,7 @@ SdrObject* SvxMSDffManager::ImportShape( const DffRecordHeader& rHd, SvStream& r // mso_sptArc special treating: // sj: since we actually can't render the arc because of its weird SnapRect settings, // we will create a new CustomShape, that can be saved/loaded without problems. - // We will change the shape type, so this code applys only if importing arcs from msoffice. + // We will change the shape type, so this code applies only if importing arcs from msoffice. if ( aObjData.eShapeType == mso_sptArc ) { const rtl::OUString sAdjustmentValues( RTL_CONSTASCII_USTRINGPARAM ( "AdjustmentValues" ) ); @@ -4638,7 +4638,7 @@ SdrObject* SvxMSDffManager::ImportShape( const DffRecordHeader& rHd, SvStream& r aPolyBoundRect = Rectangle( aXP.GetBoundRect() ); if ( nNumElemVert >= 3 ) { // arc first command is always wr -- clockwise arc - // the parameters are : (left,top),(right,bottom),start(x,y),end(x,y) + // the parameters are : (left,top),(right,bottom),start(x,y),end(x,y) aStartPt = aXP[2]; } } @@ -4965,7 +4965,7 @@ SdrObject* SvxMSDffManager::ImportShape( const DffRecordHeader& rHd, SvStream& r MSDFFReadZString( rSt, aAltText, GetPropertyValue( DFF_Prop_wzDescription ), sal_True ); pRet->SetDescription( aAltText ); } - + return pRet; } @@ -5008,7 +5008,7 @@ Rectangle SvxMSDffManager::GetGlobalChildAnchor( const DffRecordHeader& rHd, SvS Scale( t ); Scale( r ); Scale( b ); - if ( bIsClientRectRead ) + if ( bIsClientRectRead ) { Rectangle aChild( l, t, r, b ); aChildAnchor.Union( aChild ); @@ -6071,11 +6071,11 @@ void SvxMSDffManager::GetDrawingGroupContainerData( SvStream& rSt, sal_uLong nLe rSt >> nBLIPLen; // #125187# do not simply skip these four bytes, but read them. This value - // is zero when the BLIP is embedded to the FBSE directly following in the + // is zero when the BLIP is embedded to the FBSE directly following in the // stream, else 1. Use this as hint to be more reliable (see below) rSt >> nBLIPPos; - // #125476# Taking back this change - see issue. It probably was a wrong assumtion + // #125476# Taking back this change - see issue. It probably was a wrong assumption // if(0 == nBLIPPos) // { // bBLIPIsDirectlyEmbedded = true; @@ -6089,20 +6089,20 @@ void SvxMSDffManager::GetDrawingGroupContainerData( SvStream& rSt, sal_uLong nLe if( bOk ) { - // #125187# the original check to test if the BLIP is following embeded in the FBSE was + // #125187# the original check to test if the BLIP is following embedded in the FBSE was // was (!nBLIPPos && nBLIPLen < nLenFBSE), but there are ppt documents // where this is not sufficient (what means that for BLIPs in the picture // stream the same conditions can be true sometimes). I experimented with various // ppt files and detected that the four bytes before reading the nBLIPPos // contain a flag which describes that embedding more reliable, thus I will // use it here now in the form of the bBLIPIsDirectlyEmbedded variable (see above). - // This modification works with all ppt files I found which use directly embedded + // This modification works with all ppt files I found which use directly embedded // BLIPs and with the file which showed the error. More work may be needed when // exceptions to this more strict schema may show up, though. // // #125476# back to original - see task. Keeping the change in the code as hint // if this comes up again for someone who tries to fix it. This would show that - // indeed the information that the blip is embedded needs to be extracted somwhere + // indeed the information that the blip is embedded needs to be extracted somewhere // and would need to be re-evaluated. if(0 == nBLIPPos && nBLIPLen < nLenFBSE ) // #125476# && bBLIPIsDirectlyEmbedded) { @@ -7676,12 +7676,12 @@ SvxMSDffImportRec::SvxMSDffImportRec(const SvxMSDffImportRec& rCopy) SvxMSDffImportRec::~SvxMSDffImportRec() { - if (pClientAnchorBuffer) - delete[] pClientAnchorBuffer; - if (pClientDataBuffer) - delete[] pClientDataBuffer; - if (pWrapPolygon) - delete pWrapPolygon; + if (pClientAnchorBuffer) + delete[] pClientAnchorBuffer; + if (pClientDataBuffer) + delete[] pClientDataBuffer; + if (pWrapPolygon) + delete pWrapPolygon; } /* vi:set tabstop=4 shiftwidth=4 expandtab: */ @@ -7711,3 +7711,5 @@ SdrObject* SvxMSDffManager::getShapeForId( sal_Int32 nShapeId ) SvxMSDffShapeIdContainer::iterator aIter( maShapeIdContainer.find(nShapeId) ); return aIter != maShapeIdContainer.end() ? (*aIter).second : 0; } + +/* vim: set noet sw=4 ts=4: */ diff --git a/main/sal/qa/rtl/process/rtl_Process.cxx b/main/sal/qa/rtl/process/rtl_Process.cxx index f8e041770a..bae54831a3 100644 --- a/main/sal/qa/rtl/process/rtl_Process.cxx +++ b/main/sal/qa/rtl/process/rtl_Process.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. - * + * *************************************************************/ @@ -45,27 +45,27 @@ using namespace rtl; */ inline void printUString( const ::rtl::OUString & str, const sal_Char * msg = NULL ) { - if ( msg != NULL ) - { - printf("#%s #printUString_u# ", msg ); - } - rtl::OString aString; - aString = ::rtl::OUStringToOString( str, RTL_TEXTENCODING_ASCII_US ); - printf("%s\n", (char *)aString.getStr( ) ); + if ( msg != NULL ) + { + printf("#%s #printUString_u# ", msg ); + } + rtl::OString aString; + aString = ::rtl::OUStringToOString( str, RTL_TEXTENCODING_ASCII_US ); + printf("%s\n", (char *)aString.getStr( ) ); } // ----------------------------------------------------------------------------- inline ::rtl::OUString getModulePath( void ) { - ::rtl::OUString suDirPath; - ::osl::Module::getUrlFromAddress( - reinterpret_cast< oslGenericFunction >(getModulePath), suDirPath ); - - printUString(suDirPath, "modulePath:"); - suDirPath = suDirPath.copy( 0, suDirPath.lastIndexOf('/') ); - suDirPath = suDirPath.copy( 0, suDirPath.lastIndexOf('/') + 1); - suDirPath += rtl::OUString::createFromAscii("bin"); - return suDirPath; + ::rtl::OUString suDirPath; + ::osl::Module::getUrlFromAddress( + reinterpret_cast< oslGenericFunction >(getModulePath), suDirPath ); + + printUString(suDirPath, "modulePath:"); + suDirPath = suDirPath.copy( 0, suDirPath.lastIndexOf('/') ); + suDirPath = suDirPath.copy( 0, suDirPath.lastIndexOf('/') + 1); + suDirPath += rtl::OUString::createFromAscii("bin"); + return suDirPath; } // ----------------------------------------------------------------------------- @@ -75,14 +75,14 @@ namespace rtl_Process class getAppCommandArg : public ::testing::Test { public: - // initialise your test code values here. - void SetUp() - { - } - - void TearDown() - { - } + // initialize your test code values here. + void SetUp() + { + } + + void TearDown() + { + } }; // class getAppCommandArg TEST_F(getAppCommandArg, getAppCommandArg_001) @@ -125,13 +125,13 @@ TEST_F(getAppCommandArg, getAppCommandArg_001) ASSERT_TRUE(osl_error == osl_Process_E_None) << "osl_createProcess failed"; - //we could get return value only after the process terminated + // we could get return value only after the process terminated osl_joinProcess(hProcess); // ASSERT_TRUE(osl_Process_E_None == osl_error) // << "osl_joinProcess returned with failure"; oslProcessInfo* pInfo = new oslProcessInfo; - //please pay attention to initial the Size to sizeof(oslProcessInfo), or else - //you will get unknow error when call osl_getProcessInfo + // please pay attention to initial the Size to sizeof(oslProcessInfo), or else + // you will get unknown error when call osl_getProcessInfo pInfo->Size = sizeof(oslProcessInfo); osl_error = osl_getProcessInfo( hProcess, osl_Process_EXITCODE, pInfo ); ASSERT_TRUE(osl_Process_E_None == osl_error) @@ -189,7 +189,7 @@ void printUuidtoBuffer( sal_uInt8 *pNode, sal_Char * pBuffer ) class getGlobalProcessId : public ::testing::Test { public: - // initialise your test code values here. + // initialize your test code values here. void SetUp() { } @@ -199,7 +199,7 @@ public: } }; // class getGlobalProcessId -//gets a 16-byte fixed size identifier which is guaranteed not to change during the current process. +// gets a 16-byte fixed size identifier which is guaranteed not to change during the current process. TEST_F(getGlobalProcessId, getGlobalProcessId_001) { sal_uInt8 pTargetUUID1[16]; @@ -210,7 +210,7 @@ TEST_F(getGlobalProcessId, getGlobalProcessId_001) << "getGlobalProcessId: got two same ProcessIds."; } -//different processes different pids +// different processes different pids TEST_F(getGlobalProcessId, getGlobalProcessId_002) { #if defined(WNT) || defined(OS2) @@ -247,7 +247,7 @@ TEST_F(getGlobalProcessId, getGlobalProcessId_002) ASSERT_TRUE(osl_error == osl_Process_E_None) << "osl_createProcess failed"; - //we could get return value only after the process terminated + // we could get return value only after the process terminated osl_joinProcess(hProcess); sal_Char pUUID2[33]; @@ -266,3 +266,5 @@ int main(int argc, char **argv) ::testing::InitGoogleTest(&argc, argv); return RUN_ALL_TESTS(); } + +/* vim: set noet sw=4 ts=4: */ diff --git a/main/setup_native/scripts/admin.pl b/main/setup_native/scripts/admin.pl index 5d7ecd673d..9fe0035352 100644 --- a/main/setup_native/scripts/admin.pl +++ b/main/setup_native/scripts/admin.pl @@ -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. -# +# #************************************************************** @@ -85,13 +85,13 @@ sub getparameter while ( $#ARGV >= 0 ) { my $param = shift(@ARGV); - + if ($param eq "-t") { $targetdir = shift(@ARGV); } elsif ($param eq "-d") { $databasepath = shift(@ARGV); } else { print "\n**********************************************\n"; - print "Error: Unknows parameter: $param"; + print "Error: Unknown parameter: $param"; print "\n**********************************************\n"; usage(); exit(-1); @@ -122,14 +122,14 @@ sub controlparameter usage(); exit(-1); } - + if ( -d $databasepath ) { $databasepath =~ s/\\\s*$//; $databasepath =~ s/\/\s*$//; - + my $msifiles = find_file_with_file_extension("msi", $databasepath); - + if ( $#{$msifiles} < 0 ) { exit_program("ERROR: Did not find msi database in directory $installationdir"); } if ( $#{$msifiles} > 0 ) { exit_program("ERROR: Did find more than one msi database in directory $installationdir"); } @@ -137,13 +137,13 @@ sub controlparameter } if ( ! -f $databasepath ) { exit_program("ERROR: Did not find msi database in directory $databasepath."); } - + if ( ! -d $targetdir ) { create_directories($targetdir); } } ############################################################################# # The program msidb.exe can be located next to the Perl program. Then it is -# not necessary to find it in the PATH variable. +# not necessary to find it in the PATH variable. ############################################################################# sub check_local_msidb @@ -151,7 +151,7 @@ sub check_local_msidb my $msidbname = "msidb.exe"; my $perlprogramm = $0; my $path = $perlprogramm; - + get_path_from_fullqualifiedname(\$path); $path =~ s/\\\s*$//; @@ -169,14 +169,14 @@ sub check_local_msidb } ############################################################################# -# Converting a string list with separator $listseparator +# Converting a string list with separator $listseparator # into an array ############################################################################# sub convert_stringlist_into_array { my ( $includestringref, $listseparator ) = @_; - + my @newarray = (); my $first; my $last = ${$includestringref}; @@ -184,14 +184,14 @@ sub convert_stringlist_into_array while ( $last =~ /^\s*(.+?)\Q$listseparator\E(.+)\s*$/) # "$" for minimal matching { $first = $1; - $last = $2; + $last = $2; # Problem with two directly following listseparators. For example a path with two ";;" directly behind each other $first =~ s/^$listseparator//; push(@newarray, "$first\n"); - } + } + + push(@newarray, "$last\n"); - push(@newarray, "$last\n"); - return \@newarray; } @@ -202,11 +202,11 @@ sub convert_stringlist_into_array sub check_system_path { - my $onefile; + my $onefile; my $error = 0; my $pathvariable = $ENV{'PATH'}; my $local_pathseparator = $pathseparator; - + if( $^O =~ /cygwin/i ) { # When using cygwin's perl the PATH variable is POSIX style and ... $pathvariable = qx{cygpath -mp "$pathvariable"} ; @@ -214,7 +214,7 @@ sub check_system_path $local_pathseparator = ';'; } my $patharrayref = convert_stringlist_into_array(\$pathvariable, $local_pathseparator); - + my @needed_files_in_path = ("expand.exe"); if ( $localmsidbpath eq "" ) { push(@needed_files_in_path, "msidb.exe"); } # not found locally -> search in path my @optional_files_in_path = ("msiinfo.exe"); @@ -235,7 +235,7 @@ sub check_system_path else { print( "\tFound: $$fileref\n" ); - } + } } if ( $error ) { exit_program("ERROR: Could not find all needed files in path (using setsolar should help)!"); } @@ -257,7 +257,7 @@ sub check_system_path { print( "\tFound: $$fileref\n" ); if ( $onefile eq "msiinfo.exe" ) { $msiinfo_available = 1; } - } + } } } @@ -272,7 +272,7 @@ sub get_sourcepath_from_filename_and_includepath my $onefile = ""; my $foundsourcefile = 0; - + for ( my $j = 0; $j <= $#{$includepatharrayref}; $j++ ) { my $includepath = ${$includepatharrayref}[$j]; @@ -289,7 +289,7 @@ sub get_sourcepath_from_filename_and_includepath } if (!($foundsourcefile)) { $onefile = ""; } - + return \$onefile; } @@ -307,7 +307,7 @@ sub remove_empty_dirs_in_folder } my @content = (); - + $dir =~ s/\Q$separator\E\s*$//; if ( -d $dir ) @@ -317,7 +317,7 @@ sub remove_empty_dirs_in_folder closedir(DIR); my $oneitem; - + foreach $oneitem (@content) { if ((!($oneitem eq ".")) && (!($oneitem eq ".."))) @@ -330,11 +330,11 @@ sub remove_empty_dirs_in_folder } } } - - # try to remove empty directory + + # try to remove empty directory my $returnvalue = rmdir $dir; - # if ( $returnvalue ) { print "Successfully removed empty dir $dir\n"; } + # if ( $returnvalue ) { print "Successfully removed empty dir $dir\n"; } } } @@ -345,15 +345,15 @@ sub remove_empty_dirs_in_folder sub get_extensions_dir { my ( $unopkgfile ) = @_; - + my $localbranddir = $unopkgfile; get_path_from_fullqualifiedname(\$localbranddir); # "program" dir in brand layer get_path_from_fullqualifiedname(\$localbranddir); # root dir in brand layer $localbranddir =~ s/\Q$separator\E\s*$//; my $extensiondir = $localbranddir . $separator . "share" . $separator . "extensions"; my $preregdir = $localbranddir . $separator . "share" . $separator . "prereg" . $separator . "bundled"; - - return ($extensiondir, $preregdir); + + return ($extensiondir, $preregdir); } ######################################################## @@ -364,7 +364,7 @@ sub get_extensions_dir sub find_file_with_file_extension { my ($extension, $dir) = @_; - + my @allfiles = (); my @sourcefiles = (); @@ -375,7 +375,7 @@ sub find_file_with_file_extension closedir(DIR); my $onefile; - + foreach $onefile (@sourcefiles) { if ((!($onefile eq ".")) && (!($onefile eq ".."))) @@ -386,7 +386,7 @@ sub find_file_with_file_extension } } } - + return \@allfiles; } @@ -404,7 +404,7 @@ sub create_directories get_path_from_fullqualifiedname(\$parentdir); create_directories($parentdir); # recursive } - + create_directory($directory); # now it has to succeed } @@ -426,7 +426,7 @@ sub create_directory sub try_to_create_directory { my ($directory) = @_; - + my $returnvalue = 1; my $created_directory = 0; @@ -437,9 +437,9 @@ sub try_to_create_directory if ($returnvalue) { $created_directory = 1; - - my $localcall = "chmod 775 $directory \>\/dev\/null 2\>\&1"; - system($localcall); + + my $localcall = "chmod 775 $directory \>\/dev\/null 2\>\&1"; + system($localcall); } else { @@ -463,7 +463,7 @@ sub get_path_from_fullqualifiedname my ($longfilenameref) = @_; if ( $$longfilenameref =~ /\Q$separator\E/ ) # Is there a separator in the path? Otherwise the path is empty. - { + { if ( $$longfilenameref =~ /^\s*(\S.*\Q$separator\E)(\S.+\S?)/ ) { $$longfilenameref = $1; @@ -472,7 +472,7 @@ sub get_path_from_fullqualifiedname else { $$longfilenameref = ""; # there is no path - } + } } ############################################################## @@ -482,7 +482,7 @@ sub get_path_from_fullqualifiedname sub make_absolute_filename_to_relative_filename { my ($longfilenameref) = @_; - + # Either '/' or '\'. if ( $$longfilenameref =~ /^.*[\/\\](\S.+\S?)/ ) { @@ -504,7 +504,7 @@ sub exit_program print "***************************************************************\n"; remove_complete_directory($savetemppath, 1); print "\n" . get_time_string(); - exit(-1); + exit(-1); } ################################################################################# @@ -514,12 +514,12 @@ sub exit_program sub unpack_cabinet_file { my ($cabfilename, $unpackdir) = @_; - + my $expandfile = "expand.exe"; # has to be in the PATH - + # expand.exe has to be located in the system directory. - # Cygwin has another tool expand.exe, that converts tabs to spaces. This cannot be used of course. - # But this wrong expand.exe is typically in the PATH before this expand.exe, to unpack + # Cygwin has another tool expand.exe, that converts tabs to spaces. This cannot be used of course. + # But this wrong expand.exe is typically in the PATH before this expand.exe, to unpack # cabinet files. if ( $^O =~ /cygwin/i ) @@ -528,7 +528,7 @@ sub unpack_cabinet_file $expandfile =~ s/\\/\//; if ( ! -f $expandfile ) { exit_program("ERROR: Did not find file $expandfile in the Windows system folder!"); } } - + my $expandlogfile = $unpackdir . $separator . "expand.log"; # exclude cabinet file @@ -570,7 +570,7 @@ sub extract_tables_from_database my $returnvalue = ""; if ( $^O =~ /cygwin/i ) { - chomp( $fullmsidatabasepath = qx{cygpath -w "$fullmsidatabasepath"} ); + chomp( $fullmsidatabasepath = qx{cygpath -w "$fullmsidatabasepath"} ); # msidb.exe really wants backslashes. (And double escaping because system() expands the string.) $fullmsidatabasepath =~ s/\\/\\\\/g; $workdir =~ s/\\/\\\\/g; @@ -580,7 +580,7 @@ sub extract_tables_from_database } # Export of all tables by using "*" - + $systemcall = $msidb . " -d " . $fullmsidatabasepath . " -f " . $workdir . " -e $tablelist"; print "\nAnalyzing msi database\n"; $returnvalue = system($systemcall); @@ -601,10 +601,10 @@ sub extract_tables_from_database sub check_for_internal_cabfiles { my ($cabfilehash) = @_; - + my $contains_internal_cabfiles = 0; my %allcabfileshash = (); - + foreach my $filename ( keys %{$cabfilehash} ) { if ( $filename =~ /^\s*\#/ ) # starting with a hash @@ -616,7 +616,7 @@ sub check_for_internal_cabfiles $allcabfileshash{$realfilename} = $filename; } } - + return ( $contains_internal_cabfiles, \%allcabfileshash ); } @@ -632,7 +632,7 @@ sub extract_cabs_from_database my $fullsuccess = 1; my $msidb = "msidb.exe"; # Has to be in the path if ( $localmsidbpath ) { $msidb = $localmsidbpath; } - + my @all_excluded_cabfiles = (); if( $^O =~ /cygwin/i ) @@ -650,10 +650,10 @@ sub extract_cabs_from_database foreach my $onefile ( keys %{$allcabfiles} ) { my $systemcall = $msidb . " -d " . $msidatabase . " -x " . $onefile; - system($systemcall); + system($systemcall); push(@all_excluded_cabfiles, $onefile); } - + \@all_excluded_cabfiles; } @@ -664,7 +664,7 @@ sub extract_cabs_from_database sub analyze_media_file { my ($filecontent) = @_; - + my %diskidhash = (); for ( my $i = 0; $i <= $#{$filecontent}; $i++ ) @@ -688,13 +688,13 @@ sub analyze_customaction_file my ($filecontent) = @_; my $register_extensions_exists = 0; - + my %table = (); for ( my $i = 0; $i <= $#{$filecontent}; $i++ ) { if ( ${$filecontent}[$i] =~ /^\s*RegisterExtensions\s+/ ) - { + { $register_extensions_exists = 1; last; } @@ -710,7 +710,7 @@ sub analyze_customaction_file sub analyze_directory_file { my ($filecontent) = @_; - + my %table = (); for ( my $i = 0; $i <= $#{$filecontent}; $i++ ) @@ -722,18 +722,18 @@ sub analyze_directory_file my $dir = $1; my $parent = $2; my $name = $3; - + if ( $name =~ /^\s*(.*?)\s*\:\s*(.*?)\s*$/ ) { $name = $2; } if ( $name =~ /^\s*(.*?)\s*\|\s*(.*?)\s*$/ ) { $name = $2; } - + my %helphash = (); $helphash{'Directory_Parent'} = $parent; $helphash{'DefaultDir'} = $name; $table{$dir} = \%helphash; } } - - return \%table; + + return \%table; } ################################################################################# @@ -743,9 +743,9 @@ sub analyze_directory_file sub analyze_component_file { my ($filecontent) = @_; - + my %table = (); - + for ( my $i = 0; $i <= $#{$filecontent}; $i++ ) { if (( $i == 0 ) || ( $i == 1 ) || ( $i == 2 )) { next; } @@ -754,12 +754,12 @@ sub analyze_component_file { my $component = $1; my $dir = $3; - + $table{$component} = $dir; } } - return \%table; + return \%table; } ################################################################################# @@ -769,11 +769,11 @@ sub analyze_component_file sub analyze_file_file { my ($filecontent) = @_; - + my %table = (); my %fileorder = (); my $maxsequence = 0; - + for ( my $i = 0; $i <= $#{$filecontent}; $i++ ) { if (( $i == 0 ) || ( $i == 1 ) || ( $i == 2 )) { next; } @@ -786,16 +786,16 @@ sub analyze_file_file my $sequence = $8; if ( $filename =~ /^\s*(.*?)\s*\|\s*(.*?)\s*$/ ) { $filename = $2; } - + my %helphash = (); $helphash{'Component'} = $comp; $helphash{'FileName'} = $filename; $helphash{'Sequence'} = $sequence; $table{$file} = \%helphash; - + $fileorder{$sequence} = $file; - + if ( $sequence > $maxsequence ) { $maxsequence = $sequence; } } } @@ -809,7 +809,7 @@ sub analyze_file_file sub create_directory_tree { - my ($parent, $pathcollector, $fulldir, $dirhash) = @_; + my ($parent, $pathcollector, $fulldir, $dirhash) = @_; foreach my $dir ( keys %{$dirhash} ) { @@ -836,11 +836,11 @@ sub create_directory_structure my ($dirhash, $targetdir) = @_; print "Creating directories\n"; - + my %fullpathhash = (); - + my @startparents = ("TARGETDIR", "INSTALLLOCATION"); - + foreach $dir (@startparents) { create_directory_tree($dir, \%fullpathhash, $targetdir, $dirhash); } # Also adding the paths of the startparents @@ -848,7 +848,7 @@ sub create_directory_structure { if ( ! exists($fullpathhash{$dir}) ) { $fullpathhash{$dir} = $targetdir; } } - + return \%fullpathhash; } @@ -859,7 +859,7 @@ sub create_directory_structure sub change_privileges { my ($destfile, $privileges) = @_; - + my $localcall = "chmod $privileges " . "\"" . $destfile . "\""; system($localcall); } @@ -885,7 +885,7 @@ sub change_privileges_full sub create_directory_with_privileges { my ($directory, $privileges) = @_; - + my $returnvalue = 1; my $infoline = ""; @@ -895,35 +895,35 @@ sub create_directory_with_privileges $returnvalue = mkdir($directory, $localprivileges); if ($returnvalue) - { - my $localcall = "chmod $privileges $directory \>\/dev\/null 2\>\&1"; - system($localcall); + { + my $localcall = "chmod $privileges $directory \>\/dev\/null 2\>\&1"; + system($localcall); } } else { - my $localcall = "chmod $privileges $directory \>\/dev\/null 2\>\&1"; - system($localcall); + my $localcall = "chmod $privileges $directory \>\/dev\/null 2\>\&1"; + system($localcall); } } ###################################################### -# Creating a unique directory with pid extension +# Creating a unique directory with pid extension ###################################################### sub create_pid_directory { my ($directory) = @_; - + $directory =~ s/\Q$separator\E\s*$//; my $pid = $$; # process id my $time = time(); # time - + $directory = $directory . "_" . $pid . $time; - if ( ! -d $directory ) { create_directory($directory); } + if ( ! -d $directory ) { create_directory($directory); } else { exit_program("ERROR: Directory $directory already exists!"); } - + return $directory; } @@ -938,7 +938,7 @@ sub copy_files_into_directory_structure print "Copying files\n"; my $unopkgfile = ""; - + for ( my $i = 1; $i <= $maxsequence; $i++ ) { if ( exists($fileorder->{$i}) ) @@ -955,24 +955,24 @@ sub copy_files_into_directory_structure $destfile = $destdir . $separator . $destfile; my $sourcefile = $unpackdir . $separator . $file; - + if ( ! -f $sourcefile ) { # It is possible, that this was an unpacked file # Looking in the dirhash, to find the subdirectory in the installation set (the id is $dirname) # subdir is not recursively analyzed, only one directory. - - my $oldsourcefile = $sourcefile; + + my $oldsourcefile = $sourcefile; my $subdir = ""; if ( exists($dirhash->{$dirname}->{'DefaultDir'}) ) { $subdir = $dirhash->{$dirname}->{'DefaultDir'} . $separator; } my $realfilename = $filehash->{$file}->{'FileName'}; my $localinstalldir = $installdir; - + $localinstalldir =~ s/\\\s*$//; $localinstalldir =~ s/\/\s*$//; - + $sourcefile = $localinstalldir . $separator . $subdir . $realfilename; - + if ( ! -f $sourcefile ) { exit_program("ERROR: File not found: \"$oldsourcefile\" (or \"$sourcefile\")."); } } @@ -989,7 +989,7 @@ sub copy_files_into_directory_structure # exit_program("ERROR: No file assigned to sequence $i"); # } } - + return ($unopkgfile); } @@ -1003,19 +1003,19 @@ sub remove_complete_directory my @content = (); my $infoline = ""; - + $directory =~ s/\Q$separator\E\s*$//; if ( -d $directory ) { if ( $start ) { print "Removing directory $directory\n"; } - + opendir(DIR, $directory); @content = readdir(DIR); closedir(DIR); my $oneitem; - + foreach $oneitem (@content) { if ((!($oneitem eq ".")) && (!($oneitem eq ".."))) @@ -1033,11 +1033,11 @@ sub remove_complete_directory } } } - + # try to remove empty directory my $returnvalue = rmdir $directory; if ( ! $returnvalue ) { print "Warning: Problem with removing empty dir $directory\n"; } - } + } } #################################################################################### @@ -1047,7 +1047,7 @@ sub remove_complete_directory sub get_temppath { my $temppath = ""; - + if (( $ENV{'TMP'} ) || ( $ENV{'TEMP'} )) { if ( $ENV{'TMP'} ) { $temppath = $ENV{'TMP'}; } @@ -1067,7 +1067,7 @@ sub get_temppath if ( $^O =~ /cygwin/i ) { $temppath =~ s/\\/\\\\/g; - chomp( $temppath = qx{cygpath -w "$temppath"} ); + chomp( $temppath = qx{cygpath -w "$temppath"} ); } $savetemppath = $temppath; @@ -1076,7 +1076,7 @@ sub get_temppath { exit_program("ERROR: Could not set temporary directory (TMP and TEMP not set!)."); } - + return $temppath; } @@ -1092,11 +1092,11 @@ sub register_extensions_sync { my $logtext = "ERROR: Failed to determine \"prereg\" folder for extension registration! Please check your installation set."; print $logtext . "\n"; - exit_program($logtext); + exit_program($logtext); } my $from = cwd(); - + my $path = $unopkgfile; get_path_from_fullqualifiedname(\$path); $path =~ s/\\\s*$//; @@ -1105,7 +1105,7 @@ sub register_extensions_sync my $executable = $unopkgfile; make_absolute_filename_to_relative_filename(\$executable); - chdir($path); + chdir($path); if ( ! $path_displayed ) { @@ -1122,7 +1122,7 @@ sub register_extensions_sync } $preregdir =~ s/\/\s*$//g; - + my $systemcall = $executable . " sync --verbose 2\>\&1 |"; print "... $systemcall\n"; @@ -1141,7 +1141,7 @@ sub register_extensions_sync for ( my $j = 0; $j <= $#unopkgoutput; $j++ ) { print "$unopkgoutput[$j]"; } exit_program("ERROR: $systemcall failed!"); } - + chdir($from); } @@ -1152,8 +1152,8 @@ sub register_extensions_sync sub register_extensions { my ($unopkgfile, $temppath, $preregdir) = @_; - - print "Registering extensions:\n"; + + print "Registering extensions:\n"; if (( ! -f $unopkgfile ) || ( $unopkgfile eq "" )) { @@ -1192,13 +1192,13 @@ sub read_file } ############################################################### -# Setting the time string for the -# Summary Information stream in the +# Setting the time string for the +# Summary Information stream in the # msi database of the admin installations. ############################################################### sub get_sis_time_string -{ +{ # Syntax: <yyyy/mm/dd hh:mm:ss> my $second = (localtime())[0]; my $minute = (localtime())[1]; @@ -1206,22 +1206,22 @@ sub get_sis_time_string my $day = (localtime())[3]; my $month = (localtime())[4]; my $year = 1900 + (localtime())[5]; - $month++; - + $month++; + if ( $second < 10 ) { $second = "0" . $second; } if ( $minute < 10 ) { $minute = "0" . $minute; } if ( $hour < 10 ) { $hour = "0" . $hour; } if ( $day < 10 ) { $day = "0" . $day; } if ( $month < 10 ) { $month = "0" . $month; } - + my $timestring = $year . "/" . $month . "/" . $day . " " . $hour . ":" . $minute . ":" . $second; - + return $timestring; } ############################################################### -# Writing content of administrative installations into -# Summary Information Stream of msi database. +# Writing content of administrative installations into +# Summary Information Stream of msi database. # This is required for example for following # patch processes using Windows Installer service. ############################################################### @@ -1231,7 +1231,7 @@ sub write_sis_info my ($msidatabase) = @_; print "Setting SIS in msi database\n"; - + if ( ! -f $msidatabase ) { exit_program("ERROR: Cannot find file $msidatabase"); } my $msiinfo = "msiinfo.exe"; # Has to be in the path @@ -1243,20 +1243,20 @@ sub write_sis_info # -w 4 (source files are unpacked), wordcount # -s <date of admin installation>, LastPrinted, Syntax: <yyyy/mm/dd hh:mm:ss> # -l <person_making_admin_installation>, LastSavedBy - + my $wordcount = 4; # Unpacked files my $lastprinted = get_sis_time_string(); my $lastsavedby = "Installer"; - + my $localmsidatabase = $msidatabase; - + if( $^O =~ /cygwin/i ) { $localmsidatabase = qx{cygpath -w "$localmsidatabase"}; $localmsidatabase =~ s/\\/\\\\/g; $localmsidatabase =~ s/\s*$//g; } - + $systemcall = $msiinfo . " " . "\"" . $localmsidatabase . "\"" . " -w " . $wordcount . " -s " . "\"" . $lastprinted . "\"" . " -l $lastsavedby"; $returnvalue = system($systemcall); @@ -1265,7 +1265,7 @@ sub write_sis_info { $infoline = "ERROR: Could not execute $systemcall !\n"; exit_program($infoline); - } + } } ############################################################### @@ -1277,11 +1277,11 @@ sub convert_timestring my ($secondstring) = @_; my $timestring = ""; - + if ( $secondstring < 60 ) # less than a minute { if ( $secondstring < 10 ) { $secondstring = "0" . $secondstring; } - $timestring = "00\:$secondstring min\."; + $timestring = "00\:$secondstring min\."; } elsif ( $secondstring < 3600 ) { @@ -1303,9 +1303,9 @@ sub convert_timestring if ( $hours < 10 ) { $hours = "0" . $hours; } if ( $minutes < 10 ) { $minutes = "0" . $minutes; } if ( $seconds < 10 ) { $seconds = "0" . $seconds; } - $timestring = "$hours\:$minutes\:$seconds hours"; + $timestring = "$hours\:$minutes\:$seconds hours"; } - + return $timestring; } @@ -1339,9 +1339,9 @@ print("Destination directory: $targetdir\n" ); my $helperdir = $temppath . $separator . "installhelper"; create_directory($helperdir); - + # Get File.idt, Component.idt and Directory.idt from database - + my $tablelist = "File Directory Component Media CustomAction"; extract_tables_from_database($databasepath, $helperdir, $tablelist); @@ -1355,7 +1355,7 @@ if ( ! -f $filename ) { exit_program("ERROR: Could not find required file: $file my $filecontent = read_file($filename); my $cabfilehash = analyze_media_file($filecontent); -# Check, if there are internal cab files +# Check, if there are internal cab files my ( $contains_internal_cabfiles, $all_internal_cab_files) = check_for_internal_cabfiles($cabfilehash); if ( $contains_internal_cabfiles ) @@ -1371,7 +1371,7 @@ if ( $contains_internal_cabfiles ) foreach my $cabfile ( @{$all_excluded_cabs} ) { unpack_cabinet_file($cabfile, $unpackdir); } chdir($from); } - + # Unpack all cab files into $helperdir, cab files must be located next to msi database my $installdir = $databasepath; @@ -1381,7 +1381,7 @@ my $databasefilename = $databasepath; make_absolute_filename_to_relative_filename(\$databasefilename); my $cabfiles = find_file_with_file_extension("cab", $installdir); - + if (( $#{$cabfiles} < 0 ) && ( ! $contains_internal_cabfiles )) { exit_program("ERROR: Did not find any cab file in directory $installdir"); } print "Unpacking files from cabinet file(s)\n"; @@ -1390,16 +1390,16 @@ for ( my $i = 0; $i <= $#{$cabfiles}; $i++ ) my $cabfile = $installdir . $separator . ${$cabfiles}[$i]; unpack_cabinet_file($cabfile, $unpackdir); } - + # Reading tables $filename = $helperdir . $separator . "Directory.idt"; $filecontent = read_file($filename); my $dirhash = analyze_directory_file($filecontent); - + $filename = $helperdir . $separator . "Component.idt"; $filecontent = read_file($filename); my $componenthash = analyze_component_file($filecontent); - + $filename = $helperdir . $separator . "File.idt"; $filecontent = read_file($filename); my ( $filehash, $fileorder, $maxsequence ) = analyze_file_file($filecontent); @@ -1410,7 +1410,7 @@ my $fullpathhash = create_directory_structure($dirhash, $targetdir); # Copying files my ($unopkgfile) = copy_files_into_directory_structure($fileorder, $filehash, $componenthash, $fullpathhash, $maxsequence, $unpackdir, $installdir, $dirhash); if ( $^O =~ /cygwin/i ) { change_privileges_full($targetdir); } - + my $msidatabase = $targetdir . $separator . $databasefilename; my $copyreturn = copy($databasepath, $msidatabase); if ( ! $copyreturn) { exit_program("ERROR: Could not copy $source to $dest\n"); } diff --git a/main/solenv/bin/modules/installer/ziplist.pm b/main/solenv/bin/modules/installer/ziplist.pm index 5c2a785a6f..1464c06cc4 100644 --- a/main/solenv/bin/modules/installer/ziplist.pm +++ b/main/solenv/bin/modules/installer/ziplist.pm @@ -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. -# +# #************************************************************** @@ -33,14 +33,14 @@ use installer::systemactions; use strict; =head2 read_openoffice_lst_file (#loggingdir) - Read the settings and variables from the settings file (typically 'openoffice.lst'). + Read the settings and variables from the settings file (typically 'openoffice.lst'). =cut sub read_openoffice_lst_file ($$;$) { - my ($filename, $product_name, $loggingdir) = @_; + my ($filename, $product_name, $loggingdir) = @_; - # Read all lines from the settings file. - my $ziplistref = installer::files::read_file($filename); + # Read all lines from the settings file. + my $ziplistref = installer::files::read_file($filename); # Extract the lines of the settings block for the current product. my ($productblockref, $parent) = installer::ziplist::getproductblock( @@ -51,7 +51,7 @@ sub read_openoffice_lst_file ($$;$) # Split into settings and variables. my $allsettingsarrayref = installer::ziplist::get_settings_from_ziplist($settingsblockref); my $allvariablesarrayref = installer::ziplist::get_variables_from_ziplist($settingsblockref); - + # global product block from zip.lst my ($globalproductblockref, undef) = installer::ziplist::getproductblock( $ziplistref, $installer::globals::globalblock, 0); @@ -109,7 +109,7 @@ sub read_openoffice_lst_file ($$;$) installer::files::save_file($loggingdir . "allglobalsettings1.log", $allglobalsettingsarrayref); installer::files::save_file($loggingdir . "allglobalvariables1.log", $allglobalvariablesarrayref); } - + if (scalar @$allglobalsettingsarrayref > 0) { $allsettingsarrayref = installer::converter::combine_arrays_from_references_first_win( @@ -134,15 +134,15 @@ sub read_openoffice_lst_file ($$;$) installer::ziplist::set_default_productversion_if_required($allvariableshashref); installer::ziplist::add_variables_to_allvariableshashref($allvariableshashref); installer::ziplist::overwrite_ooovendor($allvariableshashref); - + if ($installer::globals::globallogging && defined $loggingdir) { installer::files::save_file($loggingdir . "allsettings2.log" ,$allsettingsarrayref); installer::files::save_file($loggingdir . "allvariables2.log" ,$allvariablesarrayref); } - # Eventually we should fix this so that we don't have to return the raw arrays, only the resulting hashes. - return ($allvariableshashref, $allsettingsarrayref); + # Eventually we should fix this so that we don't have to return the raw arrays, only the resulting hashes. + return ($allvariableshashref, $allsettingsarrayref); } @@ -159,35 +159,35 @@ sub getproductblock my $record = 0; my $count = 0; my $line; - my $inh = $inheritance ? '(?::\s*(\S+)\s*)?' : ""; - my $parent; + my $inh = $inheritance ? '(?::\s*(\S+)\s*)?' : ""; + my $parent; for ( my $i = 0; $i <= $#{$fileref}; $i++ ) { $line = ${$fileref}[$i]; - - if ( $line =~ /^\s*\Q$search\E\s*$inh$/i ) # case insensitive + + if ( $line =~ /^\s*\Q$search\E\s*$inh$/i ) # case insensitive { $record = 1; $searchexists = 1; - $parent = $1 if $inheritance; + $parent = $1 if $inheritance; } if ($record) { push(@searchblock, $line); } - + if ( ($record) && ($line =~ /\{/) ) { $count++; - } - + } + if ( ($record) && ($line =~ /\}/) ) { $count--; - } - + } + if ( ($record) && ($line =~ /\}/) && ( $count == 0 ) ) { $record = 0; @@ -229,7 +229,7 @@ sub analyze_settings_block # Allowed values in settings block: # "Settings", "Variables", "unix" (for destination path and logfile) # Furthermore allowed values are $installer::globals::build (srx645) and $installer::globals::compiler (pro and nonpro (unxsols4.pro)) - + # Comment line in settings block begin with "#" or ";" if ( $installer::globals::pro ) @@ -245,17 +245,17 @@ sub analyze_settings_block { my $line = ${$blockref}[$i]; my $nextline = ""; - + if ( ${$blockref}[$i+1] ) { $nextline = ${$blockref}[$i+1]; } # removing comment lines - if (($line =~ /^\s*\#/) || ($line =~ /^\s*\;/)) + if (($line =~ /^\s*\#/) || ($line =~ /^\s*\;/)) { - next; + next; } - - # complete blocks of unknows strings are not recorded + + # complete blocks of unknown strings are not recorded if ((!($line =~ /^\s*\Q$compilerstring\E\s*$/i)) && (!($line =~ /^\s*\Q$installer::globals::build\E\s*$/i)) && @@ -272,14 +272,14 @@ sub analyze_settings_block { if ($line =~ /^\s*\{\s*$/i) { - $counter++; + $counter++; } if ($line =~ /^\s*\}\s*$/i) { - $counter--; + $counter--; } - + if ($counter == 0) { $record = 1; @@ -291,7 +291,7 @@ sub analyze_settings_block { push(@newsettingsblock, $line); } - } + } return \@newsettingsblock; } @@ -311,7 +311,7 @@ sub get_settings_from_ziplist # Take all settings from the settings block # Do not take the variables from the settings block - # If a setting is defined more than once, take the + # If a setting is defined more than once, take the # setting with the largest counter (open brackets) for ( my $i = 0; $i <= $#{$blockref}; $i++ ) @@ -321,8 +321,8 @@ sub get_settings_from_ziplist if ( ${$blockref}[$i+1] ) { $nextline = ${$blockref}[$i+1]; } - if (($line =~ /^\s*\S+\s*$/i) && - ($nextline =~ /^\s*\{\s*$/i) && + if (($line =~ /^\s*\S+\s*$/i) && + ($nextline =~ /^\s*\{\s*$/i) && (!($line =~ /^\s*Variables\s*$/i))) { next; @@ -331,7 +331,7 @@ sub get_settings_from_ziplist if ($line =~ /^\s*Variables\s*$/i) { # This is a block of variables - + $isvariables = 1; next; } @@ -345,7 +345,7 @@ sub get_settings_from_ziplist else { $counter++; - } + } next; } @@ -355,7 +355,7 @@ sub get_settings_from_ziplist if ($isvariables) { $variablescounter--; - + if ($variablescounter == 0) { $isvariables = 0; @@ -364,24 +364,24 @@ sub get_settings_from_ziplist else { $counter--; - } + } - next; + next; } - + if ($isvariables) { next; } installer::remover::remove_leading_and_ending_whitespaces(\$line); - + $line .= "\t##$counter##\n"; - + push(@allsettings, $line); } - return \@allsettings; + return \@allsettings; } ####################################### @@ -397,10 +397,10 @@ sub get_variables_from_ziplist my $counter = 0; my $variablescounter = 0; my $countersum = 0; - + # Take all variables from the settings block # Do not take the other settings from the settings block - # If a variable is defined more than once, take the + # If a variable is defined more than once, take the # variable with the largest counter (open brackets) for ( my $i = 0; $i <= $#{$blockref}; $i++ ) @@ -411,7 +411,7 @@ sub get_variables_from_ziplist if ($line =~ /^\s*Variables\s*$/i) { # This is a block of variables - + $isvariables = 1; next; } @@ -425,7 +425,7 @@ sub get_variables_from_ziplist else { $counter++; - } + } next; } @@ -435,7 +435,7 @@ sub get_variables_from_ziplist if ($isvariables) { $variablescounter--; - + if ($variablescounter == 0) { $isvariables = 0; @@ -444,11 +444,11 @@ sub get_variables_from_ziplist else { $counter--; - } + } - next; + next; } - + if (!($isvariables)) { next; @@ -457,13 +457,13 @@ sub get_variables_from_ziplist $countersum = $counter + $variablescounter; installer::remover::remove_leading_and_ending_whitespaces(\$line); - + $line .= "\t##$countersum##\n"; - + push(@allvariables, $line); } - return \@allvariables; + return \@allvariables; } ####################################################################### @@ -484,7 +484,7 @@ sub remove_multiples_from_ziplist my ($line, $itemname, $itemnumber); # first collecting all variables and settings names - + for ( my $i = 0; $i <= $#{$blockref}; $i++ ) { $line = ${$blockref}[$i]; @@ -493,13 +493,13 @@ sub remove_multiples_from_ziplist { $itemname = $1; } - + if (! installer::existence::exists_in_array($itemname, \@itemarray)) { push(@itemarray, $itemname); } } - + # and now all $items can be selected with the highest number for ( my $i = 0; $i <= $#itemarray; $i++ ) @@ -510,7 +510,7 @@ sub remove_multiples_from_ziplist my $printline = ""; for ( my $j = 0; $j <= $#{$blockref}; $j++ ) - { + { $line = ${$blockref}[$j]; if ($line =~ /^\s*\Q$itemname\E\s+.*\#\#(\d+)\#\#\s*$/) @@ -524,16 +524,16 @@ sub remove_multiples_from_ziplist } } } - + # removing the ending number from the printline # and putting it into the array - + $printline =~ s/\#\#\d+\#\#//; installer::remover::remove_leading_and_ending_whitespaces(\$line); - push(@newarray, $printline); + push(@newarray, $printline); } - return \@newarray; + return \@newarray; } ######################################################### @@ -550,14 +550,14 @@ sub getinfofromziplist for ( my $i = 0; $i <= $#{$blockref}; $i++ ) { $line = ${$blockref}[$i]; - + if ( $line =~ /^\s*\Q$variable\E\s+(.+?)\s*$/ ) # "?" for minimal matching { $searchstring = $1; last; - } + } } - + return \$searchstring; } @@ -568,7 +568,7 @@ sub getinfofromziplist sub replace_all_variables_in_pathes { my ( $patharrayref, $variableshashref ) = @_; - + for ( my $i = 0; $i <= $#{$patharrayref}; $i++ ) { my $line = ${$patharrayref}[$i]; @@ -578,12 +578,12 @@ sub replace_all_variables_in_pathes foreach $key (keys %{$variableshashref}) { my $value = $variableshashref->{$key}; - + if (( $line =~ /\{$key\}/ ) && ( $value eq "" )) { $line = ".\n"; } - - $line =~ s/\{\Q$key\E\}/$value/g; + + $line =~ s/\{\Q$key\E\}/$value/g; } - + ${$patharrayref}[$i] = $line; } } @@ -595,7 +595,7 @@ sub replace_all_variables_in_pathes sub replace_minor_in_pathes { my ( $patharrayref ) = @_; - + for ( my $i = 0; $i <= $#{$patharrayref}; $i++ ) { my $line = ${$patharrayref}[$i]; @@ -603,16 +603,16 @@ sub replace_minor_in_pathes if ( ! defined $ENV{CWS_WORK_STAMP} and defined $ENV{UPDMINOR} ) # if ( $installer::globals::minor ) { - $line =~ s/\{minor\}/$installer::globals::minor/g; + $line =~ s/\{minor\}/$installer::globals::minor/g; # no difference for minor and minornonpre (ToDo ?) $line =~ s/\{minornonpre\}/$installer::globals::minor/g; } else # building without a minor { - $line =~ s/\.\{minor\}//g; - $line =~ s/\.\{minornonpre\}//g; + $line =~ s/\.\{minor\}//g; + $line =~ s/\.\{minornonpre\}//g; } - + ${$patharrayref}[$i] = $line; } } @@ -624,16 +624,16 @@ sub replace_minor_in_pathes sub replace_packagetype_in_pathes { my ( $patharrayref ) = @_; - + for ( my $i = 0; $i <= $#{$patharrayref}; $i++ ) { my $line = ${$patharrayref}[$i]; if (( $installer::globals::installertypedir ) && ( $line =~ /\{pkgtype\}/ )) { - $line =~ s/\{pkgtype\}/$installer::globals::installertypedir/g; + $line =~ s/\{pkgtype\}/$installer::globals::installertypedir/g; } - + ${$patharrayref}[$i] = $line; } } @@ -645,16 +645,16 @@ sub replace_packagetype_in_pathes sub remove_ending_separator { my ( $patharrayref ) = @_; - + for ( my $i = 0; $i <= $#{$patharrayref}; $i++ ) { my $line = ${$patharrayref}[$i]; - + installer::remover::remove_ending_pathseparator(\$line); - + $line =~ s/\s*$//; $line = $line . "\n"; - + ${$patharrayref}[$i] = $line; } } @@ -668,10 +668,10 @@ sub replace_languages_in_pathes my ( $patharrayref, $languagesref ) = @_; installer::logger::include_header_into_logfile("Replacing languages in include paths:"); - + my @patharray = (); my $infoline = ""; - + for ( my $i = 0; $i <= $#{$patharrayref}; $i++ ) { my $line = ${$patharrayref}[$i]; @@ -680,7 +680,7 @@ sub replace_languages_in_pathes { my $originalline = $line; my $newline = ""; - + for ( my $j = 0; $j <= $#{$languagesref}; $j++ ) { my $language = ${$languagesref}[$j]; @@ -688,7 +688,7 @@ sub replace_languages_in_pathes push(@patharray ,$line); my $newdir = $line; $line = $originalline; - + installer::remover::remove_leading_and_ending_whitespaces(\$newline); # Is it necessary to refresh the global array, containing all files of all include paths? @@ -698,28 +698,28 @@ sub replace_languages_in_pathes if ( ! installer::systemactions::is_empty_dir($newdir) ) { $installer::globals::refresh_includepathes = 1; - $infoline = "Directory $newdir exists and is not empty. Refreshing global file array is required.\n"; + $infoline = "Directory $newdir exists and is not empty. Refreshing global file array is required.\n"; $installer::logger::Lang->print($infoline); } else { - $infoline = "Directory $newdir is empty. No refresh of global file array required.\n"; - $installer::logger::Lang->print($infoline); + $infoline = "Directory $newdir is empty. No refresh of global file array required.\n"; + $installer::logger::Lang->print($infoline); } } else { - $infoline = "Directory $newdir does not exist. No refresh of global file array required.\n"; - $installer::logger::Lang->print($infoline); + $infoline = "Directory $newdir does not exist. No refresh of global file array required.\n"; + $installer::logger::Lang->print($infoline); } - } - } + } + } else # not language dependent include path { push(@patharray ,$line); } } - + return \@patharray; } @@ -730,9 +730,9 @@ sub replace_languages_in_pathes sub list_all_files_from_include_path { my ( $patharrayref) = @_; - + installer::logger::include_header_into_logfile("Include paths:"); - + for ( my $i = 0; $i <= $#{$patharrayref}; $i++ ) { my $path = ${$patharrayref}[$i]; @@ -741,7 +741,7 @@ sub list_all_files_from_include_path $installer::logger::Lang->print($infoline); } - $installer::logger::Lang->print("\n"); + $installer::logger::Lang->print("\n"); } ##################################################### @@ -751,11 +751,11 @@ sub list_all_files_from_include_path sub set_manufacturer { my ($allvariables) = @_; - + my $openofficeproductname = "OpenOffice"; my $sunname = ""; - - + + if ( $allvariables->{'OPENSOURCE'} && $allvariables->{'OPENSOURCE'} == 1 ) { $installer::globals::isopensourceproduct = 1; @@ -770,7 +770,7 @@ sub set_manufacturer $installer::globals::manufacturer = $sunname; $installer::globals::longmanufacturer = $sunname; } - + $allvariables->{'MANUFACTURER'} = $installer::globals::manufacturer; } @@ -798,18 +798,18 @@ sub simplify_path my ( $pathref ) = @_; my $oldpath = $$pathref; - + my $change = 0; - + while ( $oldpath =~ /(^.*)(\Q$installer::globals::separator\E.*\w+?)(\Q$installer::globals::separator\E\.\.)(\Q$installer::globals::separator\E.*$)/ ) { my $part1 = $1; my $part2 = $4; - $oldpath = $part1 . $part2; + $oldpath = $part1 . $part2; $change = 1; } - - if ( $change ) { $$pathref = $oldpath . "\n"; } + + if ( $change ) { $$pathref = $oldpath . "\n"; } } #################################################### @@ -819,7 +819,7 @@ sub simplify_path sub resolve_relative_pathes { my ( $patharrayref ) = @_; - + for ( my $i = 0; $i <= $#{$patharrayref}; $i++ ) { installer::parameter::make_path_absolute(\${$patharrayref}[$i]); @@ -843,7 +843,7 @@ sub replace_variables_in_ziplist_variables my $localminor = $installer::globals::lastminor; if ( $installer::globals::minor ) { $localminor = $installer::globals::minor; } - + my $buildidstringcws = $installer::globals::build . $localminor . "(Build:" . $installer::globals::buildid . ")"; # the environment variable CWS_WORK_STAMP is set only in CWS @@ -869,8 +869,8 @@ sub replace_variables_in_ziplist_variables sub overwrite_ooovendor { - my ($variableshashref) = @_; - $variableshashref->{'OOOVENDOR'} = $ENV{'OOO_VENDOR'} , if( defined $ENV{'OOO_VENDOR'} && $ENV{'OOO_VENDOR'} ne "" ); + my ($variableshashref) = @_; + $variableshashref->{'OOOVENDOR'} = $ENV{'OOO_VENDOR'} , if( defined $ENV{'OOO_VENDOR'} && $ENV{'OOO_VENDOR'} ne "" ); } ########################################################### @@ -890,21 +890,21 @@ sub add_variables_to_allvariableshashref } else { - $variableshashref->{'LCPRODUCTEXTENSION'} = ""; + $variableshashref->{'LCPRODUCTEXTENSION'} = ""; } if ($installer::globals::patch) - { - $variableshashref->{'PRODUCTADDON'} = $installer::globals::patchaddon; - } + { + $variableshashref->{'PRODUCTADDON'} = $installer::globals::patchaddon; + } elsif ($installer::globals::languagepack) - { - $variableshashref->{'PRODUCTADDON'} = $installer::globals::languagepackaddon; - } + { + $variableshashref->{'PRODUCTADDON'} = $installer::globals::languagepackaddon; + } else - { - $variableshashref->{'PRODUCTADDON'} = ""; - } + { + $variableshashref->{'PRODUCTADDON'} = ""; + } my $localbuild = $installer::globals::build; if ( $localbuild =~ /^\s*(\w+?)(\d+)\s*$/ ) { $localbuild = $2; } # using "680" instead of "src680"