[Libreoffice-commits] core.git: include/svx svx/source

2015-02-28 Thread Chris Laplante
 include/svx/Palette.hxx|   19 
 svx/source/tbxctrls/Palette.cxx|  140 +
 svx/source/tbxctrls/PaletteManager.cxx |2 
 3 files changed, 161 insertions(+)

New commits:
commit 797c48f0f74501def9f47444538c0e110fcfcca1
Author: Chris Laplante 
Date:   Thu Feb 26 00:27:02 2015 -0500

tdf#84002 Add support for .ase color palettes

CMYK, RGB, and gray color models are supported. LAB colors
are replaced by just black since the conversion to RGB is
very complicated.

Change-Id: I689e6ce972cd7b7f03725f99be4761dea4a81743
Reviewed-on: https://gerrit.libreoffice.org/14661
Tested-by: Jenkins 
Reviewed-by: Tomaž Vajngerl 
Tested-by: Tomaž Vajngerl 

diff --git a/include/svx/Palette.hxx b/include/svx/Palette.hxx
index 32088a8..32e00f1 100644
--- a/include/svx/Palette.hxx
+++ b/include/svx/Palette.hxx
@@ -40,6 +40,25 @@ public:
 virtual boolIsValid() = 0;
 };
 
+class PaletteASE : public Palette
+{
+boolmbValidPalette;
+OUStringmaFName;
+OUStringmaFPath;
+OUStringmaName;
+ColorList   maColors;
+
+voidLoadPalette();
+public:
+PaletteASE( const OUString &rFPath, const OUString &rFName );
+virtual ~PaletteASE();
+
+virtual const OUString& GetName() SAL_OVERRIDE;
+virtual voidLoadColorSet( SvxColorValueSet& rColorSet ) 
SAL_OVERRIDE;
+
+virtual boolIsValid() SAL_OVERRIDE;
+};
+
 class PaletteGPL : public Palette
 {
 boolmbLoadedPalette;
diff --git a/svx/source/tbxctrls/Palette.cxx b/svx/source/tbxctrls/Palette.cxx
index e03bed2..e960fbd 100644
--- a/svx/source/tbxctrls/Palette.cxx
+++ b/svx/source/tbxctrls/Palette.cxx
@@ -24,6 +24,146 @@ Palette::~Palette()
 {
 }
 
+PaletteASE::~PaletteASE()
+{
+}
+
+PaletteASE::PaletteASE( const OUString &rFPath, const OUString &rFName ) :
+mbValidPalette( false ),
+maFName ( rFName ),
+maFPath ( rFPath ),
+maName  ( rFName )
+{
+LoadPalette();
+}
+
+void PaletteASE::LoadColorSet( SvxColorValueSet& rColorSet )
+{
+rColorSet.Clear();
+int nIx = 1;
+for (ColorList::const_iterator it = maColors.begin(); it != 
maColors.end(); ++it)
+{
+rColorSet.InsertItem(nIx, it->first, it->second);
+++nIx;
+}
+}
+
+const OUString& PaletteASE::GetName()
+{
+return maName;
+}
+
+bool PaletteASE::IsValid()
+{
+return mbValidPalette;
+}
+
+// CMYK values from 0 to 1
+// TODO: Deduplicate me (taken from core/cui/source/dialogs/colorpicker.cxx)
+static void lcl_CMYKtoRGB( float fCyan, float fMagenta, float fYellow, float 
fKey, float& dR, float& dG, float& dB )
+{
+fCyan = (fCyan * ( 1.0 - fKey )) + fKey;
+fMagenta = (fMagenta * ( 1.0 - fKey )) + fKey;
+fYellow = (fYellow * ( 1.0 - fKey )) + fKey;
+
+dR = std::max( std::min( ( 1.0 - fCyan ), 1.0), 0.0 );
+dG = std::max( std::min( ( 1.0 - fMagenta ), 1.0), 0.0 );
+dB = std::max( std::min( ( 1.0 - fYellow ), 1.0), 0.0 );
+}
+
+void PaletteASE::LoadPalette()
+{
+SvFileStream aFile(maFPath, StreamMode::READ);
+aFile.SetEndian(SvStreamEndian::BIG);
+
+// Verify magic first 4 characters
+sal_Char cMagic[5] = {0};
+if ((aFile.Read(cMagic, 4) != 4) || (strncmp(cMagic, "ASEF", 4) != 0))
+{
+mbValidPalette = false;
+return;
+}
+
+// Ignore the version number
+aFile.SeekRel(4);
+
+sal_uInt32 nBlocks = 0;
+aFile.ReadUInt32(nBlocks);
+for (sal_uInt32 nI = 0; nI < nBlocks; nI++) {
+sal_uInt32 nChunkType = 0;
+aFile.ReadUInt32(nChunkType);
+// End chunk
+if (nChunkType == 0)
+   break;
+
+// Grab chunk size, name length
+sal_uInt16 nChunkSize = 0;
+sal_uInt16 nChars = 0;
+aFile.ReadUInt16(nChunkSize);
+aFile.ReadUInt16(nChars);
+
+OUString aName("");
+if (nChars > 1)
+aName = read_uInt16s_ToOUString(aFile, nChars);
+else
+aFile.SeekRel(2);
+
+if (nChunkType == 0xC001)
+{
+// Got a start chunk, so set palette name
+maName = aName;
+// Is there color data? (shouldn't happen in a start block, but 
check anyway)
+if (nChunkSize > ((nChars * 2) + 2))
+aName = "";
+else
+continue;
+}
+
+sal_Char cColorModel[5] = {0};
+aFile.Read(cColorModel, 4);
+OString aColorModel(cColorModel);
+// r, g, and b are floats ranging from 0 to 1
+float r = 0, g = 0, b = 0;
+
+if (aColorModel.equalsIgnoreAsciiCase("cmyk"))
+{
+float c = 0, m = 0, y = 0, k = 0;
+aFile.ReadFloat(c);
+aFile.ReadFloat(m);
+aFile.ReadFloat(y);
+aFile.ReadFloat(k);
+  

[Libreoffice-commits] core.git: Changes to 'refs/changes/57/9357/2'

2014-09-29 Thread Chris Laplante

___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Changes to 'refs/changes/11/11011/1'

2014-09-29 Thread Chris Laplante

___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Changes to 'refs/changes/06/11006/2'

2014-09-29 Thread Chris Laplante

___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Changes to 'refs/changes/06/11006/1'

2014-09-29 Thread Chris Laplante

___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Changes to 'refs/changes/11/11011/2'

2014-09-29 Thread Chris Laplante

___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Changes to 'refs/changes/57/9357/1'

2014-09-29 Thread Chris Laplante

___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Changes to 'refs/changes/45/10945/1'

2014-09-29 Thread Chris Laplante

___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Changes to 'refs/changes/45/10945/2'

2014-09-29 Thread Chris Laplante

___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Changes to 'refs/changes/17/9117/2'

2014-09-29 Thread Chris Laplante

___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Changes to 'refs/changes/06/9006/2'

2014-09-29 Thread Chris Laplante

___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Changes to 'refs/changes/14/8914/2'

2014-09-29 Thread Chris Laplante

___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Changes to 'refs/changes/90/9090/1'

2014-09-29 Thread Chris Laplante

___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Changes to 'refs/changes/06/9006/1'

2014-09-29 Thread Chris Laplante

___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Changes to 'refs/changes/17/9117/3'

2014-09-29 Thread Chris Laplante

___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Changes to 'refs/changes/17/9117/1'

2014-09-29 Thread Chris Laplante

___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Changes to 'refs/changes/17/9117/4'

2014-09-29 Thread Chris Laplante

___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Changes to 'refs/changes/14/8914/3'

2014-09-29 Thread Chris Laplante

___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Changes to 'refs/changes/90/9090/2'

2014-09-29 Thread Chris Laplante

___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Changes to 'refs/changes/01/11001/1'

2014-09-29 Thread Chris Laplante

___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Changes to 'refs/changes/77/8877/1'

2014-09-29 Thread Chris Laplante

___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Changes to 'refs/changes/01/9101/1'

2014-09-29 Thread Chris Laplante

___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Changes to 'refs/changes/01/9101/3'

2014-09-29 Thread Chris Laplante

___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Changes to 'refs/changes/94/9494/1'

2014-09-29 Thread Chris Laplante

___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Changes to 'refs/changes/77/8877/2'

2014-09-29 Thread Chris Laplante

___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Changes to 'refs/changes/77/8877/3'

2014-09-29 Thread Chris Laplante

___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Changes to 'refs/changes/81/9381/1'

2014-09-29 Thread Chris Laplante

___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Changes to 'refs/changes/94/9494/2'

2014-09-29 Thread Chris Laplante

___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Changes to 'refs/changes/72/9472/2'

2014-09-29 Thread Chris Laplante

___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Changes to 'refs/changes/12/8912/1'

2014-09-29 Thread Chris Laplante

___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Changes to 'refs/changes/72/9472/1'

2014-09-29 Thread Chris Laplante

___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Changes to 'refs/changes/56/9356/1'

2014-09-29 Thread Chris Laplante

___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Changes to 'refs/changes/12/8912/4'

2014-09-29 Thread Chris Laplante

___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Changes to 'refs/changes/12/8912/2'

2014-09-29 Thread Chris Laplante

___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Changes to 'refs/changes/56/9356/4'

2014-09-29 Thread Chris Laplante

___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Changes to 'refs/changes/12/8912/3'

2014-09-29 Thread Chris Laplante

___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Changes to 'refs/changes/56/9356/2'

2014-09-29 Thread Chris Laplante

___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: odk/examples

2014-08-19 Thread Chris Laplante
 
odk/examples/DevelopersGuide/Components/Addons/ProtocolHandlerAddon_cpp/component.cxx
 |4 ---
 odk/examples/DevelopersGuide/Database/DriverSkeleton/SConnection.cxx   
   |4 +--
 odk/examples/DevelopersGuide/Database/DriverSkeleton/SDatabaseMetaData.hxx 
   |3 --
 odk/examples/DevelopersGuide/Database/DriverSkeleton/SDriver.cxx   
   |4 +--
 odk/examples/DevelopersGuide/Database/DriverSkeleton/SResultSetMetaData.hxx
   |2 -
 odk/examples/DevelopersGuide/Database/DriverSkeleton/SStatement.hxx
   |5 ---
 odk/examples/OLE/activex/SOComWindowPeer.h 
   |3 --
 odk/examples/cpp/DocumentLoader/DocumentLoader.cxx 
   |9 --
 odk/examples/cpp/complextoolbarcontrols/MyListener.h   
   |2 -
 odk/examples/cpp/counter/counter.cxx   
   |   13 +-
 odk/examples/cpp/counter/countermain.cxx   
   |9 --
 odk/examples/cpp/custompanel/ctp_factory.cxx   
   |4 ---
 odk/examples/cpp/custompanel/ctp_factory.hxx   
   |4 ---
 odk/examples/cpp/custompanel/ctp_panel.cxx 
   |7 -
 odk/examples/cpp/custompanel/ctp_panel.hxx 
   |7 -
 15 files changed, 10 insertions(+), 70 deletions(-)

New commits:
commit 341d9c4f089c4e8dee96c49a81abf24ab809f367
Author: Chris Laplante 
Date:   Mon Aug 18 16:15:41 2014 -0400

odk: Clean up comments

Change-Id: I38aa34192244cdd29e1cce7ac612aa9cd5f9e8a1
Reviewed-on: https://gerrit.libreoffice.org/11006
Reviewed-by: Noel Grandin 
Tested-by: Noel Grandin 

diff --git 
a/odk/examples/DevelopersGuide/Components/Addons/ProtocolHandlerAddon_cpp/component.cxx
 
b/odk/examples/DevelopersGuide/Components/Addons/ProtocolHandlerAddon_cpp/component.cxx
index 6233fb7..6a57f32 100644
--- 
a/odk/examples/DevelopersGuide/Components/Addons/ProtocolHandlerAddon_cpp/component.cxx
+++ 
b/odk/examples/DevelopersGuide/Components/Addons/ProtocolHandlerAddon_cpp/component.cxx
@@ -53,10 +53,6 @@ using namespace ::com::sun::star::uno;
 using namespace ::com::sun::star::lang;
 using namespace ::com::sun::star::registry;
 
-
-// EXPORTED 

-
-
 /**
  * This function is called to get service factories for an implementation.
  *
diff --git 
a/odk/examples/DevelopersGuide/Database/DriverSkeleton/SConnection.cxx 
b/odk/examples/DevelopersGuide/Database/DriverSkeleton/SConnection.cxx
index 7075197..0530fed 100644
--- a/odk/examples/DevelopersGuide/Database/DriverSkeleton/SConnection.cxx
+++ b/odk/examples/DevelopersGuide/Database/DriverSkeleton/SConnection.cxx
@@ -280,8 +280,8 @@ void SAL_CALL OConnection::setTransactionIsolation( 
sal_Int32 level ) throw(SQLE
 ::osl::MutexGuard aGuard( m_aMutex );
 checkDisposed(OConnection_BASE::rBHelper.bDisposed);
 
-// set your isolation level
-// please have a look at @see com.sun.star.sdbc.TransactionIsolation
+/// set your isolation level
+/// please have a look at @see com.sun.star.sdbc.TransactionIsolation
 }
 
 sal_Int32 SAL_CALL OConnection::getTransactionIsolation(  ) 
throw(SQLException, RuntimeException)
diff --git 
a/odk/examples/DevelopersGuide/Database/DriverSkeleton/SDatabaseMetaData.hxx 
b/odk/examples/DevelopersGuide/Database/DriverSkeleton/SDatabaseMetaData.hxx
index fe1449b..66e6d4b 100644
--- a/odk/examples/DevelopersGuide/Database/DriverSkeleton/SDatabaseMetaData.hxx
+++ b/odk/examples/DevelopersGuide/Database/DriverSkeleton/SDatabaseMetaData.hxx
@@ -45,9 +45,6 @@ namespace connectivity
 namespace skeleton
 {
 
-// Class: ODatabaseMetaData
-
-
 typedef ::cppu::WeakImplHelper1< 
::com::sun::star::sdbc::XDatabaseMetaData> ODatabaseMetaData_BASE;
 
 class ODatabaseMetaData : public ODatabaseMetaData_BASE
diff --git a/odk/examples/DevelopersGuide/Database/DriverSkeleton/SDriver.cxx 
b/odk/examples/DevelopersGuide/Database/DriverSkeleton/SDriver.cxx
index 8cf2944..a1950a4 100644
--- a/odk/examples/DevelopersGuide/Database/DriverSkeleton/SDriver.cxx
+++ b/odk/examples/DevelopersGuide/Database/DriverSkeleton/SDriver.cxx
@@ -86,8 +86,8 @@ rtl::OUString SkeletonDriver::getImplementationName_Static(  
) throw(RuntimeExce
 
 Sequence< ::rtl::OUString > SkeletonDriver::getSupportedServiceNames_Static(  
) throw (RuntimeException)
 {
-// which service is supported
-// for more information @see com.sun.star.sdbc.Driver
+/// which service is supported
+/// for more information @see com.sun.star.sdbc.Driver
 Sequence< ::rtl::OUString > aSNS( 1 );
 aSNS[0] = ::rtl::OUString("com.sun.star.sdbc.Driver&qu

[Libreoffice-commits] core.git: svx/inc svx/source

2014-08-18 Thread Chris Laplante
   |6 
 svx/source/stbctrls/selctrl.cxx   |2 
 svx/source/stbctrls/stbctrls.h|2 
 svx/source/stbctrls/zoomctrl.cxx  |3 
 svx/source/svdraw/svdattr.cxx |   80 ---
 svx/source/svdraw/svddrgm1.hxx|   24 --
 svx/source/svdraw/svdetc.cxx  |5 
 svx/source/svdraw/svdfmtf.cxx |7 
 svx/source/svdraw/svdhdl.cxx  |8 
 svx/source/svdraw/svdlayer.cxx|4 
 svx/source/svdraw/svdmodel.cxx|4 
 svx/source/svdraw/svdopath.cxx|8 
 svx/source/svdraw/svdouno.cxx |4 
 svx/source/table/accessiblecell.cxx   |4 
 svx/source/table/accessibletableshape.cxx |   18 -
 svx/source/table/cellcursor.cxx   |4 
 svx/source/table/cellcursor.hxx   |4 
 svx/source/table/cellrange.cxx|4 
 svx/source/table/cellrange.hxx|4 
 svx/source/table/propertyset.cxx  |8 
 svx/source/table/svdotable.cxx|4 
 svx/source/table/tablecolumn.hxx  |4 
 svx/source/table/tablecolumns.cxx |4 
 svx/source/table/tablecolumns.hxx |4 
 svx/source/table/tablecontroller.cxx  |4 
 svx/source/table/tabledesign.cxx  |4 
 svx/source/table/tablemodel.hxx   |8 
 svx/source/table/tablerow.cxx |4 
 svx/source/table/tablerow.hxx |4 
 svx/source/table/tablerows.cxx|4 
 svx/source/table/tablerows.hxx|4 
 svx/source/tbxctrls/SvxColorChildWindow.cxx   |7 
 svx/source/tbxctrls/colorwindow.hxx   |7 
 svx/source/tbxctrls/colrctrl.cxx  |   92 
 svx/source/tbxctrls/extrusioncontrols.cxx |   21 -
 svx/source/tbxctrls/fillctrl.cxx  |   11 -
 svx/source/tbxctrls/fontworkgallery.cxx   |   18 -
 svx/source/tbxctrls/itemwin.cxx   |   12 -
 svx/source/tbxctrls/layctrl.cxx   |8 
 svx/source/tbxctrls/linectrl.cxx  |   28 --
 svx/source/tbxctrls/tbcontrl.cxx  |2 
 svx/source/tbxctrls/tbunocontroller.cxx   |8 
 svx/source/tbxctrls/tbunosearchcontrollers.cxx|   25 --
 svx/source/tbxctrls/tbxalign.cxx  |   29 +-
 svx/source/tbxctrls/tbxcolor.cxx  |3 
 svx/source/tbxctrls/verttexttbxctrl.cxx   |1 
 svx/source/unodraw/shapeimpl.hxx  |   20 -
 svx/source/unodraw/shapepropertynotifier.cxx  |7 
 svx/source/unodraw/unomod.cxx |   10 
 svx/source/unodraw/unopage.cxx|2 
 svx/source/unodraw/unoprov.cxx|9 
 svx/source/unodraw/unoshap2.cxx   |   44 
 svx/source/unodraw/unoshap3.cxx   |   34 ---
 svx/source/unodraw/unoshap4.cxx   |5 
 svx/source/unodraw/unoshape.cxx   |   16 -
 svx/source/unodraw/unoshtxt.cxx   |6 
 svx/source/xoutdev/xattr.cxx  |   62 -
 svx/source/xoutdev/xattr2.cxx |   18 -
 svx/source/xoutdev/xattrbmp.cxx   |2 
 svx/source/xoutdev/xtable.cxx |   12 -
 207 files changed, 237 insertions(+), 2329 deletions(-)

New commits:
commit 7b33dbb25394a88b8eb2c826d951ce578605e895
Author: Chris Laplante 
Date:   Mon Aug 18 16:57:11 2014 -0400

svx: Cleanup ASCII art and useless comments

Change-Id: I5399362056276f324fd43eda05d3f606dc6f8c71
Reviewed-on: https://gerrit.libreoffice.org/11011
Reviewed-by: Noel Grandin 
Tested-by: Noel Grandin 

diff --git a/svx/inc/AccessibleTableShape.hxx b/svx/inc/AccessibleTableShape.hxx
index 58023a8..a531837 100644
--- a/svx/inc/AccessibleTableShape.hxx
+++ b/svx/inc/AccessibleTableShape.hxx
@@ -102,7 +102,7 @@ public:
 virtual sal_Int32 SAL_CALL getSelectedAccessibleChildCount(  ) throw ( 
::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
 virtual ::com::sun::star::uno::Reference< 
::com::sun::star::accessibility::XAccessible > SAL_CALL 
getSelectedAccessibleChild( sal_Int32 nSelectedChildIndex ) throw ( 
::com::sun::star

Re: list.cxx in VCL

2014-08-18 Thread Chris Laplante
I have changed my mind, and gone ahead and submitted the patch to Gerrit. I'd
be very interested in your and anyone else's feedback regarding the
approach. It compiles fine, but I still need to figure out how to test it. I
also still have reservations about mixing C++ and C memory allocation.

Thanks,
Chris



--
View this message in context: 
http://nabble.documentfoundation.org/list-cxx-in-VCL-tp4109073p4119395.html
Sent from the Dev mailing list archive at Nabble.com.
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


[Libreoffice-commits] core.git: svl/ignores.persist svl/source

2014-08-16 Thread Chris Laplante
 svl/ignores.persist   |binary
 svl/source/config/cjkoptions.cxx  |5 -
 svl/source/config/ctloptions.cxx  |6 -
 svl/source/config/languageoptions.cxx |8 --
 svl/source/fsstor/fsstorage.cxx   |2 
 svl/source/items/globalnameitem.cxx   |5 -
 svl/source/items/itemprop.cxx |6 -
 svl/source/items/itemset.cxx  |2 
 svl/source/items/poolitem.cxx |6 -
 svl/source/items/slstitm.cxx  |2 
 svl/source/items/srchitem.cxx |2 
 svl/source/items/style.cxx|3 
 svl/source/misc/adrparse.cxx  |4 -
 svl/source/misc/filenotation.cxx  |1 
 svl/source/misc/inethist.cxx  |   81 +
 svl/source/misc/urihelper.cxx |   16 -
 svl/source/numbers/zforlist.cxx   |7 --
 svl/source/svdde/ddecli.cxx   |   49 ---
 svl/source/svdde/ddedata.cxx  |   20 --
 svl/source/svdde/ddeinf.cxx   |2 
 svl/source/svdde/ddestrg.cxx  |   10 ---
 svl/source/svdde/ddesvr.cxx   |  106 --
 22 files changed, 16 insertions(+), 327 deletions(-)

New commits:
commit b0e02e72c20f3c921fed34367f8184604387572b
Author: Chris Laplante 
Date:   Sat Aug 16 21:27:34 2014 -0400

svl: Remove ASCII art and pointless comments

Change-Id: Idd8ea0cb7e7d58a29dbfcae084558320efe5fe43
Reviewed-on: https://gerrit.libreoffice.org/10945
Reviewed-by: Thomas Arnhold 
Tested-by: Thomas Arnhold 

diff --git a/svl/ignores.persist b/svl/ignores.persist
new file mode 100644
index 000..69ae856
Binary files /dev/null and b/svl/ignores.persist differ
diff --git a/svl/source/config/cjkoptions.cxx b/svl/source/config/cjkoptions.cxx
index b8c9788..eb47226 100644
--- a/svl/source/config/cjkoptions.cxx
+++ b/svl/source/config/cjkoptions.cxx
@@ -378,15 +378,12 @@ bool 
SvtCJKOptions_Impl::IsReadOnly(SvtCJKOptions::EOption eOption) const
 return bReadOnly;
 }
 
-// global 
+// global
 
 static SvtCJKOptions_Impl*  pCJKOptions = NULL;
 static sal_Int32nCJKRefCount = 0;
 namespace { struct theCJKOptionsMutex : public rtl::Static< ::osl::Mutex , 
theCJKOptionsMutex >{}; }
 
-
-// class SvtCJKOptions --
-
 SvtCJKOptions::SvtCJKOptions(bool bDontLoad)
 {
 // Global access, must be guarded (multithreading)
diff --git a/svl/source/config/ctloptions.cxx b/svl/source/config/ctloptions.cxx
index b6c3967..a75ba60 100644
--- a/svl/source/config/ctloptions.cxx
+++ b/svl/source/config/ctloptions.cxx
@@ -37,8 +37,6 @@ using namespace ::com::sun::star::uno;
 
 #define CFG_READONLY_DEFAULT false
 
-// SvtCJKOptions_Impl 
--
-
 class SvtCTLOptions_Impl : public utl::ConfigItem
 {
 private:
@@ -377,14 +375,12 @@ void SvtCTLOptions_Impl::SetCTLTextNumerals( 
SvtCTLOptions::TextNumerals _eNumer
 NotifyListeners(0);
 }
 }
-// global 
+// global
 
 static SvtCTLOptions_Impl*  pCTLOptions = NULL;
 static sal_Int32nCTLRefCount = 0;
 namespace { struct CTLMutex : public rtl::Static< osl::Mutex, CTLMutex > {}; }
 
-// class SvtCTLOptions --
-
 SvtCTLOptions::SvtCTLOptions( bool bDontLoad )
 {
 // Global access, must be guarded (multithreading)
diff --git a/svl/source/config/languageoptions.cxx 
b/svl/source/config/languageoptions.cxx
index 72c5338..06d4382 100644
--- a/svl/source/config/languageoptions.cxx
+++ b/svl/source/config/languageoptions.cxx
@@ -33,12 +33,10 @@
 #endif
 
 using namespace ::com::sun::star;
-// global 
--
+// global
 
 namespace { struct ALMutex : public rtl::Static< ::osl::Mutex, ALMutex > {}; }
 
-// class SvtLanguageOptions 

-
 SvtLanguageOptions::SvtLanguageOptions( bool _bDontLoad )
 {
 // Global access, must be guarded (multithreading)
@@ -60,7 +58,7 @@ SvtLanguageOptions::~SvtLanguageOptions()
 delete m_pCJKOptions;
 delete m_pCTLOptions;
 }
-// CJK options 
-
+// CJK options
 bool SvtLanguageOptions::IsCJKFontEnabled() const
 {
 return m_pCJKOptions->IsCJKFontEnabled();
@@ -85,7 +83,7 @@ bool SvtLanguageOptions::IsAnyEnabled() const
 {
 return m_pCJKOptions->IsAnyEnabled();
 }
-// CTL options 
-
+// CTL options
 void SvtLanguageOptions::SetCTLFontEnabled( bool _bEnabled )
 {
 m_pCTLOptions->SetCTLFontEnabled( _bEnabled );
diff --git a/svl/source/fsstor/fsstorage.cxx b/svl/source/fsstor/fsstorage.cxx
index b2eb88f..9eb5547 100644
--- a/svl/source/fsstor/fsstorage.

Re: Semi-automated ASCII art removal tool

2014-05-24 Thread Chris Laplante
Hi Kendy,
I've completed a sizable rewrite of the tool. Doxygen comment formatting
(both C and C++ style) is now preserved. As an added little bonus, the tool
detects comments containing Doxygen commands (e.g. @brief, \example) but
that are not formatted as Doxygen comments, and will suggest the fix.

For completeness here are the other major changes:
- Useless comment detection is much more accurate. It now searches for type
declarations directly after comments, and uses that information to determine
if a comment can be removed.
- Remembers decisions to ignore comments (by creating a persistence file in
the directory in which it is run)
- Command line arguments
- Better whitespace handling
- Lots of bugfixes

Enjoy -
Chris



--
View this message in context: 
http://nabble.documentfoundation.org/Semi-automated-ASCII-art-removal-tool-tp4108832p4110134.html
Sent from the Dev mailing list archive at Nabble.com.
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


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

2014-05-20 Thread Chris Laplante
 vcl/source/fontsubset/xlat.cxx |3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

New commits:
commit eff1d991de77700505ce18dfaaa3e01d76551ffd
Author: Chris Laplante 
Date:   Fri May 16 15:05:42 2014 -0400

Move #include from middle of file to top

Change-Id: I715f606ee0f94e9ffd3ef9ec889948a56a9cdc19
Reviewed-on: https://gerrit.libreoffice.org/9381
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/vcl/source/fontsubset/xlat.cxx b/vcl/source/fontsubset/xlat.cxx
index 56b4e24..3509ada 100644
--- a/vcl/source/fontsubset/xlat.cxx
+++ b/vcl/source/fontsubset/xlat.cxx
@@ -18,6 +18,7 @@
  */
 
 #include "rtl/textcvt.h"
+#include "xlat.hxx"
 #include 
 
 namespace {
@@ -138,8 +139,6 @@ void ConverterCache::convertStr( int nSelect, const 
sal_Unicode* pSrc, sal_uInt1
 
 } // anonymous namespace
 
-#include "xlat.hxx"
-
 namespace vcl
 {
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


Re: list.cxx in VCL

2014-05-17 Thread Chris Laplante
I took a crack at it, but it resulted in too much mixing of C and C++ style
memory allocation, which I'm not comfortable intermingling. The overwhelming
majority of the original is implemented in C anyway, so I'm not sure it's
worth me replacing just one facet of the code with C++. Perhaps one day if I
build up the courage I can rewrite the entire thing in C++, if the community
thought it would useful for the long-term.

Chris



--
View this message in context: 
http://nabble.documentfoundation.org/list-cxx-in-VCL-tp4109073p4109188.html
Sent from the Dev mailing list archive at Nabble.com.
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


list.cxx in VCL

2014-05-16 Thread Chris Laplante
Would it be possible to remove vcl/source/fontsubset/list.cxx and replace its
usage with std::list? The only place I see it being used is in ttcr.cxx
(same folder). 

It is hard to tell because most of the files in that directory appear to be
C code hiding in .cxx files.

Chris



--
View this message in context: 
http://nabble.documentfoundation.org/list-cxx-in-VCL-tp4109073.html
Sent from the Dev mailing list archive at Nabble.com.
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


Re: Semi-automated ASCII art removal tool

2014-05-15 Thread Chris Laplante
Hi Kendy - thanks for the suggestions!

Now that you mention it, I think the tool should have been more careful with
http://i.imgur.com/VwHYt83.png as well. In that case it should be safe to
collapse the leading /*** into just /**, right? 

I think I'll take a peek at how Doxygen itself parses comments for some
inspiration. I suppose as a quick heuristic I can just look for things like
"@param" and "@return", or "\brief" and if found treat blocks as Doxygen
comments. Though the single line /// format makes things trickier... Anyway,
I'll play around with it today.

Thanks again!
Chris



--
View this message in context: 
http://nabble.documentfoundation.org/Semi-automated-ASCII-art-removal-tool-tp4108832p4108942.html
Sent from the Dev mailing list archive at Nabble.com.
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


Re: Semi-automated ASCII art removal tool

2014-05-15 Thread Chris Laplante
Added support for .m, .mm, and .h. Thanks for the suggestion.
Chris



--
View this message in context: 
http://nabble.documentfoundation.org/Semi-automated-ASCII-art-removal-tool-tp4108832p4108938.html
Sent from the Dev mailing list archive at Nabble.com.
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


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

2014-05-14 Thread Chris Laplante
 sw/source/ui/config/mailconfigpage.cxx |2 +-
 sw/uiconfig/swriter/ui/authenticationsettingsdialog.ui |4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

New commits:
commit 618106a1913e2df8df5236bd4b20ea5379cfef33
Author: Chris Laplante 
Date:   Wed May 14 14:20:24 2014 -0400

Misspelled property in SwAuthenticationSettingsDialog (seperate => separate)

Change-Id: I0cf29711459e5ec185b43cf28716729e659b00b4
Reviewed-on: https://gerrit.libreoffice.org/9357
Reviewed-by: Noel Grandin 
Tested-by: Noel Grandin 

diff --git a/sw/source/ui/config/mailconfigpage.cxx 
b/sw/source/ui/config/mailconfigpage.cxx
index 2c60e5e..aae0529 100644
--- a/sw/source/ui/config/mailconfigpage.cxx
+++ b/sw/source/ui/config/mailconfigpage.cxx
@@ -364,7 +364,7 @@ 
SwAuthenticationSettingsDialog::SwAuthenticationSettingsDialog(
 , rConfigItem( rItem )
 {
 get(m_pAuthenticationCB,"authentication");
-get(m_pSeparateAuthenticationRB,"seperateauthentication");
+get(m_pSeparateAuthenticationRB,"separateauthentication");
 get(m_pSMTPAfterPOPRB,"smtpafterpop");
 get(m_pOutgoingServerFT,"label1");
 get(m_pUserNameFT,"username_label");
diff --git a/sw/uiconfig/swriter/ui/authenticationsettingsdialog.ui 
b/sw/uiconfig/swriter/ui/authenticationsettingsdialog.ui
index 78644cb..6785810 100644
--- a/sw/uiconfig/swriter/ui/authenticationsettingsdialog.ui
+++ b/sw/uiconfig/swriter/ui/authenticationsettingsdialog.ui
@@ -99,7 +99,7 @@
   
 
 
-  
+  
 The outgoing mail 
server (SMTP) requires _separate authentication
 True
 True
@@ -209,7 +209,7 @@
 0
 True
 True
-seperateauthentication:wrap
+separateauthentication:wrap
   
   
 0
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2014-04-18 Thread Chris Laplante
 sw/source/filter/ww8/wrtw8nds.cxx |   27 +--
 1 file changed, 5 insertions(+), 22 deletions(-)

New commits:
commit a74f0cd6a7dad15982bcdbc048cc2712ed8b976d
Author: Chris Laplante 
Date:   Wed Apr 9 19:55:35 2014 -0400

Simplify the AttributeOutputBase::OutputFlyFrame method.

Change-Id: Iac3b1b627728d5268ce7633904af9113e3127be2
Reviewed-on: https://gerrit.libreoffice.org/9006
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/sw/source/filter/ww8/wrtw8nds.cxx 
b/sw/source/filter/ww8/wrtw8nds.cxx
index 523a9ec..5024333 100644
--- a/sw/source/filter/ww8/wrtw8nds.cxx
+++ b/sw/source/filter/ww8/wrtw8nds.cxx
@@ -2885,32 +2885,15 @@ void AttributeOutputBase::OutputFlyFrame( const 
sw::Frame& rFmt )
 return;
 
 const SwCntntNode &rNode = *rFmt.GetCntntNode();
-Point aNdPos, aPgPos;
-Point* pLayPos;
-bool bValidNdPos = false, bValidPgPos = false;
+Point aLayPos;
 
+// get the Layout Node-Position
 if (FLY_AT_PAGE == rFmt.GetFrmFmt().GetAnchor().GetAnchorId())
-{
-// get the Layout Node-Position.
-if ( !bValidPgPos )
-{
-aPgPos = rNode.FindPageFrmRect(false, &aPgPos).Pos();
-bValidPgPos = true;
-}
-pLayPos = &aPgPos;
-}
+aLayPos = rNode.FindPageFrmRect().Pos();
 else
-{
-// get the Layout Node-Position.
-if ( !bValidNdPos )
-{
-aNdPos = rNode.FindLayoutRect(false, &aNdPos).Pos();
-bValidNdPos = true;
-}
-pLayPos = &aNdPos;
-}
+aLayPos = rNode.FindLayoutRect().Pos();
 
-OutputFlyFrame_Impl( rFmt, *pLayPos );
+OutputFlyFrame_Impl( rFmt, aLayPos );
 }
 
 // write data of any redline
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2014-04-18 Thread Chris Laplante
 sw/source/core/doc/SwStyleNameMapper.cxx |  155 ---
 1 file changed, 60 insertions(+), 95 deletions(-)

New commits:
commit bfefe114e11d155abf0785a3b2c887fcf4077199
Author: Chris Laplante 
Date:   Wed Apr 9 15:15:14 2014 -0400

Rewrite getHash to reduce code duplication & improve maintainability.

Instead of each case block repeating the same operations, we build
an intermediate vector of entries to process.

Change-Id: Id111d7938a7802f6f016c2a0d1be0cb062a32110
Reviewed-on: https://gerrit.libreoffice.org/8912
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/sw/source/core/doc/SwStyleNameMapper.cxx 
b/sw/source/core/doc/SwStyleNameMapper.cxx
index d85a6de..6bff575 100644
--- a/sw/source/core/doc/SwStyleNameMapper.cxx
+++ b/sw/source/core/doc/SwStyleNameMapper.cxx
@@ -17,6 +17,9 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
+#include 
+#include 
+
 #include 
 #include 
 #include 
@@ -388,6 +391,13 @@ static void lcl_CheckSuffixAndDelete(OUString & rString)
 rString = rString.copy(0, rString.getLength() - 7);
 }
 }
+
+typedef boost::tuple& 
(*)() > NameArrayIndexTuple_t;
+
+static sal_uInt16 lcl_AccumulateIndexCount( sal_uInt16 nSum, 
NameArrayIndexTuple_t const tuple ){
+// Return running sum + (index end) - (index start)
+return nSum + boost::get<1>( tuple ) - boost::get<0>( tuple );
+}
 }
 
 #ifdef _NEED_TO_DEBUG_MAPPING
@@ -413,124 +423,79 @@ void SwStyleNameMapper::testNameTable( 
SwGetPoolIdFromName const nFamily, sal_uI
 
 const NameToIdHash & SwStyleNameMapper::getHashTable ( SwGetPoolIdFromName 
eFlags, bool bProgName )
 {
-NameToIdHash *pHash = 0;
-const ::std::vector *pStrings = 0;
+// pHashPointer is a pointer to a pointer which stores the UI/prog name 
array
+NameToIdHash **pHashPointer = 0;
+// Stores tuples representing (index start, index end, pointer to function 
which returns ref to name array)
+::std::vector vIndexes;
 
 switch ( eFlags )
 {
 case nsSwGetPoolIdFromName::GET_POOLID_TXTCOLL:
 {
-sal_uInt16 nIndex;
-sal_uInt16 nId;
-
-pHash = bProgName ? pParaProgMap : pParaUIMap;
-if ( !pHash )
-{
-pHash = new NameToIdHash ( RES_POOLCOLL_TEXT_END - 
RES_POOLCOLL_TEXT_BEGIN +
-   RES_POOLCOLL_LISTS_END - 
RES_POOLCOLL_LISTS_BEGIN +
-   RES_POOLCOLL_EXTRA_END - 
RES_POOLCOLL_EXTRA_BEGIN +
-   RES_POOLCOLL_REGISTER_END - 
RES_POOLCOLL_REGISTER_BEGIN +
-   RES_POOLCOLL_DOC_END - 
RES_POOLCOLL_DOC_BEGIN +
-   RES_POOLCOLL_HTML_END - 
RES_POOLCOLL_HTML_BEGIN );
-pStrings = bProgName ? &GetTextProgNameArray() : 
&GetTextUINameArray();
-for ( nIndex = 0, nId = RES_POOLCOLL_TEXT_BEGIN ; nId < 
RES_POOLCOLL_TEXT_END ; nId++,nIndex++ )
-(*pHash)[((*pStrings)[nIndex])] = nId;
-pStrings = bProgName ? &GetListsProgNameArray() : 
&GetListsUINameArray();
-for ( nIndex = 0, nId = RES_POOLCOLL_LISTS_BEGIN ; nId < 
RES_POOLCOLL_LISTS_END ; nId++,nIndex++ )
-(*pHash)[((*pStrings)[nIndex])] = nId;
-pStrings = bProgName ? &GetExtraProgNameArray() : 
&GetExtraUINameArray();
-for ( nIndex = 0, nId = RES_POOLCOLL_EXTRA_BEGIN ; nId < 
RES_POOLCOLL_EXTRA_END ; nId++,nIndex++ )
-(*pHash)[((*pStrings)[nIndex])] = nId;
-pStrings = bProgName ? &GetRegisterProgNameArray() : 
&GetRegisterUINameArray();
-for ( nIndex = 0, nId = RES_POOLCOLL_REGISTER_BEGIN ; nId < 
RES_POOLCOLL_REGISTER_END ; nId++,nIndex++ )
-(*pHash)[((*pStrings)[nIndex])] = nId;
-pStrings = bProgName ? &GetDocProgNameArray() : 
&GetDocUINameArray();
-for ( nIndex = 0, nId = RES_POOLCOLL_DOC_BEGIN ; nId < 
RES_POOLCOLL_DOC_END ; nId++,nIndex++ )
-(*pHash)[((*pStrings)[nIndex])] = nId;
-pStrings = bProgName ? &GetHTMLProgNameArray() : 
&GetHTMLUINameArray();
-for ( nIndex = 0, nId = RES_POOLCOLL_HTML_BEGIN ; nId < 
RES_POOLCOLL_HTML_END ; nId++,nIndex++ )
-(*pHash)[((*pStrings)[nIndex])] = nId;
-
-if ( bProgName )
-pParaProgMap = pHash;
-else
-pParaUIMap = pHash;
-}
+pHashPointer = bProgName ? &pParaProgMap : &pParaUIMap;
+vIndexes.push_back( boost::make_tuple(RES_POOLCOLL_TEXT_BEGIN, 
RES_POOLCOLL_TEXT_END, bProgName ? &GetTextProgNameArray : &GetTextUINameArray) 
)

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

2014-04-18 Thread Chris Laplante
 sw/source/core/text/EnhancedPDFExportHelper.cxx |   69 +++-
 sw/source/core/text/atrhndl.hxx |   16 +
 sw/source/core/text/atrstck.cxx |   69 +---
 sw/source/core/text/blink.cxx   |   10 +--
 sw/source/core/text/frmcrsr.cxx |   44 ---
 sw/source/core/text/frmform.cxx |   35 
 sw/source/core/text/frminf.cxx  |   41 --
 sw/source/core/text/guess.cxx   |   11 +--
 sw/source/core/text/guess.hxx   |4 -
 sw/source/core/text/inftxt.cxx  |   61 ++---
 sw/source/core/text/inftxt.hxx  |   54 ++
 sw/source/core/text/itradj.cxx  |   61 ++---
 12 files changed, 67 insertions(+), 408 deletions(-)

New commits:
commit d8f8c8aa4544e2a0e7e3c43764080d5fe0effacf
Author: Chris Laplante 
Date:   Fri Apr 18 00:59:07 2014 -0400

Begin removing ASCII art and useless comments from sw

Change-Id: Ic367b2ebca1a766c830ccd44a84274d86be4f080
Reviewed-on: https://gerrit.libreoffice.org/9090
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/sw/source/core/text/EnhancedPDFExportHelper.cxx 
b/sw/source/core/text/EnhancedPDFExportHelper.cxx
index 4a59b55..f310c5f 100644
--- a/sw/source/core/text/EnhancedPDFExportHelper.cxx
+++ b/sw/source/core/text/EnhancedPDFExportHelper.cxx
@@ -258,9 +258,6 @@ bool lcl_HasPreviousParaSameNumRule( const SwTxtNode& rNode 
)
 
 } // end namespace
 
-/*
- * SwTaggedPDFHelper::SwTaggedPDFHelper()
- */
 SwTaggedPDFHelper::SwTaggedPDFHelper( const Num_Info* pNumInfo,
   const Frm_Info* pFrmInfo,
   const Por_Info* pPorInfo,
@@ -297,9 +294,6 @@ SwTaggedPDFHelper::SwTaggedPDFHelper( const Num_Info* 
pNumInfo,
 }
 }
 
-/*
- * SwTaggedPDFHelper::~SwTaggedPDFHelper()
- */
 SwTaggedPDFHelper::~SwTaggedPDFHelper()
 {
 if ( mpPDFExtOutDevData && mpPDFExtOutDevData->GetIsExportTaggedPDF() )
@@ -319,9 +313,6 @@ SwTaggedPDFHelper::~SwTaggedPDFHelper()
 }
 }
 
-/*
- * SwTaggedPDFHelper::CheckReopenTag()
- */
 bool SwTaggedPDFHelper::CheckReopenTag()
 {
 bool bRet = false;
@@ -391,9 +382,6 @@ bool SwTaggedPDFHelper::CheckReopenTag()
 return bRet && !bContinue;
 }
 
-/*
- * SwTaggedPDFHelper::CheckRestoreTag()
- */
 bool SwTaggedPDFHelper::CheckRestoreTag() const
 {
 bool bRet = false;
@@ -413,9 +401,6 @@ bool SwTaggedPDFHelper::CheckRestoreTag() const
 return bRet;
 }
 
-/*
- * SwTaggedPDFHelper::BeginTag()
- */
 void SwTaggedPDFHelper::BeginTag( vcl::PDFWriter::StructElement eType, const 
OUString& rString )
 {
 // write new tag
@@ -474,9 +459,6 @@ void SwTaggedPDFHelper::BeginTag( 
vcl::PDFWriter::StructElement eType, const OUS
 SetAttributes( eType );
 }
 
-/*
- * SwTaggedPDFHelper::EndTag()
- */
 void SwTaggedPDFHelper::EndTag()
 {
 mpPDFExtOutDevData->EndStructureElement();
@@ -486,11 +468,7 @@ void SwTaggedPDFHelper::EndTag()
 #endif
 }
 
-/*
- * SwTaggedPDFHelper::SetAttributes()
- *
- * Sets the attributes according to the structure type.
- */
+// Sets the attributes according to the structure type.
 void SwTaggedPDFHelper::SetAttributes( vcl::PDFWriter::StructElement eType )
 {
 vcl::PDFWriter::StructAttributeValue eVal;
@@ -845,9 +823,6 @@ void SwTaggedPDFHelper::SetAttributes( 
vcl::PDFWriter::StructElement eType )
 }
 }
 
-/*
- * SwTaggedPDFHelper::BeginNumberedListStructureElements()
- */
 void SwTaggedPDFHelper::BeginNumberedListStructureElements()
 {
 OSL_ENSURE( mpNumInfo, "List without mpNumInfo?" );
@@ -985,9 +960,6 @@ void SwTaggedPDFHelper::BeginNumberedListStructureElements()
 }
 }
 
-/*
- * SwTaggedPDFHelper::BeginBlockStructureElements()
- */
 void SwTaggedPDFHelper::BeginBlockStructureElements()
 {
 const SwFrm* pFrm = &mpFrmInfo->mrFrm;
@@ -1323,9 +1295,6 @@ void SwTaggedPDFHelper::BeginBlockStructureElements()
 }
 }
 
-/*
- * SwTaggedPDFHelper::EndStructureElements()
- */
 void SwTaggedPDFHelper::EndStructureElements()
 {
 while ( nEndStructureElement > 0 )
@@ -1337,9 +1306,6 @@ void SwTaggedPDFHelper::EndStructureElements()
 CheckRestoreTag();
 }
 
-/*
- * SwTaggedPDFHelper::BeginInlineStructureElements()
- */
 void SwTaggedPDFHelper::BeginInlineStructureElements()
 {
 const SwLinePortion* pPor = &mpPorInfo->mrPor;
@@ -1471,18 +1437,12 @@ void SwTaggedPDFHelper::BeginInlineStructureElements()
 }
 }
 
-/*
- * static SwTaggedPDFHelper::IsExportTaggedPDF
- */
- bool SwTaggedPDFHelper::IsExportTaggedPDF( const OutputDevice& rOut )
- {
+bool SwTaggedPDFHelper::IsExportTaggedPDF( const OutputDevice& rOut )
+{
 vcl::PDFExtOutDevData* pPDFExtOutDevData = PTR_CAST( 
vcl::PDFExtOutDevData, rOut.GetExtOutDevData() );
 re

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

2014-04-17 Thread Chris Laplante
 sw/source/core/doc/tblafmt.cxx|2 ++
 sw/source/core/layout/pagechg.cxx |6 ++
 sw/source/core/text/txtftn.cxx|1 -
 sw/source/filter/xml/swxml.cxx|1 +
 sw/source/filter/xml/xmlithlp.cxx |1 -
 5 files changed, 5 insertions(+), 6 deletions(-)

New commits:
commit c34cc21244d74f115165e1893f03b9c62a0eef2b
Author: Chris Laplante 
Date:   Wed Apr 9 18:17:34 2014 -0400

cppcheck: Fix redundant assignments in the sw module

Change-Id: I5f266ced31295b327cdd7075b2e9d66698a01ade
Reviewed-on: https://gerrit.libreoffice.org/8914
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/sw/source/core/doc/tblafmt.cxx b/sw/source/core/doc/tblafmt.cxx
index 0dedd8b..dc0f19f 100644
--- a/sw/source/core/doc/tblafmt.cxx
+++ b/sw/source/core/doc/tblafmt.cxx
@@ -1206,6 +1206,8 @@ sal_Bool SwTableAutoFmtTbl::Save( SvStream& rStream ) 
const
.WriteUChar( (sal_uInt8)GetStoreCharSet( 
::osl_getThreadTextEncoding() ) );
 
 bRet = 0 == rStream.GetError();
+if (!bRet)
+return sal_False;
 
 // Write this version number for all attributes
 m_pImpl->m_AutoFormats[0].GetBoxFmt(0).SaveVersionNo(
diff --git a/sw/source/core/layout/pagechg.cxx 
b/sw/source/core/layout/pagechg.cxx
index 3b714b8..3f348b7 100644
--- a/sw/source/core/layout/pagechg.cxx
+++ b/sw/source/core/layout/pagechg.cxx
@@ -1156,10 +1156,9 @@ void SwFrm::CheckPageDescs( SwPageFrm *pStart, sal_Bool 
bNotifyFields, SwPageFrm
 SwPageFrm *SwFrm::InsertPage( SwPageFrm *pPrevPage, sal_Bool bFtn )
 {
 SwRootFrm *pRoot = (SwRootFrm*)pPrevPage->GetUpper();
-SwPageFrm *pSibling = (SwPageFrm*)pRoot->GetLower();
-SwPageDesc *pDesc = pSibling->GetPageDesc();
+SwPageFrm *pSibling = (SwPageFrm*)pPrevPage->GetNext();
+SwPageDesc *pDesc = 0;
 
-pSibling = (SwPageFrm*)pPrevPage->GetNext();
 // insert right (odd) or left (even) page?
 bool bNextOdd = !pPrevPage->OnRightPage();
 bool bWishedOdd = bNextOdd;
@@ -1167,7 +1166,6 @@ SwPageFrm *SwFrm::InsertPage( SwPageFrm *pPrevPage, 
sal_Bool bFtn )
 // Which PageDesc is relevant?
 // For CntntFrm take the one from format if provided,
 // otherwise from the Follow of the PrevPage
-pDesc = 0;
 if ( IsFlowFrm() && !SwFlowFrm::CastFlowFrm( this )->IsFollow() )
 {   SwFmtPageDesc &rDesc = (SwFmtPageDesc&)GetAttrSet()->GetPageDesc();
 pDesc = rDesc.GetPageDesc();
diff --git a/sw/source/core/text/txtftn.cxx b/sw/source/core/text/txtftn.cxx
index 17dc849..182251e 100644
--- a/sw/source/core/text/txtftn.cxx
+++ b/sw/source/core/text/txtftn.cxx
@@ -1102,7 +1102,6 @@ sal_Int32 SwTxtFormatter::FormatQuoVadis( const sal_Int32 
nOffset )
 pCurrPor = pFollow;
 }
 
-nLastLeft = nOldRealWidth - nQuoWidth;
 Right( Right() - nQuoWidth );
 
 SWAP_IF_NOT_SWAPPED( pFrm )
diff --git a/sw/source/filter/xml/swxml.cxx b/sw/source/filter/xml/swxml.cxx
index 2fb7a03..1073937 100644
--- a/sw/source/filter/xml/swxml.cxx
+++ b/sw/source/filter/xml/swxml.cxx
@@ -676,6 +676,7 @@ sal_uLong XMLReader::Read( SwDoc &rDoc, const OUString& 
rBaseURL, SwPaM &rPaM, c
 *pArgs++ <<= aLateInitSettings;
 
 Sequence aEmptyArgs( 3 );
+// cppcheck-suppress redundantAssignment
 pArgs = aEmptyArgs.getArray();
 *pArgs++ <<= xInfoSet;
 *pArgs++ <<= xStatusIndicator;
diff --git a/sw/source/filter/xml/xmlithlp.cxx 
b/sw/source/filter/xml/xmlithlp.cxx
index 97d21b8..aade817 100644
--- a/sw/source/filter/xml/xmlithlp.cxx
+++ b/sw/source/filter/xml/xmlithlp.cxx
@@ -292,7 +292,6 @@ void sw_frmitems_MergeXMLVertPos( SvxGraphicPosition& ePos,
 case GPOS_LT:
 case GPOS_LM:
 case GPOS_LB:
-ePos = GPOS_MT==eVert ? GPOS_LT : (GPOS_MM==eVert ? GPOS_LM : GPOS_LB);
 ePos = eVert;
 break;
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits