summaryrefslogtreecommitdiff
path: root/writerperfect
diff options
context:
space:
mode:
authorFridrich Štrba <fridrich.strba@bluewin.ch>2011-10-27 08:39:31 +0200
committerFridrich Štrba <fridrich.strba@bluewin.ch>2011-10-27 10:25:34 +0200
commiteac87fed20206377c5354eac6beccb90bb43ef20 (patch)
tree2392e1b643d76543688db8b617297a7c79d628f9 /writerperfect
parent9d1dc25f564dada022e1b62fec834d183a1fd258 (diff)
Syncing with out-of-tree writerperfect
Diffstat (limited to 'writerperfect')
-rw-r--r--writerperfect/source/filter/FontStyle.cxx1
-rw-r--r--writerperfect/source/filter/InternalHandler.cxx2
-rw-r--r--writerperfect/source/filter/OdtGenerator.cxx6
-rw-r--r--writerperfect/source/filter/TextRunStyle.cxx19
-rw-r--r--writerperfect/source/filter/TextRunStyle.hxx2
-rw-r--r--writerperfect/source/filter/libwriterperfect_filter.cxx3
-rw-r--r--writerperfect/source/filter/libwriterperfect_filter.hxx4
7 files changed, 26 insertions, 11 deletions
diff --git a/writerperfect/source/filter/FontStyle.cxx b/writerperfect/source/filter/FontStyle.cxx
index 9accf52a4032..de1bd2ecb859 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 8a1389d6f81c..cb68b012299a 100644
--- a/writerperfect/source/filter/InternalHandler.cxx
+++ b/writerperfect/source/filter/InternalHandler.cxx
@@ -33,7 +33,7 @@ InternalHandler::InternalHandler(std::vector<DocumentElement *> *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 95338036e225..b5972411a17e 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 35c6d274d135..e3ef8bbe66d0 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::map<WPXString, 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::map<WPXString, 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::map<WPXString, SpanStyle *, ltstr>::const_iterator iter = mHash.begin();
iter != mHash.end(); ++iter)
- iter->second->write(pHandler);
+ {
+ (iter->second)->write(pHandler);
+ }
}
-WPXString SpanStyleManager::findOrAdd(const WPXPropertyList &propList)
+WPXString SpanStyleManager::findOrAdd(WPXPropertyList const &propList)
{
WPXString hashKey = propListToStyleKey(propList);
std::map<WPXString, SpanStyle *, ltstr>::const_iterator iter = mHash.find(hashKey);
diff --git a/writerperfect/source/filter/TextRunStyle.hxx b/writerperfect/source/filter/TextRunStyle.hxx
index b990f45d0193..0ae670dca2d0 100644
--- a/writerperfect/source/filter/TextRunStyle.hxx
+++ b/writerperfect/source/filter/TextRunStyle.hxx
@@ -80,7 +80,7 @@ public:
/* create a new style if it does not exists. In all case, returns the name of the style
Note: using S%i as new name*/
- WPXString findOrAdd(WPXPropertyList const &xPropList, WPXPropertyListVector const &tabStops);
+ WPXString findOrAdd(const WPXPropertyList &xPropList, const WPXPropertyListVector &tabStops);
virtual void clean();
virtual void write(OdfDocumentHandler *) const;
diff --git a/writerperfect/source/filter/libwriterperfect_filter.cxx b/writerperfect/source/filter/libwriterperfect_filter.cxx
index 700f204ce7cb..db976efcabd8 100644
--- a/writerperfect/source/filter/libwriterperfect_filter.cxx
+++ b/writerperfect/source/filter/libwriterperfect_filter.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* libwriterperfect_filter.hxx: define basic functions for libwriterperfect/fileter
*
* Copyright (C) 2002-2004 William Lachance (wrlach@gmail.com)
@@ -44,4 +45,4 @@ WPXString propListToStyleKey(const WPXPropertyList &xPropList)
return sKey;
}
-
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/writerperfect/source/filter/libwriterperfect_filter.hxx b/writerperfect/source/filter/libwriterperfect_filter.hxx
index 4f9c7224d098..f99026cb6d0c 100644
--- a/writerperfect/source/filter/libwriterperfect_filter.hxx
+++ b/writerperfect/source/filter/libwriterperfect_filter.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* libwriterperfect_filter.hxx: define basic functions for libwriterperfect/fileter
*
* Copyright (C) 2002-2003 William Lachance (wrlach@gmail.com)
@@ -42,5 +43,6 @@ struct ltstr
}
};
-
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */