summaryrefslogtreecommitdiff
path: root/writerperfect/source/writer/exp/xmltbli.cxx
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2018-04-20 09:07:25 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2018-04-20 11:16:34 +0200
commitac4ea366ec040cdb68f93d42045cba5780852d9f (patch)
tree5be6a2ecac320004551fd4bd50b66271cf5322a9 /writerperfect/source/writer/exp/xmltbli.cxx
parent66c02d16dd078613e754dcc775f366413fad13f0 (diff)
writerperfect: astyle -> clang-format
< vmiklos> dtardon: are you strongly attached to astyle usage in core.git writerperfect/? my problem is that 1) when less regular contributors touch it, they don't run astyle 2) core.git has git hooks in place to enforce consistent style for selected files, but that uses clang-format. i wonder if switching to the standard core.git clang-format would be an option to stop this reformat game <@dtardon> vmiklos, clang-format is okay. we started to use astyle years ago, before there were even any serious talk about automatic formatting for the whole libreoffice Change-Id: I844fc9c2e8560e54a49f26064cc0b3c55a5f034c Reviewed-on: https://gerrit.libreoffice.org/53184 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
Diffstat (limited to 'writerperfect/source/writer/exp/xmltbli.cxx')
-rw-r--r--writerperfect/source/writer/exp/xmltbli.cxx117
1 files changed, 66 insertions, 51 deletions
diff --git a/writerperfect/source/writer/exp/xmltbli.cxx b/writerperfect/source/writer/exp/xmltbli.cxx
index 82468e12a91a..b5c16388b750 100644
--- a/writerperfect/source/writer/exp/xmltbli.cxx
+++ b/writerperfect/source/writer/exp/xmltbli.cxx
@@ -19,19 +19,22 @@ namespace writerperfect
{
namespace exp
{
-
/// Handler for <table:table-row>.
class XMLTableRowContext : public XMLImportContext
{
public:
- XMLTableRowContext(XMLImport &rImport);
+ XMLTableRowContext(XMLImport& rImport);
- rtl::Reference<XMLImportContext> CreateChildContext(const OUString &rName, const css::uno::Reference<css::xml::sax::XAttributeList> &xAttribs) override;
+ rtl::Reference<XMLImportContext>
+ CreateChildContext(const OUString& rName,
+ const css::uno::Reference<css::xml::sax::XAttributeList>& xAttribs) override;
int GetColumn() const;
void SetColumn(int nColumn);
- void SAL_CALL startElement(const OUString &rName, const css::uno::Reference<css::xml::sax::XAttributeList> &xAttribs) override;
- void SAL_CALL endElement(const OUString &rName) override;
+ void SAL_CALL
+ startElement(const OUString& rName,
+ const css::uno::Reference<css::xml::sax::XAttributeList>& xAttribs) override;
+ void SAL_CALL endElement(const OUString& rName) override;
private:
int m_nColumn = 0;
@@ -41,38 +44,45 @@ private:
class XMLTableCellContext : public XMLImportContext
{
public:
- XMLTableCellContext(XMLImport &rImport, XMLTableRowContext &rRow);
+ XMLTableCellContext(XMLImport& rImport, XMLTableRowContext& rRow);
- rtl::Reference<XMLImportContext> CreateChildContext(const OUString &rName, const css::uno::Reference<css::xml::sax::XAttributeList> &xAttribs) override;
+ rtl::Reference<XMLImportContext>
+ CreateChildContext(const OUString& rName,
+ const css::uno::Reference<css::xml::sax::XAttributeList>& xAttribs) override;
- void SAL_CALL startElement(const OUString &rName, const css::uno::Reference<css::xml::sax::XAttributeList> &xAttribs) override;
- void SAL_CALL endElement(const OUString &rName) override;
+ void SAL_CALL
+ startElement(const OUString& rName,
+ const css::uno::Reference<css::xml::sax::XAttributeList>& xAttribs) override;
+ void SAL_CALL endElement(const OUString& rName) override;
private:
- XMLTableRowContext &m_rRow;
+ XMLTableRowContext& m_rRow;
};
-XMLTableCellContext::XMLTableCellContext(XMLImport &rImport, XMLTableRowContext &rRow)
- : XMLImportContext(rImport),
- m_rRow(rRow)
+XMLTableCellContext::XMLTableCellContext(XMLImport& rImport, XMLTableRowContext& rRow)
+ : XMLImportContext(rImport)
+ , m_rRow(rRow)
{
}
-rtl::Reference<XMLImportContext> XMLTableCellContext::CreateChildContext(const OUString &rName, const css::uno::Reference<css::xml::sax::XAttributeList> &/*xAttribs*/)
+rtl::Reference<XMLImportContext> XMLTableCellContext::CreateChildContext(
+ const OUString& rName, const css::uno::Reference<css::xml::sax::XAttributeList>& /*xAttribs*/)
{
return CreateTextChildContext(mrImport, rName);
}
-void XMLTableCellContext::startElement(const OUString &/*rName*/, const css::uno::Reference<css::xml::sax::XAttributeList> &xAttribs)
+void XMLTableCellContext::startElement(
+ const OUString& /*rName*/, const css::uno::Reference<css::xml::sax::XAttributeList>& xAttribs)
{
librevenge::RVNGPropertyList aPropertyList;
for (sal_Int16 i = 0; i < xAttribs->getLength(); ++i)
{
- const OUString &rAttributeName = xAttribs->getNameByIndex(i);
- const OUString &rAttributeValue = xAttribs->getValueByIndex(i);
+ const OUString& rAttributeName = xAttribs->getNameByIndex(i);
+ const OUString& rAttributeValue = xAttribs->getValueByIndex(i);
if (rAttributeName == "table:style-name")
- FillStyles(rAttributeValue, mrImport.GetAutomaticCellStyles(), mrImport.GetCellStyles(), aPropertyList);
+ FillStyles(rAttributeValue, mrImport.GetAutomaticCellStyles(), mrImport.GetCellStyles(),
+ aPropertyList);
else
{
OString sName = OUStringToOString(rAttributeName, RTL_TEXTENCODING_UTF8);
@@ -85,7 +95,7 @@ void XMLTableCellContext::startElement(const OUString &/*rName*/, const css::uno
m_rRow.SetColumn(m_rRow.GetColumn() + 1);
}
-void XMLTableCellContext::endElement(const OUString &/*rName*/)
+void XMLTableCellContext::endElement(const OUString& /*rName*/)
{
mrImport.GetGenerator().closeTableCell();
}
@@ -94,40 +104,46 @@ void XMLTableCellContext::endElement(const OUString &/*rName*/)
class XMLTableColumnContext : public XMLImportContext
{
public:
- XMLTableColumnContext(XMLImport &rImport, librevenge::RVNGPropertyListVector &rColumns);
+ XMLTableColumnContext(XMLImport& rImport, librevenge::RVNGPropertyListVector& rColumns);
- void SAL_CALL startElement(const OUString &rName, const css::uno::Reference<css::xml::sax::XAttributeList> &xAttribs) override;
+ void SAL_CALL
+ startElement(const OUString& rName,
+ const css::uno::Reference<css::xml::sax::XAttributeList>& xAttribs) override;
private:
- librevenge::RVNGPropertyListVector &m_rColumns;
+ librevenge::RVNGPropertyListVector& m_rColumns;
};
-XMLTableColumnContext::XMLTableColumnContext(XMLImport &rImport, librevenge::RVNGPropertyListVector &rColumns)
- : XMLImportContext(rImport),
- m_rColumns(rColumns)
+XMLTableColumnContext::XMLTableColumnContext(XMLImport& rImport,
+ librevenge::RVNGPropertyListVector& rColumns)
+ : XMLImportContext(rImport)
+ , m_rColumns(rColumns)
{
}
-void XMLTableColumnContext::startElement(const OUString &/*rName*/, const css::uno::Reference<css::xml::sax::XAttributeList> &xAttribs)
+void XMLTableColumnContext::startElement(
+ const OUString& /*rName*/, const css::uno::Reference<css::xml::sax::XAttributeList>& xAttribs)
{
librevenge::RVNGPropertyList aPropertyList;
for (sal_Int16 i = 0; i < xAttribs->getLength(); ++i)
{
- const OUString &rAttributeName = xAttribs->getNameByIndex(i);
- const OUString &rAttributeValue = xAttribs->getValueByIndex(i);
+ const OUString& rAttributeName = xAttribs->getNameByIndex(i);
+ const OUString& rAttributeValue = xAttribs->getValueByIndex(i);
if (rAttributeName == "table:style-name")
- FillStyles(rAttributeValue, mrImport.GetAutomaticColumnStyles(), mrImport.GetColumnStyles(), aPropertyList);
+ FillStyles(rAttributeValue, mrImport.GetAutomaticColumnStyles(),
+ mrImport.GetColumnStyles(), aPropertyList);
}
m_rColumns.append(aPropertyList);
}
-XMLTableRowContext::XMLTableRowContext(XMLImport &rImport)
+XMLTableRowContext::XMLTableRowContext(XMLImport& rImport)
: XMLImportContext(rImport)
{
}
-rtl::Reference<XMLImportContext> XMLTableRowContext::CreateChildContext(const OUString &rName, const css::uno::Reference<css::xml::sax::XAttributeList> &/*xAttribs*/)
+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);
@@ -141,41 +157,38 @@ rtl::Reference<XMLImportContext> XMLTableRowContext::CreateChildContext(const OU
return nullptr;
}
-void XMLTableRowContext::startElement(const OUString &/*rName*/, const css::uno::Reference<css::xml::sax::XAttributeList> &xAttribs)
+void XMLTableRowContext::startElement(
+ const OUString& /*rName*/, const css::uno::Reference<css::xml::sax::XAttributeList>& xAttribs)
{
librevenge::RVNGPropertyList aPropertyList;
for (sal_Int16 i = 0; i < xAttribs->getLength(); ++i)
{
- const OUString &rAttributeName = xAttribs->getNameByIndex(i);
- const OUString &rAttributeValue = xAttribs->getValueByIndex(i);
+ const OUString& rAttributeName = xAttribs->getNameByIndex(i);
+ const OUString& rAttributeValue = xAttribs->getValueByIndex(i);
if (rAttributeName == "table:style-name")
- FillStyles(rAttributeValue, mrImport.GetAutomaticRowStyles(), mrImport.GetRowStyles(), aPropertyList);
+ FillStyles(rAttributeValue, mrImport.GetAutomaticRowStyles(), mrImport.GetRowStyles(),
+ aPropertyList);
}
mrImport.GetGenerator().openTableRow(aPropertyList);
}
-void XMLTableRowContext::endElement(const OUString &/*rName*/)
+void XMLTableRowContext::endElement(const OUString& /*rName*/)
{
mrImport.GetGenerator().closeTableRow();
}
-int XMLTableRowContext::GetColumn() const
-{
- return m_nColumn;
-}
+int XMLTableRowContext::GetColumn() const { return m_nColumn; }
-void XMLTableRowContext::SetColumn(int nColumn)
-{
- m_nColumn = nColumn;
-}
+void XMLTableRowContext::SetColumn(int nColumn) { m_nColumn = nColumn; }
-XMLTableContext::XMLTableContext(XMLImport &rImport)
+XMLTableContext::XMLTableContext(XMLImport& rImport)
: XMLImportContext(rImport)
{
}
-rtl::Reference<XMLImportContext> XMLTableContext::CreateChildContext(const OUString &rName, const css::uno::Reference<css::xml::sax::XAttributeList> &/*xAttribs*/)
+rtl::Reference<XMLImportContext> XMLTableContext::CreateChildContext(
+ const OUString& rName, const css::uno::Reference<css::xml::sax::XAttributeList>& /*xAttribs*/)
{
if (rName == "table:table-column")
// Make sure columns are parsed before we open the table.
@@ -197,16 +210,18 @@ rtl::Reference<XMLImportContext> XMLTableContext::CreateChildContext(const OUStr
return nullptr;
}
-void XMLTableContext::startElement(const OUString &/*rName*/, const css::uno::Reference<css::xml::sax::XAttributeList> &xAttribs)
+void XMLTableContext::startElement(
+ const OUString& /*rName*/, const css::uno::Reference<css::xml::sax::XAttributeList>& xAttribs)
{
for (sal_Int16 i = 0; i < xAttribs->getLength(); ++i)
{
- const OUString &rAttributeName = xAttribs->getNameByIndex(i);
- const OUString &rAttributeValue = xAttribs->getValueByIndex(i);
+ const OUString& rAttributeName = xAttribs->getNameByIndex(i);
+ const OUString& rAttributeValue = xAttribs->getValueByIndex(i);
if (rAttributeName == "table:style-name")
{
- FillStyles(rAttributeValue, mrImport.GetAutomaticTableStyles(), mrImport.GetTableStyles(), m_aPropertyList);
+ FillStyles(rAttributeValue, mrImport.GetAutomaticTableStyles(),
+ mrImport.GetTableStyles(), m_aPropertyList);
mrImport.HandlePageSpan(m_aPropertyList);
}
else
@@ -218,7 +233,7 @@ void XMLTableContext::startElement(const OUString &/*rName*/, const css::uno::Re
}
}
-void XMLTableContext::endElement(const OUString &/*rName*/)
+void XMLTableContext::endElement(const OUString& /*rName*/)
{
mrImport.GetGenerator().closeTable();
}