[Libreoffice-commits] .: writerperfect/source writerperfect/util
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
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
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
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
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
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
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
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
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
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
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
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
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
[Libreoffice-commits] .: writerperfect/source
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
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
[Libreoffice-commits] .: writerperfect/source
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
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
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
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
[Libreoffice-commits] .: writerperfect/source writerperfect/StaticLibrary_writerperfect.mk
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
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
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