[Libreoffice-commits] .: writerperfect/source xmloff/source xmlsecurity/source

2012-10-08 Thread Libreoffice Gerrit user
 writerperfect/source/filter/OdgGenerator.cxx |   41 
--
 writerperfect/source/filter/TextRunStyle.cxx |4 
 xmloff/source/core/SettingsExportHelper.cxx  |   11 --
 xmloff/source/table/XMLTableImport.cxx   |   10 --
 xmlsecurity/source/xmlsec/mscrypt/xmlsecuritycontext_mscryptimpl.hxx |   19 

 5 files changed, 85 deletions(-)

New commits:
commit d540c322cce4f00418466cf7715ecc2c2f1e95c5
Author: Marcos Paulo de Souza marcos.souza@gmail.com
Date:   Mon Oct 8 18:15:59 2012 -0300

Remove more useless code inside #if 0 blocks

Change-Id: Ifb9f9d2211608b848a5de66e1d19c4815a755907
Signed-off-by: Marcos Paulo de Souza marcos.souza@gmail.com
Reviewed-on: https://gerrit.libreoffice.org/840
Reviewed-by: Markus Mohrhard markus.mohrh...@googlemail.com
Tested-by: Markus Mohrhard markus.mohrh...@googlemail.com

diff --git a/writerperfect/source/filter/OdgGenerator.cxx 
b/writerperfect/source/filter/OdgGenerator.cxx
index 0d39862..8661138 100644
--- a/writerperfect/source/filter/OdgGenerator.cxx
+++ b/writerperfect/source/filter/OdgGenerator.cxx
@@ -241,22 +241,6 @@ static inline double cubicBase(double t, double a, double 
b, double c, double d)
 return (1.0-t)*(1.0-t)*(1.0-t)*a + 3.0*(1.0-t)*(1.0-t)*t*b + 
3.0*(1.0-t)*t*t*c + t*t*t*d;
 }
 
-#if 0
-static std::vectordouble cubicExtremes(double a, double b, double c, double 
d)
-{
-std::vectordouble vec;
-double u = -a + 2*b - c;
-double v = sqrt((-a*(c-d) + b*b - b*(c+d) + c*c));
-double w = -a + 3.0*b - 3.0*c + d;
-if (w != 0.0)
-{
-vec.push_back((u-v)/w);
-vec.push_back((u+v)/w);
-}
-return vec;
-}
-#endif
-
 static void getCubicBezierBBox(double x0, double y0, double x1, double y1, 
double x2, double y2, double x, double y,
double xmin, double ymin, double xmax, 
double ymax)
 {
@@ -265,29 +249,6 @@ static void getCubicBezierBBox(double x0, double y0, 
double x1, double y1, doubl
 ymin = y0  y ? y0 : y;
 ymax = y0  y ? y0 : y;
 
-#if 0
-std::vectordouble extremes = cubicExtremes(x0, x1, x2, x);
-for(std::vectordouble::iterator iterX = extremes.begin(); iterX != 
extremes.end(); ++iterX)
-{
-if(*iterX = 0  *iterX = 1)
-{
-double tmpx = cubicBase(*iterX, x0, x1, x2, x);
-xmin = tmpx  xmin ? tmpx : xmin;
-xmax = tmpx  xmax ? tmpx : xmax;
-}
-}
-
-extremes = cubicExtremes(y0, y1, y2, y);
-for(std::vectordouble::iterator iterY = extremes.begin(); iterY != 
extremes.end(); ++iterY)
-{
-if(*iterY=0.0  *iterY=1.0)
-{
-double tmpy = cubicBase(*iterY, y0, y1, y2, y);
-ymin = tmpy  ymin ? tmpy : ymin;
-ymax = tmpy  ymax ? tmpy : ymax;
-}
-}
-#else
 for (double t = 0.0; t = 1.0; t+=0.01)
 {
 double tmpx = cubicBase(t, x0, x1, x2, x);
@@ -297,7 +258,6 @@ static void getCubicBezierBBox(double x0, double y0, double 
x1, double y1, doubl
 ymin = tmpy  ymin ? tmpy : ymin;
 ymax = tmpy  ymax ? tmpy : ymax;
 }
-#endif
 }
 
 
@@ -763,7 +723,6 @@ void OdgGenerator::startGraphics(const ::WPXPropertyList 
propList)
 
 
 TagOpenElement *pStyleDrawingPagePropertiesOpenElement = new 
TagOpenElement(style:drawing-page-properties);
-// 
pStyleDrawingPagePropertiesOpenElement-addAttribute(draw:background-size, 
border);
 pStyleDrawingPagePropertiesOpenElement-addAttribute(draw:fill, none);
 
mpImpl-mPageAutomaticStyles.push_back(pStyleDrawingPagePropertiesOpenElement);
 
diff --git a/writerperfect/source/filter/TextRunStyle.cxx 
b/writerperfect/source/filter/TextRunStyle.cxx
index dbdecae..4c461f9 100644
--- a/writerperfect/source/filter/TextRunStyle.cxx
+++ b/writerperfect/source/filter/TextRunStyle.cxx
@@ -51,10 +51,6 @@ void ParagraphStyle::write(OdfDocumentHandler *pHandler) 
const
 WPXPropertyList::Iter i(mpPropList);
 for (i.rewind(); i.next(); )
 {
-#if 0
-if (strcmp(i.key(), style:list-style-name) == 0)
-propList.insert(style:list-style-name, i()-getStr());
-#endif
 if (strncmp(i.key(), fo:margin-,10) == 0)
 {
 if (strcmp(i.key(), fo:margin-left) == 0 ||
diff --git a/xmloff/source/core/SettingsExportHelper.cxx 
b/xmloff/source/core/SettingsExportHelper.cxx
index 7d61bdd..1dadead 100644
--- a/xmloff/source/core/SettingsExportHelper.cxx
+++ b/xmloff/source/core/SettingsExportHelper.cxx
@@ -205,22 +205,11 @@ void XMLSettingsExportHelper::exportBool(const sal_Bool 
bValue, const rtl::OUStr
 
 void XMLSettingsExportHelper::exportByte(const sal_Int8 nValue, const 
rtl::OUString rName) const
 {
-#if 0
-DBG_ASSERT(!rName.isEmpty(), no name);
-m_rContext.AddAttribute( XML_NAME, rName );
-m_rContext.AddAttribute( XML_TYPE, XML_BYTE );
-m_rContext.StartElement( XML_CONFIG_ITEM, 

[Libreoffice-commits] .: writerperfect/source

2012-09-23 Thread Libreoffice Gerrit user
 writerperfect/source/stream/WPXSvStream.cxx |6 ++
 1 file changed, 6 insertions(+)

New commits:
commit bb8839250271b6d951233e0ad21a773962d06889
Author: Fridrich Å trba fridrich.st...@bluewin.ch
Date:   Sun Sep 23 14:42:28 2012 +0200

The upcoming libwpd 0.9.5 has also WPX_SEEK_END seek type

Change-Id: I7be3b67c797a728b5c72e957c67e3f864072addc

diff --git a/writerperfect/source/stream/WPXSvStream.cxx 
b/writerperfect/source/stream/WPXSvStream.cxx
index 12be644..b058b87 100644
--- a/writerperfect/source/stream/WPXSvStream.cxx
+++ b/writerperfect/source/stream/WPXSvStream.cxx
@@ -99,6 +99,12 @@ int WPXSvInputStream::seek(long offset, WPX_SEEK_TYPE 
seekType)
 sal_Int64 tmpOffset = offset;
 if (seekType == WPX_SEEK_CUR)
 tmpOffset += tmpPosition;
+#if defined(LIBWPD_STREAM_VERSION_MAJOR)  
defined(LIBWPD_STREAM_VERSION_MINOR)  defined(LIBWPD_STREAM_VERSION_REVISION) 
\
+ (LIBWPD_STREAM_VERSION_MAJOR  0 || (LIBWPD_STREAM_VERSION_MAJOR == 0 
 (LIBWPD_STREAM_VERSION_MINOR  9 \
+|| (LIBWPD_STREAM_VERSION_MINOR == 9  LIBWPD_STREAM_VERSION_REVISION = 
5
+if (seekType == WPX_SEEK_END)
+tmpOffset += mnLength;
+#endif
 
 int retVal = 0;
 if (tmpOffset  0)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: writerperfect/source

2012-09-03 Thread Libreoffice Gerrit user
 writerperfect/source/draw/CDRImportFilter.cxx   |4 ++--
 writerperfect/source/draw/CMXImportFilter.cxx   |4 ++--
 writerperfect/source/draw/MSPUBImportFilter.cxx |4 ++--
 writerperfect/source/draw/VisioImportFilter.cxx |4 ++--
 writerperfect/source/draw/WPGImportFilter.cxx   |4 ++--
 writerperfect/source/writer/MSWorksImportFilter.cxx |4 ++--
 writerperfect/source/writer/WordPerfectImportFilter.cxx |   10 +-
 7 files changed, 17 insertions(+), 17 deletions(-)

New commits:
commit c578ed53615d219768bc1f07506b1e8756375db6
Author: Fridrich Å trba fridrich.st...@bluewin.ch
Date:   Mon Sep 3 16:36:31 2012 +0200

No explicit rtl::OUString ctors needed, sberg dixit

Change-Id: I0b675213064a10cebfdea1fb99573dcf3e34284b

diff --git a/writerperfect/source/draw/CDRImportFilter.cxx 
b/writerperfect/source/draw/CDRImportFilter.cxx
index 7fc2288..026c7b1 100644
--- a/writerperfect/source/draw/CDRImportFilter.cxx
+++ b/writerperfect/source/draw/CDRImportFilter.cxx
@@ -145,14 +145,14 @@ throw( com::sun::star::uno::RuntimeException )
 WPXSvInputStream input( xInputStream );
 
 if (libcdr::CDRDocument::isSupported(input))
-sTypeName = OUString( draw_CorelDraw_Document );
+sTypeName = draw_CorelDraw_Document;
 
 if (sTypeName.getLength())
 {
 if ( location == Descriptor.getLength() )
 {
 Descriptor.realloc(nLength+1);
-Descriptor[location].Name = ::rtl::OUString( TypeName );
+Descriptor[location].Name = TypeName;
 }
 
 Descriptor[location].Value =sTypeName;
diff --git a/writerperfect/source/draw/CMXImportFilter.cxx 
b/writerperfect/source/draw/CMXImportFilter.cxx
index d3ae6ff..9d53df3 100644
--- a/writerperfect/source/draw/CMXImportFilter.cxx
+++ b/writerperfect/source/draw/CMXImportFilter.cxx
@@ -145,14 +145,14 @@ throw( com::sun::star::uno::RuntimeException )
 WPXSvInputStream input( xInputStream );
 
 if (libcdr::CMXDocument::isSupported(input))
-sTypeName = OUString( draw_Corel_Presentation_Exchange );
+sTypeName = draw_Corel_Presentation_Exchange;
 
 if (sTypeName.getLength())
 {
 if ( location == Descriptor.getLength() )
 {
 Descriptor.realloc(nLength+1);
-Descriptor[location].Name = ::rtl::OUString( TypeName );
+Descriptor[location].Name = TypeName;
 }
 
 Descriptor[location].Value =sTypeName;
diff --git a/writerperfect/source/draw/MSPUBImportFilter.cxx 
b/writerperfect/source/draw/MSPUBImportFilter.cxx
index 49af07d..5f886ab 100644
--- a/writerperfect/source/draw/MSPUBImportFilter.cxx
+++ b/writerperfect/source/draw/MSPUBImportFilter.cxx
@@ -141,14 +141,14 @@ throw( com::sun::star::uno::RuntimeException )
 WPXSvInputStream input( xInputStream );
 
 if (libmspub::MSPUBDocument::isSupported(input))
-sTypeName = OUString( draw_Publisher_Document );
+sTypeName = draw_Publisher_Document;
 
 if (sTypeName.getLength())
 {
 if ( location == Descriptor.getLength() )
 {
 Descriptor.realloc(nLength+1);
-Descriptor[location].Name = ::rtl::OUString( TypeName );
+Descriptor[location].Name = TypeName;
 }
 
 Descriptor[location].Value =sTypeName;
diff --git a/writerperfect/source/draw/VisioImportFilter.cxx 
b/writerperfect/source/draw/VisioImportFilter.cxx
index 1a601b0..291f358 100644
--- a/writerperfect/source/draw/VisioImportFilter.cxx
+++ b/writerperfect/source/draw/VisioImportFilter.cxx
@@ -141,14 +141,14 @@ throw( com::sun::star::uno::RuntimeException )
 WPXSvInputStream input( xInputStream );
 
 if (libvisio::VisioDocument::isSupported(input))
-sTypeName = OUString( draw_Visio_Document );
+sTypeName = draw_Visio_Document;
 
 if (!sTypeName.isEmpty())
 {
 if ( location == Descriptor.getLength() )
 {
 Descriptor.realloc(nLength+1);
-Descriptor[location].Name = ::rtl::OUString( TypeName );
+Descriptor[location].Name = TypeName;
 }
 
 Descriptor[location].Value =sTypeName;
diff --git a/writerperfect/source/draw/WPGImportFilter.cxx 
b/writerperfect/source/draw/WPGImportFilter.cxx
index f8e654c..7538ee9 100644
--- a/writerperfect/source/draw/WPGImportFilter.cxx
+++ b/writerperfect/source/draw/WPGImportFilter.cxx
@@ -146,14 +146,14 @@ throw( com::sun::star::uno::RuntimeException )
 WPXSvInputStream input( xInputStream );
 
 if (libwpg::WPGraphics::isSupported(input))
-sTypeName = OUString(  draw_WordPerfect_Graphics  );
+sTypeName = draw_WordPerfect_Graphics;
 
 if (!sTypeName.isEmpty())
 {
 if ( location == Descriptor.getLength() )
 {
 Descriptor.realloc(nLength+1);
-Descriptor[location].Name = ::rtl::OUString(TypeName);
+Descriptor[location].Name = TypeName;
 

[Libreoffice-commits] .: writerperfect/source

2012-08-07 Thread Brennan Vincent
 writerperfect/source/filter/OdgGenerator.cxx |   30 +++
 1 file changed, 30 insertions(+)

New commits:
commit 1386ccc8edf467d69ebb4a06ea5f55940cf4024f
Author: Brennan Vincent brenn...@email.arizona.edu
Date:   Mon Aug 6 12:08:52 2012 -0700

Pass rgb/contrast/brightness filters through writerperfect to ODG

Change-Id: I2881e1b3439e52c1008d9d50d00c897ddc81071f

diff --git a/writerperfect/source/filter/OdgGenerator.cxx 
b/writerperfect/source/filter/OdgGenerator.cxx
index 1d333c7..f873343 100644
--- a/writerperfect/source/filter/OdgGenerator.cxx
+++ b/writerperfect/source/filter/OdgGenerator.cxx
@@ -1084,6 +1084,21 @@ void OdgGenerator::drawGraphicObject(const 
::WPXPropertyList propList, const ::
 mpImpl-mxStyle.insert(style:mirror, horizontal);
 else
 mpImpl-mxStyle.insert(style:mirror, none);
+if (propList[draw:color-mode])
+mpImpl-mxStyle.insert(draw:color-mode, 
propList[draw:color-mode]-getStr());
+if (propList[draw:luminance])
+mpImpl-mxStyle.insert(draw:luminance, 
propList[draw:luminance]-getStr());
+if (propList[draw:contrast])
+mpImpl-mxStyle.insert(draw:contrast, 
propList[draw:contrast]-getStr());
+if (propList[draw:gamma])
+mpImpl-mxStyle.insert(draw:gamma, propList[draw:gamma]-getStr());
+if (propList[draw:red])
+mpImpl-mxStyle.insert(draw:red, propList[draw:red]-getStr());
+if (propList[draw:green])
+mpImpl-mxStyle.insert(draw:green, propList[draw:green]-getStr());
+if (propList[draw:blue])
+mpImpl-mxStyle.insert(draw:blue, propList[draw:blue]-getStr());
+
 
 mpImpl-_writeGraphicsStyle();
 
@@ -1380,6 +1395,21 @@ void OdgGeneratorPrivate::_writeGraphicsStyle()
 
 TagOpenElement *pStyleGraphicsPropertiesElement = new 
TagOpenElement(style:graphic-properties);
 
+if (mxStyle[draw:color-mode]  
mxStyle[draw:color-mode]-getStr().len()  0)
+pStyleGraphicsPropertiesElement-addAttribute(draw:color-mode, 
mxStyle[draw:color-mode]-getStr());
+if (mxStyle[draw:luminance]  mxStyle[draw:luminance]-getStr().len() 
 0)
+pStyleGraphicsPropertiesElement-addAttribute(draw:luminance, 
mxStyle[draw:luminance]-getStr());
+if (mxStyle[draw:contrast]  mxStyle[draw:contrast]-getStr().len()  
0)
+pStyleGraphicsPropertiesElement-addAttribute(draw:contrast, 
mxStyle[draw:contrast]-getStr());
+if (mxStyle[draw:gamma]  mxStyle[draw:gamma]-getStr().len()  0)
+pStyleGraphicsPropertiesElement-addAttribute(draw:gamma, 
mxStyle[draw:gamma]-getStr());
+if (mxStyle[draw:red]  mxStyle[draw:red]-getStr().len()  0)
+pStyleGraphicsPropertiesElement-addAttribute(draw:red, 
mxStyle[draw:red]-getStr());
+if (mxStyle[draw:green]  mxStyle[draw:green]-getStr().len()  0)
+pStyleGraphicsPropertiesElement-addAttribute(draw:green, 
mxStyle[draw:green]-getStr());
+if (mxStyle[draw:blue]  mxStyle[draw:blue]-getStr().len()  0)
+pStyleGraphicsPropertiesElement-addAttribute(draw:blue, 
mxStyle[draw:blue]-getStr());
+
 if (mxStyle[draw:stroke]  mxStyle[draw:stroke]-getStr() == none)
 pStyleGraphicsPropertiesElement-addAttribute(draw:stroke, none);
 else
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: writerperfect/source

2012-07-05 Thread Fridrich Strba
 writerperfect/source/draw/CDRImportFilter.cxx   |   12 ++--
 writerperfect/source/draw/CMXImportFilter.cxx   |   12 ++--
 writerperfect/source/draw/MSPUBImportFilter.cxx |   12 ++--
 writerperfect/source/draw/VisioImportFilter.cxx |   12 ++--
 4 files changed, 24 insertions(+), 24 deletions(-)

New commits:
commit 14ca2a853cde386bea8cf8bf45d803933592aeaf
Author: Fridrich Å trba fridrich.st...@bluewin.ch
Date:   Fri Jul 6 00:36:13 2012 +0200

Bin RTL_CONSTASCII_USTRINGPARAM

Change-Id: Idba2f900f962da57f9e9254b71b68f9b64f6ba6c

diff --git a/writerperfect/source/draw/CDRImportFilter.cxx 
b/writerperfect/source/draw/CDRImportFilter.cxx
index 431b18d..7fc2288 100644
--- a/writerperfect/source/draw/CDRImportFilter.cxx
+++ b/writerperfect/source/draw/CDRImportFilter.cxx
@@ -86,7 +86,7 @@ throw (RuntimeException)
 sFileName = OUStringToOString(sURL, RTL_TEXTENCODING_INFO_ASCII);
 
 // An XML import service: what we push sax messages to..
-OUString sXMLImportService ( RTL_CONSTASCII_USTRINGPARAM ( 
com.sun.star.comp.Draw.XMLOasisImporter ) );
+OUString sXMLImportService ( com.sun.star.comp.Draw.XMLOasisImporter );
 Reference  XDocumentHandler  xInternalHandler( 
comphelper::ComponentContext( mxContext ).createComponent( sXMLImportService ), 
UNO_QUERY );
 
 // The XImporter sets up an empty target document for XDocumentHandler to 
write to..
@@ -145,14 +145,14 @@ throw( com::sun::star::uno::RuntimeException )
 WPXSvInputStream input( xInputStream );
 
 if (libcdr::CDRDocument::isSupported(input))
-sTypeName = OUString( RTL_CONSTASCII_USTRINGPARAM ( 
draw_CorelDraw_Document ) );
+sTypeName = OUString( draw_CorelDraw_Document );
 
 if (sTypeName.getLength())
 {
 if ( location == Descriptor.getLength() )
 {
 Descriptor.realloc(nLength+1);
-Descriptor[location].Name = 
::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(TypeName));
+Descriptor[location].Name = ::rtl::OUString( TypeName );
 }
 
 Descriptor[location].Value =sTypeName;
@@ -190,7 +190,7 @@ throw (RuntimeException)
 #ifdef DEBUG
 std::cerr  CDRImportFilter_getImplementationName  std::endl;
 #endif
-return OUString ( RTL_CONSTASCII_USTRINGPARAM ( 
com.sun.star.comp.Draw.CDRImportFilter ) );
+return OUString ( com.sun.star.comp.Draw.CDRImportFilter );
 }
 
 #define SERVICE_NAME1 com.sun.star.document.ImportFilter
@@ -211,8 +211,8 @@ throw (RuntimeException)
 #endif
 Sequence  OUString  aRet(2);
 OUString *pArray = aRet.getArray();
-pArray[0] =  OUString ( RTL_CONSTASCII_USTRINGPARAM ( SERVICE_NAME1 ) );
-pArray[1] =  OUString ( RTL_CONSTASCII_USTRINGPARAM ( SERVICE_NAME2 ) );
+pArray[0] =  OUString ( SERVICE_NAME1 );
+pArray[1] =  OUString ( SERVICE_NAME2 );
 return aRet;
 }
 #undef SERVICE_NAME2
diff --git a/writerperfect/source/draw/CMXImportFilter.cxx 
b/writerperfect/source/draw/CMXImportFilter.cxx
index 1658c36..d3ae6ff 100644
--- a/writerperfect/source/draw/CMXImportFilter.cxx
+++ b/writerperfect/source/draw/CMXImportFilter.cxx
@@ -86,7 +86,7 @@ throw (RuntimeException)
 sFileName = OUStringToOString(sURL, RTL_TEXTENCODING_INFO_ASCII);
 
 // An XML import service: what we push sax messages to..
-OUString sXMLImportService ( RTL_CONSTASCII_USTRINGPARAM ( 
com.sun.star.comp.Draw.XMLOasisImporter ) );
+OUString sXMLImportService ( com.sun.star.comp.Draw.XMLOasisImporter );
 Reference  XDocumentHandler  xInternalHandler( 
comphelper::ComponentContext( mxContext ).createComponent( sXMLImportService ), 
UNO_QUERY );
 
 // The XImporter sets up an empty target document for XDocumentHandler to 
write to..
@@ -145,14 +145,14 @@ throw( com::sun::star::uno::RuntimeException )
 WPXSvInputStream input( xInputStream );
 
 if (libcdr::CMXDocument::isSupported(input))
-sTypeName = OUString( RTL_CONSTASCII_USTRINGPARAM ( 
draw_Corel_Presentation_Exchange ) );
+sTypeName = OUString( draw_Corel_Presentation_Exchange );
 
 if (sTypeName.getLength())
 {
 if ( location == Descriptor.getLength() )
 {
 Descriptor.realloc(nLength+1);
-Descriptor[location].Name = 
::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(TypeName));
+Descriptor[location].Name = ::rtl::OUString( TypeName );
 }
 
 Descriptor[location].Value =sTypeName;
@@ -190,7 +190,7 @@ throw (RuntimeException)
 #ifdef DEBUG
 std::cerr  CMXImportFilter_getImplementationName  std::endl;
 #endif
-return OUString ( RTL_CONSTASCII_USTRINGPARAM ( 
com.sun.star.comp.Draw.CMXImportFilter ) );
+return OUString ( com.sun.star.comp.Draw.CMXImportFilter );
 }
 
 #define SERVICE_NAME1 com.sun.star.document.ImportFilter
@@ -211,8 +211,8 @@ throw (RuntimeException)
 #endif
 Sequence  OUString  aRet(2);
 OUString *pArray = aRet.getArray();
-pArray[0] =  OUString ( RTL_CONSTASCII_USTRINGPARAM ( 

[Libreoffice-commits] .: writerperfect/source

2012-07-04 Thread Fridrich Strba
 writerperfect/source/filter/DocumentHandler.hxx |6 --
 writerperfect/source/stream/WPXSvStream.h   |   12 +---
 2 files changed, 1 insertion(+), 17 deletions(-)

New commits:
commit 7989bba5b65b6fd27fb99197087456da0b2eee17
Author: Fridrich Å trba fridrich.st...@bluewin.ch
Date:   Wed Jul 4 20:56:08 2012 +0200

No need to suppress warnings anymore

The corresponding classes in libwpd-0.9.x have virtual destructor
if they have virtual functions.

Change-Id: Ibf97b45e7ce7d5949ac8bea0a8c204b548f567e4

diff --git a/writerperfect/source/filter/DocumentHandler.hxx 
b/writerperfect/source/filter/DocumentHandler.hxx
index 13dac59..d781f30 100644
--- a/writerperfect/source/filter/DocumentHandler.hxx
+++ b/writerperfect/source/filter/DocumentHandler.hxx
@@ -22,13 +22,7 @@
 
 #include com/sun/star/xml/sax/XDocumentHandler.hpp
 
-#if defined _MSC_VER
-#pragma warning( push, 1 )
-#endif
 #include libwpd/libwpd.h
-#if defined _MSC_VER
-#pragma warning( pop )
-#endif
 
 #include OdfDocumentHandler.hxx
 
diff --git a/writerperfect/source/stream/WPXSvStream.h 
b/writerperfect/source/stream/WPXSvStream.h
index 6206a00..248e081 100644
--- a/writerperfect/source/stream/WPXSvStream.h
+++ b/writerperfect/source/stream/WPXSvStream.h
@@ -4,19 +4,9 @@
 
 #include sot/storage.hxx
 #include com/sun/star/io/XInputStream.hpp
-
-#ifndef _COM_SUN_STAR_IO_XINPUTSTREAM_H_
 #include com/sun/star/io/XSeekable.hpp
-#endif
-
 
-#if defined _MSC_VER
-#pragma warning( push, 1 )
-#endif
-#include libwpd-stream/WPXStream.h
-#if defined _MSC_VER
-#pragma warning( pop )
-#endif
+#include libwpd-stream/libwpd-stream.h
 
 typedef struct
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: writerperfect/source

2012-07-04 Thread Fridrich Strba
 writerperfect/source/writer/WordPerfectImportFilter.cxx |   54 
 1 file changed, 27 insertions(+), 27 deletions(-)

New commits:
commit 0be0cc0e50fa6c4161d6f71964ec90ba579026ac
Author: Fridrich Å trba fridrich.st...@bluewin.ch
Date:   Wed Jul 4 22:42:04 2012 +0200

Targeted cleanup of namespaces

Change-Id: I9e3449b44ff47f77f72da398c4f651519b824bfd

diff --git a/writerperfect/source/writer/WordPerfectImportFilter.cxx 
b/writerperfect/source/writer/WordPerfectImportFilter.cxx
index bb9fb07..7dfddb5 100644
--- a/writerperfect/source/writer/WordPerfectImportFilter.cxx
+++ b/writerperfect/source/writer/WordPerfectImportFilter.cxx
@@ -54,10 +54,9 @@
 #include stream/WPXSvStream.h
 #include WordPerfectImportFilter.hxx
 
-using namespace ::com::sun::star;
-
-using rtl::OString;
-using rtl::OUString;
+using ::rtl::OString;
+using ::rtl::OUString;
+using ::ucbhelper::Content;
 using com::sun::star::uno::Sequence;
 using com::sun::star::uno::Reference;
 using com::sun::star::uno::Any;
@@ -65,6 +64,7 @@ using com::sun::star::uno::UNO_QUERY;
 using com::sun::star::uno::XInterface;
 using com::sun::star::uno::Exception;
 using com::sun::star::uno::RuntimeException;
+using com::sun::star::uno::XComponentContext;
 using com::sun::star::beans::PropertyValue;
 using com::sun::star::document::XFilter;
 using com::sun::star::document::XExtendedFilterDetection;
@@ -77,7 +77,7 @@ using com::sun::star::xml::sax::XAttributeList;
 using com::sun::star::xml::sax::XDocumentHandler;
 using com::sun::star::xml::sax::XParser;
 
-void callHandler(uno::Reference  XDocumentHandler  xDocHandler);
+void callHandler(Reference  XDocumentHandler  xDocHandler);
 
 
 static bool handleEmbeddedWPGObject(const WPXBinaryData data, 
OdfDocumentHandler *pHandler,  const OdfStreamType streamType)
@@ -116,7 +116,7 @@ throw (RuntimeException)
 sal_Int32 nLength = aDescriptor.getLength();
 const PropertyValue *pValue = aDescriptor.getConstArray();
 OUString sURL;
-uno::Reference  XInputStream  xInputStream;
+Reference  XInputStream  xInputStream;
 for ( sal_Int32 i = 0 ; i  nLength; i++)
 {
 if ( pValue[i].Name == InputStream )
@@ -162,7 +162,7 @@ throw (RuntimeException)
 Reference  XDocumentHandler  xInternalHandler( 
comphelper::ComponentContext( mxContext ).createComponent( sXMLImportService ), 
UNO_QUERY );
 
 // The XImporter sets up an empty target document for XDocumentHandler to 
write to..
-uno::Reference  XImporter  xImporter(xInternalHandler, UNO_QUERY);
+Reference  XImporter  xImporter(xInternalHandler, UNO_QUERY);
 xImporter-setTargetDocument(mxDoc);
 
 // OO Document Handler: abstract class to handle document SAX messages, 
concrete implementation here
@@ -190,7 +190,7 @@ throw (RuntimeException)
 }
 
 // XImporter
-void SAL_CALL WordPerfectImportFilter::setTargetDocument( const 
uno::Reference ::com::sun::star::lang::XComponent  xDoc )
+void SAL_CALL WordPerfectImportFilter::setTargetDocument( const Reference 
::com::sun::star::lang::XComponent  xDoc )
 throw (::com::sun::star::lang::IllegalArgumentException, RuntimeException)
 {
 WRITER_DEBUG_MSG((WordPerfectImportFilter::getTargetDocument: Got 
here!\n));
@@ -198,8 +198,8 @@ throw (::com::sun::star::lang::IllegalArgumentException, 
RuntimeException)
 }
 
 // XExtendedFilterDetection
-OUString SAL_CALL WordPerfectImportFilter::detect( uno::Sequence 
PropertyValue  Descriptor )
-throw( uno::RuntimeException )
+OUString SAL_CALL WordPerfectImportFilter::detect( Sequence PropertyValue  
Descriptor )
+throw( RuntimeException )
 {
 WRITER_DEBUG_MSG((WordPerfectImportFilter::detect: Got here!\n));
 
@@ -209,7 +209,7 @@ throw( uno::RuntimeException )
 sal_Int32 location = nLength;
 OUString sURL;
 const PropertyValue *pValue = Descriptor.getConstArray();
-uno::Reference  XInputStream  xInputStream;
+Reference  XInputStream  xInputStream;
 for ( sal_Int32 i = 0 ; i  nLength; i++)
 {
 if ( pValue[i].Name == TypeName )
@@ -220,13 +220,13 @@ throw( uno::RuntimeException )
 pValue[i].Value = sURL;
 }
 
-uno::Reference com::sun::star::ucb::XCommandEnvironment  xEnv;
+Reference com::sun::star::ucb::XCommandEnvironment  xEnv;
 if (!xInputStream.is())
 {
 try
 {
-::ucbhelper::Content aContent(sURL, xEnv);
-xInputStream = aContent.openStream();
+Content aContent(sURL, xEnv);
+xInputStream = aContent.openStream();
 }
 catch ( ... )
 {
@@ -308,7 +308,7 @@ throw (RuntimeException)
 #undef SERVICE_NAME2
 #undef SERVICE_NAME1
 
-uno::Reference XInterface  SAL_CALL WordPerfectImportFilter_createInstance( 
const uno::Reference uno::XComponentContext   rContext)
+Reference XInterface  SAL_CALL WordPerfectImportFilter_createInstance( const 
Reference XComponentContext   rContext)
 throw( Exception )
 {
 return (cppu::OWeakObject *) new 

[Libreoffice-commits] .: writerperfect/source

2012-05-30 Thread Fridrich Strba
 writerperfect/source/filter/OdgGenerator.cxx |   19 +++
 1 file changed, 15 insertions(+), 4 deletions(-)

New commits:
commit 6c1107ad8fd6375ed02906e8700c24b471df2d97
Author: Brennan Vincent brenn...@email.arizona.edu
Date:   Tue May 29 19:17:51 2012 -0700

Handle opacity in gradients

Signed-off-by: Fridrich Å trba fridrich.st...@bluewin.ch

diff --git a/writerperfect/source/filter/OdgGenerator.cxx 
b/writerperfect/source/filter/OdgGenerator.cxx
index da6d64d..9704389 100644
--- a/writerperfect/source/filter/OdgGenerator.cxx
+++ b/writerperfect/source/filter/OdgGenerator.cxx
@@ -1347,16 +1347,27 @@ void OdgGeneratorPrivate::_writeGraphicsStyle()
 if (mxStyle[svg:cy])
 pDrawGradientElement-addAttribute(draw:cy, 
mxStyle[svg:cy]-getStr());
 if (mxGradient[1][svg:stop-opacity])
-pDrawGradientElement-addAttribute(draw:start-intensity, 
mxGradient[1][svg:stop-opacity]-getStr());
+{
+pDrawOpacityElement-addAttribute(draw:start, 
mxGradient[1][svg:stop-opacity]-getStr());
+bUseOpacityGradient = true;
+}
 else
-pDrawGradientElement-addAttribute(draw:start-intensity, 
100%);
+pDrawOpacityElement-addAttribute(draw:start, 100%);
 if (mxGradient[0][svg:stop-opacity])
-pDrawGradientElement-addAttribute(draw:end-intensity, 
mxGradient[0][svg:stop-opacity]-getStr());
+{
+pDrawOpacityElement-addAttribute(draw:end, 
mxGradient[0][svg:stop-opacity]-getStr());
+bUseOpacityGradient = true;
+}
 else
-pDrawGradientElement-addAttribute(draw:end-intensity, 
100%);
+pDrawOpacityElement-addAttribute(draw:end, 100%);
 pDrawGradientElement-addAttribute(draw:border, 0%);
 mGraphicsGradientStyles.push_back(pDrawGradientElement);
 mGraphicsGradientStyles.push_back(new 
TagCloseElement(draw:gradient));
+if (bUseOpacityGradient)
+{
+mGraphicsGradientStyles.push_back(pDrawOpacityElement);
+mGraphicsGradientStyles.push_back(new 
TagCloseElement(draw:opacity));
+}
 }
 
 if(!bUseOpacityGradient)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: writerperfect/source

2012-05-25 Thread Fridrich Strba
 writerperfect/source/stream/WPXSvStream.cxx |   46 +++-
 writerperfect/source/stream/WPXSvStream.h   |4 +-
 2 files changed, 40 insertions(+), 10 deletions(-)

New commits:
commit 02c61b924d4687477e4818e1f8682e2f9f4a753c
Author: Fridrich Å trba fridrich.st...@bluewin.ch
Date:   Fri May 25 12:14:05 2012 +0200

Allow WPXSvStream to read stream in a hierarchy of substorages

Change-Id: I8f9726e3e93a16d59f0e3c24783a98f4b9edd692

diff --git a/writerperfect/source/stream/WPXSvStream.cxx 
b/writerperfect/source/stream/WPXSvStream.cxx
index 762220c..58c0544 100644
--- a/writerperfect/source/stream/WPXSvStream.cxx
+++ b/writerperfect/source/stream/WPXSvStream.cxx
@@ -9,10 +9,20 @@
 using namespace ::com::sun::star::uno;
 using namespace ::com::sun::star::io;
 
+namespace
+{
+static void splitPath( std::vectorrtl::OUString rElems, const 
::rtl::OUString rPath )
+{
+for (sal_Int32 i = 0; i = 0;)
+rElems.push_back( rPath.getToken( 0, '/', i ) );
+}
+
+} // anonymous namespace
+
 WPXSvInputStream::WPXSvInputStream( Reference XInputStream  xStream ) :
 WPXInputStream(),
-mxChildStorage(),
-mxChildStream(),
+mxChildrenStorages(),
+mxChildrenStreams(),
 mxStream(xStream),
 mxSeekable(xStream, UNO_QUERY),
 maData(0)
@@ -133,6 +143,12 @@ bool WPXSvInputStream::isOLEStream()
 
 WPXInputStream *WPXSvInputStream::getDocumentOLEStream(const char *name)
 {
+if (!name)
+return 0;
+rtl::OUString rPath(name,strlen(name),RTL_TEXTENCODING_UTF8);
+std::vectorrtl::OUString aElems;
+splitPath( aElems, rPath );
+
 if ((mnLength == 0) || !mxStream.is() || !mxSeekable.is())
 return 0;
 
@@ -147,21 +163,35 @@ WPXInputStream 
*WPXSvInputStream::getDocumentOLEStream(const char *name)
 return 0;
 }
 
-mxChildStorage = new SotStorage( pStream, sal_True );
+mxChildrenStorages.push_back(new SotStorage( pStream, sal_True ));
+
+unsigned i = 0;
+while (i  aElems.size())
+{
+if( mxChildrenStorages.back()-IsStream(aElems[i]))
+break;
+else if (mxChildrenStorages.back()-IsStorage(aElems[i]))
+{
+SotStorageRef tmpParent(mxChildrenStorages.back());
+
mxChildrenStorages.push_back(tmpParent-OpenSotStorage(aElems[i++], 
STREAM_STD_READ));
+}
+else
+// should not happen
+return 0;
+}
 
-mxChildStream = mxChildStorage-OpenSotStream(
-rtl::OUString::createFromAscii( name ),
-STREAM_STD_READ );
+mxChildrenStreams.push_back( mxChildrenStorages.back()-OpenSotStream(
+ aElems[i], STREAM_STD_READ ));
 
 mxSeekable-seek(tmpPosition);
 
-if ( !mxChildStream.Is() || mxChildStream-GetError() )
+if ( !mxChildrenStreams.back().Is() || 
mxChildrenStreams.back()-GetError() )
 {
 mxSeekable-seek(tmpPosition);
 return 0;
 }
 
-Reference  XInputStream  xContents(new utl::OSeekableInputStreamWrapper( 
mxChildStream ));
+Reference  XInputStream  xContents(new utl::OSeekableInputStreamWrapper( 
mxChildrenStreams.back() ));
 mxSeekable-seek(tmpPosition);
 if (xContents.is())
 return new WPXSvInputStream( xContents );
diff --git a/writerperfect/source/stream/WPXSvStream.h 
b/writerperfect/source/stream/WPXSvStream.h
index 37d905a..2e9dc09 100644
--- a/writerperfect/source/stream/WPXSvStream.h
+++ b/writerperfect/source/stream/WPXSvStream.h
@@ -34,8 +34,8 @@ public:
 virtual bool atEOS();
 
 private:
-SotStorageRef   mxChildStorage;
-SotStorageStreamRef mxChildStream;
+std::vector SotStorageRef  mxChildrenStorages;
+std::vector SotStorageStreamRef  mxChildrenStreams;
 ::com::sun::star::uno::Reference
 ::com::sun::star::io::XInputStream  mxStream;
 ::com::sun::star::uno::Reference
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: writerperfect/source

2012-05-25 Thread Fridrich Strba
 writerperfect/source/stream/WPXSvStream.cxx |6 ++
 1 file changed, 6 insertions(+)

New commits:
commit c7e71b31bd7b042da6aeda80bc92933e91533c1d
Author: Fridrich Å trba fridrich.st...@bluewin.ch
Date:   Fri May 25 12:54:14 2012 +0200

Don't get out of bonds

Change-Id: Ifd743fe59d468b3d89c95f4963a038068cf34629

diff --git a/writerperfect/source/stream/WPXSvStream.cxx 
b/writerperfect/source/stream/WPXSvStream.cxx
index 58c0544..d71e155 100644
--- a/writerperfect/source/stream/WPXSvStream.cxx
+++ b/writerperfect/source/stream/WPXSvStream.cxx
@@ -180,6 +180,12 @@ WPXInputStream 
*WPXSvInputStream::getDocumentOLEStream(const char *name)
 return 0;
 }
 
+// For the while don't return stream in this situation.
+// Later, given how libcdr's zip stream implementation behaves,
+// return the first stream in the storage if there is one.
+if (i = aElems.size())
+return 0;
+
 mxChildrenStreams.push_back( mxChildrenStorages.back()-OpenSotStream(
  aElems[i], STREAM_STD_READ ));
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: writerperfect/source

2012-05-25 Thread Fridrich Strba
 writerperfect/source/stream/WPXSvStream.cxx |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

New commits:
commit 70d473c07d79dc59a69f6cc725c026eacdc12c2a
Author: Fridrich Å trba fridrich.st...@bluewin.ch
Date:   Fri May 25 15:22:30 2012 +0200

Blind Hail Mary trying to solve tinderbox breakages

Change-Id: Ic69195e2ae991cf837c3dcfb086d9834f99b2d40

diff --git a/writerperfect/source/stream/WPXSvStream.cxx 
b/writerperfect/source/stream/WPXSvStream.cxx
index d71e155..7039b42 100644
--- a/writerperfect/source/stream/WPXSvStream.cxx
+++ b/writerperfect/source/stream/WPXSvStream.cxx
@@ -173,7 +173,7 @@ WPXInputStream 
*WPXSvInputStream::getDocumentOLEStream(const char *name)
 else if (mxChildrenStorages.back()-IsStorage(aElems[i]))
 {
 SotStorageRef tmpParent(mxChildrenStorages.back());
-
mxChildrenStorages.push_back(tmpParent-OpenSotStorage(aElems[i++], 
STREAM_STD_READ));
+
mxChildrenStorages.push_back(static_castSotStorageRef(tmpParent-OpenSotStorage(aElems[i++],
 STREAM_STD_READ)));
 }
 else
 // should not happen
@@ -186,8 +186,8 @@ WPXInputStream 
*WPXSvInputStream::getDocumentOLEStream(const char *name)
 if (i = aElems.size())
 return 0;
 
-mxChildrenStreams.push_back( mxChildrenStorages.back()-OpenSotStream(
- aElems[i], STREAM_STD_READ ));
+mxChildrenStreams.push_back( 
static_castSotStorageStreamRef(mxChildrenStorages.back()-OpenSotStream(
+ aElems[i], STREAM_STD_READ )));
 
 mxSeekable-seek(tmpPosition);
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: writerperfect/source

2012-04-26 Thread Fridrich Strba
 writerperfect/source/draw/CMXImportFilter.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit cdacce4e4b1ab6f06b809e21152c39103404a5f4
Author: Fridrich Å trba fridrich.st...@bluewin.ch
Date:   Thu Apr 26 11:47:21 2012 +0200

Fix a CP error

diff --git a/writerperfect/source/draw/CMXImportFilter.cxx 
b/writerperfect/source/draw/CMXImportFilter.cxx
index 83f161b..e1cf06c 100644
--- a/writerperfect/source/draw/CMXImportFilter.cxx
+++ b/writerperfect/source/draw/CMXImportFilter.cxx
@@ -164,7 +164,7 @@ throw( com::sun::star::uno::RuntimeException )
 WPXSvInputStream input( xInputStream );
 
 if (libcdr::CMXDocument::isSupported(input))
-sTypeName = OUString( RTL_CONSTASCII_USTRINGPARAM ( 
draw_CorelDraw_Document ) );
+sTypeName = OUString( RTL_CONSTASCII_USTRINGPARAM ( 
draw_Corel_Presentation_Exchange ) );
 
 if (sTypeName.getLength())
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: writerperfect/source writerperfect/util

2012-04-19 Thread Fridrich Strba
 writerperfect/source/cdrimp/cdrimport_genericfilter.cxx   |2 +-
 writerperfect/source/vsdimp/visioimport_genericfilter.cxx |2 +-
 writerperfect/source/wpdimp/wpft_genericfilter.cxx|2 +-
 writerperfect/source/wpgimp/wpgimport_genericfilter.cxx   |2 +-
 writerperfect/source/wpsimp/msworks_genericfilter.cxx |2 +-
 writerperfect/util/cdrfilter.component|2 +-
 writerperfect/util/msworksfilter.component|2 +-
 writerperfect/util/visiofilter.component  |2 +-
 writerperfect/util/wpft.component |2 +-
 writerperfect/util/wpgfilter.component|2 +-
 10 files changed, 10 insertions(+), 10 deletions(-)

New commits:
commit d77b839868491d2d97081be9592e7860fcdea063
Author: Fridrich Å trba fridrich.st...@bluewin.ch
Date:   Thu Apr 19 12:00:15 2012 +0200

Prefix the UNO components in writerperfect

diff --git a/writerperfect/source/cdrimp/cdrimport_genericfilter.cxx 
b/writerperfect/source/cdrimp/cdrimport_genericfilter.cxx
index ced5137..5612610 100644
--- a/writerperfect/source/cdrimp/cdrimport_genericfilter.cxx
+++ b/writerperfect/source/cdrimp/cdrimport_genericfilter.cxx
@@ -42,7 +42,7 @@ using namespace ::com::sun::star::registry;
 
 extern C
 {
-SAL_DLLPUBLIC_EXPORT void *SAL_CALL component_getFactory(
+SAL_DLLPUBLIC_EXPORT void *SAL_CALL cdrfilter_component_getFactory(
 const sal_Char *pImplName, void *pServiceManager, void * /* 
pRegistryKey */ )
 {
 void *pRet = 0;
diff --git a/writerperfect/source/vsdimp/visioimport_genericfilter.cxx 
b/writerperfect/source/vsdimp/visioimport_genericfilter.cxx
index bfed51a..04172b0 100644
--- a/writerperfect/source/vsdimp/visioimport_genericfilter.cxx
+++ b/writerperfect/source/vsdimp/visioimport_genericfilter.cxx
@@ -41,7 +41,7 @@ using namespace ::com::sun::star::registry;
 
 extern C
 {
-SAL_DLLPUBLIC_EXPORT void *SAL_CALL component_getFactory(
+SAL_DLLPUBLIC_EXPORT void *SAL_CALL visiofilter_component_getFactory(
 const sal_Char *pImplName, void *pServiceManager, void * /* 
pRegistryKey */ )
 {
 void *pRet = 0;
diff --git a/writerperfect/source/wpdimp/wpft_genericfilter.cxx 
b/writerperfect/source/wpdimp/wpft_genericfilter.cxx
index 8e3534b..5e0f141 100644
--- a/writerperfect/source/wpdimp/wpft_genericfilter.cxx
+++ b/writerperfect/source/wpdimp/wpft_genericfilter.cxx
@@ -40,7 +40,7 @@ using namespace ::com::sun::star::registry;
 
 extern C
 {
-SAL_DLLPUBLIC_EXPORT void *SAL_CALL component_getFactory(
+SAL_DLLPUBLIC_EXPORT void *SAL_CALL wpft_component_getFactory(
 const sal_Char *pImplName, void *pServiceManager, void * /* 
pRegistryKey */ )
 {
 void *pRet = 0;
diff --git a/writerperfect/source/wpgimp/wpgimport_genericfilter.cxx 
b/writerperfect/source/wpgimp/wpgimport_genericfilter.cxx
index 2870915..22e99d8 100644
--- a/writerperfect/source/wpgimp/wpgimport_genericfilter.cxx
+++ b/writerperfect/source/wpgimp/wpgimport_genericfilter.cxx
@@ -41,7 +41,7 @@ using namespace ::com::sun::star::registry;
 
 extern C
 {
-SAL_DLLPUBLIC_EXPORT void *SAL_CALL component_getFactory(
+SAL_DLLPUBLIC_EXPORT void *SAL_CALL wpgfilter_component_getFactory(
 const sal_Char *pImplName, void *pServiceManager, void * /* 
pRegistryKey */ )
 {
 void *pRet = 0;
diff --git a/writerperfect/source/wpsimp/msworks_genericfilter.cxx 
b/writerperfect/source/wpsimp/msworks_genericfilter.cxx
index b53707c..ae9c701 100644
--- a/writerperfect/source/wpsimp/msworks_genericfilter.cxx
+++ b/writerperfect/source/wpsimp/msworks_genericfilter.cxx
@@ -41,7 +41,7 @@ using namespace ::com::sun::star::registry;
 
 extern C
 {
-SAL_DLLPUBLIC_EXPORT void *SAL_CALL component_getFactory(
+SAL_DLLPUBLIC_EXPORT void *SAL_CALL msworksfilter_component_getFactory(
 const sal_Char *pImplName, void *pServiceManager, void * /* 
pRegistryKey */ )
 {
 void *pRet = 0;
diff --git a/writerperfect/util/cdrfilter.component 
b/writerperfect/util/cdrfilter.component
index be1e77c..902bf9a 100644
--- a/writerperfect/util/cdrfilter.component
+++ b/writerperfect/util/cdrfilter.component
@@ -1,5 +1,5 @@
 ?xml version=1.0 encoding=UTF-8?
-component loader=com.sun.star.loader.SharedLibrary
+component loader=com.sun.star.loader.SharedLibrary prefix=cdrfilter
 xmlns=http://openoffice.org/2010/uno-components;
   implementation name=com.sun.star.comp.Draw.CDRImportFilter
 service name=com.sun.star.document.ImportFilter/
diff --git a/writerperfect/util/msworksfilter.component 
b/writerperfect/util/msworksfilter.component
index 769eaf3..8fc2120 100644
--- a/writerperfect/util/msworksfilter.component
+++ b/writerperfect/util/msworksfilter.component
@@ -1,5 +1,5 @@
 ?xml version=1.0 encoding=UTF-8?
-component loader=com.sun.star.loader.SharedLibrary
+component loader=com.sun.star.loader.SharedLibrary prefix=msworksfilter
 

[Libreoffice-commits] .: writerperfect/source

2012-04-09 Thread Fridrich Strba
 writerperfect/source/filter/OdgGenerator.cxx |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit c227447b9ab253a1d263b315ad0a7dbba4b08ff1
Author: Fridrich Å trba fridrich.st...@bluewin.ch
Date:   Mon Apr 9 23:49:31 2012 +0200

Write out the groupping

diff --git a/writerperfect/source/filter/OdgGenerator.cxx 
b/writerperfect/source/filter/OdgGenerator.cxx
index 897ce4e..da6d64d 100644
--- a/writerperfect/source/filter/OdgGenerator.cxx
+++ b/writerperfect/source/filter/OdgGenerator.cxx
@@ -805,10 +805,12 @@ void OdgGenerator::setStyle(const ::WPXPropertyList 
propList, const ::WPXProper
 
 void OdgGenerator::startLayer(const ::WPXPropertyList  /* propList */)
 {
+mpImpl-mBodyElements.push_back(new TagOpenElement(draw:g));
 }
 
 void OdgGenerator::endLayer()
 {
+mpImpl-mBodyElements.push_back(new TagCloseElement(draw:g));
 }
 
 void OdgGenerator::drawRectangle(const ::WPXPropertyList propList)
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: writerperfect/source

2012-03-12 Thread Fridrich Strba
 writerperfect/source/filter/OdgGenerator.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 5eee7de29362ecd00d43ed9eb9ed7230606dc92a
Author: Fridrich Å trba fridrich.st...@bluewin.ch
Date:   Mon Mar 12 10:40:10 2012 +0100

CP error

diff --git a/writerperfect/source/filter/OdgGenerator.cxx 
b/writerperfect/source/filter/OdgGenerator.cxx
index dc257a3..897ce4e 100644
--- a/writerperfect/source/filter/OdgGenerator.cxx
+++ b/writerperfect/source/filter/OdgGenerator.cxx
@@ -1484,9 +1484,9 @@ void OdgGeneratorPrivate::_writeGraphicsStyle()
 if (mxStyle[draw:fill-image-ref-point])
 
pStyleGraphicsPropertiesElement-addAttribute(draw:fill-image-ref-point, 
mxStyle[draw:fill-image-ref-point]-getStr());
 if (mxStyle[draw:fill-image-ref-point-x])
-
pStyleGraphicsPropertiesElement-addAttribute(draw:fill-image-ref-point-x, 
mxStyle[draw:fill-image-ref-point]-getStr());
+
pStyleGraphicsPropertiesElement-addAttribute(draw:fill-image-ref-point-x, 
mxStyle[draw:fill-image-ref-point-x]-getStr());
 if (mxStyle[draw:fill-image-ref-point-y])
-
pStyleGraphicsPropertiesElement-addAttribute(draw:fill-image-ref-point-y, 
mxStyle[draw:fill-image-ref-point]-getStr());
+
pStyleGraphicsPropertiesElement-addAttribute(draw:fill-image-ref-point-y, 
mxStyle[draw:fill-image-ref-point-y]-getStr());
 }
 else
 pStyleGraphicsPropertiesElement-addAttribute(draw:fill, none);
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: writerperfect/source

2012-01-30 Thread Fridrich Strba
 writerperfect/source/filter/OdgGenerator.cxx |   14 ++
 1 file changed, 14 insertions(+)

New commits:
commit dc6953f932ffbddd5168f039e58075789b91b98b
Author: Fridrich Å trba fridrich.st...@bluewin.ch
Date:   Mon Jan 30 11:31:32 2012 +0100

Initial support for quadratic beziers

diff --git a/writerperfect/source/filter/OdgGenerator.cxx 
b/writerperfect/source/filter/OdgGenerator.cxx
index 79722e8..6d58aa4 100644
--- a/writerperfect/source/filter/OdgGenerator.cxx
+++ b/writerperfect/source/filter/OdgGenerator.cxx
@@ -858,6 +858,13 @@ void OdgGeneratorPrivate::_drawPath(const 
WPXPropertyListVector path)
 qx = (qx  path[k][svg:x2]-getDouble()) ? 
path[k][svg:x2]-getDouble() : qx;
 qy = (qy  path[k][svg:y2]-getDouble()) ? 
path[k][svg:y2]-getDouble() : qy;
 }
+if(path[k][libwpg:path-action]-getStr() == Q)
+{
+px = (px  path[k][svg:x1]-getDouble()) ? 
path[k][svg:x1]-getDouble() : px;
+py = (py  path[k][svg:y1]-getDouble()) ? 
path[k][svg:y1]-getDouble() : py;
+qx = (qx  path[k][svg:x1]-getDouble()) ? 
path[k][svg:x1]-getDouble() : qx;
+qy = (qy  path[k][svg:y1]-getDouble()) ? 
path[k][svg:y1]-getDouble() : qy;
+}
 if(path[k][libwpg:path-action]-getStr() == A)
 {
 double xmin, xmax, ymin, ymax;
@@ -924,6 +931,13 @@ void OdgGeneratorPrivate::_drawPath(const 
WPXPropertyListVector path)
  
(unsigned)((path[i][svg:y]-getDouble()-py)*2540));
 sValue.append(sElement);
 }
+else if (path[i][libwpg:path-action]-getStr() == Q)
+{
+sElement.sprintf(Q%i %i %i %i, 
(unsigned)((path[i][svg:x1]-getDouble()-px)*2540),
+ 
(unsigned)((path[i][svg:y1]-getDouble()-py)*2540), 
(unsigned)((path[i][svg:x]-getDouble()-px)*2540),
+ 
(unsigned)((path[i][svg:y]-getDouble()-py)*2540));
+sValue.append(sElement);
+}
 else if (path[i][libwpg:path-action]-getStr() == A)
 {
 sElement.sprintf(A%i %i %i %i %i %i %i, 
(unsigned)((path[i][svg:rx]-getDouble())*2540),
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: writerperfect/source

2012-01-17 Thread Fridrich Strba
 writerperfect/source/filter/OdgGenerator.cxx |   43 +--
 1 file changed, 41 insertions(+), 2 deletions(-)

New commits:
commit b350765be4852b8d2dc914a6048a5d273447480a
Author: Fridrich Å trba fridrich.st...@bluewin.ch
Date:   Mon Jan 16 17:32:23 2012 +0100

Implementing text rotations

diff --git a/writerperfect/source/filter/OdgGenerator.cxx 
b/writerperfect/source/filter/OdgGenerator.cxx
index 5681ed5..79722e8 100644
--- a/writerperfect/source/filter/OdgGenerator.cxx
+++ b/writerperfect/source/filter/OdgGenerator.cxx
@@ -1371,10 +1371,27 @@ void OdgGenerator::startTextObject(const 
WPXPropertyList propList, const WPXPro
 pStyleGraphicPropertiesOpenElement-addAttribute(draw:fill, none);
 pStyleGraphicPropertiesOpenElement-addAttribute(draw:fill-color, 
#ff);
 
+double x = 0.0;
+double y = 0.0;
+double height = 0.0;
+double width = 0.0;
 if (propList[svg:x])
-pDrawFrameOpenElement-addAttribute(svg:x, 
propList[svg:x]-getStr());
+x = propList[svg:x]-getDouble();
 if (propList[svg:y])
-pDrawFrameOpenElement-addAttribute(svg:y, 
propList[svg:y]-getStr());
+y = propList[svg:y]-getDouble();
+if (propList[svg:width])
+width = propList[svg:width]-getDouble();
+if (propList[svg:height])
+height = propList[svg:height]-getDouble();
+
+double angle(propList[libwpg:rotate] ? - M_PI * 
propList[libwpg:rotate]-getDouble() / 180.0 : 0.0);
+if (angle != 0.0)
+{
+double deltax((width*cos(angle)+height*sin(angle)-width)/2.0);
+double deltay((-width*sin(angle)+height*cos(angle)-height)/2.0);
+x -= deltax;
+y -= deltay;
+}
 
 if (!propList[svg:width]  !propList[svg:height])
 {
@@ -1452,6 +1469,28 @@ void OdgGenerator::startTextObject(const WPXPropertyList 
propList, const WPXPro
 pDrawFrameOpenElement-addAttribute(draw:opacity, 
propList[draw:opacity]-getStr());
 pStyleGraphicPropertiesOpenElement-addAttribute(draw:opacity, 
propList[draw:opacity]-getStr());
 }
+
+WPXProperty *svg_x = WPXPropertyFactory::newInchProp(x);
+WPXProperty *svg_y = WPXPropertyFactory::newInchProp(y);
+if (angle != 0.0)
+{
+WPXProperty *libwpg_rotate = WPXPropertyFactory::newDoubleProp(angle);
+sValue.sprintf(rotate (%s) translate(%s, %s),
+   libwpg_rotate-getStr().cstr(),
+   svg_x-getStr().cstr(),
+   svg_y-getStr().cstr());
+delete libwpg_rotate;
+pDrawFrameOpenElement-addAttribute(draw:transform, sValue);
+}
+else
+{
+if (propList[svg:x])
+pDrawFrameOpenElement-addAttribute(svg:x, svg_x-getStr());
+if (propList[svg:y])
+pDrawFrameOpenElement-addAttribute(svg:y, svg_y-getStr());
+}
+delete svg_x;
+delete svg_y;
 mpImpl-mBodyElements.push_back(pDrawFrameOpenElement);
 mpImpl-mBodyElements.push_back(new TagOpenElement(draw:text-box));
 
mpImpl-mGraphicsAutomaticStyles.push_back(pStyleGraphicPropertiesOpenElement);
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: writerperfect/source

2012-01-12 Thread Fridrich Strba
 writerperfect/source/filter/OdgGenerator.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit e198eea5a87bff84783bd038cf134e6ea3b764ad
Author: Fridrich Å trba fridrich.st...@bluewin.ch
Date:   Thu Jan 12 15:01:13 2012 +0100

Logical error in writerperfect

diff --git a/writerperfect/source/filter/OdgGenerator.cxx 
b/writerperfect/source/filter/OdgGenerator.cxx
index 584e8cc..fbafb02 100644
--- a/writerperfect/source/filter/OdgGenerator.cxx
+++ b/writerperfect/source/filter/OdgGenerator.cxx
@@ -948,7 +948,7 @@ void OdgGenerator::drawPath(const WPXPropertyListVector 
path)
 
 void OdgGenerator::drawGraphicObject(const ::WPXPropertyList propList, const 
::WPXBinaryData binaryData)
 {
-if (!propList[libwpg:mime-type]  
propList[libwpg:mime-type]-getStr().len() = 0)
+if (!propList[libwpg:mime-type] || 
propList[libwpg:mime-type]-getStr().len() = 0)
 return;
 
 mpImpl-_writeGraphicsStyle();
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: writerperfect/source

2011-12-25 Thread Julien Nabet
 writerperfect/source/filter/TextRunStyle.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 372ea70b5b42504bd42531d9915a2a71a7e30de8
Author: julien julien@julienPC
Date:   Sun Dec 25 13:58:55 2011 +0100

Some cppcheck cleaning

diff --git a/writerperfect/source/filter/TextRunStyle.cxx 
b/writerperfect/source/filter/TextRunStyle.cxx
index 6cc7378..abce545 100644
--- a/writerperfect/source/filter/TextRunStyle.cxx
+++ b/writerperfect/source/filter/TextRunStyle.cxx
@@ -195,7 +195,7 @@ void ParagraphStyleManager::clean()
 void ParagraphStyleManager::write(OdfDocumentHandler *pHandler) const
 {
 for (std::mapWPXString, shared_ptrParagraphStyle, 
ltstr::const_iterator iter = mStyleHash.begin();
-iter != mStyleHash.end(); iter++)
+iter != mStyleHash.end(); ++iter)
 {
 if (strcmp(iter-second-getName().cstr(), Standard) == 0)
 continue;
@@ -254,7 +254,7 @@ void SpanStyleManager::clean()
 void SpanStyleManager::write(OdfDocumentHandler *pHandler) const
 {
 for (std::mapWPXString, shared_ptrSpanStyle, ltstr::const_iterator 
iter = mStyleHash.begin();
-iter != mStyleHash.end(); iter++)
+iter != mStyleHash.end(); ++iter)
 {
 (iter-second)-write(pHandler);
 }
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: writerperfect/source

2011-12-06 Thread Fridrich Strba
 writerperfect/source/filter/OdgGenerator.cxx |   10 --
 writerperfect/source/filter/OdtGenerator.cxx |   13 -
 2 files changed, 16 insertions(+), 7 deletions(-)

New commits:
commit fa22c33794245d64056ed0f7b6260ddd60f9dc70
Author: Fridrich Å trba fridrich.st...@bluewin.ch
Date:   Tue Dec 6 16:14:12 2011 +0100

Allow inserting of ole objects into draw documents

diff --git a/writerperfect/source/filter/OdgGenerator.cxx 
b/writerperfect/source/filter/OdgGenerator.cxx
index f4d68dc..4d70f8d 100644
--- a/writerperfect/source/filter/OdgGenerator.cxx
+++ b/writerperfect/source/filter/OdgGenerator.cxx
@@ -964,7 +964,10 @@ void OdgGenerator::drawGraphicObject(const 
::WPXPropertyList propList, const ::
 pDrawFrameElement-addAttribute(svg:width, 
propList[svg:width]-getStr());
 mpImpl-mBodyElements.push_back(pDrawFrameElement);
 
-mpImpl-mBodyElements.push_back(new TagOpenElement(draw:image));
+if (propList[libwpg:mime-type]-getStr() == object/ole)
+mpImpl-mBodyElements.push_back(new TagOpenElement(draw:object-ole));
+else
+mpImpl-mBodyElements.push_back(new TagOpenElement(draw:image));
 
 mpImpl-mBodyElements.push_back(new TagOpenElement(office:binary-data));
 
@@ -973,7 +976,10 @@ void OdgGenerator::drawGraphicObject(const 
::WPXPropertyList propList, const ::
 
 mpImpl-mBodyElements.push_back(new TagCloseElement(office:binary-data));
 
-mpImpl-mBodyElements.push_back(new TagCloseElement(draw:image));
+if (propList[libwpg:mime-type]-getStr() == object/ole)
+mpImpl-mBodyElements.push_back(new 
TagCloseElement(draw:object-ole));
+else
+mpImpl-mBodyElements.push_back(new TagCloseElement(draw:image));
 
 mpImpl-mBodyElements.push_back(new TagCloseElement(draw:frame));
 }
diff --git a/writerperfect/source/filter/OdtGenerator.cxx 
b/writerperfect/source/filter/OdtGenerator.cxx
index b609678..94e46c9 100644
--- a/writerperfect/source/filter/OdtGenerator.cxx
+++ b/writerperfect/source/filter/OdtGenerator.cxx
@@ -1264,10 +1264,10 @@ void OdtGenerator::insertBinaryObject(const 
WPXPropertyList propList, const WPX
 else
 // assuming we have a binary image or a object_ole that we can just 
insert as it is
 {
-std::string dataType = draw:image;
-if (propList[libwpd:mimetype]-getStr() == object/ole)
-dataType = draw:object-ole;
-mpImpl-mpCurrentContentElements-push_back(new 
TagOpenElement(dataType.c_str()));
+if (propList[libwpg:mime-type]-getStr() == object/ole)
+mpImpl-mpCurrentContentElements-push_back(new 
TagOpenElement(draw:object-ole));
+else
+mpImpl-mpCurrentContentElements-push_back(new 
TagOpenElement(draw:image));
 
 mpImpl-mpCurrentContentElements-push_back(new 
TagOpenElement(office:binary-data));
 
@@ -1277,7 +1277,10 @@ void OdtGenerator::insertBinaryObject(const 
WPXPropertyList propList, const WPX
 
 mpImpl-mpCurrentContentElements-push_back(new 
TagCloseElement(office:binary-data));
 
-mpImpl-mpCurrentContentElements-push_back(new 
TagCloseElement(dataType.c_str()));
+if (propList[libwpg:mime-type]-getStr() == object/ole)
+mpImpl-mpCurrentContentElements-push_back(new 
TagCloseElement(draw:object-ole));
+else
+mpImpl-mpCurrentContentElements-push_back(new 
TagCloseElement(draw:image));
 }
 }
 
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: writerperfect/source

2011-11-03 Thread Fridrich Strba
 writerperfect/source/filter/OdtGenerator.cxx |9 +++--
 writerperfect/source/filter/TextRunStyle.cxx |   47 ---
 2 files changed, 34 insertions(+), 22 deletions(-)

New commits:
commit 3e8dee1a48bd80c52b5adda6bd9358c2136ea764
Author: Laurent Alonso alo...@loria.fr
Date:   Thu Nov 3 14:57:48 2011 +0100

Add possibilty to embed ole object and to pass paragraph borders

diff --git a/writerperfect/source/filter/OdtGenerator.cxx 
b/writerperfect/source/filter/OdtGenerator.cxx
index 7c1e19e..9e9ae10 100644
--- a/writerperfect/source/filter/OdtGenerator.cxx
+++ b/writerperfect/source/filter/OdtGenerator.cxx
@@ -1268,9 +1268,12 @@ void OdtGenerator::insertBinaryObject(const 
WPXPropertyList propList, const WPX
 }
 }
 else
-// assuming we have a binary image that we can just insert as it is
+// assuming we have a binary image or a object_ole that we can just 
insert as it is
 {
-mpImpl-mpCurrentContentElements-push_back(new 
TagOpenElement(draw:image));
+std::string dataType = draw:image;
+if (propList[libwpd:mimetype]-getStr() == object/ole)
+dataType = draw:object-ole;
+mpImpl-mpCurrentContentElements-push_back(new 
TagOpenElement(dataType.c_str()));
 
 mpImpl-mpCurrentContentElements-push_back(new 
TagOpenElement(office:binary-data));
 
@@ -1280,7 +1283,7 @@ void OdtGenerator::insertBinaryObject(const 
WPXPropertyList propList, const WPX
 
 mpImpl-mpCurrentContentElements-push_back(new 
TagCloseElement(office:binary-data));
 
-mpImpl-mpCurrentContentElements-push_back(new 
TagCloseElement(draw:image));
+mpImpl-mpCurrentContentElements-push_back(new 
TagCloseElement(dataType.c_str()));
 }
 }
 
diff --git a/writerperfect/source/filter/TextRunStyle.cxx 
b/writerperfect/source/filter/TextRunStyle.cxx
index 092d3a2..6cc7378 100644
--- a/writerperfect/source/filter/TextRunStyle.cxx
+++ b/writerperfect/source/filter/TextRunStyle.cxx
@@ -69,32 +69,41 @@ void ParagraphStyle::write(OdfDocumentHandler *pHandler) 
const
 if (strcmp(i.key(), style:list-style-name) == 0)
 propList.insert(style:list-style-name, i()-getStr());
 #endif
-if (strcmp(i.key(), fo:margin-left) == 0)
-propList.insert(fo:margin-left, i()-getStr());
-if (strcmp(i.key(), fo:margin-right) == 0)
-propList.insert(fo:margin-right, i()-getStr());
-if (strcmp(i.key(), fo:text-indent) == 0)
-propList.insert(fo:text-indent, i()-getStr());
-if (strcmp(i.key(), fo:margin-top) == 0)
-propList.insert(fo:margin-top, i()-getStr());
-if (strcmp(i.key(), fo:margin-bottom) == 0)
+if (strncmp(i.key(), fo:margin-,10) == 0)
 {
-if (i()-getDouble()  0.0)
-propList.insert(fo:margin-bottom, i()-getStr());
-else
-propList.insert(fo:margin-bottom, 0.0);
+if (strcmp(i.key(), fo:margin-left) == 0 ||
+strcmp(i.key(), fo:margin-right) == 0 ||
+strcmp(i.key(), fo:margin-top) == 0)
+propList.insert(i.key(), i()-getStr());
+else if (strcmp(i.key(), fo:margin-bottom) == 0)
+{
+if (i()-getDouble()  0.0)
+propList.insert(fo:margin-bottom, i()-getStr());
+else
+propList.insert(fo:margin-bottom, 0.0);
+}
 }
-if (strcmp(i.key(), fo:line-height) == 0)
+else if (strcmp(i.key(), fo:text-indent) == 0)
+propList.insert(fo:text-indent, i()-getStr());
+else if (strcmp(i.key(), fo:line-height) == 0)
 propList.insert(fo:line-height, i()-getStr());
-if (strcmp(i.key(), fo:break-before) == 0)
+else if (strcmp(i.key(), fo:break-before) == 0)
 propList.insert(fo:break-before, i()-getStr());
-if (strcmp(i.key(), fo:text-align) == 0)
+else if (strcmp(i.key(), fo:text-align) == 0)
 propList.insert(fo:text-align, i()-getStr());
-if (strcmp(i.key(), fo:text-align-last) == 0)
+else if (strcmp(i.key(), fo:text-align-last) == 0)
 propList.insert(fo:text-align-last, i()-getStr());
-if (strcmp(i.key(), style:page-number) == 0)
+else if (strcmp(i.key(), style:page-number) == 0)
 propList.insert(style:page-number, i()-getStr());
-
+else if (strncmp(i.key(), fo:border, 9) == 0)
+{
+if (strcmp(i.key(), fo:border) == 0 ||
+strcmp(i.key(), fo:border-left) == 0 ||
+strcmp(i.key(), fo:border-right) == 0 ||
+strcmp(i.key(), fo:border-top) == 0 ||
+strcmp(i.key(), fo:border-bottom) == 0)
+propList.insert(i.key(), i()-getStr());
+}
 }
 
 propList.insert(style:justify-single-word, false);

[Libreoffice-commits] .: writerperfect/source

2011-10-28 Thread Fridrich Strba
 writerperfect/source/filter/FilterInternal.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 3bf2d830649ec83e2d63baddaffdcc9f33300f7c
Author: Fridrich Å trba fridrich.st...@bluewin.ch
Date:   Fri Oct 28 16:02:45 2011 +0200

Modelines also for this file

diff --git a/writerperfect/source/filter/FilterInternal.cxx 
b/writerperfect/source/filter/FilterInternal.cxx
index 898b9ce..c0ab66d 100644
--- a/writerperfect/source/filter/FilterInternal.cxx
+++ b/writerperfect/source/filter/FilterInternal.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
 /* FilterInternal.hxx: define basic functions for libwriterperfect/fileter
  *
  * Copyright (C) 2002-2004 William Lachance (wrl...@gmail.com)
@@ -42,4 +43,6 @@ WPXString propListToStyleKey(const WPXPropertyList xPropList)
 }
 
 return sKey;
-}
\ No newline at end of file
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: writerperfect/source

2011-10-28 Thread Fridrich Strba
 writerperfect/source/filter/WriterProperties.hxx |   38 ---
 1 file changed, 38 deletions(-)

New commits:
commit 8a103fba463b3bb71e3fd9f4d3d8f4a928a6f0ca
Author: Fridrich Å trba fridrich.st...@bluewin.ch
Date:   Fri Oct 28 16:20:28 2011 +0200

Removing unused header

diff --git a/writerperfect/source/filter/WriterProperties.hxx 
b/writerperfect/source/filter/WriterProperties.hxx
deleted file mode 100644
index dba3595..000
--- a/writerperfect/source/filter/WriterProperties.hxx
+++ /dev/null
@@ -1,38 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/* WriterProperties: A grab bag of writer-specific properties which we use
- * define here for later use.
- *
- * Copyright (C) 2002-2003 William Lachance (wrl...@gmail.com)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
- *
- * For further information visit http://libwpd.sourceforge.net
- *
- */
-
-/* This product is not manufactured, approved, or supported by
- * Corel Corporation or Corel Corporation Limited.
- */
-#ifndef _WRITER_PROPERTIES_H
-#define _WRITER_PROPERTIES_H
-
-#define IMP_DEFAULT_SUPER_SUB_SCRIPT 58%
-#define IMP_NUM_CENTIMETERES_PER_INCH 2.54f
-#define IMP_DEFAULT_FONT_NAME Times New Roman
-#define IMP_DEFAULT_FONT_SIZE 12.0
-#define IMP_DEFAULT_FONT_PITCH variable
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: writerperfect/source

2011-10-27 Thread Fridrich Strba
 writerperfect/source/filter/FontStyle.cxx   |1 
 writerperfect/source/filter/InternalHandler.cxx |2 -
 writerperfect/source/filter/OdtGenerator.cxx|6 +
 writerperfect/source/filter/TextRunStyle.cxx|   19 ++--
 writerperfect/source/filter/TextRunStyle.hxx|2 -
 writerperfect/source/filter/libwriterperfect_filter.cxx |3 +-
 writerperfect/source/filter/libwriterperfect_filter.hxx |4 ++-
 7 files changed, 26 insertions(+), 11 deletions(-)

New commits:
commit eac87fed20206377c5354eac6beccb90bb43ef20
Author: Fridrich Å trba fridrich.st...@bluewin.ch
Date:   Thu Oct 27 08:39:31 2011 +0200

Syncing with out-of-tree writerperfect

diff --git a/writerperfect/source/filter/FontStyle.cxx 
b/writerperfect/source/filter/FontStyle.cxx
index 9accf52..de1bd2e 100644
--- a/writerperfect/source/filter/FontStyle.cxx
+++ b/writerperfect/source/filter/FontStyle.cxx
@@ -88,5 +88,4 @@ WPXString FontStyleManager::findOrAdd(const char 
*psFontFamily)
 return psFontFamily;
 }
 
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/writerperfect/source/filter/InternalHandler.cxx 
b/writerperfect/source/filter/InternalHandler.cxx
index 8a1389d..cb68b01 100644
--- a/writerperfect/source/filter/InternalHandler.cxx
+++ b/writerperfect/source/filter/InternalHandler.cxx
@@ -33,7 +33,7 @@ InternalHandler::InternalHandler(std::vectorDocumentElement 
* *elements):
 
 void InternalHandler::startElement(const char *psName, const WPXPropertyList 
xPropList)
 {
-TagOpenElement*element = new TagOpenElement(psName);
+TagOpenElement *element = new TagOpenElement(psName);
 WPXPropertyList::Iter i(xPropList);
 for (i.rewind(); i.next(); )
 {
diff --git a/writerperfect/source/filter/OdtGenerator.cxx 
b/writerperfect/source/filter/OdtGenerator.cxx
index 9533803..b597241 100644
--- a/writerperfect/source/filter/OdtGenerator.cxx
+++ b/writerperfect/source/filter/OdtGenerator.cxx
@@ -561,10 +561,16 @@ void OdtGenerator::openSection(const WPXPropertyList 
propList, const WPXPropert
 int iNumColumns = columns.count();
 double fSectionMarginLeft = 0.0;
 double fSectionMarginRight = 0.0;
+double fSectionSpaceAfter = 0.0;
 if (propList[fo:margin-left])
 fSectionMarginLeft = propList[fo:margin-left]-getDouble();
 if (propList[fo:margin-right])
 fSectionMarginRight = propList[fo:margin-right]-getDouble();
+if (propList[fo:margin-bottom])
+fSectionSpaceAfter = propList[fo:margin-bottom]-getDouble();
+else if (propList[libwpd:margin-bottom])
+fSectionSpaceAfter =  propList[libwpd:margin-bottom]-getDouble();
+
 
 if (iNumColumns  1 || fSectionMarginLeft != 0 || fSectionMarginRight != 0)
 {
diff --git a/writerperfect/source/filter/TextRunStyle.cxx 
b/writerperfect/source/filter/TextRunStyle.cxx
index 35c6d27..e3ef8bb 100644
--- a/writerperfect/source/filter/TextRunStyle.cxx
+++ b/writerperfect/source/filter/TextRunStyle.cxx
@@ -200,21 +200,23 @@ void ParagraphStyleManager::write(OdfDocumentHandler 
*pHandler) const
 }
 }
 
-WPXString ParagraphStyleManager::getKey(const WPXPropertyList xPropList, 
const WPXPropertyListVector tabStops) const
+WPXString ParagraphStyleManager::getKey(WPXPropertyList const xPropList, 
WPXPropertyListVector const tabStops) const
 {
 WPXString sKey = propListToStyleKey(xPropList);
 
 WPXString sTabStops;
 sTabStops.sprintf([num-tab-stops:%i], tabStops.count());
 WPXPropertyListVector::Iter i(tabStops);
-for (i.rewind(); i.next(); )
+for (i.rewind(); i.next();)
+{
 sTabStops.append(propListToStyleKey(i()));
+}
 sKey.append(sTabStops);
 
 return sKey;
 }
 
-WPXString ParagraphStyleManager::findOrAdd (const WPXPropertyList propList, 
const WPXPropertyListVector tabStops)
+WPXString ParagraphStyleManager::findOrAdd(WPXPropertyList const propList, 
WPXPropertyListVector const tabStops)
 {
 WPXString hashKey = getKey(propList, tabStops);
 std::mapWPXString, ParagraphStyle *, ltstr::const_iterator iter = 
mHash.find(hashKey);
@@ -226,7 +228,8 @@ WPXString ParagraphStyleManager::findOrAdd (const 
WPXPropertyList propList, con
 
 WPXString sName;
 sName.sprintf(S%i, mHash.size());
-ParagraphStyle *pStyle = new ParagraphStyle(propList, tabStops, sName);
+ParagraphStyle *pStyle =
+new ParagraphStyle(propList, tabStops, sName);
 mHash[hashKey] = pStyle;
 return sName;
 }
@@ -235,7 +238,9 @@ void SpanStyleManager::clean()
 {
 for (std::mapWPXString, SpanStyle *, ltstr::iterator iter = 
mHash.begin();
 iter != mHash.end(); ++iter)
+{
 delete(iter-second);
+}
 mHash.clear();
 }
 
@@ -243,10 +248,12 @@ void SpanStyleManager::write(OdfDocumentHandler 
*pHandler) const
 {
 for (std::mapWPXString, SpanStyle *, ltstr::const_iterator iter = 
mHash.begin();
 iter != mHash.end(); ++iter)
-

[Libreoffice-commits] .: writerperfect/source

2011-10-27 Thread Caolán McNamara
 writerperfect/source/filter/OdtGenerator.cxx |6 --
 1 file changed, 6 deletions(-)

New commits:
commit c6e86f8b7af28d990b9539903560554fc130775e
Author: Caolán McNamara caol...@redhat.com
Date:   Thu Oct 27 13:54:19 2011 +0100

fSectionSpaceAfter is unused

diff --git a/writerperfect/source/filter/OdtGenerator.cxx 
b/writerperfect/source/filter/OdtGenerator.cxx
index b597241..9533803 100644
--- a/writerperfect/source/filter/OdtGenerator.cxx
+++ b/writerperfect/source/filter/OdtGenerator.cxx
@@ -561,16 +561,10 @@ void OdtGenerator::openSection(const WPXPropertyList 
propList, const WPXPropert
 int iNumColumns = columns.count();
 double fSectionMarginLeft = 0.0;
 double fSectionMarginRight = 0.0;
-double fSectionSpaceAfter = 0.0;
 if (propList[fo:margin-left])
 fSectionMarginLeft = propList[fo:margin-left]-getDouble();
 if (propList[fo:margin-right])
 fSectionMarginRight = propList[fo:margin-right]-getDouble();
-if (propList[fo:margin-bottom])
-fSectionSpaceAfter = propList[fo:margin-bottom]-getDouble();
-else if (propList[libwpd:margin-bottom])
-fSectionSpaceAfter =  propList[libwpd:margin-bottom]-getDouble();
-
 
 if (iNumColumns  1 || fSectionMarginLeft != 0 || fSectionMarginRight != 0)
 {
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


Re: [Libreoffice] [Libreoffice-commits] .: writerperfect/source

2011-10-27 Thread Terrence Enger
On Tue, 2011-10-25 at 09:16 +0200, Stephan Bergmann wrote:
 
 In general, and if the expression's value is not used, prefix 
 increment/decrement is preferable to postfix, as the former conceptually 
 avoids creation of a temporary that makes the old, unmodified value 
 available as the expression's value.

Just to be picky, if my memory of C++ serves, ...

(*) For built-in types, it is true that prefix and postfix
increment/decrement have the same effect on the variable.

(*) For STL iterators, I guess that the same statement is true.  At
least, I think that a violation of the symmetry would have
provoked my Oh, eeeuuuw! reflex so strongly that I would
remember it.  grin /

(*) For class types in general, the prefix and postfix operators can
be completely different.  In my opinion, it is evil to do this;
but the language allows it.

Terry.

 
 That said, you see both forms with more-or-less similar frequency in the 
 wild.
 
 -Stephan


___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


[Libreoffice-commits] .: writerperfect/source

2011-10-25 Thread David Tardon
 writerperfect/source/filter/OdtGenerator.cxx |6 --
 1 file changed, 6 deletions(-)

New commits:
commit c6dee8c995caeb78054c1677d6c36fd466b78955
Author: David Tardon dtar...@redhat.com
Date:   Tue Oct 25 08:25:05 2011 +0200

remove unused code... again

diff --git a/writerperfect/source/filter/OdtGenerator.cxx 
b/writerperfect/source/filter/OdtGenerator.cxx
index 979b383..cb64d63 100644
--- a/writerperfect/source/filter/OdtGenerator.cxx
+++ b/writerperfect/source/filter/OdtGenerator.cxx
@@ -561,16 +561,10 @@ void OdtGenerator::openSection(const WPXPropertyList 
propList, const WPXPropert
 int iNumColumns = columns.count();
 double fSectionMarginLeft = 0.0;
 double fSectionMarginRight = 0.0;
-double fSectionSpaceAfter = 0.0;
 if (propList[fo:margin-left])
 fSectionMarginLeft = propList[fo:margin-left]-getDouble();
 if (propList[fo:margin-right])
 fSectionMarginRight = propList[fo:margin-right]-getDouble();
-if (propList[fo:margin-bottom])
-fSectionSpaceAfter = propList[fo:margin-bottom]-getDouble();
-else if (propList[libwpd:margin-bottom])
-fSectionSpaceAfter =  propList[libwpd:margin-bottom]-getDouble();
-
 
 if (iNumColumns  1 || fSectionMarginLeft != 0 || fSectionMarginRight != 0)
 {
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: writerperfect/source

2011-10-25 Thread Fridrich Strba
 writerperfect/source/filter/OdtGenerator.cxx |   16 +---
 writerperfect/source/filter/TextRunStyle.cxx |4 ++--
 2 files changed, 15 insertions(+), 5 deletions(-)

New commits:
commit 5f6e5f766252fab44cf0c5ab4b1bca18b884695c
Author: Laurent Alonso alo...@loria.fr
Date:   Tue Oct 25 22:16:15 2011 +0200

Fix a typo + don't open a row or cell if no table is started

diff --git a/writerperfect/source/filter/OdtGenerator.cxx 
b/writerperfect/source/filter/OdtGenerator.cxx
index 72f816c..9533803 100644
--- a/writerperfect/source/filter/OdtGenerator.cxx
+++ b/writerperfect/source/filter/OdtGenerator.cxx
@@ -966,6 +966,11 @@ void OdtGenerator::openTable(const WPXPropertyList 
propList, const WPXPropertyL
 
 void OdtGenerator::openTableRow(const WPXPropertyList propList)
 {
+if (!mpImpl-mpCurrentTableStyle)
+{
+WRITER_DEBUG_MSG((OdtGenerator::openTableRow called with no 
table\n));
+return;
+}
 if (!mpImpl-mWriterDocumentStates.top().mbInNote)
 {
 if (propList[libwpd:is-header-row]  
(propList[libwpd:is-header-row]-getInt()))
@@ -987,7 +992,7 @@ void OdtGenerator::openTableRow(const WPXPropertyList 
propList)
 
 void OdtGenerator::closeTableRow()
 {
-if (!mpImpl-mWriterDocumentStates.top().mbInNote)
+if (!mpImpl-mWriterDocumentStates.top().mbInNote  
mpImpl-mpCurrentTableStyle)
 {
 mpImpl-mpCurrentContentElements-push_back(new 
TagCloseElement(table:table-row));
 if (mpImpl-mWriterDocumentStates.top().mbHeaderRow)
@@ -1000,6 +1005,11 @@ void OdtGenerator::closeTableRow()
 
 void OdtGenerator::openTableCell(const WPXPropertyList propList)
 {
+if (!mpImpl-mpCurrentTableStyle)
+{
+WRITER_DEBUG_MSG((OdtGenerator::openTableCell called with no 
table\n));
+return;
+}
 if (!mpImpl-mWriterDocumentStates.top().mbInNote)
 {
 WPXString sTableCellStyleName;
@@ -1024,7 +1034,7 @@ void OdtGenerator::openTableCell(const WPXPropertyList 
propList)
 
 void OdtGenerator::closeTableCell()
 {
-if (!mpImpl-mWriterDocumentStates.top().mbInNote)
+if (!mpImpl-mWriterDocumentStates.top().mbInNote  
mpImpl-mpCurrentTableStyle)
 {
 mpImpl-mpCurrentContentElements-push_back(new 
TagCloseElement(table:table-cell));
 mpImpl-mWriterDocumentStates.top().mbTableCellOpened = false;
@@ -1033,7 +1043,7 @@ void OdtGenerator::closeTableCell()
 
 void OdtGenerator::insertCoveredTableCell(const WPXPropertyList )
 {
-if (!mpImpl-mWriterDocumentStates.top().mbInNote)
+if (!mpImpl-mWriterDocumentStates.top().mbInNote  
mpImpl-mpCurrentTableStyle)
 {
 mpImpl-mpCurrentContentElements-push_back(new 
TagOpenElement(table:covered-table-cell));
 mpImpl-mpCurrentContentElements-push_back(new 
TagCloseElement(table:covered-table-cell));
diff --git a/writerperfect/source/filter/TextRunStyle.cxx 
b/writerperfect/source/filter/TextRunStyle.cxx
index 36e16ac..35c6d27 100644
--- a/writerperfect/source/filter/TextRunStyle.cxx
+++ b/writerperfect/source/filter/TextRunStyle.cxx
@@ -222,7 +222,7 @@ WPXString ParagraphStyleManager::findOrAdd (const 
WPXPropertyList propList, con
 return iter-second-getName();
 
 // ok create a new list
-WRITER_DEBUG_MSG((ParagraphStyleManager::findOrAdd: Paragraph Hash Key: 
%s\n, hasKey.cstr()));
+WRITER_DEBUG_MSG((ParagraphStyleManager::findOrAdd: Paragraph Hash Key: 
%s\n, hashKey.cstr()));
 
 WPXString sName;
 sName.sprintf(S%i, mHash.size());
@@ -254,7 +254,7 @@ WPXString SpanStyleManager::findOrAdd(const WPXPropertyList 
propList)
 return iter-second-getName();
 
 // ok create a new list
-WRITER_DEBUG_MSG((SpanStyleManager::findOrAdd: Span Hash Key: %s\n, 
hasKey.cstr()));
+WRITER_DEBUG_MSG((SpanStyleManager::findOrAdd: Span Hash Key: %s\n, 
hashKey.cstr()));
 
 WPXString sName;
 sName.sprintf(Span%i, mHash.size());
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


Re: [Libreoffice] [Libreoffice-commits] .: writerperfect/source

2011-10-25 Thread Stephan Bergmann

On 10/25/2011 04:04 AM, Kevin Hunter wrote:

At 9:48pm -0400 Mon, 24 Oct 2011, Kevin Hunter wrote:

At 7:24pm -0400 Mon, 24 Oct 2011, Fridrich Štrba wrote:

for (std::mapWPXString, FontStyle *, ltstr::const_iterator iter =
mHash.begin();
- iter != mHash.end(); ++iter)
+ iter != mHash.end(); iter++)


Err, in terms of coding style, is a pre to post increment operator
merely a whitespace change? I seem to recall a message or two on the
subject but I'm having a difficult time tracking them down just now.
About 8 months ago, perhaps?


Kevin: open mouth, insert foot. I apologize. Just perusing commits,
should've kept going. I take it the pre to post is needed to fix the
build.


This looks more like fix the build reverted more than was really 
necessary in this case.


In general, and if the expression's value is not used, prefix 
increment/decrement is preferable to postfix, as the former conceptually 
avoids creation of a temporary that makes the old, unmodified value 
available as the expression's value.


That said, you see both forms with more-or-less similar frequency in the 
wild.


-Stephan
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


Re: [Libreoffice] [Libreoffice-commits] .: writerperfect/source

2011-10-25 Thread Fridrich Strba
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Actually, the post/preincrement change was an accidental one. The
problem I have is that the writeperfect source code lives in two
different places. The original code lives in
sourceforge.new/projects/libwpd as writerperfect module. That one
produces standalone converters for all the file-format. And that is
the place where it all started, kind of historical original place. I
normally fix that one and then use the same patch to patch the
libreoffice tree.

It is a bit hard for me to sync those things when the change is done
only in libreoffice and some larger changes are difficult to sync
using patches, so I just copy the corresponding classes from the
SF.net project and reformat the code according to the libreoffice
coding standards. This pre/postincrement change did not happen in the
sf.net repo and during the sync got lost. Although, just in the for
loops, I don't see much difference in the two.

I am thinking about making the writerperfect generators just a library
and use it as any other external library inside libreoffice build. But
that is not for tomorrow.

Cheers

F.

On 25/10/11 04:04, Kevin Hunter wrote:
 At 9:48pm -0400 Mon, 24 Oct 2011, Kevin Hunter wrote:
 At 7:24pm -0400 Mon, 24 Oct 2011, Fridrich Štrba wrote:
 for (std::mapWPXString, FontStyle *, ltstr::const_iterator
 iter = mHash.begin(); - iter != mHash.end(); ++iter) + iter !=
 mHash.end(); iter++)
 
 Err, in terms of coding style, is a pre to post increment
 operator merely a whitespace change? I seem to recall a message
 or two on the subject but I'm having a difficult time tracking
 them down just now. About 8 months ago, perhaps?
 
 Kevin: open mouth, insert foot.  I apologize.  Just perusing
 commits, should've kept going.  I take it the pre to post is needed
 to fix the build.
 
 Kevin
 

-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.16 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk6me3AACgkQu9a1imXPdA+rRwCdFxwc/C6abM2x8gQ8yo1EqHhg
MHMAnA+MiUxLe1EFJCQyh2heenV0CmMw
=fnJH
-END PGP SIGNATURE-
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


[Libreoffice-commits] .: writerperfect/source

2011-10-24 Thread Caolán McNamara
 writerperfect/source/filter/DocumentElement.hxx |2 
 writerperfect/source/filter/FontStyle.cxx   |3 -
 writerperfect/source/filter/OdgGenerator.cxx|   57 
 writerperfect/source/filter/OdtGenerator.cxx|   21 
 writerperfect/source/filter/Style.hxx   |   21 ++--
 writerperfect/source/filter/TextRunStyle.hxx|4 -
 6 files changed, 52 insertions(+), 56 deletions(-)

New commits:
commit f9832c3edb8c69eb9791e55ebfdce8c21f460291
Author: Caolán McNamara caol...@redhat.com
Date:   Mon Oct 24 14:51:29 2011 +0100

fix warning and indent and use boost::noncopyable

diff --git a/writerperfect/source/filter/DocumentElement.hxx 
b/writerperfect/source/filter/DocumentElement.hxx
index f56cfb2..4032a39 100644
--- a/writerperfect/source/filter/DocumentElement.hxx
+++ b/writerperfect/source/filter/DocumentElement.hxx
@@ -57,7 +57,7 @@ private:
 class TagOpenElement : public TagElement
 {
 public:
-   TagOpenElement(const WPXString szTagName) : TagElement(szTagName), 
maAttrList() {}
+TagOpenElement(const WPXString szTagName) : TagElement(szTagName), 
maAttrList() {}
 virtual ~TagOpenElement() {}
 void addAttribute(const WPXString szAttributeName, const WPXString 
sAttributeValue);
 virtual void write(OdfDocumentHandler *pHandler) const;
diff --git a/writerperfect/source/filter/FontStyle.cxx 
b/writerperfect/source/filter/FontStyle.cxx
index a3f0ef7..8b24e18 100644
--- a/writerperfect/source/filter/FontStyle.cxx
+++ b/writerperfect/source/filter/FontStyle.cxx
@@ -54,7 +54,8 @@ void FontStyle::write(OdfDocumentHandler *pHandler) const
 void FontStyleManager::clean()
 {
 for (std::mapWPXString, FontStyle *, ltstr::iterator iter = 
mHash.begin();
- iter != mHash.end(); iter++) {
+ iter != mHash.end(); iter++)
+{
 delete(iter-second);
 }
 mHash.clear();
diff --git a/writerperfect/source/filter/OdgGenerator.cxx 
b/writerperfect/source/filter/OdgGenerator.cxx
index 79653fa..2de6f4a 100644
--- a/writerperfect/source/filter/OdgGenerator.cxx
+++ b/writerperfect/source/filter/OdgGenerator.cxx
@@ -255,14 +255,14 @@ public:
 std::vectorDocumentElement * mPageAutomaticStyles;
 std::vectorDocumentElement * mPageMasterStyles;
 
-   // paragraph styles
-  ParagraphStyleManager mParagraphManager;
+// paragraph styles
+ParagraphStyleManager mParagraphManager;
 
-   // span styles
-  SpanStyleManager mSpanManager;
+// span styles
+SpanStyleManager mSpanManager;
 
 // font styles
-  FontStyleManager mFontManager;
+FontStyleManager mFontManager;
 
 OdfDocumentHandler *mpHandler;
 
@@ -283,17 +283,18 @@ public:
 };
 
 OdgGeneratorPrivate::OdgGeneratorPrivate(OdfDocumentHandler *pHandler, const 
OdfStreamType streamType):
-   mBodyElements(),
-   mGraphicsStrokeDashStyles(),
-   mGraphicsGradientStyles(),
-   mGraphicsAutomaticStyles(),
-   mPageAutomaticStyles(),
-   mPageMasterStyles(),
-   mParagraphManager(),
-   mSpanManager(),
-   mFontManager(),
+mBodyElements(),
+mGraphicsStrokeDashStyles(),
+mGraphicsGradientStyles(),
+mGraphicsAutomaticStyles(),
+mPageAutomaticStyles(),
+mPageMasterStyles(),
+mParagraphManager(),
+mSpanManager(),
+mFontManager(),
 mpHandler(pHandler),
-   mxStyle(), mxGradient(),
+mxStyle(),
+mxGradient(),
 miGradientIndex(1),
 miDashIndex(1),
 miGraphicsStyleIndex(1),
@@ -1335,15 +1336,15 @@ void OdgGenerator::endTextObject()
 
 void OdgGenerator::startTextLine(WPXPropertyList const propList)
 {
-  WPXPropertyList finalPropList(propList);
-  finalPropList.insert(style:parent-style-name, Standard);
-  WPXString paragName = mpImpl-mParagraphManager.findOrAdd(finalPropList, 
WPXPropertyListVector());
+WPXPropertyList finalPropList(propList);
+finalPropList.insert(style:parent-style-name, Standard);
+WPXString paragName = mpImpl-mParagraphManager.findOrAdd(finalPropList, 
WPXPropertyListVector());
 
 
-   // create a document element corresponding to the paragraph, and append it 
to our list of document elements
-   TagOpenElement *pParagraphOpenElement = new TagOpenElement(text:p);
-   pParagraphOpenElement-addAttribute(text:style-name, paragName);
-   mpImpl-mBodyElements.push_back(pParagraphOpenElement);
+// create a document element corresponding to the paragraph, and append it 
to our list of document elements
+TagOpenElement *pParagraphOpenElement = new TagOpenElement(text:p);
+pParagraphOpenElement-addAttribute(text:style-name, paragName);
+mpImpl-mBodyElements.push_back(pParagraphOpenElement);
 }
 
 void OdgGenerator::endTextLine()
@@ -1354,18 +1355,18 @@ void OdgGenerator::endTextLine()
 void OdgGenerator::startTextSpan(WPXPropertyList constpropList)
 {
 if (propList[style:font-name])
-
mpImpl-mFontManager.findOrAdd(propList[style:font-name]-getStr().cstr());
+

[Libreoffice-commits] .: writerperfect/source

2011-10-24 Thread Caolán McNamara
 writerperfect/source/filter/DocumentElement.hxx |2 
 writerperfect/source/filter/FontStyle.cxx   |3 -
 writerperfect/source/filter/OdgGenerator.cxx|   57 
 writerperfect/source/filter/OdtGenerator.cxx|   21 
 writerperfect/source/filter/Style.hxx   |   21 ++--
 writerperfect/source/filter/TextRunStyle.hxx|4 -
 6 files changed, 52 insertions(+), 56 deletions(-)

New commits:
commit f8c2d298be72440da658b580630d1f4452a807a4
Author: Caolán McNamara caol...@redhat.com
Date:   Mon Oct 24 14:51:29 2011 +0100

fix warning and indent and use boost::noncopyable

diff --git a/writerperfect/source/filter/DocumentElement.hxx 
b/writerperfect/source/filter/DocumentElement.hxx
index f56cfb2..4032a39 100644
--- a/writerperfect/source/filter/DocumentElement.hxx
+++ b/writerperfect/source/filter/DocumentElement.hxx
@@ -57,7 +57,7 @@ private:
 class TagOpenElement : public TagElement
 {
 public:
-   TagOpenElement(const WPXString szTagName) : TagElement(szTagName), 
maAttrList() {}
+TagOpenElement(const WPXString szTagName) : TagElement(szTagName), 
maAttrList() {}
 virtual ~TagOpenElement() {}
 void addAttribute(const WPXString szAttributeName, const WPXString 
sAttributeValue);
 virtual void write(OdfDocumentHandler *pHandler) const;
diff --git a/writerperfect/source/filter/FontStyle.cxx 
b/writerperfect/source/filter/FontStyle.cxx
index a3f0ef7..8b24e18 100644
--- a/writerperfect/source/filter/FontStyle.cxx
+++ b/writerperfect/source/filter/FontStyle.cxx
@@ -54,7 +54,8 @@ void FontStyle::write(OdfDocumentHandler *pHandler) const
 void FontStyleManager::clean()
 {
 for (std::mapWPXString, FontStyle *, ltstr::iterator iter = 
mHash.begin();
- iter != mHash.end(); iter++) {
+ iter != mHash.end(); iter++)
+{
 delete(iter-second);
 }
 mHash.clear();
diff --git a/writerperfect/source/filter/OdgGenerator.cxx 
b/writerperfect/source/filter/OdgGenerator.cxx
index 79653fa..2de6f4a 100644
--- a/writerperfect/source/filter/OdgGenerator.cxx
+++ b/writerperfect/source/filter/OdgGenerator.cxx
@@ -255,14 +255,14 @@ public:
 std::vectorDocumentElement * mPageAutomaticStyles;
 std::vectorDocumentElement * mPageMasterStyles;
 
-   // paragraph styles
-  ParagraphStyleManager mParagraphManager;
+// paragraph styles
+ParagraphStyleManager mParagraphManager;
 
-   // span styles
-  SpanStyleManager mSpanManager;
+// span styles
+SpanStyleManager mSpanManager;
 
 // font styles
-  FontStyleManager mFontManager;
+FontStyleManager mFontManager;
 
 OdfDocumentHandler *mpHandler;
 
@@ -283,17 +283,18 @@ public:
 };
 
 OdgGeneratorPrivate::OdgGeneratorPrivate(OdfDocumentHandler *pHandler, const 
OdfStreamType streamType):
-   mBodyElements(),
-   mGraphicsStrokeDashStyles(),
-   mGraphicsGradientStyles(),
-   mGraphicsAutomaticStyles(),
-   mPageAutomaticStyles(),
-   mPageMasterStyles(),
-   mParagraphManager(),
-   mSpanManager(),
-   mFontManager(),
+mBodyElements(),
+mGraphicsStrokeDashStyles(),
+mGraphicsGradientStyles(),
+mGraphicsAutomaticStyles(),
+mPageAutomaticStyles(),
+mPageMasterStyles(),
+mParagraphManager(),
+mSpanManager(),
+mFontManager(),
 mpHandler(pHandler),
-   mxStyle(), mxGradient(),
+mxStyle(),
+mxGradient(),
 miGradientIndex(1),
 miDashIndex(1),
 miGraphicsStyleIndex(1),
@@ -1335,15 +1336,15 @@ void OdgGenerator::endTextObject()
 
 void OdgGenerator::startTextLine(WPXPropertyList const propList)
 {
-  WPXPropertyList finalPropList(propList);
-  finalPropList.insert(style:parent-style-name, Standard);
-  WPXString paragName = mpImpl-mParagraphManager.findOrAdd(finalPropList, 
WPXPropertyListVector());
+WPXPropertyList finalPropList(propList);
+finalPropList.insert(style:parent-style-name, Standard);
+WPXString paragName = mpImpl-mParagraphManager.findOrAdd(finalPropList, 
WPXPropertyListVector());
 
 
-   // create a document element corresponding to the paragraph, and append it 
to our list of document elements
-   TagOpenElement *pParagraphOpenElement = new TagOpenElement(text:p);
-   pParagraphOpenElement-addAttribute(text:style-name, paragName);
-   mpImpl-mBodyElements.push_back(pParagraphOpenElement);
+// create a document element corresponding to the paragraph, and append it 
to our list of document elements
+TagOpenElement *pParagraphOpenElement = new TagOpenElement(text:p);
+pParagraphOpenElement-addAttribute(text:style-name, paragName);
+mpImpl-mBodyElements.push_back(pParagraphOpenElement);
 }
 
 void OdgGenerator::endTextLine()
@@ -1354,18 +1355,18 @@ void OdgGenerator::endTextLine()
 void OdgGenerator::startTextSpan(WPXPropertyList constpropList)
 {
 if (propList[style:font-name])
-
mpImpl-mFontManager.findOrAdd(propList[style:font-name]-getStr().cstr());
+

[Libreoffice-commits] .: writerperfect/source

2011-10-24 Thread Julien Nabet
 writerperfect/source/filter/FontStyle.cxx|4 ++--
 writerperfect/source/filter/OdtGenerator.cxx |   16 
 writerperfect/source/filter/TextRunStyle.cxx |8 
 3 files changed, 14 insertions(+), 14 deletions(-)

New commits:
commit 510199339092ab83ddaaa3bdfccb2f757024ca74
Author: Julien Nabet serval2...@yahoo.fr
Date:   Mon Oct 24 16:46:18 2011 +0200

Some cppcheck cleaning (I let the extra qualified as advised on IRC)

diff --git a/writerperfect/source/filter/FontStyle.cxx 
b/writerperfect/source/filter/FontStyle.cxx
index 8b24e18..5743e1e 100644
--- a/writerperfect/source/filter/FontStyle.cxx
+++ b/writerperfect/source/filter/FontStyle.cxx
@@ -54,7 +54,7 @@ void FontStyle::write(OdfDocumentHandler *pHandler) const
 void FontStyleManager::clean()
 {
 for (std::mapWPXString, FontStyle *, ltstr::iterator iter = 
mHash.begin();
- iter != mHash.end(); iter++)
+ iter != mHash.end(); ++iter)
 {
 delete(iter-second);
 }
@@ -65,7 +65,7 @@ void 
FontStyleManager::writeFontsDeclaration(OdfDocumentHandler *pHandler) const
 {
 TagOpenElement(office:font-face-decls).write(pHandler);
 for (std::mapWPXString, FontStyle *, ltstr::const_iterator iter = 
mHash.begin();
- iter != mHash.end(); iter++)
+ iter != mHash.end(); ++iter)
 {
 (iter-second)-write(pHandler);
 }
diff --git a/writerperfect/source/filter/OdtGenerator.cxx 
b/writerperfect/source/filter/OdtGenerator.cxx
index aba82d8..69e8f24 100644
--- a/writerperfect/source/filter/OdtGenerator.cxx
+++ b/writerperfect/source/filter/OdtGenerator.cxx
@@ -215,7 +215,7 @@ OdtGeneratorPrivate::~OdtGeneratorPrivate()
  WRITER_DEBUG_MSG((WriterWordPerfect: Cleaning up our mess..\n));
 
 WRITER_DEBUG_MSG((Destroying the body elements\n));
-for (std::vectorDocumentElement *::iterator iterBody = 
mBodyElements.begin(); iterBody != mBodyElements.end(); iterBody++) {
+for (std::vectorDocumentElement *::iterator iterBody = 
mBodyElements.begin(); iterBody != mBodyElements.end(); ++iterBody) {
 delete (*iterBody);
 (*iterBody) = 0;
 }
@@ -225,32 +225,32 @@ OdtGeneratorPrivate::~OdtGeneratorPrivate()
 mFontManager.clean();
 
 for (std::vectorListStyle *::iterator iterListStyles = 
mListStyles.begin();
-iterListStyles != mListStyles.end(); iterListStyles++) {
+iterListStyles != mListStyles.end(); ++iterListStyles) {
 delete(*iterListStyles);
 }
 for (std::vectorSectionStyle *::iterator iterSectionStyles = 
mSectionStyles.begin();
-iterSectionStyles != mSectionStyles.end(); iterSectionStyles++) {
+iterSectionStyles != mSectionStyles.end(); ++iterSectionStyles) {
 delete(*iterSectionStyles);
 }
 for (std::vectorTableStyle *::iterator iterTableStyles = 
mTableStyles.begin();
-iterTableStyles != mTableStyles.end(); iterTableStyles++) {
+iterTableStyles != mTableStyles.end(); ++iterTableStyles) {
 delete((*iterTableStyles));
 }
 
 for (std::vectorPageSpan *::iterator iterPageSpans = mPageSpans.begin();
-iterPageSpans != mPageSpans.end(); iterPageSpans++) {
+iterPageSpans != mPageSpans.end(); ++iterPageSpans) {
 delete(*iterPageSpans);
 }
 for (std::vectorDocumentElement *::iterator iterFrameStyles = 
mFrameStyles.begin();
-iterFrameStyles != mFrameStyles.end(); iterFrameStyles++) {
+iterFrameStyles != mFrameStyles.end(); ++iterFrameStyles) {
 delete(*iterFrameStyles);
 }
 for (std::vectorDocumentElement *::iterator iterFrameAutomaticStyles = 
mFrameAutomaticStyles.begin();
-iterFrameAutomaticStyles != mFrameAutomaticStyles.end(); 
iterFrameAutomaticStyles++) {
+iterFrameAutomaticStyles != mFrameAutomaticStyles.end(); 
++iterFrameAutomaticStyles) {
 delete(*iterFrameAutomaticStyles);
 }
 for (std::vectorDocumentElement *::iterator iterMetaData = 
mMetaData.begin();
-iterMetaData != mMetaData.end(); iterMetaData++) {
+iterMetaData != mMetaData.end(); ++iterMetaData) {
 delete(*iterMetaData);
 }
 }
diff --git a/writerperfect/source/filter/TextRunStyle.cxx 
b/writerperfect/source/filter/TextRunStyle.cxx
index 6a1eec6..caa70af 100644
--- a/writerperfect/source/filter/TextRunStyle.cxx
+++ b/writerperfect/source/filter/TextRunStyle.cxx
@@ -184,7 +184,7 @@ void SpanStyle::write(OdfDocumentHandler *pHandler) const
 void ParagraphStyleManager::clean()
 {
   for (std::mapWPXString, ParagraphStyle *, ltstr::iterator iter = 
mHash.begin();
-   iter != mHash.end(); iter++) {
+   iter != mHash.end(); ++iter) {
 delete(iter-second);
   }
   mHash.clear();
@@ -193,7 +193,7 @@ void ParagraphStyleManager::clean()
 void ParagraphStyleManager::write(OdfDocumentHandler *pHandler) const
 {
 for (std::mapWPXString, ParagraphStyle *, ltstr::const_iterator iter = 
mHash.begin();
- iter != mHash.end(); iter++)
+ iter 

[Libreoffice-commits] .: writerperfect/source

2011-10-24 Thread Fridrich Strba
 writerperfect/source/filter/OdtGenerator.cxx |3 +++
 1 file changed, 3 insertions(+)

New commits:
commit 2ba5d12f3a49a23767f17b9db3c019cd6351cfc9
Author: Fridrich Å trba fridrich.st...@bluewin.ch
Date:   Tue Oct 25 01:54:00 2011 +0200

Put the modeline back

diff --git a/writerperfect/source/filter/OdtGenerator.cxx 
b/writerperfect/source/filter/OdtGenerator.cxx
index 94fd1fd..979b383 100644
--- a/writerperfect/source/filter/OdtGenerator.cxx
+++ b/writerperfect/source/filter/OdtGenerator.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
 /* OdtGenerator: Collects sections and runs of text from a
  * wordperfect file (and styles to go along with them) and writes them
  * to a Writer target document
@@ -1345,3 +1346,5 @@ void OdtGenerator::registerEmbeddedObjectHandler(const 
WPXString mimeType, OdfE
 {
 mpImpl-mObjectHandlers[mimeType] = objectHandler;
 }
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


Re: [Libreoffice] [Libreoffice-commits] .: writerperfect/source

2011-10-24 Thread Kevin Hunter

At 7:24pm -0400 Mon, 24 Oct 2011, Fridrich Štrba wrote:

New commits:
commit 38cf494f90d19d1673773437cd52e8f0cfbf4eb5
Author: Fridrich Štrba fridrich.st...@bluewin.ch
Date:   Tue Oct 25 01:11:49 2011 +0200

White-space change to fix messy mix of different coding styles


[...]


diff --git a/writerperfect/source/filter/FontStyle.cxx 
b/writerperfect/source/filter/FontStyle.cxx
index 5743e1e..ac501c6 100644



  void FontStyleManager::clean()
  {
  for (std::mapWPXString, FontStyle *, ltstr::iterator iter = 
mHash.begin();
- iter != mHash.end(); ++iter)
+iter != mHash.end(); iter++)
  {



@@ -65,7 +63,7 @@ void 
FontStyleManager::writeFontsDeclaration(OdfDocumentHandler *pHandler) const



  for (std::mapWPXString, FontStyle *, ltstr::const_iterator iter = 
mHash.begin();
- iter != mHash.end(); ++iter)
+iter != mHash.end(); iter++)


Err, in terms of coding style, is a pre to post increment operator 
merely a whitespace change?  I seem to recall a message or two on the 
subject but I'm having a difficult time tracking them down just now. 
About 8 months ago, perhaps?


Kevin

___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


Re: [Libreoffice] [Libreoffice-commits] .: writerperfect/source

2011-10-24 Thread Kevin Hunter

At 9:48pm -0400 Mon, 24 Oct 2011, Kevin Hunter wrote:

At 7:24pm -0400 Mon, 24 Oct 2011, Fridrich Štrba wrote:

for (std::mapWPXString, FontStyle *, ltstr::const_iterator iter =
mHash.begin();
- iter != mHash.end(); ++iter)
+ iter != mHash.end(); iter++)


Err, in terms of coding style, is a pre to post increment operator
merely a whitespace change? I seem to recall a message or two on the
subject but I'm having a difficult time tracking them down just now.
About 8 months ago, perhaps?


Kevin: open mouth, insert foot.  I apologize.  Just perusing commits, 
should've kept going.  I take it the pre to post is needed to fix the 
build.


Kevin

___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


[Libreoffice-commits] .: writerperfect/source writerperfect/StaticLibrary_writerperfect.mk

2011-10-23 Thread Fridrich Strba
 writerperfect/StaticLibrary_writerperfect.mk|1 
 writerperfect/source/filter/DocumentElement.hxx |2 
 writerperfect/source/filter/FilterInternal.hxx  |9 
 writerperfect/source/filter/FontStyle.cxx   |   42 ++
 writerperfect/source/filter/FontStyle.hxx   |   24 +
 writerperfect/source/filter/InternalHandler.hxx |2 
 writerperfect/source/filter/OdgGenerator.cxx|  110 +-
 writerperfect/source/filter/OdgGenerator.hxx|1 
 writerperfect/source/filter/OdtGenerator.cxx|  277 
 writerperfect/source/filter/Style.hxx   |   22 +
 writerperfect/source/filter/TextRunStyle.cxx|  107 +-
 writerperfect/source/filter/TextRunStyle.hxx|   49 ++
 writerperfect/source/filter/libwriterperfect_filter.cxx |   47 ++
 writerperfect/source/filter/libwriterperfect_filter.hxx |   48 ++
 14 files changed, 411 insertions(+), 330 deletions(-)

New commits:
commit 55170dd7a0cfd552a89b4bea6c7f4a9854971161
Author: Laurent Alonso alo...@loria.fr
Date:   Sun Oct 23 21:02:14 2011 +0200

Handle styles in a more intelligent way

diff --git a/writerperfect/StaticLibrary_writerperfect.mk 
b/writerperfect/StaticLibrary_writerperfect.mk
index 67e6afc..2569cba 100644
--- a/writerperfect/StaticLibrary_writerperfect.mk
+++ b/writerperfect/StaticLibrary_writerperfect.mk
@@ -55,6 +55,7 @@ $(eval $(call 
gb_StaticLibrary_add_exception_objects,writerperfect,\
writerperfect/source/filter/SectionStyle \
writerperfect/source/filter/TableStyle \
writerperfect/source/filter/TextRunStyle \
+   writerperfect/source/filter/libwriterperfect_filter \
writerperfect/source/stream/WPXSvStream \
 ))
 
diff --git a/writerperfect/source/filter/DocumentElement.hxx 
b/writerperfect/source/filter/DocumentElement.hxx
index b191de5..f56cfb2 100644
--- a/writerperfect/source/filter/DocumentElement.hxx
+++ b/writerperfect/source/filter/DocumentElement.hxx
@@ -57,7 +57,7 @@ private:
 class TagOpenElement : public TagElement
 {
 public:
-TagOpenElement(const WPXString szTagName) : TagElement(szTagName) {}
+   TagOpenElement(const WPXString szTagName) : TagElement(szTagName), 
maAttrList() {}
 virtual ~TagOpenElement() {}
 void addAttribute(const WPXString szAttributeName, const WPXString 
sAttributeValue);
 virtual void write(OdfDocumentHandler *pHandler) const;
diff --git a/writerperfect/source/filter/FilterInternal.hxx 
b/writerperfect/source/filter/FilterInternal.hxx
index 04a0561..eb8c6e6 100644
--- a/writerperfect/source/filter/FilterInternal.hxx
+++ b/writerperfect/source/filter/FilterInternal.hxx
@@ -30,20 +30,11 @@
 #define WRITER_DEBUG_MSG(M)
 #endif
 #include libwpd/libwpd.h
-#include string.h // for strcmp
 
 const double fDefaultSideMargin = 1.0; // inches
 const double fDefaultPageWidth = 8.5f; // inches (OOo required default: we 
will handle this later)
 const double fDefaultPageHeight = 11.0; // inches
 
-struct ltstr
-{
-   bool operator()(const WPXString  s1, const WPXString  s2) const
-   {
-  return strcmp(s1.cstr(), s2.cstr())  0;
-   }
-};
-
 #endif
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/writerperfect/source/filter/FontStyle.cxx 
b/writerperfect/source/filter/FontStyle.cxx
index e9a5be1..a3f0ef7 100644
--- a/writerperfect/source/filter/FontStyle.cxx
+++ b/writerperfect/source/filter/FontStyle.cxx
@@ -44,10 +44,50 @@ void FontStyle::write(OdfDocumentHandler *pHandler) const
 TagOpenElement styleOpen(style:font-face);
 styleOpen.addAttribute(style:name, getName());
 styleOpen.addAttribute(svg:font-family, msFontFamily);
-//styleOpen.addAttribute(style:font-pitch, msFontPitch);
 styleOpen.write(pHandler);
 TagCloseElement styleClose(style:font-face);
 styleClose.write(pHandler);
 }
 
+
+
+void FontStyleManager::clean()
+{
+for (std::mapWPXString, FontStyle *, ltstr::iterator iter = 
mHash.begin();
+ iter != mHash.end(); iter++) {
+delete(iter-second);
+}
+mHash.clear();
+}
+
+void FontStyleManager::writeFontsDeclaration(OdfDocumentHandler *pHandler) 
const
+{
+TagOpenElement(office:font-face-decls).write(pHandler);
+for (std::mapWPXString, FontStyle *, ltstr::const_iterator iter = 
mHash.begin();
+ iter != mHash.end(); iter++)
+{
+(iter-second)-write(pHandler);
+}
+
+TagOpenElement symbolFontOpen(style:font-face);
+symbolFontOpen.addAttribute(style:name, StarSymbol);
+symbolFontOpen.addAttribute(svg:font-family, StarSymbol);
+symbolFontOpen.addAttribute(style:font-charset, x-symbol);
+symbolFontOpen.write(pHandler);
+pHandler-endElement(style:font-face);
+
+pHandler-endElement(office:font-face-decls);
+}
+
+WPXString FontStyleManager::findOrAdd(const char 

[Libreoffice-commits] .: writerperfect/source

2011-10-23 Thread Stephan Bergmann
 writerperfect/source/filter/OdtGenerator.cxx |6 --
 1 file changed, 6 deletions(-)

New commits:
commit d049f12c29faa685dc79a32dc8337b91680ca7a7
Author: Stephan Bergmann sberg...@redhat.com
Date:   Sun Oct 23 22:48:10 2011 +0200

Removed apparently unused fSectionSpaceAfter (nee 
OdtGenerator::mfSectionSpaceAfter).

diff --git a/writerperfect/source/filter/OdtGenerator.cxx 
b/writerperfect/source/filter/OdtGenerator.cxx
index e681a39..04e0351 100644
--- a/writerperfect/source/filter/OdtGenerator.cxx
+++ b/writerperfect/source/filter/OdtGenerator.cxx
@@ -547,16 +547,10 @@ void OdtGenerator::openSection(const WPXPropertyList 
propList, const WPXPropert
 int iNumColumns = columns.count();
 double fSectionMarginLeft = 0.0;
 double fSectionMarginRight = 0.0;
-double fSectionSpaceAfter = 0.0;
 if (propList[fo:margin-left])
 fSectionMarginLeft = propList[fo:margin-left]-getDouble();
 if (propList[fo:margin-right])
 fSectionMarginRight = propList[fo:margin-right]-getDouble();
-if (propList[fo:margin-bottom])
-  fSectionSpaceAfter = propList[fo:margin-bottom]-getDouble();
-else if (propList[libwpd:margin-bottom])
-  fSectionSpaceAfter =  propList[libwpd:margin-bottom]-getDouble();
-
 
 if (iNumColumns  1 || fSectionMarginLeft != 0 || fSectionMarginRight != 0)
 {
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: writerperfect/source

2011-10-11 Thread Fridrich Strba
 writerperfect/source/filter/OdgGenerator.cxx |   20 
 1 file changed, 20 insertions(+)

New commits:
commit 7700e8e82084acb403eefce0d934bd339ffbca30
Author: Fridrich Å trba fridrich.st...@bluewin.ch
Date:   Wed Oct 12 01:57:50 2011 +0200

write out the text margins in text block

diff --git a/writerperfect/source/filter/OdgGenerator.cxx 
b/writerperfect/source/filter/OdgGenerator.cxx
index a848b35..65c72f8 100644
--- a/writerperfect/source/filter/OdgGenerator.cxx
+++ b/writerperfect/source/filter/OdgGenerator.cxx
@@ -1309,6 +1309,26 @@ void OdgGenerator::startTextObject(WPXPropertyList const 
propList, WPXPropertyL
 pDrawFrameOpenElement-addAttribute(fo:max-height, 
propList[fo:max-height]-getStr());
 pStyleGraphicPropertiesOpenElement-addAttribute(fo:max-height, 
propList[fo:max-height]-getStr());
 }
+if (propList[fo:padding-top])
+{
+pDrawFrameOpenElement-addAttribute(fo:padding-top, 
propList[fo:padding-top]-getStr());
+pStyleGraphicPropertiesOpenElement-addAttribute(fo:padding-top, 
propList[fo:padding-top]-getStr());
+}
+if (propList[fo:padding-bottom])
+{
+pDrawFrameOpenElement-addAttribute(fo:padding-bottom, 
propList[fo:padding-bottom]-getStr());
+pStyleGraphicPropertiesOpenElement-addAttribute(fo:padding-bottom, 
propList[fo:padding-bottom]-getStr());
+}
+if (propList[fo:padding-left])
+{
+pDrawFrameOpenElement-addAttribute(fo:padding-left, 
propList[fo:padding-left]-getStr());
+pStyleGraphicPropertiesOpenElement-addAttribute(fo:padding-left, 
propList[fo:padding-left]-getStr());
+}
+if (propList[fo:padding-right])
+{
+pDrawFrameOpenElement-addAttribute(fo:padding-right, 
propList[fo:padding-right]-getStr());
+pStyleGraphicPropertiesOpenElement-addAttribute(fo:padding-right, 
propList[fo:padding-right]-getStr());
+}
 mpImpl-mBodyElements.push_back(pDrawFrameOpenElement);
 mpImpl-mBodyElements.push_back(new TagOpenElement(draw:text-box));
 
mpImpl-mGraphicsAutomaticStyles.push_back(pStyleGraphicPropertiesOpenElement);
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits