summaryrefslogtreecommitdiff
path: root/writerperfect/source/writer/exp
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2019-04-16 21:31:05 +0200
committerMiklos Vajna <vmiklos@collabora.com>2019-04-17 09:05:09 +0200
commit9a0934babd347c579c7f5f5c4094800cdc239063 (patch)
treec316e27911b9b913ad85eaf828c3ee07b4ab1767 /writerperfect/source/writer/exp
parent3f59a2df61620fbb7216fc66780620f142d81e66 (diff)
EPUB export: make member variable private
In most cases these were public without a good reason, in other cases setter / getters are added. Change-Id: Id6c1032189db1bba211344162e737dabf7ff3f07 Reviewed-on: https://gerrit.libreoffice.org/70842 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Diffstat (limited to 'writerperfect/source/writer/exp')
-rw-r--r--writerperfect/source/writer/exp/XMLFootnoteImportContext.cxx10
-rw-r--r--writerperfect/source/writer/exp/XMLSectionContext.cxx6
-rw-r--r--writerperfect/source/writer/exp/XMLTextFrameContext.cxx22
-rw-r--r--writerperfect/source/writer/exp/XMLTextListContext.cxx2
-rw-r--r--writerperfect/source/writer/exp/XMLTextListItemContext.cxx4
-rw-r--r--writerperfect/source/writer/exp/txtparai.cxx127
-rw-r--r--writerperfect/source/writer/exp/txtstyli.cxx16
-rw-r--r--writerperfect/source/writer/exp/xmlfmt.cxx57
-rw-r--r--writerperfect/source/writer/exp/xmlictxt.hxx3
-rw-r--r--writerperfect/source/writer/exp/xmlimp.cxx30
-rw-r--r--writerperfect/source/writer/exp/xmlmetai.cxx41
-rw-r--r--writerperfect/source/writer/exp/xmlmetai.hxx3
-rw-r--r--writerperfect/source/writer/exp/xmltbli.cxx40
-rw-r--r--writerperfect/source/writer/exp/xmltext.cxx6
14 files changed, 193 insertions, 174 deletions
diff --git a/writerperfect/source/writer/exp/XMLFootnoteImportContext.cxx b/writerperfect/source/writer/exp/XMLFootnoteImportContext.cxx
index 5f1b53c804a8..15753306a97d 100644
--- a/writerperfect/source/writer/exp/XMLFootnoteImportContext.cxx
+++ b/writerperfect/source/writer/exp/XMLFootnoteImportContext.cxx
@@ -81,19 +81,19 @@ XMLFootnoteBodyImportContext::XMLFootnoteBodyImportContext(
rtl::Reference<XMLImportContext> XMLFootnoteBodyImportContext::CreateChildContext(
const OUString& rName, const css::uno::Reference<css::xml::sax::XAttributeList>& /*xAttribs*/)
{
- return CreateTextChildContext(mrImport, rName);
+ return CreateTextChildContext(GetImport(), rName);
}
void XMLFootnoteBodyImportContext::startElement(
const OUString& /*rName*/,
const css::uno::Reference<css::xml::sax::XAttributeList>& /*xAttribs*/)
{
- mrImport.GetGenerator().openFootnote(m_rProperties);
+ GetImport().GetGenerator().openFootnote(m_rProperties);
}
void XMLFootnoteBodyImportContext::endElement(const OUString& /*rName*/)
{
- mrImport.GetGenerator().closeFootnote();
+ GetImport().GetGenerator().closeFootnote();
}
XMLFootnoteImportContext::XMLFootnoteImportContext(XMLImport& rImport)
@@ -105,9 +105,9 @@ rtl::Reference<XMLImportContext> XMLFootnoteImportContext::CreateChildContext(
const OUString& rName, const css::uno::Reference<css::xml::sax::XAttributeList>& /*xAttribs*/)
{
if (rName == "text:note-citation")
- return new XMLTextNoteCitationContext(mrImport, m_aProperties);
+ return new XMLTextNoteCitationContext(GetImport(), m_aProperties);
if (rName == "text:note-body")
- return new XMLFootnoteBodyImportContext(mrImport, m_aProperties);
+ return new XMLFootnoteBodyImportContext(GetImport(), m_aProperties);
SAL_WARN("writerperfect", "XMLFootnoteImportContext::CreateChildContext: unhandled " << rName);
return nullptr;
}
diff --git a/writerperfect/source/writer/exp/XMLSectionContext.cxx b/writerperfect/source/writer/exp/XMLSectionContext.cxx
index bf88d0e174fb..dbd1f9663539 100644
--- a/writerperfect/source/writer/exp/XMLSectionContext.cxx
+++ b/writerperfect/source/writer/exp/XMLSectionContext.cxx
@@ -26,19 +26,19 @@ XMLSectionContext::XMLSectionContext(XMLImport& rImport)
rtl::Reference<XMLImportContext> XMLSectionContext::CreateChildContext(
const OUString& rName, const css::uno::Reference<css::xml::sax::XAttributeList>& /*xAttribs*/)
{
- return CreateTextChildContext(mrImport, rName);
+ return CreateTextChildContext(GetImport(), rName);
}
void XMLSectionContext::startElement(
const OUString& /*rName*/,
const css::uno::Reference<css::xml::sax::XAttributeList>& /*xAttribs*/)
{
- mrImport.GetGenerator().openSection(librevenge::RVNGPropertyList());
+ GetImport().GetGenerator().openSection(librevenge::RVNGPropertyList());
}
void XMLSectionContext::endElement(const OUString& /*rName*/)
{
- mrImport.GetGenerator().closeSection();
+ GetImport().GetGenerator().closeSection();
}
} // namespace exp
diff --git a/writerperfect/source/writer/exp/XMLTextFrameContext.cxx b/writerperfect/source/writer/exp/XMLTextFrameContext.cxx
index cb7d3f9a8340..dc62f8bf85ce 100644
--- a/writerperfect/source/writer/exp/XMLTextFrameContext.cxx
+++ b/writerperfect/source/writer/exp/XMLTextFrameContext.cxx
@@ -46,19 +46,19 @@ XMLTextBoxContext::XMLTextBoxContext(XMLImport& rImport)
rtl::Reference<XMLImportContext> XMLTextBoxContext::CreateChildContext(
const OUString& rName, const css::uno::Reference<css::xml::sax::XAttributeList>& /*xAttribs*/)
{
- return CreateTextChildContext(mrImport, rName);
+ return CreateTextChildContext(GetImport(), rName);
}
void XMLTextBoxContext::startElement(
const OUString& /*rName*/,
const css::uno::Reference<css::xml::sax::XAttributeList>& /*xAttribs*/)
{
- mrImport.GetGenerator().openTextBox(librevenge::RVNGPropertyList());
+ GetImport().GetGenerator().openTextBox(librevenge::RVNGPropertyList());
}
void XMLTextBoxContext::endElement(const OUString& /*rName*/)
{
- mrImport.GetGenerator().closeTextBox();
+ GetImport().GetGenerator().closeTextBox();
}
/// Handler for <draw:image>.
@@ -91,7 +91,7 @@ rtl::Reference<XMLImportContext> XMLTextImageContext::CreateChildContext(
{
if (rName == "office:binary-data")
{
- m_xBinaryData = new XMLBase64ImportContext(mrImport);
+ m_xBinaryData = new XMLBase64ImportContext(GetImport());
return m_xBinaryData.get();
}
return nullptr;
@@ -116,7 +116,7 @@ void XMLTextImageContext::endElement(const OUString& /*rName*/)
if (m_xBinaryData.is())
aPropertyList.insert("office:binary-data", m_xBinaryData->getBinaryData());
- mrImport.GetGenerator().insertBinaryObject(aPropertyList);
+ GetImport().GetGenerator().insertBinaryObject(aPropertyList);
}
XMLTextFrameContext::XMLTextFrameContext(XMLImport& rImport)
@@ -128,9 +128,9 @@ rtl::Reference<XMLImportContext> XMLTextFrameContext::CreateChildContext(
const OUString& rName, const css::uno::Reference<css::xml::sax::XAttributeList>& /*xAttribs*/)
{
if (rName == "draw:image")
- return new XMLTextImageContext(mrImport);
+ return new XMLTextImageContext(GetImport());
if (rName == "draw:text-box")
- return new XMLTextBoxContext(mrImport);
+ return new XMLTextBoxContext(GetImport());
SAL_WARN("writerperfect", "XMLTextFrameContext::CreateChildContext: unhandled " << rName);
return nullptr;
}
@@ -145,8 +145,8 @@ void XMLTextFrameContext::startElement(
const OUString& rAttributeValue = xAttribs->getValueByIndex(i);
if (rAttributeName == "draw:style-name")
- FillStyles(rAttributeValue, mrImport.GetAutomaticGraphicStyles(),
- mrImport.GetGraphicStyles(), aPropertyList);
+ FillStyles(rAttributeValue, GetImport().GetAutomaticGraphicStyles(),
+ GetImport().GetGraphicStyles(), aPropertyList);
else
{
OString sName = OUStringToOString(rAttributeName, RTL_TEXTENCODING_UTF8);
@@ -154,12 +154,12 @@ void XMLTextFrameContext::startElement(
aPropertyList.insert(sName.getStr(), sValue.getStr());
}
}
- mrImport.GetGenerator().openFrame(aPropertyList);
+ GetImport().GetGenerator().openFrame(aPropertyList);
}
void XMLTextFrameContext::endElement(const OUString& /*rName*/)
{
- mrImport.GetGenerator().closeFrame();
+ GetImport().GetGenerator().closeFrame();
}
} // namespace exp
diff --git a/writerperfect/source/writer/exp/XMLTextListContext.cxx b/writerperfect/source/writer/exp/XMLTextListContext.cxx
index 5aae47876ec2..77a378e8179d 100644
--- a/writerperfect/source/writer/exp/XMLTextListContext.cxx
+++ b/writerperfect/source/writer/exp/XMLTextListContext.cxx
@@ -26,7 +26,7 @@ rtl::Reference<XMLImportContext> XMLTextListContext::CreateChildContext(
const OUString& rName, const css::uno::Reference<css::xml::sax::XAttributeList>& /*xAttribs*/)
{
if (rName == "text:list-item")
- return new XMLTextListItemContext(mrImport);
+ return new XMLTextListItemContext(GetImport());
return nullptr;
}
diff --git a/writerperfect/source/writer/exp/XMLTextListItemContext.cxx b/writerperfect/source/writer/exp/XMLTextListItemContext.cxx
index 8651e9d8666c..16a64d0bcdaf 100644
--- a/writerperfect/source/writer/exp/XMLTextListItemContext.cxx
+++ b/writerperfect/source/writer/exp/XMLTextListItemContext.cxx
@@ -27,9 +27,9 @@ rtl::Reference<XMLImportContext> XMLTextListItemContext::CreateChildContext(
const OUString& rName, const css::uno::Reference<css::xml::sax::XAttributeList>& /*xAttribs*/)
{
if (rName == "text:p" || rName == "text:h")
- return new XMLParaContext(mrImport);
+ return new XMLParaContext(GetImport());
if (rName == "text:list")
- return new XMLTextListContext(mrImport);
+ return new XMLTextListContext(GetImport());
return nullptr;
}
diff --git a/writerperfect/source/writer/exp/txtparai.cxx b/writerperfect/source/writer/exp/txtparai.cxx
index b947b87813e0..7ab5171fad01 100644
--- a/writerperfect/source/writer/exp/txtparai.cxx
+++ b/writerperfect/source/writer/exp/txtparai.cxx
@@ -78,12 +78,12 @@ XMLTextSequenceContext::XMLTextSequenceContext(XMLImport& rImport,
void XMLTextSequenceContext::characters(const OUString& rChars)
{
- mrImport.GetGenerator().openSpan(m_aPropertyList);
+ GetImport().GetGenerator().openSpan(m_aPropertyList);
OString sCharU8 = OUStringToOString(rChars, RTL_TEXTENCODING_UTF8);
- mrImport.GetGenerator().insertText(librevenge::RVNGString(sCharU8.getStr()));
+ GetImport().GetGenerator().insertText(librevenge::RVNGString(sCharU8.getStr()));
- mrImport.GetGenerator().closeSpan();
+ GetImport().GetGenerator().closeSpan();
}
/// Handler for <text:span>.
@@ -118,7 +118,7 @@ XMLSpanContext::XMLSpanContext(XMLImport& rImport,
rtl::Reference<XMLImportContext> XMLSpanContext::CreateChildContext(
const OUString& rName, const css::uno::Reference<css::xml::sax::XAttributeList>& /*xAttribs*/)
{
- return CreateParagraphOrSpanChildContext(mrImport, rName, m_aPropertyList);
+ return CreateParagraphOrSpanChildContext(GetImport(), rName, m_aPropertyList);
}
void XMLSpanContext::startElement(
@@ -129,8 +129,8 @@ void XMLSpanContext::startElement(
const OUString& rAttributeName = xAttribs->getNameByIndex(i);
const OUString& rAttributeValue = xAttribs->getValueByIndex(i);
if (rAttributeName == "text:style-name")
- FillStyles(rAttributeValue, mrImport.GetAutomaticTextStyles(), mrImport.GetTextStyles(),
- m_aPropertyList);
+ FillStyles(rAttributeValue, GetImport().GetAutomaticTextStyles(),
+ GetImport().GetTextStyles(), m_aPropertyList);
else
{
OString sName = OUStringToOString(rAttributeName, RTL_TEXTENCODING_UTF8);
@@ -142,12 +142,12 @@ void XMLSpanContext::startElement(
void XMLSpanContext::characters(const OUString& rChars)
{
- mrImport.GetGenerator().openSpan(m_aPropertyList);
+ GetImport().GetGenerator().openSpan(m_aPropertyList);
OString sCharU8 = OUStringToOString(rChars, RTL_TEXTENCODING_UTF8);
- mrImport.GetGenerator().insertText(librevenge::RVNGString(sCharU8.getStr()));
+ GetImport().GetGenerator().insertText(librevenge::RVNGString(sCharU8.getStr()));
- mrImport.GetGenerator().closeSpan();
+ GetImport().GetGenerator().closeSpan();
}
/// Handler for <text:ruby>.
@@ -162,10 +162,13 @@ public:
void SAL_CALL endElement(const OUString& rName) override;
- OUString m_sRubyText;
- OUString m_sRubyBase;
+ void SetRubyText(const OUString& rRubyText) { m_sRubyText = rRubyText; }
+
+ OUString& GetRubyBase() { return m_sRubyBase; }
private:
+ OUString m_sRubyText;
+ OUString m_sRubyBase;
librevenge::RVNGPropertyList m_aPropertyList;
};
@@ -179,7 +182,7 @@ public:
{
}
- void SAL_CALL characters(const OUString& rChars) override { m_rParent.m_sRubyText = rChars; }
+ void SAL_CALL characters(const OUString& rChars) override { m_rParent.SetRubyText(rChars); }
private:
XMLRubyContext& m_rParent;
@@ -195,7 +198,7 @@ public:
{
}
- void SAL_CALL characters(const OUString& rChars) override { m_rParent.m_sRubyBase += rChars; }
+ void SAL_CALL characters(const OUString& rChars) override { m_rParent.GetRubyBase() += rChars; }
private:
XMLRubyContext& m_rParent;
@@ -215,9 +218,9 @@ rtl::Reference<XMLImportContext> XMLRubyContext::CreateChildContext(
const OUString& rName, const css::uno::Reference<css::xml::sax::XAttributeList>& /*xAttribs*/)
{
if (rName == "text:ruby-base")
- return new XMLRubyBaseContext(mrImport, *this);
+ return new XMLRubyBaseContext(GetImport(), *this);
if (rName == "text:ruby-text")
- return new XMLRubyTextContext(mrImport, *this);
+ return new XMLRubyTextContext(GetImport(), *this);
return nullptr;
}
@@ -227,9 +230,9 @@ void XMLRubyContext::endElement(const OUString& /*rName*/)
OString sRubyBase = OUStringToOString(m_sRubyBase, RTL_TEXTENCODING_UTF8);
if (sRubyText.getLength())
m_aPropertyList.insert("text:ruby-text", sRubyText.getStr());
- mrImport.GetGenerator().openSpan(m_aPropertyList);
- mrImport.GetGenerator().insertText(sRubyBase.getStr());
- mrImport.GetGenerator().closeSpan();
+ GetImport().GetGenerator().openSpan(m_aPropertyList);
+ GetImport().GetGenerator().insertText(sRubyBase.getStr());
+ GetImport().GetGenerator().closeSpan();
}
/// Base class for contexts that represent a single character only.
@@ -238,7 +241,9 @@ class XMLCharContext : public XMLImportContext
public:
XMLCharContext(XMLImport& rImport, const librevenge::RVNGPropertyList& rPropertyList);
-protected:
+ const librevenge::RVNGPropertyList& GetPropertyList() const { return m_aPropertyList; }
+
+private:
librevenge::RVNGPropertyList m_aPropertyList;
};
@@ -273,9 +278,9 @@ void XMLLineBreakContext::startElement(
const OUString& /*rName*/,
const css::uno::Reference<css::xml::sax::XAttributeList>& /*xAttribs*/)
{
- mrImport.GetGenerator().openSpan(m_aPropertyList);
- mrImport.GetGenerator().insertLineBreak();
- mrImport.GetGenerator().closeSpan();
+ GetImport().GetGenerator().openSpan(GetPropertyList());
+ GetImport().GetGenerator().insertLineBreak();
+ GetImport().GetGenerator().closeSpan();
}
/// Handler for <text:s>.
@@ -299,9 +304,9 @@ void XMLSpaceContext::startElement(
const OUString& /*rName*/,
const css::uno::Reference<css::xml::sax::XAttributeList>& /*xAttribs*/)
{
- mrImport.GetGenerator().openSpan(m_aPropertyList);
- mrImport.GetGenerator().insertSpace();
- mrImport.GetGenerator().closeSpan();
+ GetImport().GetGenerator().openSpan(GetPropertyList());
+ GetImport().GetGenerator().insertSpace();
+ GetImport().GetGenerator().closeSpan();
}
/// Handler for <text:tab>.
@@ -324,9 +329,9 @@ void XMLTabContext::startElement(
const OUString& /*rName*/,
const css::uno::Reference<css::xml::sax::XAttributeList>& /*xAttribs*/)
{
- mrImport.GetGenerator().openSpan(m_aPropertyList);
- mrImport.GetGenerator().insertTab();
- mrImport.GetGenerator().closeSpan();
+ GetImport().GetGenerator().openSpan(GetPropertyList());
+ GetImport().GetGenerator().insertTab();
+ GetImport().GetGenerator().closeSpan();
}
/// Handler for <draw:a>.
@@ -363,7 +368,7 @@ XMLTextFrameHyperlinkContext::XMLTextFrameHyperlinkContext(
rtl::Reference<XMLImportContext> XMLTextFrameHyperlinkContext::CreateChildContext(
const OUString& rName, const css::uno::Reference<css::xml::sax::XAttributeList>& /*xAttribs*/)
{
- return CreateParagraphOrSpanChildContext(mrImport, rName, m_aPropertyList);
+ return CreateParagraphOrSpanChildContext(GetImport(), rName, m_aPropertyList);
}
void XMLTextFrameHyperlinkContext::startElement(
@@ -376,13 +381,13 @@ void XMLTextFrameHyperlinkContext::startElement(
const OUString& rAttributeValue = xAttribs->getValueByIndex(i);
if (rAttributeName == "text:style-name")
// This affects the nested span's properties.
- FillStyles(rAttributeValue, mrImport.GetAutomaticTextStyles(), mrImport.GetTextStyles(),
- m_aPropertyList);
+ FillStyles(rAttributeValue, GetImport().GetAutomaticTextStyles(),
+ GetImport().GetTextStyles(), m_aPropertyList);
else
{
if (rAttributeName == "xlink:href")
{
- m_ePopupState = mrImport.FillPopupData(rAttributeValue, aPropertyList);
+ m_ePopupState = GetImport().FillPopupData(rAttributeValue, aPropertyList);
if (m_ePopupState != PopupState::NotConsumed)
continue;
}
@@ -395,23 +400,23 @@ void XMLTextFrameHyperlinkContext::startElement(
}
if (m_ePopupState != PopupState::Ignore)
- mrImport.GetGenerator().openLink(aPropertyList);
+ GetImport().GetGenerator().openLink(aPropertyList);
}
void XMLTextFrameHyperlinkContext::endElement(const OUString& /*rName*/)
{
if (m_ePopupState != PopupState::Ignore)
- mrImport.GetGenerator().closeLink();
+ GetImport().GetGenerator().closeLink();
}
void XMLTextFrameHyperlinkContext::characters(const OUString& rChars)
{
- mrImport.GetGenerator().openSpan(m_aPropertyList);
+ GetImport().GetGenerator().openSpan(m_aPropertyList);
OString sCharU8 = OUStringToOString(rChars, RTL_TEXTENCODING_UTF8);
- mrImport.GetGenerator().insertText(librevenge::RVNGString(sCharU8.getStr()));
+ GetImport().GetGenerator().insertText(librevenge::RVNGString(sCharU8.getStr()));
- mrImport.GetGenerator().closeSpan();
+ GetImport().GetGenerator().closeSpan();
}
/// Handler for <text:a>.
@@ -447,7 +452,7 @@ XMLHyperlinkContext::XMLHyperlinkContext(XMLImport& rImport,
rtl::Reference<XMLImportContext> XMLHyperlinkContext::CreateChildContext(
const OUString& rName, const css::uno::Reference<css::xml::sax::XAttributeList>& /*xAttribs*/)
{
- return CreateParagraphOrSpanChildContext(mrImport, rName, m_aPropertyList);
+ return CreateParagraphOrSpanChildContext(GetImport(), rName, m_aPropertyList);
}
void XMLHyperlinkContext::startElement(
@@ -460,13 +465,13 @@ void XMLHyperlinkContext::startElement(
const OUString& rAttributeValue = xAttribs->getValueByIndex(i);
if (rAttributeName == "text:style-name")
// This affects the nested span's properties.
- FillStyles(rAttributeValue, mrImport.GetAutomaticTextStyles(), mrImport.GetTextStyles(),
- m_aPropertyList);
+ FillStyles(rAttributeValue, GetImport().GetAutomaticTextStyles(),
+ GetImport().GetTextStyles(), m_aPropertyList);
else
{
if (rAttributeName == "xlink:href")
{
- m_ePopupState = mrImport.FillPopupData(rAttributeValue, aPropertyList);
+ m_ePopupState = GetImport().FillPopupData(rAttributeValue, aPropertyList);
if (m_ePopupState != PopupState::NotConsumed)
continue;
}
@@ -479,23 +484,23 @@ void XMLHyperlinkContext::startElement(
}
if (m_ePopupState != PopupState::Ignore)
- mrImport.GetGenerator().openLink(aPropertyList);
+ GetImport().GetGenerator().openLink(aPropertyList);
}
void XMLHyperlinkContext::endElement(const OUString& /*rName*/)
{
if (m_ePopupState != PopupState::Ignore)
- mrImport.GetGenerator().closeLink();
+ GetImport().GetGenerator().closeLink();
}
void XMLHyperlinkContext::characters(const OUString& rChars)
{
- mrImport.GetGenerator().openSpan(m_aPropertyList);
+ GetImport().GetGenerator().openSpan(m_aPropertyList);
OString sCharU8 = OUStringToOString(rChars, RTL_TEXTENCODING_UTF8);
- mrImport.GetGenerator().insertText(librevenge::RVNGString(sCharU8.getStr()));
+ GetImport().GetGenerator().insertText(librevenge::RVNGString(sCharU8.getStr()));
- mrImport.GetGenerator().closeSpan();
+ GetImport().GetGenerator().closeSpan();
}
XMLParaContext::XMLParaContext(XMLImport& rImport)
@@ -507,12 +512,12 @@ rtl::Reference<XMLImportContext> XMLParaContext::CreateChildContext(
const OUString& rName, const css::uno::Reference<css::xml::sax::XAttributeList>& /*xAttribs*/)
{
if (rName == "text:a")
- return new XMLHyperlinkContext(mrImport, m_aTextPropertyList);
+ return new XMLHyperlinkContext(GetImport(), m_aTextPropertyList);
if (rName == "draw:a")
- return new XMLTextFrameHyperlinkContext(mrImport, m_aTextPropertyList);
+ return new XMLTextFrameHyperlinkContext(GetImport(), m_aTextPropertyList);
if (rName == "text:ruby")
- return new XMLRubyContext(mrImport, m_aTextPropertyList);
- return CreateParagraphOrSpanChildContext(mrImport, rName, m_aTextPropertyList);
+ return new XMLRubyContext(GetImport(), m_aTextPropertyList);
+ return CreateParagraphOrSpanChildContext(GetImport(), rName, m_aTextPropertyList);
}
void XMLParaContext::startElement(
@@ -526,11 +531,11 @@ void XMLParaContext::startElement(
if (rAttributeName == "text:style-name")
{
m_aStyleName = rAttributeValue;
- FillStyles(m_aStyleName, mrImport.GetAutomaticParagraphStyles(),
- mrImport.GetParagraphStyles(), aPropertyList);
- FillStyles(m_aStyleName, mrImport.GetAutomaticTextStyles(), mrImport.GetTextStyles(),
- m_aTextPropertyList);
- mrImport.HandlePageSpan(aPropertyList);
+ FillStyles(m_aStyleName, GetImport().GetAutomaticParagraphStyles(),
+ GetImport().GetParagraphStyles(), aPropertyList);
+ FillStyles(m_aStyleName, GetImport().GetAutomaticTextStyles(),
+ GetImport().GetTextStyles(), m_aTextPropertyList);
+ GetImport().HandlePageSpan(aPropertyList);
}
else
{
@@ -540,26 +545,26 @@ void XMLParaContext::startElement(
}
}
- mrImport.GetGenerator().openParagraph(aPropertyList);
+ GetImport().GetGenerator().openParagraph(aPropertyList);
}
void XMLParaContext::endElement(const OUString& /*rName*/)
{
- mrImport.GetGenerator().closeParagraph();
+ GetImport().GetGenerator().closeParagraph();
}
void XMLParaContext::characters(const OUString& rChars)
{
librevenge::RVNGPropertyList aPropertyList;
if (!m_aStyleName.isEmpty())
- FillStyles(m_aStyleName, mrImport.GetAutomaticTextStyles(), mrImport.GetTextStyles(),
+ FillStyles(m_aStyleName, GetImport().GetAutomaticTextStyles(), GetImport().GetTextStyles(),
aPropertyList);
- mrImport.GetGenerator().openSpan(aPropertyList);
+ GetImport().GetGenerator().openSpan(aPropertyList);
OString sCharU8 = OUStringToOString(rChars, RTL_TEXTENCODING_UTF8);
- mrImport.GetGenerator().insertText(librevenge::RVNGString(sCharU8.getStr()));
+ GetImport().GetGenerator().insertText(librevenge::RVNGString(sCharU8.getStr()));
- mrImport.GetGenerator().closeSpan();
+ GetImport().GetGenerator().closeSpan();
}
rtl::Reference<XMLImportContext>
diff --git a/writerperfect/source/writer/exp/txtstyli.cxx b/writerperfect/source/writer/exp/txtstyli.cxx
index b8b84c03410c..02d2bb206e4b 100644
--- a/writerperfect/source/writer/exp/txtstyli.cxx
+++ b/writerperfect/source/writer/exp/txtstyli.cxx
@@ -290,21 +290,21 @@ rtl::Reference<XMLImportContext> XMLStyleContext::CreateChildContext(
const OUString& rName, const css::uno::Reference<css::xml::sax::XAttributeList>& /*xAttribs*/)
{
if (rName == "style:paragraph-properties")
- return new XMLParagraphPropertiesContext(mrImport, *this);
+ return new XMLParagraphPropertiesContext(GetImport(), *this);
if (rName == "style:text-properties")
- return new XMLTextPropertiesContext(mrImport, *this);
+ return new XMLTextPropertiesContext(GetImport(), *this);
if (rName == "style:table-cell-properties")
- return new XMLTableCellPropertiesContext(mrImport, *this);
+ return new XMLTableCellPropertiesContext(GetImport(), *this);
if (rName == "style:table-column-properties")
- return new XMLTableColumnPropertiesContext(mrImport, *this);
+ return new XMLTableColumnPropertiesContext(GetImport(), *this);
if (rName == "style:table-row-properties")
- return new XMLTableRowPropertiesContext(mrImport, *this);
+ return new XMLTableRowPropertiesContext(GetImport(), *this);
if (rName == "style:table-properties")
- return new XMLTablePropertiesContext(mrImport, *this);
+ return new XMLTablePropertiesContext(GetImport(), *this);
if (rName == "style:graphic-properties")
- return new XMLGraphicPropertiesContext(mrImport, *this);
+ return new XMLGraphicPropertiesContext(GetImport(), *this);
if (rName == "style:page-layout-properties")
- return new XMLPageLayoutPropertiesContext(mrImport, *this);
+ return new XMLPageLayoutPropertiesContext(GetImport(), *this);
return nullptr;
}
diff --git a/writerperfect/source/writer/exp/xmlfmt.cxx b/writerperfect/source/writer/exp/xmlfmt.cxx
index 349bd71af60e..db04adc1761d 100644
--- a/writerperfect/source/writer/exp/xmlfmt.cxx
+++ b/writerperfect/source/writer/exp/xmlfmt.cxx
@@ -23,22 +23,22 @@ namespace exp
{
XMLStylesContext::XMLStylesContext(XMLImport& rImport, StyleType eType)
: XMLImportContext(rImport)
- , m_rParagraphStyles(eType == StyleType_AUTOMATIC ? mrImport.GetAutomaticParagraphStyles()
- : mrImport.GetParagraphStyles())
- , m_rTextStyles(eType == StyleType_AUTOMATIC ? mrImport.GetAutomaticTextStyles()
- : mrImport.GetTextStyles())
- , m_rCellStyles(eType == StyleType_AUTOMATIC ? mrImport.GetAutomaticCellStyles()
- : mrImport.GetCellStyles())
- , m_rColumnStyles(eType == StyleType_AUTOMATIC ? mrImport.GetAutomaticColumnStyles()
- : mrImport.GetColumnStyles())
- , m_rRowStyles(eType == StyleType_AUTOMATIC ? mrImport.GetAutomaticRowStyles()
- : mrImport.GetRowStyles())
- , m_rTableStyles(eType == StyleType_AUTOMATIC ? mrImport.GetAutomaticTableStyles()
- : mrImport.GetTableStyles())
- , m_rGraphicStyles(eType == StyleType_AUTOMATIC ? mrImport.GetAutomaticGraphicStyles()
- : mrImport.GetGraphicStyles())
- , m_rPageLayouts(mrImport.GetPageLayouts())
- , m_rMasterStyles(mrImport.GetMasterStyles())
+ , m_rParagraphStyles(eType == StyleType_AUTOMATIC ? GetImport().GetAutomaticParagraphStyles()
+ : GetImport().GetParagraphStyles())
+ , m_rTextStyles(eType == StyleType_AUTOMATIC ? GetImport().GetAutomaticTextStyles()
+ : GetImport().GetTextStyles())
+ , m_rCellStyles(eType == StyleType_AUTOMATIC ? GetImport().GetAutomaticCellStyles()
+ : GetImport().GetCellStyles())
+ , m_rColumnStyles(eType == StyleType_AUTOMATIC ? GetImport().GetAutomaticColumnStyles()
+ : GetImport().GetColumnStyles())
+ , m_rRowStyles(eType == StyleType_AUTOMATIC ? GetImport().GetAutomaticRowStyles()
+ : GetImport().GetRowStyles())
+ , m_rTableStyles(eType == StyleType_AUTOMATIC ? GetImport().GetAutomaticTableStyles()
+ : GetImport().GetTableStyles())
+ , m_rGraphicStyles(eType == StyleType_AUTOMATIC ? GetImport().GetAutomaticGraphicStyles()
+ : GetImport().GetGraphicStyles())
+ , m_rPageLayouts(GetImport().GetPageLayouts())
+ , m_rMasterStyles(GetImport().GetMasterStyles())
{
}
@@ -46,7 +46,7 @@ rtl::Reference<XMLImportContext> XMLStylesContext::CreateChildContext(
const OUString& rName, const css::uno::Reference<css::xml::sax::XAttributeList>& /*xAttribs*/)
{
if (rName == "style:style" || rName == "style:page-layout" || rName == "style:master-page")
- return new XMLStyleContext(mrImport, *this);
+ return new XMLStyleContext(GetImport(), *this);
return nullptr;
}
@@ -108,6 +108,9 @@ public:
CreateChildContext(const OUString& rName,
const css::uno::Reference<css::xml::sax::XAttributeList>& xAttribs) override;
+ OUString GetName() const { return maName; }
+
+private:
OUString maName;
};
@@ -139,9 +142,10 @@ public:
CreateChildContext(const OUString& rName,
const css::uno::Reference<css::xml::sax::XAttributeList>& xAttribs) override;
- librevenge::RVNGPropertyList maPropertyList;
+ librevenge::RVNGPropertyList& GetPropertyList() { return maPropertyList; }
private:
+ librevenge::RVNGPropertyList maPropertyList;
rtl::Reference<XMLBase64ImportContext> mxBinaryData;
};
@@ -175,7 +179,8 @@ void XMLFontFaceFormatContext::startElement(
if (rAttributeName == "svg:string")
{
OString aAttributeValueU8 = OUStringToOString(rAttributeValue, RTL_TEXTENCODING_UTF8);
- mrFontFaceUri.maPropertyList.insert("librevenge:mime-type", aAttributeValueU8.getStr());
+ mrFontFaceUri.GetPropertyList().insert("librevenge:mime-type",
+ aAttributeValueU8.getStr());
}
}
}
@@ -184,7 +189,7 @@ XMLFontFaceUriContext::XMLFontFaceUriContext(XMLImport& rImport,
XMLFontFaceContext const& rFontFace)
: XMLImportContext(rImport)
{
- OString aNameU8 = OUStringToOString(rFontFace.maName, RTL_TEXTENCODING_UTF8);
+ OString aNameU8 = OUStringToOString(rFontFace.GetName(), RTL_TEXTENCODING_UTF8);
maPropertyList.insert("librevenge:name", aNameU8.getStr());
}
@@ -212,7 +217,7 @@ void XMLFontFaceUriContext::endElement(const OUString& /*rName*/)
{
if (mxBinaryData.is())
maPropertyList.insert("office:binary-data", mxBinaryData->getBinaryData());
- mrImport.GetGenerator().defineEmbeddedFont(maPropertyList);
+ GetImport().GetGenerator().defineEmbeddedFont(maPropertyList);
}
rtl::Reference<XMLImportContext> XMLFontFaceUriContext::CreateChildContext(
@@ -220,11 +225,11 @@ rtl::Reference<XMLImportContext> XMLFontFaceUriContext::CreateChildContext(
{
if (rName == "office:binary-data")
{
- mxBinaryData = new XMLBase64ImportContext(mrImport);
+ mxBinaryData = new XMLBase64ImportContext(GetImport());
return mxBinaryData.get();
}
if (rName == "svg:font-face-format")
- return new XMLFontFaceFormatContext(mrImport, *this);
+ return new XMLFontFaceFormatContext(GetImport(), *this);
SAL_WARN("writerperfect", "XMLFontFaceUriContext::CreateChildContext: unhandled " << rName);
return nullptr;
@@ -240,7 +245,7 @@ rtl::Reference<XMLImportContext> XMLFontFaceSrcContext::CreateChildContext(
const OUString& rName, const css::uno::Reference<css::xml::sax::XAttributeList>& /*xAttribs*/)
{
if (rName == "svg:font-face-uri")
- return new XMLFontFaceUriContext(mrImport, mrFontFace);
+ return new XMLFontFaceUriContext(GetImport(), mrFontFace);
SAL_WARN("writerperfect", "XMLFontFaceSrcContext::CreateChildContext: unhandled " << rName);
return nullptr;
}
@@ -266,7 +271,7 @@ rtl::Reference<XMLImportContext> XMLFontFaceContext::CreateChildContext(
const OUString& rName, const css::uno::Reference<css::xml::sax::XAttributeList>& /*xAttribs*/)
{
if (rName == "svg:font-face-src")
- return new XMLFontFaceSrcContext(mrImport, *this);
+ return new XMLFontFaceSrcContext(GetImport(), *this);
SAL_WARN("writerperfect", "XMLFontFaceContext::CreateChildContext: unhandled " << rName);
return nullptr;
}
@@ -280,7 +285,7 @@ rtl::Reference<XMLImportContext> XMLFontFaceDeclsContext::CreateChildContext(
const OUString& rName, const css::uno::Reference<css::xml::sax::XAttributeList>& /*xAttribs*/)
{
if (rName == "style:font-face")
- return new XMLFontFaceContext(mrImport);
+ return new XMLFontFaceContext(GetImport());
return nullptr;
}
diff --git a/writerperfect/source/writer/exp/xmlictxt.hxx b/writerperfect/source/writer/exp/xmlictxt.hxx
index 03801d104bcb..a0ea42bc63df 100644
--- a/writerperfect/source/writer/exp/xmlictxt.hxx
+++ b/writerperfect/source/writer/exp/xmlictxt.hxx
@@ -26,6 +26,7 @@ class XMLImportContext : public cppu::WeakImplHelper<css::xml::sax::XDocumentHan
{
public:
XMLImportContext(XMLImport& rImport);
+ XMLImport& GetImport() { return mrImport; }
virtual rtl::Reference<XMLImportContext>
CreateChildContext(const OUString& rName,
@@ -44,7 +45,7 @@ public:
void SAL_CALL
setDocumentLocator(const css::uno::Reference<css::xml::sax::XLocator>& xLocator) override;
-protected:
+private:
XMLImport& mrImport;
};
diff --git a/writerperfect/source/writer/exp/xmlimp.cxx b/writerperfect/source/writer/exp/xmlimp.cxx
index f3a12c761f44..dcb4d7641205 100644
--- a/writerperfect/source/writer/exp/xmlimp.cxx
+++ b/writerperfect/source/writer/exp/xmlimp.cxx
@@ -227,7 +227,7 @@ XMLBodyContext::CreateChildContext(const OUString& rName,
const uno::Reference<xml::sax::XAttributeList>& /*xAttribs*/)
{
if (rName == "office:text")
- return new XMLBodyContentContext(mrImport);
+ return new XMLBodyContentContext(GetImport());
return nullptr;
}
@@ -254,24 +254,24 @@ rtl::Reference<XMLImportContext> XMLOfficeDocContext::CreateChildContext(
const OUString& rName, const uno::Reference<xml::sax::XAttributeList>& /*xAttribs*/)
{
if (rName == "office:meta")
- return new XMLMetaDocumentContext(mrImport);
+ return new XMLMetaDocumentContext(GetImport());
if (rName == "office:automatic-styles")
- return new XMLStylesContext(mrImport, XMLStylesContext::StyleType_AUTOMATIC);
+ return new XMLStylesContext(GetImport(), XMLStylesContext::StyleType_AUTOMATIC);
if (rName == "office:styles")
- return new XMLStylesContext(mrImport, XMLStylesContext::StyleType_NONE);
+ return new XMLStylesContext(GetImport(), XMLStylesContext::StyleType_NONE);
if (rName == "office:master-styles")
- return new XMLStylesContext(mrImport, XMLStylesContext::StyleType_NONE);
+ return new XMLStylesContext(GetImport(), XMLStylesContext::StyleType_NONE);
if (rName == "office:font-face-decls")
- return new XMLFontFaceDeclsContext(mrImport);
+ return new XMLFontFaceDeclsContext(GetImport());
if (rName == "office:body")
{
- if (mrImport.GetPageMetafiles().empty())
- return new XMLBodyContext(mrImport);
+ if (GetImport().GetPageMetafiles().empty())
+ return new XMLBodyContext(GetImport());
// Ignore text from doc model in the fixed layout case, instead
// insert the page metafiles.
bool bFirst = true;
- for (const auto& rPage : mrImport.GetPageMetafiles())
+ for (const auto& rPage : GetImport().GetPageMetafiles())
{
HandleFixedLayoutPage(rPage, bFirst);
if (bFirst)
@@ -283,7 +283,7 @@ rtl::Reference<XMLImportContext> XMLOfficeDocContext::CreateChildContext(
void XMLOfficeDocContext::HandleFixedLayoutPage(const FixedLayoutPage& rPage, bool bFirst)
{
- uno::Reference<uno::XComponentContext> xCtx = mrImport.GetComponentContext();
+ uno::Reference<uno::XComponentContext> xCtx = GetImport().GetComponentContext();
uno::Reference<xml::sax::XWriter> xSaxWriter = xml::sax::Writer::create(xCtx);
if (!xSaxWriter.is())
return;
@@ -325,22 +325,22 @@ void XMLOfficeDocContext::HandleFixedLayoutPage(const FixedLayoutPage& rPage, bo
aPageProperties.insert("librevenge:chapter-names", aChapterNames);
}
- mrImport.GetGenerator().openPageSpan(aPageProperties);
+ GetImport().GetGenerator().openPageSpan(aPageProperties);
librevenge::RVNGPropertyList aParagraphProperties;
if (!bFirst)
// All pages except the first one needs a page break before the page
// metafile.
aParagraphProperties.insert("fo:break-before", "page");
- mrImport.GetGenerator().openParagraph(aParagraphProperties);
+ GetImport().GetGenerator().openParagraph(aParagraphProperties);
librevenge::RVNGPropertyList aImageProperties;
aImageProperties.insert("librevenge:mime-type", "image/svg+xml");
librevenge::RVNGBinaryData aBinaryData;
aBinaryData.append(static_cast<const unsigned char*>(aMemoryStream.GetData()),
aMemoryStream.GetSize());
aImageProperties.insert("office:binary-data", aBinaryData);
- mrImport.GetGenerator().insertBinaryObject(aImageProperties);
- mrImport.GetGenerator().closeParagraph();
- mrImport.GetGenerator().closePageSpan();
+ GetImport().GetGenerator().insertBinaryObject(aImageProperties);
+ GetImport().GetGenerator().closeParagraph();
+ GetImport().GetGenerator().closePageSpan();
}
XMLImport::XMLImport(const uno::Reference<uno::XComponentContext>& xContext,
diff --git a/writerperfect/source/writer/exp/xmlmetai.cxx b/writerperfect/source/writer/exp/xmlmetai.cxx
index 229dd82ff2d5..19641d345cfb 100644
--- a/writerperfect/source/writer/exp/xmlmetai.cxx
+++ b/writerperfect/source/writer/exp/xmlmetai.cxx
@@ -25,6 +25,7 @@ public:
void SAL_CALL characters(const OUString& rChars) override;
+private:
XMLMetaDocumentContext& mrMeta;
};
@@ -37,8 +38,8 @@ XMLDcTitleContext::XMLDcTitleContext(XMLImport& rImport, XMLMetaDocumentContext&
void XMLDcTitleContext::characters(const OUString& rChars)
{
OString sCharU8 = OUStringToOString(rChars, RTL_TEXTENCODING_UTF8);
- if (!mrMeta.m_aPropertyList["dc:title"])
- mrMeta.m_aPropertyList.insert("dc:title", librevenge::RVNGString(sCharU8.getStr()));
+ if (!mrMeta.GetPropertyList()["dc:title"])
+ mrMeta.GetPropertyList().insert("dc:title", librevenge::RVNGString(sCharU8.getStr()));
}
/// Handler for <dc:language>.
@@ -49,6 +50,7 @@ public:
void SAL_CALL characters(const OUString& rChars) override;
+private:
XMLMetaDocumentContext& mrMeta;
};
@@ -61,8 +63,8 @@ XMLDcLanguageContext::XMLDcLanguageContext(XMLImport& rImport, XMLMetaDocumentCo
void XMLDcLanguageContext::characters(const OUString& rChars)
{
OString sCharU8 = OUStringToOString(rChars, RTL_TEXTENCODING_UTF8);
- if (!mrMeta.m_aPropertyList["dc:language"])
- mrMeta.m_aPropertyList.insert("dc:language", librevenge::RVNGString(sCharU8.getStr()));
+ if (!mrMeta.GetPropertyList()["dc:language"])
+ mrMeta.GetPropertyList().insert("dc:language", librevenge::RVNGString(sCharU8.getStr()));
}
/// Handler for <dc:date>.
@@ -73,6 +75,7 @@ public:
void SAL_CALL characters(const OUString& rChars) override;
+private:
XMLMetaDocumentContext& mrMeta;
};
@@ -85,8 +88,8 @@ XMLDcDateContext::XMLDcDateContext(XMLImport& rImport, XMLMetaDocumentContext& r
void XMLDcDateContext::characters(const OUString& rChars)
{
OString sCharU8 = OUStringToOString(rChars, RTL_TEXTENCODING_UTF8);
- if (!mrMeta.m_aPropertyList["dc:date"])
- mrMeta.m_aPropertyList.insert("dc:date", librevenge::RVNGString(sCharU8.getStr()));
+ if (!mrMeta.GetPropertyList()["dc:date"])
+ mrMeta.GetPropertyList().insert("dc:date", librevenge::RVNGString(sCharU8.getStr()));
}
/// Handler for <meta:generator>.
@@ -97,6 +100,7 @@ public:
void SAL_CALL characters(const OUString& rChars) override;
+private:
XMLMetaDocumentContext& mrMeta;
};
@@ -109,7 +113,7 @@ XMLMetaGeneratorContext::XMLMetaGeneratorContext(XMLImport& rImport, XMLMetaDocu
void XMLMetaGeneratorContext::characters(const OUString& rChars)
{
OString sCharU8 = OUStringToOString(rChars, RTL_TEXTENCODING_UTF8);
- mrMeta.m_aPropertyList.insert("meta:generator", librevenge::RVNGString(sCharU8.getStr()));
+ mrMeta.GetPropertyList().insert("meta:generator", librevenge::RVNGString(sCharU8.getStr()));
}
/// Handler for <meta:initial-creator>.
@@ -120,6 +124,7 @@ public:
void SAL_CALL characters(const OUString& rChars) override;
+private:
XMLMetaDocumentContext& mrMeta;
};
@@ -133,39 +138,39 @@ XMLMetaInitialCreatorContext::XMLMetaInitialCreatorContext(XMLImport& rImport,
void XMLMetaInitialCreatorContext::characters(const OUString& rChars)
{
OString sCharU8 = OUStringToOString(rChars, RTL_TEXTENCODING_UTF8);
- if (!mrMeta.m_aPropertyList["meta:initial-creator"])
- mrMeta.m_aPropertyList.insert("meta:initial-creator",
- librevenge::RVNGString(sCharU8.getStr()));
+ if (!mrMeta.GetPropertyList()["meta:initial-creator"])
+ mrMeta.GetPropertyList().insert("meta:initial-creator",
+ librevenge::RVNGString(sCharU8.getStr()));
}
XMLMetaDocumentContext::XMLMetaDocumentContext(XMLImport& rImport)
: XMLImportContext(rImport)
{
- librevenge::RVNGPropertyList::Iter it(mrImport.GetMetaData());
+ librevenge::RVNGPropertyList::Iter it(GetImport().GetMetaData());
for (it.rewind(); it.next();)
m_aPropertyList.insert(it.key(), it()->clone());
- m_aPropertyList.insert("librevenge:cover-images", mrImport.GetCoverImages());
+ m_aPropertyList.insert("librevenge:cover-images", GetImport().GetCoverImages());
}
rtl::Reference<XMLImportContext> XMLMetaDocumentContext::CreateChildContext(
const OUString& rName, const css::uno::Reference<css::xml::sax::XAttributeList>& /*xAttribs*/)
{
if (rName == "dc:title")
- return new XMLDcTitleContext(mrImport, *this);
+ return new XMLDcTitleContext(GetImport(), *this);
if (rName == "dc:language")
- return new XMLDcLanguageContext(mrImport, *this);
+ return new XMLDcLanguageContext(GetImport(), *this);
if (rName == "dc:date")
- return new XMLDcDateContext(mrImport, *this);
+ return new XMLDcDateContext(GetImport(), *this);
if (rName == "meta:generator")
- return new XMLMetaGeneratorContext(mrImport, *this);
+ return new XMLMetaGeneratorContext(GetImport(), *this);
if (rName == "meta:initial-creator")
- return new XMLMetaInitialCreatorContext(mrImport, *this);
+ return new XMLMetaInitialCreatorContext(GetImport(), *this);
return nullptr;
}
void XMLMetaDocumentContext::endElement(const OUString& /*rName*/)
{
- mrImport.GetGenerator().setDocumentMetaData(m_aPropertyList);
+ GetImport().GetGenerator().setDocumentMetaData(m_aPropertyList);
}
XMPParser::XMPParser(librevenge::RVNGPropertyList& rMetaData)
diff --git a/writerperfect/source/writer/exp/xmlmetai.hxx b/writerperfect/source/writer/exp/xmlmetai.hxx
index 296adec7f836..1f3e0d774794 100644
--- a/writerperfect/source/writer/exp/xmlmetai.hxx
+++ b/writerperfect/source/writer/exp/xmlmetai.hxx
@@ -24,12 +24,15 @@ class XMLMetaDocumentContext : public XMLImportContext
public:
XMLMetaDocumentContext(XMLImport& rImport);
+ librevenge::RVNGPropertyList& GetPropertyList() { return m_aPropertyList; }
+
rtl::Reference<XMLImportContext>
CreateChildContext(const OUString& rName,
const css::uno::Reference<css::xml::sax::XAttributeList>& xAttribs) override;
void SAL_CALL endElement(const OUString& rName) override;
+private:
librevenge::RVNGPropertyList m_aPropertyList;
};
diff --git a/writerperfect/source/writer/exp/xmltbli.cxx b/writerperfect/source/writer/exp/xmltbli.cxx
index bc029faf369a..a54210ad147f 100644
--- a/writerperfect/source/writer/exp/xmltbli.cxx
+++ b/writerperfect/source/writer/exp/xmltbli.cxx
@@ -70,7 +70,7 @@ XMLTableCellContext::XMLTableCellContext(XMLImport& rImport, XMLTableRowContext&
rtl::Reference<XMLImportContext> XMLTableCellContext::CreateChildContext(
const OUString& rName, const css::uno::Reference<css::xml::sax::XAttributeList>& /*xAttribs*/)
{
- return CreateTextChildContext(mrImport, rName);
+ return CreateTextChildContext(GetImport(), rName);
}
void XMLTableCellContext::startElement(
@@ -83,8 +83,8 @@ void XMLTableCellContext::startElement(
const OUString& rAttributeValue = xAttribs->getValueByIndex(i);
if (rAttributeName == "table:style-name")
- FillStyles(rAttributeValue, mrImport.GetAutomaticCellStyles(), mrImport.GetCellStyles(),
- aPropertyList);
+ FillStyles(rAttributeValue, GetImport().GetAutomaticCellStyles(),
+ GetImport().GetCellStyles(), aPropertyList);
else
{
OString sName = OUStringToOString(rAttributeName, RTL_TEXTENCODING_UTF8);
@@ -93,13 +93,13 @@ void XMLTableCellContext::startElement(
}
}
aPropertyList.insert("librevenge:column", m_rRow.GetColumn());
- mrImport.GetGenerator().openTableCell(aPropertyList);
+ GetImport().GetGenerator().openTableCell(aPropertyList);
m_rRow.SetColumn(m_rRow.GetColumn() + 1);
}
void XMLTableCellContext::endElement(const OUString& /*rName*/)
{
- mrImport.GetGenerator().closeTableCell();
+ GetImport().GetGenerator().closeTableCell();
}
/// Handler for <table:table-column>.
@@ -133,8 +133,8 @@ void XMLTableColumnContext::startElement(
const OUString& rAttributeValue = xAttribs->getValueByIndex(i);
if (rAttributeName == "table:style-name")
- FillStyles(rAttributeValue, mrImport.GetAutomaticColumnStyles(),
- mrImport.GetColumnStyles(), aPropertyList);
+ FillStyles(rAttributeValue, GetImport().GetAutomaticColumnStyles(),
+ GetImport().GetColumnStyles(), aPropertyList);
}
m_rColumns.append(aPropertyList);
}
@@ -148,11 +148,11 @@ rtl::Reference<XMLImportContext> XMLTableRowContext::CreateChildContext(
const OUString& rName, const css::uno::Reference<css::xml::sax::XAttributeList>& /*xAttribs*/)
{
if (rName == "table:table-cell")
- return new XMLTableCellContext(mrImport, *this);
+ return new XMLTableCellContext(GetImport(), *this);
if (rName == "table:covered-table-cell")
{
++m_nColumn;
- mrImport.GetGenerator().insertCoveredTableCell(librevenge::RVNGPropertyList());
+ GetImport().GetGenerator().insertCoveredTableCell(librevenge::RVNGPropertyList());
}
else
SAL_WARN("writerperfect", "XMLTableRowContext::CreateChildContext: unhandled " << rName);
@@ -169,15 +169,15 @@ void XMLTableRowContext::startElement(
const OUString& rAttributeValue = xAttribs->getValueByIndex(i);
if (rAttributeName == "table:style-name")
- FillStyles(rAttributeValue, mrImport.GetAutomaticRowStyles(), mrImport.GetRowStyles(),
- aPropertyList);
+ FillStyles(rAttributeValue, GetImport().GetAutomaticRowStyles(),
+ GetImport().GetRowStyles(), aPropertyList);
}
- mrImport.GetGenerator().openTableRow(aPropertyList);
+ GetImport().GetGenerator().openTableRow(aPropertyList);
}
void XMLTableRowContext::endElement(const OUString& /*rName*/)
{
- mrImport.GetGenerator().closeTableRow();
+ GetImport().GetGenerator().closeTableRow();
}
int XMLTableRowContext::GetColumn() const { return m_nColumn; }
@@ -194,18 +194,18 @@ rtl::Reference<XMLImportContext> XMLTableContext::CreateChildContext(
{
if (rName == "table:table-column")
// Make sure columns are parsed before we open the table.
- return new XMLTableColumnContext(mrImport, m_aColumns);
+ return new XMLTableColumnContext(GetImport(), m_aColumns);
if (!m_bTableOpened)
{
if (!m_aColumns.empty())
m_aPropertyList.insert("librevenge:table-columns", m_aColumns);
- mrImport.GetGenerator().openTable(m_aPropertyList);
+ GetImport().GetGenerator().openTable(m_aPropertyList);
m_bTableOpened = true;
}
if (rName == "table:table-row")
- return new XMLTableRowContext(mrImport);
+ return new XMLTableRowContext(GetImport());
SAL_WARN("writerperfect", "XMLTableContext::CreateChildContext: unhandled " << rName);
@@ -222,9 +222,9 @@ void XMLTableContext::startElement(
if (rAttributeName == "table:style-name")
{
- FillStyles(rAttributeValue, mrImport.GetAutomaticTableStyles(),
- mrImport.GetTableStyles(), m_aPropertyList);
- mrImport.HandlePageSpan(m_aPropertyList);
+ FillStyles(rAttributeValue, GetImport().GetAutomaticTableStyles(),
+ GetImport().GetTableStyles(), m_aPropertyList);
+ GetImport().HandlePageSpan(m_aPropertyList);
}
else
{
@@ -237,7 +237,7 @@ void XMLTableContext::startElement(
void XMLTableContext::endElement(const OUString& /*rName*/)
{
- mrImport.GetGenerator().closeTable();
+ GetImport().GetGenerator().closeTable();
}
} // namespace exp
diff --git a/writerperfect/source/writer/exp/xmltext.cxx b/writerperfect/source/writer/exp/xmltext.cxx
index 1472a23c3763..8177be04b573 100644
--- a/writerperfect/source/writer/exp/xmltext.cxx
+++ b/writerperfect/source/writer/exp/xmltext.cxx
@@ -28,14 +28,14 @@ XMLBodyContentContext::XMLBodyContentContext(XMLImport& rImport)
void XMLBodyContentContext::endElement(const OUString& /*rName*/)
{
- if (mrImport.GetIsInPageSpan())
- mrImport.GetGenerator().closePageSpan();
+ if (GetImport().GetIsInPageSpan())
+ GetImport().GetGenerator().closePageSpan();
}
rtl::Reference<XMLImportContext> XMLBodyContentContext::CreateChildContext(
const OUString& rName, const css::uno::Reference<css::xml::sax::XAttributeList>& /*xAttribs*/)
{
- return CreateTextChildContext(mrImport, rName);
+ return CreateTextChildContext(GetImport(), rName);
}
rtl::Reference<XMLImportContext> CreateTextChildContext(XMLImport& rImport, const OUString& rName)