Kaydet (Commit) eac87fed authored tarafından Fridrich Štrba's avatar Fridrich Štrba

Syncing with out-of-tree writerperfect

üst 9d1dc25f
......@@ -88,5 +88,4 @@ WPXString FontStyleManager::findOrAdd(const char *psFontFamily)
return psFontFamily;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -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(); )
{
......
......@@ -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)
{
......
......@@ -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);
......
......@@ -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;
......
/* -*- 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: */
/* -*- 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: */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment