[Libreoffice-commits] core.git: sw/source

Philipp Weissenbacher p.weissenbacher at gmail.com
Sat Oct 18 01:16:35 PDT 2014


 sw/source/core/sw3io/sw3convert.cxx     |  174 +++++++++++++++-----------------
 sw/source/core/sw3io/swacorr.cxx        |   17 ++-
 sw/source/core/swg/SwXMLTextBlocks.cxx  |   12 +-
 sw/source/core/swg/SwXMLTextBlocks1.cxx |   12 --
 sw/source/core/swg/swblocks.cxx         |   45 ++++----
 sw/source/core/unocore/unochart.cxx     |  126 +++++++++++------------
 6 files changed, 197 insertions(+), 189 deletions(-)

New commits:
commit b6c32f3fd330d4297fc448a090d8c95bed11b02d
Author: Philipp Weissenbacher <p.weissenbacher at gmail.com>
Date:   Fri Oct 17 20:59:54 2014 +0200

    fdo#39468 Translate German comments - sw/source/core/{sw3io|swg|unocore}
    
    - Convert Deutsche Mark (DM) to Euro (EUR)
    - Fix some whitespace
    
    Change-Id: I94e0c9cbf5f5defca2e0d0f59f08592a914a381b
    Reviewed-on: https://gerrit.libreoffice.org/12011
    Reviewed-by: Noel Grandin <noelgrandin at gmail.com>
    Tested-by: Noel Grandin <noelgrandin at gmail.com>

diff --git a/sw/source/core/sw3io/sw3convert.cxx b/sw/source/core/sw3io/sw3convert.cxx
index 9056381..3ab1589 100644
--- a/sw/source/core/sw3io/sw3convert.cxx
+++ b/sw/source/core/sw3io/sw3convert.cxx
@@ -46,8 +46,8 @@
 #include "ndtxt.hxx"
 
 //really used ids from old sw3ids.hxx
-#define SWG_INETBROWSER 0x000e      // URL-Grf-Nodes, Browse-Flag, Format-Ums.
-#define SWG_NEWFIELDS   0x0200      // Felder mit Numberformatter-Zahlenformat
+#define SWG_INETBROWSER 0x000e      // URL graph nodes, browse flag, formatter
+#define SWG_NEWFIELDS   0x0200      // Fields with Numberformatter numberformat
 
 using namespace nsSwDocInfoSubType;
 
@@ -59,118 +59,114 @@ struct OldFormats
 
 static const OldFormats aOldDateFmt40[] =
 {
-    // Datumsfelder:
-    { NF_DATE_SYSTEM_SHORT,         DFF_SSYS },     // Kurzes Systemdatum
-    { NF_DATE_SYSTEM_LONG,          DFF_LSYS },     // Langes Systemdatum
-    { NF_DATE_SYS_DDMMYY,               DFF_DMY },        // 06.10.64
+    // Date fields
+    { NF_DATE_SYSTEM_SHORT,         DFF_SSYS },     // Short system date
+    { NF_DATE_SYSTEM_LONG,          DFF_LSYS },     // Long system date
+    { NF_DATE_SYS_DDMMYY,           DFF_DMY },      // 06.10.64
     { NF_DATE_SYS_DDMMYYYY,         DFF_DMYY },     // 06.10.1964
-    { NF_DATE_SYS_DMMMYY,               DFF_DMMY },     // 06. Okt 64
-    { NF_DATE_SYS_DMMMYYYY,         DFF_DMMYY },        // 06. Okt 1964
-    { NF_DATE_DIN_DMMMMYYYY,            DFF_DMMMYY },       // 06. Oktober 1964
-    { NF_DATE_DIN_DMMMMYYYY,            DFF_DMMMY },        // 06. Oktober 64
-    { NF_DATE_SYS_NNDMMMYY,         DFF_DDMMY },        // Di, 06. Okt 64
-    { NF_DATE_SYS_NNDMMMMYYYY,      DFF_DDMMMY },       // Di, 06. Oktober 64
-    { NF_DATE_SYS_NNDMMMMYYYY,      DFF_DDMMMYY },  // Di, 06. Oktober 1964
-    { NF_DATE_SYS_NNNNDMMMMYYYY,        DFF_DDDMMMYY }, // Dienstag, 06. Oktober 1964
-    { NF_DATE_SYS_NNNNDMMMMYYYY,        DFF_DDDMMMY },  // Dienstag, 06. Oktober 64
-    { NF_DATE_SYS_MMYY,             DFF_MY },           // 10.64
-    { NF_DATE_DIN_MMDD,             DFF_MD },           // 10-06
-    { NF_DATE_DIN_YYMMDD,               DFF_YMD },      // 64-10-06
+    { NF_DATE_SYS_DMMMYY,           DFF_DMMY },     // 06. Oct 64
+    { NF_DATE_SYS_DMMMYYYY,         DFF_DMMYY },    // 06. Oct 1964
+    { NF_DATE_DIN_DMMMMYYYY,        DFF_DMMMYY },   // 06. October 1964
+    { NF_DATE_DIN_DMMMMYYYY,        DFF_DMMMY },    // 06. October 64
+    { NF_DATE_SYS_NNDMMMYY,         DFF_DDMMY },    // Tue, 06. Oct 64
+    { NF_DATE_SYS_NNDMMMMYYYY,      DFF_DDMMMY },   // Tue, 06. October 64
+    { NF_DATE_SYS_NNDMMMMYYYY,      DFF_DDMMMYY },  // Tue, 06. October 1964
+    { NF_DATE_SYS_NNNNDMMMMYYYY,    DFF_DDDMMMYY }, // Tuesday, 06. October 1964
+    { NF_DATE_SYS_NNNNDMMMMYYYY,    DFF_DDDMMMY },  // Tuesday, 06. October 64
+    { NF_DATE_SYS_MMYY,             DFF_MY },       // 10.64
+    { NF_DATE_DIN_MMDD,             DFF_MD },       // 10-06
+    { NF_DATE_DIN_YYMMDD,           DFF_YMD },      // 64-10-06
     { NF_DATE_DIN_YYYYMMDD,         DFF_YYMD },     // 1964-10-06
 
-    { NF_NUMERIC_START,             0  }                // Tabellenende
+    { NF_NUMERIC_START,             0  }            // End of table
 };
 
 static const OldFormats aOldDateFmt30[] =
 {
-    // Datumsfelder:
-    { NF_DATE_SYSTEM_SHORT,         DFF_SSYS },     // Kurzes Systemdatum
-    { NF_DATE_SYSTEM_LONG,          DFF_LSYS },     // Langes Systemdatum
-    { NF_DATE_SYS_DDMMYY,               DFF_DMY },        // 06.10.64
+    // Date fields
+    { NF_DATE_SYSTEM_SHORT,         DFF_SSYS },     // Short system date
+    { NF_DATE_SYSTEM_LONG,          DFF_LSYS },     // Long system date
+    { NF_DATE_SYS_DDMMYY,           DFF_DMY },      // 06.10.64
     { NF_DATE_SYS_DDMMYYYY,         DFF_DMYY },     // 06.10.1964
-    { NF_DATE_SYS_DMMMYY,               DFF_DMMY },     // 06. Okt 64
-    { NF_DATE_SYS_DMMMYYYY,         4 /*DFF_DMMYY*/ },  // 06. Okt 1964
-    { NF_DATE_DIN_DMMMMYYYY,            5 /*DFF_DMMMYY*/ }, // 06. Oktober 1964
-    { NF_DATE_DIN_DMMMMYYYY,            5 /*DFF_DMMMY*/ },  // 06. Oktober 64
-    { NF_DATE_SYS_NNDMMMMYYYY,      6 /*DFF_DDMMMYY*/ },    // Di, 06. Oktober 1964
-    { NF_DATE_SYS_NNDMMMYY,         6 /*DFF_DDMMY*/ },  // Di, 06. Okt 64
-    { NF_DATE_SYS_NNDMMMMYYYY,      6 /*DFF_DDMMMY*/ }, // Di, 06. Oktober 64
-    { NF_DATE_SYS_NNNNDMMMMYYYY,        7 /*DFF_DDDMMMYY*/ },   // Dienstag, 06. Oktober 1964
-    { NF_DATE_SYS_NNNNDMMMMYYYY,        7 /*DFF_DDDMMMY*/ },    // Dienstag, 06. Oktober 64
+    { NF_DATE_SYS_DMMMYY,           DFF_DMMY },     // 06. Oct 64
+    { NF_DATE_SYS_DMMMYYYY,         4 /*DFF_DMMYY*/ },  // 06. Oct 1964
+    { NF_DATE_DIN_DMMMMYYYY,        5 /*DFF_DMMMYY*/ }, // 06. October 1964
+    { NF_DATE_DIN_DMMMMYYYY,        5 /*DFF_DMMMY*/ },  // 06. October 64
+    { NF_DATE_SYS_NNDMMMMYYYY,      6 /*DFF_DDMMMYY*/ },// Tue, 06. October 1964
+    { NF_DATE_SYS_NNDMMMYY,         6 /*DFF_DDMMY*/ },  // Tue, 06. Oct 64
+    { NF_DATE_SYS_NNDMMMMYYYY,      6 /*DFF_DDMMMY*/ }, // Tue, 06. October 64
+    { NF_DATE_SYS_NNNNDMMMMYYYY,    7 /*DFF_DDDMMMYY*/ }, // Tuesday, 06. October 1964
+    { NF_DATE_SYS_NNNNDMMMMYYYY,    7 /*DFF_DDDMMMY*/ },  // Tuesday, 06. October 64
     { NF_DATE_SYS_MMYY,             2 /*DFF_MY*/ },     // 10.64
     { NF_DATE_DIN_MMDD,             DFF_MD },           // 10-06
-    { NF_DATE_DIN_YYMMDD,               DFF_YMD },      // 64-10-06
+    { NF_DATE_DIN_YYMMDD,           DFF_YMD },      // 64-10-06
     { NF_DATE_DIN_YYYYMMDD,         DFF_YYMD },     // 1964-10-06
 
-    { NF_NUMERIC_START,             0  }                // Tabellenende
+    { NF_NUMERIC_START,             0  }            // End of table
 };
 
 static const OldFormats aOldTimeFmt[] =
 {
-    // Zeitfelder:
-    { NF_TIME_HHMMSS,                   TF_SYSTEM },        // Systemzeit
-    { NF_TIME_HHMM,                 TF_SSMM_24 },       // 23:25
-    { NF_TIME_HHMMAMPM,             TF_SSMM_12 },       // 11:25 PM
+    // Time fields
+    { NF_TIME_HHMMSS,               TF_SYSTEM },    // System time
+    { NF_TIME_HHMM,                 TF_SSMM_24 },   // 23:25
+    { NF_TIME_HHMMAMPM,             TF_SSMM_12 },   // 11:25 PM
 
-    { NF_NUMERIC_START,             0 }             // Tabellenende
+    { NF_NUMERIC_START,             0 }             // End of table
 };
 
 static const OldFormats aOldGetSetExpFmt40[] =
 {
-    { NF_TEXT,                      VVF_CMD },      // Kommando anzeigen
-    { NF_TEXT,                      VVF_INVISIBLE },    // unsichtbar
-    { NF_PERCENT_INT,                   VVF_XXP },      // 1234%
-    { NF_PERCENT_DEC2,              VVF_XX_XXP },       // 1.234,56%
-    { NF_TEXT,                      VVF_CLEAR },        // ???
+    { NF_TEXT,                      VVF_CMD },      // Show command
+    { NF_TEXT,                      VVF_INVISIBLE },// Invisible
+    { NF_PERCENT_INT,               VVF_XXP },      // 1234%
+    { NF_PERCENT_DEC2,              VVF_XX_XXP },   // 1.234,56%
+    { NF_TEXT,                      VVF_CLEAR },    // ???
 
-    { NF_NUMBER_SYSTEM,             VVF_SYS },      // Zahlenformat aus der
-                                                    // Systemeinstellung
-    { NF_NUMBER_INT,                    VVF_X },            // 1234
-    { NF_NUMBER_DEC2,                   VVF_X_X },          // 1234,5
-    { NF_NUMBER_DEC2,                   VVF_X_XX },     // 1245,56
-    { NF_NUMBER_1000DEC2,               VVF_XX_XX },    // 1.234,56
-    { NF_NUMBER_1000DEC2,               VVF_XX_X },     // 1.234,5
-    { NF_NUMBER_1000DEC2,               VVF_XX_XXX },       // 1.234,567
-    { NF_CURRENCY_1000DEC2,         VVF_SYS_CUR },  // W?hrungsformat aus der
-                                                    // Systemeinstellung
-                                                    // (1.234,00 DM)
-    { NF_CURRENCY_1000INT,          VVF_X_CUR },        // 1234 DM
-    { NF_CURRENCY_1000DEC2,         VVF_XX_XX_CUR },  // 1234,56 DM 1234,00 DM
-    { NF_CURRENCY_1000DEC2_DASHED,  VVF_XX_X0_CUR },  // 1234,56 DM 1234,-- DM
-    { NF_CURRENCY_1000INT,          VVF_CUR_X },    // DM 1234
-    { NF_CURRENCY_1000DEC2,         VVF_CUR_XX_XX },  // DM 1234,56 DM 1234,00
-    { NF_CURRENCY_1000DEC2_DASHED,  VVF_CUR_XX_X0 },  // DM 1234,56 DM 1234,--
+    { NF_NUMBER_SYSTEM,             VVF_SYS },      // Number format from system preferences
+    { NF_NUMBER_INT,                VVF_X },        // 1234
+    { NF_NUMBER_DEC2,               VVF_X_X },      // 1234,5
+    { NF_NUMBER_DEC2,               VVF_X_XX },     // 1245,56
+    { NF_NUMBER_1000DEC2,           VVF_XX_XX },    // 1.234,56
+    { NF_NUMBER_1000DEC2,           VVF_XX_X },     // 1.234,5
+    { NF_NUMBER_1000DEC2,           VVF_XX_XXX },   // 1.234,567
+    { NF_CURRENCY_1000DEC2,         VVF_SYS_CUR },  // Currency format from system settings
+                                                    // (1.234,00 EUR)
+    { NF_CURRENCY_1000INT,          VVF_X_CUR },    // 1234 EUR
+    { NF_CURRENCY_1000DEC2,         VVF_XX_XX_CUR },// 1234,56 EUR 1234,00 EUR
+    { NF_CURRENCY_1000DEC2_DASHED,  VVF_XX_X0_CUR },// 1234,56 EUR 1234,-- EUR
+    { NF_CURRENCY_1000INT,          VVF_CUR_X },    // EUR 1234
+    { NF_CURRENCY_1000DEC2,         VVF_CUR_XX_XX },// EUR 1234,56 EUR 1234,00
+    { NF_CURRENCY_1000DEC2_DASHED,  VVF_CUR_XX_X0 },// EUR 1234,56 EUR 1234,--
 
-    { NF_NUMERIC_START,                 0  }                // Tabellenende
+    { NF_NUMERIC_START,                 0  }        // End of table
 };
 
 static const OldFormats aOldGetSetExpFmt30[] =
 {
-    { NF_TEXT,                      VVF_CMD },      // Kommando anzeigen
-    { NF_TEXT,                      VVF_INVISIBLE },    // unsichtbar
-    { NF_PERCENT_INT,                   VVF_XXP },      // 1234%
-    { NF_PERCENT_DEC2,              VVF_XX_XXP },       // 1.234,56%
-    { NF_TEXT,                      VVF_CLEAR },        // ???
+    { NF_TEXT,                      VVF_CMD },      // Show command
+    { NF_TEXT,                      VVF_INVISIBLE },// Invisible
+    { NF_PERCENT_INT,                   VVF_XXP },  // 1234%
+    { NF_PERCENT_DEC2,              VVF_XX_XXP },   // 1.234,56%
+    { NF_TEXT,                      VVF_CLEAR },    // ???
 
-    { NF_NUMBER_SYSTEM,             0x0020 },       // Zahlenformat aus der
-                                                    // Systemeinstellung
-    { NF_NUMBER_INT,                    0x0080 },           // 1234
-    { NF_NUMBER_1000DEC2,               0x0100 },           // 1.234,56
-    { NF_NUMBER_DEC2,                   0x0100 },           // 1234,5
-    { NF_NUMBER_DEC2,                   0x0100 },       // 1245,56
-    { NF_NUMBER_1000DEC2,               0x0100 },           // 1.234,5
-    { NF_NUMBER_1000DEC2,               0x0100 },           // 1.234,567
-    { NF_CURRENCY_1000DEC2,         0x0200 },           // W?hrungsformat aus der
-                                                    // Systemeinstellung
-                                                    // (1.234,00 DM)
-    { NF_CURRENCY_1000INT,          0x1000 },           // 1234 DM
-    { NF_CURRENCY_1000DEC2,         0x1000 },       // 1234,56 DM 1234,00 DM
-    { NF_CURRENCY_1000DEC2_DASHED,  0x1000 },       // 1234,56 DM 1234,-- DM
-    { NF_CURRENCY_1000INT,          0x1000 },           // DM 1234
-    { NF_CURRENCY_1000DEC2,         0x1000 },       // DM 1234,56 DM 1234,00
-    { NF_CURRENCY_1000DEC2_DASHED,  0x1000 },       // DM 1234,56 DM 1234,--
+    { NF_NUMBER_SYSTEM,             0x0020 },       // Number format from system preferences
+    { NF_NUMBER_INT,                    0x0080 },   // 1234
+    { NF_NUMBER_1000DEC2,               0x0100 },   // 1.234,56
+    { NF_NUMBER_DEC2,                   0x0100 },   // 1234,5
+    { NF_NUMBER_DEC2,                   0x0100 },   // 1245,56
+    { NF_NUMBER_1000DEC2,               0x0100 },   // 1.234,5
+    { NF_NUMBER_1000DEC2,               0x0100 },   // 1.234,567
+    { NF_CURRENCY_1000DEC2,         0x0200 },       // Currency format from system settings
+                                                    // (1.234,00 EUR)
+    { NF_CURRENCY_1000INT,          0x1000 },       // 1234 EUR
+    { NF_CURRENCY_1000DEC2,         0x1000 },       // 1234,56 EUR 1234,00 EUR
+    { NF_CURRENCY_1000DEC2_DASHED,  0x1000 },       // 1234,56 EUR 1234,-- EUR
+    { NF_CURRENCY_1000INT,          0x1000 },       // EUR 1234
+    { NF_CURRENCY_1000DEC2,         0x1000 },       // EUR 1234,56 EUR 1234,00
+    { NF_CURRENCY_1000DEC2_DASHED,  0x1000 },       // EUR 1234,56 EUR 1234,--
 
-    { NF_NUMERIC_START,                 0  }                // Tabellenende
+    { NF_NUMERIC_START,                 0  }        // End of table
 };
 
 SW_DLLPUBLIC void sw3io_ConvertFromOldField( SwDoc& rDoc, sal_uInt16& rWhich,
@@ -233,10 +229,10 @@ SW_DLLPUBLIC void sw3io_ConvertFromOldField( SwDoc& rDoc, sal_uInt16& rWhich,
                 }
                 else
                 {
-                    // Kleiner Hack: Bei Numernkreisen wird das
-                    // unkonvertierte Format noch benoetigt. Wir merken es
-                    // uns voruebergehend mal im Subtyp, sofern es
-                    // ueberhaupt als entsprechendes Format in Frage kommt.
+                    // Small hack: We still need the unconverted format
+                    // when handling number groups. We keep it temporarily
+                    // in the subtype; if it's a valid format in the first
+                    // place.
                     if( RES_SETEXPFLD==rWhich &&
                         /*rFmt >= (sal_uInt16)SVX_NUM_CHARS_UPPER_LETTER && always true*/
                         rFmt <= (sal_uInt16)SVX_NUM_BITMAP )
diff --git a/sw/source/core/sw3io/swacorr.cxx b/sw/source/core/sw3io/swacorr.cxx
index be4d6d5..8472942 100644
--- a/sw/source/core/sw3io/swacorr.cxx
+++ b/sw/source/core/sw3io/swacorr.cxx
@@ -29,10 +29,14 @@ using namespace ::com::sun::star;
 
 TYPEINIT1( SwAutoCorrect, SvxAutoCorrect );
 
-    //  - return den Ersetzungstext (nur fuer SWG-Format, alle anderen
-    //      koennen aus der Wortliste herausgeholt werden!)
-    //      rShort ist der Stream-Name - gecryptet!
 
+/**
+ * Returns the replacement text
+ *
+ * Only for the SWG format, all others can be extracted from the word list
+ *
+ * @param rShort - the stream name (encrypted)
+ */
 bool SwAutoCorrect::GetLongText( const uno::Reference < embed::XStorage >& rStg,
                                  const OUString& rShort, OUString& rLong )
 {
@@ -51,6 +55,13 @@ bool SwAutoCorrect::GetLongText( const uno::Reference < embed::XStorage >& rStg,
 
     //  - Text mit Attributierung (kann nur der SWG - SWG-Format!)
     //      rShort ist der Stream-Name - gecryptet!
+/**
+ * Text with attributes
+ *
+ * Only for SWG format
+ *
+ * @param rShort - the stream name (encrypted)
+ */
 bool SwAutoCorrect::PutText( const uno::Reference < embed::XStorage >&  rStg,
                                  const OUString& rFileName, const OUString& rShort,
                                  SfxObjectShell& rObjSh, OUString& rLong )
diff --git a/sw/source/core/swg/SwXMLTextBlocks.cxx b/sw/source/core/swg/SwXMLTextBlocks.cxx
index 5205556..108c119 100644
--- a/sw/source/core/swg/SwXMLTextBlocks.cxx
+++ b/sw/source/core/swg/SwXMLTextBlocks.cxx
@@ -73,7 +73,8 @@ SwXMLTextBlocks::SwXMLTextBlocks( const OUString& rFile )
     pDoc->acquire();
     uno::Reference< embed::XStorage > refStg;
     if( !aDateModified.GetDate() || !aTimeModified.GetTime() )
-        Touch();        // falls neu angelegt -> neuen ZeitStempel besorgen
+        Touch(); // If it's created anew -> get a new timestamp
+
     try
     {
         refStg  = comphelper::OStorageHelper::GetStorageFromURL( rFile, embed::ElementModes::READWRITE );
@@ -81,7 +82,7 @@ SwXMLTextBlocks::SwXMLTextBlocks( const OUString& rFile )
     }
     catch(const uno::Exception&)
     {
-        //couldn't open the file - maybe it's readonly
+        //FIXME: couldn't open the file - maybe it's readonly
     }
     if( !refStg.is())
     {
@@ -269,7 +270,7 @@ sal_uLong SwXMLTextBlocks::CopyBlock( SwImpBlocks& rDestImp, OUString& rShort,
     while ( xAccess->hasByName( sDestShortName ) )
     {
         ++nIdx;
-        //falls wirklich mal einer so verrueckt ist
+        // If someone is that crazy ...
         if(USHRT_MAX == nIdx)
         {
             CloseFile();
@@ -324,7 +325,7 @@ sal_uLong SwXMLTextBlocks::StartPutBlock( const OUString& rShort, const OUString
 
 sal_uLong SwXMLTextBlocks::BeginPutDoc( const OUString& rShort, const OUString& rLong )
 {
-    // In der Basisklasse ablegen!
+    // Store in base class
     aShort = rShort;
     aLong = rLong;
     aPackageName = GeneratePackageName( rShort );
@@ -355,7 +356,6 @@ sal_uLong SwXMLTextBlocks::PutBlock( SwPaM& , const OUString& )
         // we have to write to the temporary storage first, since the used below functions are optimized
         // TODO/LATER: it is only a temporary solution, that should be changed soon, the used methods should be
         // called without optimization
-
         bool bOK = false;
 
         if ( xRoot.is() )
@@ -442,7 +442,7 @@ bool SwXMLTextBlocks::PutMuchEntries( bool bOn )
     {
         if( bInPutMuchBlocks )
         {
-            OSL_ENSURE( false, "verschachtelte Aufrufe sind nicht erlaubt" );
+            OSL_ENSURE( false, "Nested calls are not allowed");
         }
         else if( !IsFileChanged() )
         {
diff --git a/sw/source/core/swg/SwXMLTextBlocks1.cxx b/sw/source/core/swg/SwXMLTextBlocks1.cxx
index 1193b2a..b4c8ef9 100644
--- a/sw/source/core/swg/SwXMLTextBlocks1.cxx
+++ b/sw/source/core/swg/SwXMLTextBlocks1.cxx
@@ -62,8 +62,8 @@ sal_uLong SwXMLTextBlocks::GetDoc( sal_uInt16 nIdx )
             ReadXML->SetBlockMode( true );
             aReader.Read( *ReadXML );
             ReadXML->SetBlockMode( false );
-            // Ole objects fails to display when inserted into document
-            // because the ObjectReplacement folder ( and contents are missing )
+            // Ole objects fail to display when inserted into the document, as
+            // the ObjectReplacement folder and contents are missing
             OUString sObjReplacements( "ObjectReplacements" );
             if ( xRoot->hasByName( sObjReplacements ) )
             {
@@ -152,7 +152,6 @@ sal_uLong SwXMLTextBlocks::GetMacroTable( sal_uInt16 nIdx,
                                       bool bFileAlreadyOpen )
 {
     // set current auto text
-
     aShort = aNames[nIdx]->aShort;
     aLong = aNames[nIdx]->aLong;
     aPackageName = aNames[nIdx]->aPackageName;
@@ -218,8 +217,7 @@ sal_uLong SwXMLTextBlocks::GetMacroTable( sal_uInt16 nIdx,
                     xParser->setDocumentHandler( xFilter );
 
                     // connect model and filter
-                    uno::Reference<document::XImporter> xImporter( xFilter,
-                                                            UNO_QUERY );
+                    uno::Reference<document::XImporter> xImporter( xFilter, UNO_QUERY );
 
                     // we don't need a model
                     // xImporter->setTargetDocument( xModelComponent );
@@ -397,7 +395,7 @@ sal_uLong SwXMLTextBlocks::PutBlockText( const OUString& rShort, const OUString&
     else if( nErr != SVSTREAM_OK )
         nRes = ERR_SWG_WRITE_ERROR;
     */
-    if( !nRes )         // damit ueber GetText & nCur aufs Doc zugegriffen
+    if( !nRes ) // So that we can access the Doc via GetText & nCur
         MakeBlockText( rText );
 
     return nRes;
@@ -527,7 +525,7 @@ sal_uLong SwXMLTextBlocks::SetMacroTable(
     // open stream in proper sub-storage
     if( !bFileAlreadyOpen )
     {
-        CloseFile();    // close (it may be open in read-only-mode)
+        CloseFile(); // close (it may be open in read-only-mode)
         nRes = OpenFile ( false );
     }
 
diff --git a/sw/source/core/swg/swblocks.cxx b/sw/source/core/swg/swblocks.cxx
index 77427c5..0f2f83a 100644
--- a/sw/source/core/swg/swblocks.cxx
+++ b/sw/source/core/swg/swblocks.cxx
@@ -40,8 +40,9 @@
 #include <statstr.hrc>
 #include <swerror.h>
 
-// Hash-Code errechnen (muss nicht eindeutig sein)
-
+/**
+ * Calculate hash code (is not guaranteed to be unique)
+ */
 sal_uInt16 SwImpBlocks::Hash( const OUString& r )
 {
     sal_uInt16 n = 0;
@@ -70,8 +71,9 @@ SwBlockName::SwBlockName( const OUString& rShort, const OUString& rLong, const O
     nHashL = SwImpBlocks::Hash( rLong );
 }
 
-// Ist die angegebene Datei ein Storage oder gibt es sie nicht?
-
+/**
+ * Is the provided file a storage or doesn't it exist?
+ */
 short SwImpBlocks::GetFileType( const OUString& rFile )
 {
     if( !FStatHelper::IsDocument( rFile ) )
@@ -104,13 +106,17 @@ SwImpBlocks::~SwImpBlocks()
     aNames.DeleteAndDestroyAll();
 }
 
-// Loeschen des Inhaltes des Dokuments
+/**
+ * Delete the document's content
+ */
 void SwImpBlocks::ClearDoc()
 {
     pDoc->ClearDoc();
 }
 
-// Erzeugen eines PaMs, der das ganze Dokument umfasst
+/**
+ * Creating a PaM, that spans the whole document
+ */
 SwPaM* SwImpBlocks::MakePaM()
 {
     SwPaM* pPam = new SwPaM( pDoc->GetNodes().GetEndOfContent() );
@@ -126,7 +132,9 @@ sal_uInt16 SwImpBlocks::GetCount() const
     return aNames.size();
 }
 
-// Case Insensitive
+/**
+ * Case Insensitive
+ */
 sal_uInt16 SwImpBlocks::GetIndex( const OUString& rShort ) const
 {
     const OUString s( GetAppCharClass().uppercase( rShort ) );
@@ -194,16 +202,14 @@ bool SwImpBlocks::IsFileChanged() const
 {
     Date aTempDateModified( aDateModified );
     tools::Time aTempTimeModified( aTimeModified );
-    return FStatHelper::GetModifiedDateTimeOfFile( aFile,
-                            &aTempDateModified, &aTempTimeModified ) &&
+    return FStatHelper::GetModifiedDateTimeOfFile( aFile, &aTempDateModified, &aTempTimeModified ) &&
           ( aDateModified != aTempDateModified ||
             aTimeModified != aTempTimeModified );
 }
 
 void SwImpBlocks::Touch()
 {
-    FStatHelper::GetModifiedDateTimeOfFile( aFile,
-                                            &aDateModified, &aTimeModified );
+    FStatHelper::GetModifiedDateTimeOfFile( aFile, &aDateModified, &aTimeModified );
 }
 
 bool SwImpBlocks::IsOnlyTextBlock( const OUString& ) const
@@ -216,8 +222,7 @@ sal_uLong SwImpBlocks::GetMacroTable( sal_uInt16, SvxMacroTableDtor&, bool )
     return 0;
 }
 
-sal_uLong SwImpBlocks::SetMacroTable( sal_uInt16 ,
-                                const SvxMacroTableDtor& , bool )
+sal_uLong SwImpBlocks::SetMacroTable( sal_uInt16 , const SvxMacroTableDtor& , bool )
 {
     return 0;
 }
@@ -338,7 +343,7 @@ sal_uInt16 SwTextBlocks::Rename( sal_uInt16 n, const OUString* s, const OUString
             aLong = *l;
         if( aNew.isEmpty() )
         {
-            OSL_ENSURE( false, "Kein Kurzname in Rename angegeben" );
+            OSL_ENSURE( false, "No short name provided in the rename" );
             nErr = ERR_SWG_INTERNAL_ERROR; return (sal_uInt16) -1;
         }
 
@@ -346,7 +351,7 @@ sal_uInt16 SwTextBlocks::Rename( sal_uInt16 n, const OUString* s, const OUString
             nErr = ERR_TXTBLOCK_NEWFILE_ERROR;
         else if( 0 == ( nErr = pImp->OpenFile( false )))
         {
-            // Vorher den neuen Eintrag in die Liste setzen!
+            // Set the new entry in the list before we do that!
             aNew = GetAppCharClass().uppercase( aNew );
              nErr = pImp->Rename( n, aNew, aLong );
             if( !nErr )
@@ -389,11 +394,6 @@ bool SwTextBlocks::BeginGetDoc( sal_uInt16 n )
 {
     if( pImp && !pImp->bInPutMuchBlocks )
     {
-// diese Optimierierung darf es nicht mehr geben. OLE-Objecte muessen auf
-// ihre SubStorages zugreifem koennen!
-//      if( n == pImp->nCur )
-//          return sal_True;
-
         if( pImp->IsFileChanged() )
             nErr = ERR_TXTBLOCK_NEWFILE_ERROR;
         else if( 0 == ( nErr = pImp->OpenFile( true )))
@@ -566,7 +566,7 @@ bool SwTextBlocks::IsOnlyTextBlock( const OUString& rShort ) const
         return IsOnlyTextBlock( nIdx );
     }
 
-    OSL_ENSURE( false, "ungueltiger Name" );
+    OSL_ENSURE( false, "Invalid name" );
     return false;
 }
 
@@ -578,8 +578,7 @@ bool SwTextBlocks::GetMacroTable( sal_uInt16 nIdx, SvxMacroTableDtor& rMacroTbl
     return bRet;
 }
 
-bool SwTextBlocks::SetMacroTable( sal_uInt16 nIdx,
-                                const SvxMacroTableDtor& rMacroTbl )
+bool SwTextBlocks::SetMacroTable( sal_uInt16 nIdx, const SvxMacroTableDtor& rMacroTbl )
 {
     bool bRet = true;
     if ( pImp && !pImp->bInPutMuchBlocks )
diff --git a/sw/source/core/unocore/unochart.cxx b/sw/source/core/unocore/unochart.cxx
index d688d9f..2434798 100644
--- a/sw/source/core/unocore/unochart.cxx
+++ b/sw/source/core/unocore/unochart.cxx
@@ -186,9 +186,11 @@ static void LaunchModifiedEvent(
     }
 }
 
-// rCellRangeName needs to be of one of the following formats:
-// - e.g. "A2:E5" or
-// - e.g. "Table1.A2:E5"
+/**
+ * rCellRangeName needs to be of one of the following formats:
+ * - e.g. "A2:E5" or
+ *   - e.g. "Table1.A2:E5"
+ */
 bool FillRangeDescriptor(
         SwRangeDescriptor &rDesc,
         const OUString &rCellRangeName )
@@ -243,6 +245,7 @@ static OUString GetCellRangeName( SwFrmFmt &rTblFmt, SwUnoCrsr &rTblCrsr )
         }
         OSL_ENSURE( pStartBox, "start box not found" );
         OSL_ENSURE( pEndBox, "end box not found" );
+
         // need to switch start and end?
         if (*pUnoTblCrsr->GetPoint() < *pUnoTblCrsr->GetMark())
         {
@@ -365,8 +368,7 @@ static void GetFormatAndCreateCursorFromRangeRep(
         const SwDoc    *pDoc,
         const OUString &rRangeRepresentation,   // must be a single range (i.e. so called sub-range)
         SwFrmFmt    **ppTblFmt,     // will be set to the table format of the table used in the range representation
-        SwUnoCrsr   **ppUnoCrsr )   // will be set to cursor spanning the cell range
-                                    // (cursor will be created!)
+        SwUnoCrsr   **ppUnoCrsr )   // will be set to cursor spanning the cell range (cursor will be created!)
 {
     OUString aTblName;    // table name
     OUString aStartCell;  // name of top left cell
@@ -406,14 +408,16 @@ static void GetFormatAndCreateCursorFromRangeRep(
                             pTable ? pTable->GetTblBox( aStartCell, true ) : 0;
             if(pTLBox)
             {
-                // hier muessen die Actions aufgehoben werden
+                // The Actions need to be removed here
                 UnoActionRemoveContext aRemoveContext(pTblFmt->GetDoc());
                 const SwStartNode* pSttNd = pTLBox->GetSttNd();
                 SwPosition aPos(*pSttNd);
+
                 // set cursor to top left box of range
                 SwUnoCrsr* pUnoCrsr = pTblFmt->GetDoc()->CreateUnoCrsr(aPos, true);
                 pUnoCrsr->Move( fnMoveForward, fnGoNode );
                 pUnoCrsr->SetRemainInSection( false );
+
                 // #i80314#
                 // perform validation check. Thus, pass <true> as 2nd parameter to <SwTable::GetTblBox(..)>
                 const SwTableBox* pBRBox = pTable->GetTblBox( aEndCell, true );
@@ -562,8 +566,9 @@ uno::Reference< chart2::data::XDataSource > SwChartDataProvider::Impl_createData
     uno::Sequence< sal_Int32 > aSequenceMapping;
     bool bFirstIsLabel      = false;
     bool bDtaSrcIsColumns   = true; // true : DataSource will be sequence of columns
-                                            // false: DataSource will be sequence of rows
-    OUString aChartOleObjectName;//work around wrong writer ranges ( see Issue 58464 )
+                                    // false: DataSource will be sequence of rows
+
+    OUString aChartOleObjectName; //work around wrong writer ranges ( see Issue 58464 )
     sal_Int32 nArgs = rArguments.getLength();
     OSL_ENSURE( nArgs != 0, "no properties provided" );
     if (nArgs == 0)
@@ -640,11 +645,14 @@ uno::Reference< chart2::data::XDataSource > SwChartDataProvider::Impl_createData
             SwRangeDescriptor aDesc;
             if (aRangeRepresentation.isEmpty())
                 return xRes;        // we can't handle this thus returning an empty references
-            aRangeRepresentation = aRangeRepresentation.copy( 1 );    // get rid of '.' to have only the cell range left
+
+            aRangeRepresentation = aRangeRepresentation.copy( 1 ); // get rid of '.' to have only the cell range left
             FillRangeDescriptor( aDesc, aRangeRepresentation );
             aDesc.Normalize();
+
             if (aDesc.nTop <= 0)    // no chance to shift the range one row up?
                 return xRes;        // we can't handle this thus returning an empty references
+
             aDesc.nTop      -= 1;
             aDesc.nBottom   -= 1;
 
@@ -655,7 +663,7 @@ uno::Reference< chart2::data::XDataSource > SwChartDataProvider::Impl_createData
             bOk = GetSubranges( aRangeRepresentation, aSubRanges, true );
         }
     }
-    if (!bOk)    // different tables used, or incorrect range specifiers
+    if (!bOk) // different tables used, or incorrect range specifiers
         throw lang::IllegalArgumentException();
 
     SortSubranges( aSubRanges, bDtaSrcIsColumns );
@@ -677,6 +685,7 @@ uno::Reference< chart2::data::XDataSource > SwChartDataProvider::Impl_createData
     SwUnoCrsr   *pUnoCrsr = 0;      // here required to check if the cells in the range do actually exist
     if (aSubRanges.getLength() > 0)
         GetFormatAndCreateCursorFromRangeRep( pDoc, pSubRanges[0], &pTblFmt, &pUnoCrsr );
+
     boost::scoped_ptr< SwUnoCrsr > pAuto( pUnoCrsr );  // to end lifetime of object pointed to by pUnoCrsr
     if (!pTblFmt || !pUnoCrsr)
         throw lang::IllegalArgumentException();
@@ -902,8 +911,7 @@ uno::Reference< chart2::data::XDataSource > SwChartDataProvider::Impl_createData
                 if (pLabelUnoCrsr || pDataUnoCrsr)
                     ++nSeqsIdx;
             }
-            OSL_ENSURE( nSeqsIdx == nNumLDS,
-                    "mismatch between sequence size and num,ber of entries" );
+            OSL_ENSURE( nSeqsIdx == nNumLDS, "mismatch between sequence size and num,ber of entries" );
 
             // build data source from data and label sequences
             uno::Sequence< uno::Reference< chart2::data::XLabeledDataSequence > > aLDS( nNumLDS );
@@ -985,15 +993,15 @@ uno::Reference< chart2::data::XDataSource > SAL_CALL SwChartDataProvider::create
     return Impl_createDataSource( rArguments );
 }
 
-// SwChartDataProvider::GetBrokenCellRangeForExport
-
-// fix for #i79009
-// we need to return a property that has the same value as the property
-// 'CellRangeRepresentation' but for all rows which are increased by one.
-// E.g. Table1:A1:D5 -> Table1:A2:D6
-// Since the problem is only for old charts which did not support multiple
-// we do not need to provide that property/string if the 'CellRangeRepresentation'
-// contains multiple ranges.
+/**
+ * Fix for #i79009
+ * we need to return a property that has the same value as the property
+ * 'CellRangeRepresentation' but for all rows which are increased by one.
+ * E.g. Table1:A1:D5 -> Table1:A2:D6
+ * Since the problem is only for old charts which did not support multiple
+ * we do not need to provide that property/string if the 'CellRangeRepresentation'
+ * contains multiple ranges.
+ */
 OUString SwChartDataProvider::GetBrokenCellRangeForExport(
     const OUString &rCellRangeRepresentation )
 {
@@ -1627,26 +1635,27 @@ void SwChartDataProvider::DisposeAllDataSequences( const SwTable *pTable )
     }
 }
 
-// SwChartDataProvider::AddRowCols tries to notify charts of added columns
-// or rows and extends the value sequence respectively (if possible).
-// If those can be added to the end of existing value data-sequences those
-// sequences get mofdified accordingly and will send a modification
-// notification (calling 'setModified').
-
-// Since this function is a work-around for non existent Writer core functionality
-// (no arbitrary multi-selection in tables that can be used to define a
-// data-sequence) this function will be somewhat unreliable.
-// For example we will only try to adapt value sequences. For this we assume
-// that a sequence of length 1 is a label sequence and those with length >= 2
-// we presume to be value sequences. Also new cells can only be added in the
-// direction the value sequence is already pointing (rows / cols) and at the
-// start or end of the values data-sequence.
-// Nothing needs to be done if the new cells are in between the table cursors
-// point and mark since data-sequence are considered to consist of all cells
-// between those.
-// New rows/cols need to be added already to the table before calling
-// this function.
-
+/**
+ * SwChartDataProvider::AddRowCols tries to notify charts of added columns
+ * or rows and extends the value sequence respectively (if possible).
+ * If those can be added to the end of existing value data-sequences those
+ * sequences get mofdified accordingly and will send a modification
+ * notification (calling 'setModified
+ *
+ * Since this function is a work-around for non existent Writer core functionality
+ * (no arbitrary multi-selection in tables that can be used to define a
+ * data-sequence) this function will be somewhat unreliable.
+ * For example we will only try to adapt value sequences. For this we assume
+ * that a sequence of length 1 is a label sequence and those with length >= 2
+ * we presume to be value sequences. Also new cells can only be added in the
+ * direction the value sequence is already pointing (rows / cols) and at the
+ * start or end of the values data-sequence.
+ * Nothing needs to be done if the new cells are in between the table cursors
+ * point and mark since data-sequence are considered to consist of all cells
+ * between those.
+ * New rows/cols need to be added already to the table before calling
+ * this function.
+ */
 void SwChartDataProvider::AddRowCols(
         const SwTable &rTable,
         const SwSelBoxes& rBoxes,
@@ -1751,7 +1760,7 @@ OUString SAL_CALL SwChartDataProvider::convertRangeToXML( const OUString& rRange
     for (sal_Int32 i = 0;  i < nNumRanges;  ++i)
     {
         const OUString aRange( rRangeRepresentation.getToken(0, ';', nPos) );
-        SwFrmFmt    *pTblFmt  = 0;      // pointer to table format
+        SwFrmFmt    *pTblFmt  = 0; // pointer to table format
         GetFormatAndCreateCursorFromRangeRep( pDoc, aRange, &pTblFmt, NULL );
         if (!pTblFmt)
             throw lang::IllegalArgumentException();
@@ -2094,7 +2103,7 @@ uno::Sequence< OUString > SAL_CALL SwChartDataSequence::generateLabel(
             OSL_ENSURE( nColSpan == 1 || nRowSpan == 1,
                     "unexpected range of selected cells" );
 
-            OUString aTxt;    // label text to be returned
+            OUString aTxt; // label text to be returned
             bool bReturnEmptyTxt = false;
             bool bUseCol = true;
             if (eLabelOrigin == chart2::data::LabelOrigin_COLUMN)
@@ -2607,24 +2616,19 @@ void SwChartDataSequence::FillRangeDesc( SwRangeDescriptor &rRangeDesc ) const
 }
 
 /**
-SwChartDataSequence::ExtendTo
-
-extends the data-sequence by new cells added at the end of the direction
-the data-sequence points to.
-If the cells are already within the range of the sequence nothing needs
-to be done.
-If the cells are beyond the end of the sequence (are not adjacent to the
-current last cell) nothing can be done. Only if the cells are adjacent to
-the last cell they can be added.
-
- at returns     true if the data-sequence was changed.
- at param       bExtendCols
-             specifies if columns or rows are to be extended
- at param       nFirstNew
-             index of first new row/col to be included in data-sequence
- at param       nLastNew
-             index of last new row/col to be included in data-sequence
-*/
+ * Extends the data-sequence by new cells added at the end of the direction
+ * the data-sequence points to.
+ * If the cells are already within the range of the sequence nothing needs
+ * to be done.
+ * If the cells are beyond the end of the sequence (are not adjacent to the
+ * current last cell) nothing can be done. Only if the cells are adjacent to
+ * the last cell they can be added.
+ *
+ * @returns true if the data-sequence was changed.
+ * @param   bExtendCols - specifies if columns or rows are to be extended
+ * @param   nFirstNew - index of first new row/col to be included in data-sequence
+ * @param   nLastNew - index of last new row/col to be included in data-sequence
+ */
 bool SwChartDataSequence::ExtendTo( bool bExtendCol,
         sal_Int32 nFirstNew, sal_Int32 nCount )
 {


More information about the Libreoffice-commits mailing list