[Libreoffice-commits] .: 99 commits - writerfilter/Library_rtftok.mk writerfilter/source
Miklos Vajna
vmiklos at kemper.freedesktop.org
Fri Jul 29 08:46:26 PDT 2011
writerfilter/Library_rtftok.mk | 2
writerfilter/source/dmapper/DomainMapper.cxx | 3
writerfilter/source/dmapper/DomainMapper_Impl.cxx | 26
writerfilter/source/dmapper/DomainMapper_Impl.hxx | 1
writerfilter/source/dmapper/NumberingManager.cxx | 3
writerfilter/source/rtftok/rtfcharsets.cxx | 2
writerfilter/source/rtftok/rtfcharsets.hxx | 46
writerfilter/source/rtftok/rtfcontrolwords.cxx | 2
writerfilter/source/rtftok/rtfcontrolwords.hxx | 20
writerfilter/source/rtftok/rtfdocumentimpl.cxx | 1580 ++++++++++--------
writerfilter/source/rtftok/rtfdocumentimpl.hxx | 218 +-
writerfilter/source/rtftok/rtfreferenceproperties.cxx | 8
writerfilter/source/rtftok/rtfreferenceproperties.hxx | 8
writerfilter/source/rtftok/rtfsdrimport.cxx | 335 +++
writerfilter/source/rtftok/rtfsdrimport.hxx | 59
writerfilter/source/rtftok/rtfsprm.cxx | 29
writerfilter/source/rtftok/rtfsprm.hxx | 22
writerfilter/source/rtftok/rtftokenizer.cxx | 264 +++
writerfilter/source/rtftok/rtftokenizer.hxx | 59
writerfilter/source/rtftok/rtftypes.hxx | 58
writerfilter/source/rtftok/rtfvalue.cxx | 70
writerfilter/source/rtftok/rtfvalue.hxx | 22
22 files changed, 2034 insertions(+), 803 deletions(-)
New commits:
commit 5d597d4c9a598717fcf05f7ceea22fa67d87c5ee
Merge: bbba68e... 7e9b696...
Author: Miklos Vajna <vmiklos at frugalware.org>
Date: Fri Jul 29 17:45:24 2011 +0200
Merge remote-tracking branch 'feature/gsoc2011_rtfimport'
commit 7e9b696dcd3e1c728e5f3d5e9c3ead741301397d
Author: Miklos Vajna <vmiklos at frugalware.org>
Date: Fri Jul 29 17:40:31 2011 +0200
no need to call lcl_RtfToString in product build
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index 2c54e1d..cdefe9e 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -1137,7 +1137,9 @@ int RTFDocumentImpl::dispatchDestination(RTFKeyword nKeyword)
m_aStates.top().nDestinationState = DESTINATION_SKIP;
break;
default:
+#if OSL_DEBUG_LEVEL > 1
OSL_TRACE("%s: TODO handle destination '%s'", OSL_THIS_FUNC, lcl_RtfToString(nKeyword));
+#endif
// Make sure we skip destinations (even without \*) till we don't handle them
m_aStates.top().nDestinationState = DESTINATION_SKIP;
bParsed = false;
@@ -1307,7 +1309,9 @@ int RTFDocumentImpl::dispatchSymbol(RTFKeyword nKeyword)
// Nothing to do, dmapper assumes this is the default.
break;
default:
+#if OSL_DEBUG_LEVEL > 1
OSL_TRACE("%s: TODO handle symbol '%s'", OSL_THIS_FUNC, lcl_RtfToString(nKeyword));
+#endif
bParsed = false;
break;
}
@@ -1650,7 +1654,9 @@ int RTFDocumentImpl::dispatchFlag(RTFKeyword nKeyword)
}
break;
default:
+#if OSL_DEBUG_LEVEL > 1
OSL_TRACE("%s: TODO handle flag '%s'", OSL_THIS_FUNC, lcl_RtfToString(nKeyword));
+#endif
bParsed = false;
break;
}
@@ -2209,7 +2215,9 @@ int RTFDocumentImpl::dispatchValue(RTFKeyword nKeyword, int nParam)
// Ignore this for now, later the RTF writer version could be used to add hacks for older buggy writers.
break;
default:
+#if OSL_DEBUG_LEVEL > 1
OSL_TRACE("%s: TODO handle value '%s'", OSL_THIS_FUNC, lcl_RtfToString(nKeyword));
+#endif
bParsed = false;
break;
}
@@ -2309,7 +2317,9 @@ int RTFDocumentImpl::dispatchToggle(RTFKeyword nKeyword, bool bParam, int nParam
}
break;
default:
+#if OSL_DEBUG_LEVEL > 1
OSL_TRACE("%s: TODO handle toggle '%s'", OSL_THIS_FUNC, lcl_RtfToString(nKeyword));
+#endif
bParsed = false;
break;
}
commit 4eb483eaa36a9e04bcffc6ec325c713900384d21
Author: Miklos Vajna <vmiklos at frugalware.org>
Date: Fri Jul 29 17:18:12 2011 +0200
Add initial support for the EQ field (fdo#36089)
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index 833e982..2c54e1d 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -275,7 +275,8 @@ RTFDocumentImpl::RTFDocumentImpl(uno::Reference<uno::XComponentContext> const& x
m_aFontTableEntries(),
m_nCurrentFontIndex(0),
m_aStyleTableEntries(),
- m_nCurrentStyleIndex(0)
+ m_nCurrentStyleIndex(0),
+ m_bEq(false)
{
OSL_ASSERT(xInputStream.is());
m_pInStream = utl::UcbStreamHelper::CreateStream(xInputStream, sal_True);
@@ -747,6 +748,11 @@ void RTFDocumentImpl::text(OUString& rString)
case DESTINATION_ANNOTATIONAUTHOR:
m_aDestinationText.append(rString);
break;
+ case DESTINATION_EQINSTRUCTION:
+ if (rString.copy(0, 2).equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("do"))
+ && rString.copy(2).toInt32() > 0)
+ dispatchFlag(RTF_SUB);
+ break;
default: bRet = false; break;
}
if (bRet)
@@ -884,10 +890,26 @@ int RTFDocumentImpl::dispatchDestination(RTFKeyword nKeyword)
break;
case RTF_FLDINST:
{
- sal_uInt8 sFieldStart[] = { 0x13 };
- Mapper().startCharacterGroup();
- Mapper().text(sFieldStart, 1);
- Mapper().endCharacterGroup();
+ sal_Int32 nPos = Strm().Tell();
+ OStringBuffer aBuf;
+ char ch;
+ for (int i = 0; i < 4; ++i)
+ {
+ Strm() >> ch;
+ aBuf.append(ch);
+ }
+ Strm().Seek(nPos);
+
+ // EQ fields are not really fields in fact.
+ if (aBuf.toString().equals("{ EQ"))
+ m_bEq = true;
+ else
+ {
+ sal_uInt8 sFieldStart[] = { 0x13 };
+ Mapper().startCharacterGroup();
+ Mapper().text(sFieldStart, 1);
+ Mapper().endCharacterGroup();
+ }
m_aStates.top().nDestinationState = DESTINATION_FIELDINSTRUCTION;
}
break;
@@ -2329,10 +2351,14 @@ int RTFDocumentImpl::pushState()
else if (m_aStates.top().nDestinationState == DESTINATION_FIELDRESULT ||
m_aStates.top().nDestinationState == DESTINATION_SHAPETEXT ||
m_aStates.top().nDestinationState == DESTINATION_FORMFIELD ||
- m_aStates.top().nDestinationState == DESTINATION_FIELDINSTRUCTION)
+ (m_aStates.top().nDestinationState == DESTINATION_FIELDINSTRUCTION && !m_bEq))
m_aStates.top().nDestinationState = DESTINATION_NORMAL;
+ else if (m_aStates.top().nDestinationState == DESTINATION_FIELDINSTRUCTION && m_bEq)
+ m_aStates.top().nDestinationState = DESTINATION_EQINSTRUCTION;
else if (m_aStates.top().nDestinationState == DESTINATION_REVISIONTABLE)
m_aStates.top().nDestinationState = DESTINATION_REVISIONENTRY;
+ else if (m_aStates.top().nDestinationState == DESTINATION_EQINSTRUCTION)
+ m_aStates.top().nDestinationState = DESTINATION_NORMAL;
return 0;
}
@@ -2448,17 +2474,25 @@ int RTFDocumentImpl::popState()
m_aFormfieldAttributes->clear();
m_aFormfieldSprms->clear();
}
- sal_uInt8 sFieldSep[] = { 0x14 };
- Mapper().startCharacterGroup();
- Mapper().text(sFieldSep, 1);
- Mapper().endCharacterGroup();
+ if (!m_bEq)
+ {
+ sal_uInt8 sFieldSep[] = { 0x14 };
+ Mapper().startCharacterGroup();
+ Mapper().text(sFieldSep, 1);
+ Mapper().endCharacterGroup();
+ }
}
else if (m_aStates.top().nDestinationState == DESTINATION_FIELDRESULT)
{
- sal_uInt8 sFieldEnd[] = { 0x15 };
- Mapper().startCharacterGroup();
- Mapper().text(sFieldEnd, 1);
- Mapper().endCharacterGroup();
+ if (!m_bEq)
+ {
+ sal_uInt8 sFieldEnd[] = { 0x15 };
+ Mapper().startCharacterGroup();
+ Mapper().text(sFieldEnd, 1);
+ Mapper().endCharacterGroup();
+ }
+ else
+ m_bEq = false;
}
else if (m_aStates.top().nDestinationState == DESTINATION_LEVELTEXT)
{
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.hxx b/writerfilter/source/rtftok/rtfdocumentimpl.hxx
index edf7b73..dec202b 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.hxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.hxx
@@ -69,6 +69,7 @@ namespace writerfilter {
DESTINATION_COLORTABLE,
DESTINATION_STYLESHEET,
DESTINATION_STYLEENTRY,
+ DESTINATION_EQINSTRUCTION,
DESTINATION_FIELDINSTRUCTION,
DESTINATION_FIELDRESULT,
DESTINATION_LISTTABLE,
@@ -385,6 +386,7 @@ namespace writerfilter {
RTFReferenceTable::Entries_t m_aStyleTableEntries;
int m_nCurrentStyleIndex;
+ bool m_bEq;
};
} // namespace rtftok
commit d2af5f65503f33c8d59097fe873c0f1534d0e872
Author: Miklos Vajna <vmiklos at frugalware.org>
Date: Fri Jul 29 12:06:30 2011 +0200
handle groups inside fldinst destination
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index 58809d4..833e982 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -2328,7 +2328,8 @@ int RTFDocumentImpl::pushState()
m_aStates.top().nDestinationState = DESTINATION_STYLEENTRY;
else if (m_aStates.top().nDestinationState == DESTINATION_FIELDRESULT ||
m_aStates.top().nDestinationState == DESTINATION_SHAPETEXT ||
- m_aStates.top().nDestinationState == DESTINATION_FORMFIELD)
+ m_aStates.top().nDestinationState == DESTINATION_FORMFIELD ||
+ m_aStates.top().nDestinationState == DESTINATION_FIELDINSTRUCTION)
m_aStates.top().nDestinationState = DESTINATION_NORMAL;
else if (m_aStates.top().nDestinationState == DESTINATION_REVISIONTABLE)
m_aStates.top().nDestinationState = DESTINATION_REVISIONENTRY;
commit 89457083258d090e55012f59e21210614e613ec3
Author: Miklos Vajna <vmiklos at frugalware.org>
Date: Thu Jul 28 16:09:54 2011 +0200
send cell width values in the first row only
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index 5ecd013..58809d4 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -250,6 +250,7 @@ RTFDocumentImpl::RTFDocumentImpl(uno::Reference<uno::XComponentContext> const& x
m_aFontEncodings(),
m_aColorTable(),
m_bFirstRun(true),
+ m_bFirstRow(true),
m_bNeedPap(false),
m_aListTableSprms(),
m_aSettingsTableSprms(),
@@ -397,6 +398,11 @@ void RTFDocumentImpl::parBreak()
Mapper().endCharacterGroup();
Mapper().endParagraphGroup();
+ // If we are not in a table, then the next table row will be the first one.
+ RTFValue::Pointer_t pValue = m_aStates.top().aParagraphSprms.find(NS_sprm::LN_PFInTable);
+ if (!pValue.get())
+ m_bFirstRow = true;
+
// start new one
Mapper().startParagraphGroup();
}
@@ -1211,6 +1217,7 @@ int RTFDocumentImpl::dispatchSymbol(RTFKeyword nKeyword)
case RTF_ROW:
case RTF_NESTROW:
{
+ m_bFirstRow = false;
if (m_aStates.top().nCells)
{
// Make a backup before we start popping elements
@@ -1224,6 +1231,8 @@ int RTFDocumentImpl::dispatchSymbol(RTFKeyword nKeyword)
m_aStates.top().aTableCellsSprms = m_aStates.top().aTableInheritingCellsSprms;
m_aStates.top().aTableCellsAttributes = m_aStates.top().aTableInheritingCellsAttributes;
m_aStates.top().nCells = m_aStates.top().nInheritingCells;
+ // This can't be the first row, and we need cell width only there
+ while(m_aStates.top().aTableRowSprms.erase(NS_ooxml::LN_CT_TblGridBase_gridCol));
}
for (int i = 0; i < m_aStates.top().nCells; ++i)
{
@@ -1974,8 +1983,11 @@ int RTFDocumentImpl::dispatchValue(RTFKeyword nKeyword, int nParam)
{
int nCellX = nParam - m_aStates.top().nCellX;
m_aStates.top().nCellX = nParam;
- RTFValue::Pointer_t pXValue(new RTFValue(nCellX));
- m_aStates.top().aTableRowSprms->push_back(make_pair(NS_ooxml::LN_CT_TblGridBase_gridCol, pXValue));
+ if (m_bFirstRow)
+ {
+ RTFValue::Pointer_t pXValue(new RTFValue(nCellX));
+ m_aStates.top().aTableRowSprms->push_back(make_pair(NS_ooxml::LN_CT_TblGridBase_gridCol, pXValue));
+ }
m_aStates.top().nCells++;
// Push cell properties.
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.hxx b/writerfilter/source/rtftok/rtfdocumentimpl.hxx
index f10a434..edf7b73 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.hxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.hxx
@@ -332,6 +332,8 @@ namespace writerfilter {
/// Color index <-> RGB color value map
std::vector<sal_uInt32> m_aColorTable;
bool m_bFirstRun;
+ /// If this is the first row in a table - there we send cell widths.
+ bool m_bFirstRow;
/// If paragraph properties should be emitted on next run.
bool m_bNeedPap;
/// The list table and list override table combined.
commit 42b90d539efa169af9846fc6e67503b3fcef11af
Author: Miklos Vajna <vmiklos at frugalware.org>
Date: Thu Jul 28 16:31:57 2011 +0200
RTFSprms::erase: use return value to signal if the call was a noop
diff --git a/writerfilter/source/rtftok/rtfsprm.cxx b/writerfilter/source/rtftok/rtfsprm.cxx
index cdeae22..976505f 100644
--- a/writerfilter/source/rtftok/rtfsprm.cxx
+++ b/writerfilter/source/rtftok/rtfsprm.cxx
@@ -105,14 +105,15 @@ RTFValue::Pointer_t RTFSprms::find(Id nKeyword)
return pValue;
}
-void RTFSprms::erase(Id nKeyword)
+bool RTFSprms::erase(Id nKeyword)
{
for (RTFSprms::Iterator_t i = m_aSprms.begin(); i != m_aSprms.end(); ++i)
if (i->first == nKeyword)
{
m_aSprms.erase(i);
- return;
+ return true;
}
+ return false;
}
RTFSprms::RTFSprms()
diff --git a/writerfilter/source/rtftok/rtfsprm.hxx b/writerfilter/source/rtftok/rtfsprm.hxx
index 96e23f3..1f34720 100644
--- a/writerfilter/source/rtftok/rtfsprm.hxx
+++ b/writerfilter/source/rtftok/rtfsprm.hxx
@@ -45,7 +45,7 @@ namespace writerfilter {
RTFSprms(const RTFSprms& rSprms);
std::vector< std::pair<Id, RTFValue::Pointer_t> >* operator->();
RTFValue::Pointer_t find(Id nKeyword);
- void erase(Id nKeyword);
+ bool erase(Id nKeyword);
private:
std::vector< std::pair<Id, RTFValue::Pointer_t> > m_aSprms;
};
commit 45eda88851285c108db1244647d66ec4af042567
Author: Miklos Vajna <vmiklos at frugalware.org>
Date: Thu Jul 28 13:44:32 2011 +0200
avoid sending duplicated paragraph flags
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index b0a7a8a..5ecd013 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -1402,6 +1402,7 @@ int RTFDocumentImpl::dispatchFlag(RTFKeyword nKeyword)
if (nParam >= 0)
{
RTFValue::Pointer_t pValue(new RTFValue(1));
+ m_aStates.top().aParagraphSprms.erase(NS_sprm::LN_PFInTable);
m_aStates.top().aParagraphSprms->push_back(make_pair(nParam, pValue));
skipDestination(bParsed);
return 0;
commit 34b4d3f67b69343ff19ac489d4eafd510cc13e4b
Author: Miklos Vajna <vmiklos at frugalware.org>
Date: Thu Jul 28 13:36:50 2011 +0200
inherit table definition from previous row if it's missing
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index eeefbf0..b0a7a8a 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -1211,6 +1211,20 @@ int RTFDocumentImpl::dispatchSymbol(RTFKeyword nKeyword)
case RTF_ROW:
case RTF_NESTROW:
{
+ if (m_aStates.top().nCells)
+ {
+ // Make a backup before we start popping elements
+ m_aStates.top().aTableInheritingCellsSprms = m_aStates.top().aTableCellsSprms;
+ m_aStates.top().aTableInheritingCellsAttributes = m_aStates.top().aTableCellsAttributes;
+ m_aStates.top().nInheritingCells = m_aStates.top().nCells;
+ }
+ else
+ {
+ // No table definition? Then inherit from the previous row
+ m_aStates.top().aTableCellsSprms = m_aStates.top().aTableInheritingCellsSprms;
+ m_aStates.top().aTableCellsAttributes = m_aStates.top().aTableInheritingCellsAttributes;
+ m_aStates.top().nCells = m_aStates.top().nInheritingCells;
+ }
for (int i = 0; i < m_aStates.top().nCells; ++i)
{
m_aStates.top().aTableCellSprms = m_aStates.top().aTableCellsSprms.front();
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.hxx b/writerfilter/source/rtftok/rtfdocumentimpl.hxx
index 5db4bbd..f10a434 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.hxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.hxx
@@ -204,6 +204,9 @@ namespace writerfilter {
// reset by row/nestrow
std::deque<RTFSprms> aTableCellsSprms;
std::deque<RTFSprms> aTableCellsAttributes;
+ // backup of the above two, to support inheriting cell props
+ std::deque<RTFSprms> aTableInheritingCellsSprms;
+ std::deque<RTFSprms> aTableInheritingCellsAttributes;
// reset by tx
RTFSprms aTabAttributes;
@@ -231,6 +234,7 @@ namespace writerfilter {
/// Current cellx value.
int nCellX;
int nCells;
+ int nInheritingCells;
/// CJK or CTL?
bool bIsCjk;
commit 5bdb2ba403f025e6a3ea8ea603625feb72a68f5f
Author: Miklos Vajna <vmiklos at frugalware.org>
Date: Thu Jul 28 10:52:20 2011 +0200
Support table definition at the start of the row
Old writers like Word97 output the table definition there, instead of at
the end.
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index 61b0509..eeefbf0 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -1211,6 +1211,18 @@ int RTFDocumentImpl::dispatchSymbol(RTFKeyword nKeyword)
case RTF_ROW:
case RTF_NESTROW:
{
+ for (int i = 0; i < m_aStates.top().nCells; ++i)
+ {
+ m_aStates.top().aTableCellSprms = m_aStates.top().aTableCellsSprms.front();
+ m_aStates.top().aTableCellsSprms.pop_front();
+ m_aStates.top().aTableCellAttributes = m_aStates.top().aTableCellsAttributes.front();
+ m_aStates.top().aTableCellsAttributes.pop_front();
+ replayBuffer(m_aTableBuffer);
+ }
+ m_aStates.top().nCells = 0;
+ m_aStates.top().aTableCellSprms = m_aDefaultState.aTableCellSprms;
+ m_aStates.top().aTableCellAttributes = m_aDefaultState.aTableCellAttributes;
+
writerfilter::Reference<Properties>::Pointer_t const pParagraphProperties(
new RTFReferenceProperties(m_aStates.top().aParagraphAttributes, m_aStates.top().aParagraphSprms)
);
@@ -1234,6 +1246,8 @@ int RTFDocumentImpl::dispatchSymbol(RTFKeyword nKeyword)
tableBreak();
m_bNeedPap = true;
m_aTableBuffer.clear();
+ m_aStates.top().aTableCellsSprms.clear();
+ m_aStates.top().aTableCellsAttributes.clear();
}
break;
case RTF_COLUMN:
@@ -1947,10 +1961,11 @@ int RTFDocumentImpl::dispatchValue(RTFKeyword nKeyword, int nParam)
m_aStates.top().nCellX = nParam;
RTFValue::Pointer_t pXValue(new RTFValue(nCellX));
m_aStates.top().aTableRowSprms->push_back(make_pair(NS_ooxml::LN_CT_TblGridBase_gridCol, pXValue));
+ m_aStates.top().nCells++;
- replayBuffer(m_aTableBuffer);
-
- // Reset cell properties.
+ // Push cell properties.
+ m_aStates.top().aTableCellsSprms.push_back(m_aStates.top().aTableCellSprms);
+ m_aStates.top().aTableCellsAttributes.push_back(m_aStates.top().aTableCellAttributes);
m_aStates.top().aTableCellSprms = m_aDefaultState.aTableCellSprms;
m_aStates.top().aTableCellAttributes = m_aDefaultState.aTableCellAttributes;
}
@@ -2765,6 +2780,8 @@ RTFParserState::RTFParserState()
aTableRowAttributes(),
aTableCellSprms(),
aTableCellAttributes(),
+ aTableCellsSprms(),
+ aTableCellsAttributes(),
aTabAttributes(),
aCurrentColor(),
nCurrentEncoding(0),
@@ -2777,6 +2794,7 @@ RTFParserState::RTFParserState()
nPictureScaleY(0),
aShape(),
nCellX(0),
+ nCells(0),
bIsCjk(false),
nYear(0),
nMonth(0),
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.hxx b/writerfilter/source/rtftok/rtfdocumentimpl.hxx
index 1c31e5f..5db4bbd 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.hxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.hxx
@@ -201,6 +201,9 @@ namespace writerfilter {
// reset by cellx
RTFSprms aTableCellSprms;
RTFSprms aTableCellAttributes;
+ // reset by row/nestrow
+ std::deque<RTFSprms> aTableCellsSprms;
+ std::deque<RTFSprms> aTableCellsAttributes;
// reset by tx
RTFSprms aTabAttributes;
@@ -227,6 +230,7 @@ namespace writerfilter {
/// Current cellx value.
int nCellX;
+ int nCells;
/// CJK or CTL?
bool bIsCjk;
commit 5aac2d083b24f3b2b93577302d84b5f9411f90b3
Author: Miklos Vajna <vmiklos at frugalware.org>
Date: Wed Jul 27 18:48:59 2011 +0200
these are unused
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index 64d5e91..61b0509 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -1951,8 +1951,6 @@ int RTFDocumentImpl::dispatchValue(RTFKeyword nKeyword, int nParam)
replayBuffer(m_aTableBuffer);
// Reset cell properties.
- RTFSprms::Pointer_t pTableCellSprms(new RTFSprms(m_aStates.top().aTableCellSprms));
- RTFSprms::Pointer_t pTableCellAttributes(new RTFSprms(m_aStates.top().aTableCellAttributes));
m_aStates.top().aTableCellSprms = m_aDefaultState.aTableCellSprms;
m_aStates.top().aTableCellAttributes = m_aDefaultState.aTableCellAttributes;
}
commit 11a907441c9ed4428ba7bd2067810d360b9a9fe1
Author: Miklos Vajna <vmiklos at frugalware.org>
Date: Wed Jul 27 18:09:04 2011 +0200
these static methods are no longer needed
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index eee54dd..64d5e91 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -68,14 +68,14 @@ namespace rtftok {
static RTFSprms& lcl_getNumPr(std::stack<RTFParserState>& aStates)
{
// insert the numpr sprm if necessary
- RTFValue::Pointer_t p = RTFSprm::find(aStates.top().aParagraphSprms, NS_ooxml::LN_CT_PPrBase_numPr);
+ RTFValue::Pointer_t p = aStates.top().aParagraphSprms.find(NS_ooxml::LN_CT_PPrBase_numPr);
if (!p.get())
{
RTFSprms aAttributes;
RTFSprms aSprms;
RTFValue::Pointer_t pValue(new RTFValue(aAttributes, aSprms));
aStates.top().aParagraphSprms->push_back(make_pair(NS_ooxml::LN_CT_PPrBase_numPr, pValue));
- p = RTFSprm::find(aStates.top().aParagraphSprms, NS_ooxml::LN_CT_PPrBase_numPr);
+ p = aStates.top().aParagraphSprms.find(NS_ooxml::LN_CT_PPrBase_numPr);
}
return p->getSprms();
}
@@ -93,7 +93,7 @@ static Id lcl_getParagraphBorder(sal_uInt32 nIndex)
static void lcl_putNestedAttribute(RTFSprms& rSprms, Id nParent, Id nId, RTFValue::Pointer_t pValue,
bool bOverwrite = false, bool bAttribute = true)
{
- RTFValue::Pointer_t pParent = RTFSprm::find(rSprms, nParent);
+ RTFValue::Pointer_t pParent = rSprms.find(nParent);
if (!pParent.get())
{
RTFSprms aAttributes;
@@ -119,7 +119,7 @@ static void lcl_putNestedSprm(RTFSprms& rSprms, Id nParent, Id nId, RTFValue::Po
static RTFSprms& lcl_getLastAttributes(RTFSprms& rSprms, Id nId)
{
- RTFValue::Pointer_t p = RTFSprm::find(rSprms, nId);
+ RTFValue::Pointer_t p = rSprms.find(nId);
if (p.get() && p->getSprms()->size())
return p->getSprms()->back().second->getAttributes();
else
@@ -134,7 +134,7 @@ static void lcl_putBorderProperty(std::stack<RTFParserState>& aStates, Id nId, R
if (aStates.top().nBorderState == BORDER_PARAGRAPH)
for (int i = 0; i < 4; i++)
{
- RTFValue::Pointer_t p = RTFSprm::find(aStates.top().aParagraphSprms, lcl_getParagraphBorder(i));
+ RTFValue::Pointer_t p = aStates.top().aParagraphSprms.find(lcl_getParagraphBorder(i));
if (p.get())
{
RTFSprms& rAttributes = p->getAttributes();
@@ -410,10 +410,10 @@ void RTFDocumentImpl::sectBreak(bool bFinal = false)
resolveSubstream(aPair.second, aPair.first);
}
- RTFValue::Pointer_t pBreak = RTFSprm::find(m_aStates.top().aSectionSprms, NS_sprm::LN_SBkc);
+ RTFValue::Pointer_t pBreak = m_aStates.top().aSectionSprms.find(NS_sprm::LN_SBkc);
// In case the last section is a continous one, we don't need to output a section break.
if (bFinal && pBreak.get() && !pBreak->getInt())
- RTFSprm::erase(m_aStates.top().aSectionSprms, NS_sprm::LN_SBkc);
+ m_aStates.top().aSectionSprms.erase(NS_sprm::LN_SBkc);
// Section properties are a paragraph sprm.
RTFValue::Pointer_t pValue(new RTFValue(m_aStates.top().aSectionAttributes, m_aStates.top().aSectionSprms));
@@ -2434,8 +2434,8 @@ int RTFDocumentImpl::popState()
}
else if (m_aStates.top().nDestinationState == DESTINATION_LEVELNUMBERS)
{
- RTFSprms& rAttributes = RTFSprm::find(m_aStates.top().aTableSprms, NS_ooxml::LN_CT_Lvl_lvlText)->getAttributes();
- RTFValue::Pointer_t pValue = RTFSprm::find(rAttributes, NS_ooxml::LN_CT_LevelText_val);
+ RTFSprms& rAttributes = m_aStates.top().aTableSprms.find(NS_ooxml::LN_CT_Lvl_lvlText)->getAttributes();
+ RTFValue::Pointer_t pValue = rAttributes.find(NS_ooxml::LN_CT_LevelText_val);
OUString aOrig = pValue->getString();
OUStringBuffer aBuf;
@@ -2624,7 +2624,7 @@ int RTFDocumentImpl::popState()
aObjSprms->push_back(make_pair(NS_ooxml::LN_object, pValue));
writerfilter::Reference<Properties>::Pointer_t const pProperties(new RTFReferenceProperties(aObjAttributes, aObjSprms));
uno::Reference<drawing::XShape> xShape;
- RTFValue::Pointer_t pShape = RTFSprm::find(m_aObjectAttributes, NS_ooxml::LN_shape);
+ RTFValue::Pointer_t pShape = m_aObjectAttributes.find(NS_ooxml::LN_shape);
OSL_ASSERT(pShape.get());
if (pShape.get())
pShape->getAny() >>= xShape;
@@ -2654,7 +2654,7 @@ int RTFDocumentImpl::popState()
m_aAuthor = m_aDestinationText.makeStringAndClear();
// See if we need to end a track change
- RTFValue::Pointer_t pTrackchange = RTFSprm::find(m_aStates.top().aCharacterSprms, NS_ooxml::LN_trackchange);
+ RTFValue::Pointer_t pTrackchange = m_aStates.top().aCharacterSprms.find(NS_ooxml::LN_trackchange);
if (pTrackchange.get())
{
RTFSprms aTCAttributes;
diff --git a/writerfilter/source/rtftok/rtfsprm.cxx b/writerfilter/source/rtftok/rtfsprm.cxx
index cb634df..cdeae22 100644
--- a/writerfilter/source/rtftok/rtfsprm.cxx
+++ b/writerfilter/source/rtftok/rtfsprm.cxx
@@ -96,21 +96,21 @@ std::string RTFSprm::toString() const
return aBuf.makeStringAndClear().getStr();
}
-RTFValue::Pointer_t RTFSprm::find(RTFSprms &rVector, Id nKeyword)
+RTFValue::Pointer_t RTFSprms::find(Id nKeyword)
{
- for (RTFSprms::Iterator_t i = rVector->begin(); i != rVector->end(); ++i)
+ for (RTFSprms::Iterator_t i = m_aSprms.begin(); i != m_aSprms.end(); ++i)
if (i->first == nKeyword)
return i->second;
RTFValue::Pointer_t pValue;
return pValue;
}
-void RTFSprm::erase(RTFSprms &rVector, Id nKeyword)
+void RTFSprms::erase(Id nKeyword)
{
- for (RTFSprms::Iterator_t i = rVector->begin(); i != rVector->end(); ++i)
+ for (RTFSprms::Iterator_t i = m_aSprms.begin(); i != m_aSprms.end(); ++i)
if (i->first == nKeyword)
{
- rVector->erase(i);
+ m_aSprms.erase(i);
return;
}
}
diff --git a/writerfilter/source/rtftok/rtfsprm.hxx b/writerfilter/source/rtftok/rtfsprm.hxx
index 0bb18d2..96e23f3 100644
--- a/writerfilter/source/rtftok/rtfsprm.hxx
+++ b/writerfilter/source/rtftok/rtfsprm.hxx
@@ -44,6 +44,8 @@ namespace writerfilter {
RTFSprms();
RTFSprms(const RTFSprms& rSprms);
std::vector< std::pair<Id, RTFValue::Pointer_t> >* operator->();
+ RTFValue::Pointer_t find(Id nKeyword);
+ void erase(Id nKeyword);
private:
std::vector< std::pair<Id, RTFValue::Pointer_t> > m_aSprms;
};
@@ -62,8 +64,6 @@ namespace writerfilter {
virtual Kind getKind();
virtual std::string getName() const;
virtual std::string toString() const;
- static RTFValue::Pointer_t find(RTFSprms& rVector, Id nKeyword);
- static void erase(RTFSprms& rVector, Id nKeyword);
private:
Id m_nKeyword;
RTFValue::Pointer_t& m_pValue;
commit d4618a5441724ea2ff496e58aea23611a7f75c0b
Author: Miklos Vajna <vmiklos at frugalware.org>
Date: Wed Jul 27 17:56:02 2011 +0200
Introduce the RTFSprms class
Instead of hardwiring an ugly list in RTFParserState::Clone(), turn the
RTFSprms_t typedef to a real class with a proper copy constructor.
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index 01082ee..eee54dd 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -65,16 +65,16 @@ using rtl::OUStringToOString;
namespace writerfilter {
namespace rtftok {
-static RTFSprms_t& lcl_getNumPr(std::stack<RTFParserState>& aStates)
+static RTFSprms& lcl_getNumPr(std::stack<RTFParserState>& aStates)
{
// insert the numpr sprm if necessary
RTFValue::Pointer_t p = RTFSprm::find(aStates.top().aParagraphSprms, NS_ooxml::LN_CT_PPrBase_numPr);
if (!p.get())
{
- RTFSprms_t aAttributes;
- RTFSprms_t aSprms;
+ RTFSprms aAttributes;
+ RTFSprms aSprms;
RTFValue::Pointer_t pValue(new RTFValue(aAttributes, aSprms));
- aStates.top().aParagraphSprms.push_back(make_pair(NS_ooxml::LN_CT_PPrBase_numPr, pValue));
+ aStates.top().aParagraphSprms->push_back(make_pair(NS_ooxml::LN_CT_PPrBase_numPr, pValue));
p = RTFSprm::find(aStates.top().aParagraphSprms, NS_ooxml::LN_CT_PPrBase_numPr);
}
return p->getSprms();
@@ -90,38 +90,38 @@ static Id lcl_getParagraphBorder(sal_uInt32 nIndex)
return aBorderIds[nIndex];
}
-static void lcl_putNestedAttribute(RTFSprms_t& rSprms, Id nParent, Id nId, RTFValue::Pointer_t pValue,
+static void lcl_putNestedAttribute(RTFSprms& rSprms, Id nParent, Id nId, RTFValue::Pointer_t pValue,
bool bOverwrite = false, bool bAttribute = true)
{
RTFValue::Pointer_t pParent = RTFSprm::find(rSprms, nParent);
if (!pParent.get())
{
- RTFSprms_t aAttributes;
+ RTFSprms aAttributes;
RTFValue::Pointer_t pParentValue(new RTFValue(aAttributes));
- rSprms.push_back(make_pair(nParent, pParentValue));
+ rSprms->push_back(make_pair(nParent, pParentValue));
pParent = pParentValue;
}
- RTFSprms_t& rAttributes = (bAttribute ? pParent->getAttributes() : pParent->getSprms());
+ RTFSprms& rAttributes = (bAttribute ? pParent->getAttributes() : pParent->getSprms());
if (bOverwrite)
- for (RTFSprms_t::iterator i = rAttributes.begin(); i != rAttributes.end(); ++i)
+ for (RTFSprms::Iterator_t i = rAttributes->begin(); i != rAttributes->end(); ++i)
if (i->first == nId)
{
i->second = pValue;
return;
}
- rAttributes.push_back(make_pair(nId, pValue));
+ rAttributes->push_back(make_pair(nId, pValue));
}
-static void lcl_putNestedSprm(RTFSprms_t& rSprms, Id nParent, Id nId, RTFValue::Pointer_t pValue, bool bOverwrite = false)
+static void lcl_putNestedSprm(RTFSprms& rSprms, Id nParent, Id nId, RTFValue::Pointer_t pValue, bool bOverwrite = false)
{
lcl_putNestedAttribute(rSprms, nParent, nId, pValue, bOverwrite, false);
}
-static RTFSprms_t& lcl_getLastAttributes(RTFSprms_t& rSprms, Id nId)
+static RTFSprms& lcl_getLastAttributes(RTFSprms& rSprms, Id nId)
{
RTFValue::Pointer_t p = RTFSprm::find(rSprms, nId);
- if (p.get() && p->getSprms().size())
- return p->getSprms().back().second->getAttributes();
+ if (p.get() && p->getSprms()->size())
+ return p->getSprms()->back().second->getAttributes();
else
{
OSL_FAIL("trying to set property when no type is defined");
@@ -137,21 +137,21 @@ static void lcl_putBorderProperty(std::stack<RTFParserState>& aStates, Id nId, R
RTFValue::Pointer_t p = RTFSprm::find(aStates.top().aParagraphSprms, lcl_getParagraphBorder(i));
if (p.get())
{
- RTFSprms_t& rAttributes = p->getAttributes();
- rAttributes.push_back(make_pair(nId, pValue));
+ RTFSprms& rAttributes = p->getAttributes();
+ rAttributes->push_back(make_pair(nId, pValue));
}
}
else if (aStates.top().nBorderState == BORDER_CELL)
{
// Attributes of the last border type
- RTFSprms_t& rAttributes = lcl_getLastAttributes(aStates.top().aTableCellSprms, NS_ooxml::LN_CT_TcPrBase_tcBorders);
- rAttributes.push_back(make_pair(nId, pValue));
+ RTFSprms& rAttributes = lcl_getLastAttributes(aStates.top().aTableCellSprms, NS_ooxml::LN_CT_TcPrBase_tcBorders);
+ rAttributes->push_back(make_pair(nId, pValue));
}
else if (aStates.top().nBorderState == BORDER_PAGE)
{
// Attributes of the last border type
- RTFSprms_t& rAttributes = lcl_getLastAttributes(aStates.top().aSectionSprms, NS_ooxml::LN_EG_SectPrContents_pgBorders);
- rAttributes.push_back(make_pair(nId, pValue));
+ RTFSprms& rAttributes = lcl_getLastAttributes(aStates.top().aSectionSprms, NS_ooxml::LN_EG_SectPrContents_pgBorders);
+ rAttributes->push_back(make_pair(nId, pValue));
}
}
@@ -200,15 +200,15 @@ static OString lcl_DTTM22OString(long lDTTM)
static writerfilter::Reference<Properties>::Pointer_t lcl_getBookmarkProperties(int nPos, OUString& rString)
{
- RTFSprms_t aAttributes;
+ RTFSprms aAttributes;
RTFValue::Pointer_t pPos(new RTFValue(nPos));
if (rString.getLength())
{
// If present, this should be sent first.
RTFValue::Pointer_t pString(new RTFValue(rString));
- aAttributes.push_back(make_pair(NS_rtf::LN_BOOKMARKNAME, pString));
+ aAttributes->push_back(make_pair(NS_rtf::LN_BOOKMARKNAME, pString));
}
- aAttributes.push_back(make_pair(NS_rtf::LN_IBKL, pPos));
+ aAttributes->push_back(make_pair(NS_rtf::LN_IBKL, pPos));
return writerfilter::Reference<Properties>::Pointer_t(new RTFReferenceProperties(aAttributes));
}
@@ -360,7 +360,7 @@ void RTFDocumentImpl::checkFirstRun()
new RTFReferenceProperties(m_aStates.top().aParagraphAttributes, m_aStates.top().aParagraphSprms)
);
// output settings table
- RTFSprms_t aAttributes;
+ RTFSprms aAttributes;
writerfilter::Reference<Properties>::Pointer_t const pProp(new RTFReferenceProperties(aAttributes, m_aSettingsTableSprms));
RTFReferenceTable::Entries_t aSettingsTableEntries;
aSettingsTableEntries.insert(make_pair(0, pProp));
@@ -417,9 +417,9 @@ void RTFDocumentImpl::sectBreak(bool bFinal = false)
// Section properties are a paragraph sprm.
RTFValue::Pointer_t pValue(new RTFValue(m_aStates.top().aSectionAttributes, m_aStates.top().aSectionSprms));
- RTFSprms_t aAttributes;
- RTFSprms_t aSprms;
- aSprms.push_back(make_pair(NS_ooxml::LN_CT_PPr_sectPr, pValue));
+ RTFSprms aAttributes;
+ RTFSprms aSprms;
+ aSprms->push_back(make_pair(NS_ooxml::LN_CT_PPr_sectPr, pValue));
writerfilter::Reference<Properties>::Pointer_t const pProperties(
new RTFReferenceProperties(aAttributes, aSprms)
);
@@ -536,7 +536,7 @@ int RTFDocumentImpl::resolvePict(bool bInline)
// Set size
awt::Size aSize;
- for (RTFSprms_t::iterator i = m_aStates.top().aCharacterAttributes.begin(); i != m_aStates.top().aCharacterAttributes.end(); ++i)
+ for (RTFSprms::Iterator_t i = m_aStates.top().aCharacterAttributes->begin(); i != m_aStates.top().aCharacterAttributes->end(); ++i)
if (i->first == NS_rtf::LN_XEXT)
aSize.Width = i->second->getInt();
else if (i->first == NS_rtf::LN_YEXT)
@@ -544,71 +544,71 @@ int RTFDocumentImpl::resolvePict(bool bInline)
xShape->setSize(aSize);
RTFValue::Pointer_t pShapeValue(new RTFValue(xShape));
- m_aObjectAttributes.push_back(make_pair(NS_ooxml::LN_shape, pShapeValue));
+ m_aObjectAttributes->push_back(make_pair(NS_ooxml::LN_shape, pShapeValue));
return 0;
}
xPropertySet->setPropertyValue(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("GraphicURL")), uno::Any(aGraphicUrl));
// Send it to the dmapper.
- RTFSprms_t aSprms;
- RTFSprms_t aAttributes;
+ RTFSprms aSprms;
+ RTFSprms aAttributes;
// shape attribute
- RTFSprms_t aPicAttributes;
+ RTFSprms aPicAttributes;
RTFValue::Pointer_t pShapeValue(new RTFValue(xShape));
- aPicAttributes.push_back(make_pair(NS_ooxml::LN_shape, pShapeValue));
+ aPicAttributes->push_back(make_pair(NS_ooxml::LN_shape, pShapeValue));
// pic sprm
- RTFSprms_t aGraphicDataAttributes;
- RTFSprms_t aGraphicDataSprms;
+ RTFSprms aGraphicDataAttributes;
+ RTFSprms aGraphicDataSprms;
RTFValue::Pointer_t pPicValue(new RTFValue(aPicAttributes));
- aGraphicDataSprms.push_back(make_pair(NS_ooxml::LN_pic_pic, pPicValue));
+ aGraphicDataSprms->push_back(make_pair(NS_ooxml::LN_pic_pic, pPicValue));
// graphicData sprm
- RTFSprms_t aGraphicAttributes;
- RTFSprms_t aGraphicSprms;
+ RTFSprms aGraphicAttributes;
+ RTFSprms aGraphicSprms;
RTFValue::Pointer_t pGraphicDataValue(new RTFValue(aGraphicDataAttributes, aGraphicDataSprms));
- aGraphicSprms.push_back(make_pair(NS_ooxml::LN_CT_GraphicalObject_graphicData, pGraphicDataValue));
+ aGraphicSprms->push_back(make_pair(NS_ooxml::LN_CT_GraphicalObject_graphicData, pGraphicDataValue));
// graphic sprm
RTFValue::Pointer_t pGraphicValue(new RTFValue(aGraphicAttributes, aGraphicSprms));
// extent sprm
- RTFSprms_t aExtentAttributes;
- for (RTFSprms_t::iterator i = m_aStates.top().aCharacterAttributes.begin(); i != m_aStates.top().aCharacterAttributes.end(); ++i)
+ RTFSprms aExtentAttributes;
+ for (RTFSprms::Iterator_t i = m_aStates.top().aCharacterAttributes->begin(); i != m_aStates.top().aCharacterAttributes->end(); ++i)
if (i->first == NS_rtf::LN_XEXT || i->first == NS_rtf::LN_YEXT)
- aExtentAttributes.push_back(make_pair(i->first, i->second));
+ aExtentAttributes->push_back(make_pair(i->first, i->second));
RTFValue::Pointer_t pExtentValue(new RTFValue(aExtentAttributes));
// docpr sprm
- RTFSprms_t aDocprAttributes;
- for (RTFSprms_t::iterator i = m_aStates.top().aCharacterAttributes.begin(); i != m_aStates.top().aCharacterAttributes.end(); ++i)
+ RTFSprms aDocprAttributes;
+ for (RTFSprms::Iterator_t i = m_aStates.top().aCharacterAttributes->begin(); i != m_aStates.top().aCharacterAttributes->end(); ++i)
if (i->first == NS_ooxml::LN_CT_NonVisualDrawingProps_name || i->first == NS_ooxml::LN_CT_NonVisualDrawingProps_descr)
- aDocprAttributes.push_back(make_pair(i->first, i->second));
+ aDocprAttributes->push_back(make_pair(i->first, i->second));
RTFValue::Pointer_t pDocprValue(new RTFValue(aDocprAttributes));
if (bInline)
{
- RTFSprms_t aInlineAttributes;
- RTFSprms_t aInlineSprms;
- aInlineSprms.push_back(make_pair(NS_ooxml::LN_CT_Inline_extent, pExtentValue));
- aInlineSprms.push_back(make_pair(NS_ooxml::LN_CT_Inline_docPr, pDocprValue));
- aInlineSprms.push_back(make_pair(NS_ooxml::LN_graphic_graphic, pGraphicValue));
+ RTFSprms aInlineAttributes;
+ RTFSprms aInlineSprms;
+ aInlineSprms->push_back(make_pair(NS_ooxml::LN_CT_Inline_extent, pExtentValue));
+ aInlineSprms->push_back(make_pair(NS_ooxml::LN_CT_Inline_docPr, pDocprValue));
+ aInlineSprms->push_back(make_pair(NS_ooxml::LN_graphic_graphic, pGraphicValue));
// inline sprm
RTFValue::Pointer_t pValue(new RTFValue(aInlineAttributes, aInlineSprms));
- aSprms.push_back(make_pair(NS_ooxml::LN_inline_inline, pValue));
+ aSprms->push_back(make_pair(NS_ooxml::LN_inline_inline, pValue));
}
else // anchored
{
// wrap sprm
- RTFSprms_t aAnchorWrapAttributes;
- for (RTFSprms_t::iterator i = m_aStates.top().aCharacterAttributes.begin(); i != m_aStates.top().aCharacterAttributes.end(); ++i)
+ RTFSprms aAnchorWrapAttributes;
+ for (RTFSprms::Iterator_t i = m_aStates.top().aCharacterAttributes->begin(); i != m_aStates.top().aCharacterAttributes->end(); ++i)
if (i->first == NS_ooxml::LN_CT_WrapSquare_wrapText)
- aAnchorWrapAttributes.push_back(make_pair(i->first, i->second));
+ aAnchorWrapAttributes->push_back(make_pair(i->first, i->second));
RTFValue::Pointer_t pAnchorWrapValue(new RTFValue(aAnchorWrapAttributes));
- RTFSprms_t aAnchorAttributes;
- RTFSprms_t aAnchorSprms;
- aAnchorSprms.push_back(make_pair(NS_ooxml::LN_CT_Anchor_extent, pExtentValue));
- if (aAnchorWrapAttributes.size())
- aAnchorSprms.push_back(make_pair(NS_ooxml::LN_EG_WrapType_wrapSquare, pAnchorWrapValue));
- aAnchorSprms.push_back(make_pair(NS_ooxml::LN_CT_Anchor_docPr, pDocprValue));
- aAnchorSprms.push_back(make_pair(NS_ooxml::LN_graphic_graphic, pGraphicValue));
+ RTFSprms aAnchorAttributes;
+ RTFSprms aAnchorSprms;
+ aAnchorSprms->push_back(make_pair(NS_ooxml::LN_CT_Anchor_extent, pExtentValue));
+ if (aAnchorWrapAttributes->size())
+ aAnchorSprms->push_back(make_pair(NS_ooxml::LN_EG_WrapType_wrapSquare, pAnchorWrapValue));
+ aAnchorSprms->push_back(make_pair(NS_ooxml::LN_CT_Anchor_docPr, pDocprValue));
+ aAnchorSprms->push_back(make_pair(NS_ooxml::LN_graphic_graphic, pGraphicValue));
// anchor sprm
RTFValue::Pointer_t pValue(new RTFValue(aAnchorAttributes, aAnchorSprms));
- aSprms.push_back(make_pair(NS_ooxml::LN_anchor_anchor, pValue));
+ aSprms->push_back(make_pair(NS_ooxml::LN_anchor_anchor, pValue));
}
writerfilter::Reference<Properties>::Pointer_t const pProperties(new RTFReferenceProperties(aAttributes, aSprms));
Mapper().props(pProperties);
@@ -692,7 +692,7 @@ void RTFDocumentImpl::text(OUString& rString)
case DESTINATION_FONTENTRY:
{
RTFValue::Pointer_t pValue(new RTFValue(m_aDestinationText.makeStringAndClear()));
- m_aStates.top().aTableAttributes.push_back(make_pair(NS_rtf::LN_XSZFFN, pValue));
+ m_aStates.top().aTableAttributes->push_back(make_pair(NS_rtf::LN_XSZFFN, pValue));
writerfilter::Reference<Properties>::Pointer_t const pProp(
new RTFReferenceProperties(m_aStates.top().aTableAttributes, m_aStates.top().aTableSprms)
@@ -704,7 +704,7 @@ void RTFDocumentImpl::text(OUString& rString)
case DESTINATION_STYLEENTRY:
{
RTFValue::Pointer_t pValue(new RTFValue(m_aDestinationText.makeStringAndClear()));
- m_aStates.top().aTableAttributes.push_back(make_pair(NS_rtf::LN_XSTZNAME1, pValue));
+ m_aStates.top().aTableAttributes->push_back(make_pair(NS_rtf::LN_XSTZNAME1, pValue));
writerfilter::Reference<Properties>::Pointer_t const pProp(
new RTFReferenceProperties(mergeAttributes(), mergeSprms())
@@ -832,7 +832,7 @@ void RTFDocumentImpl::replayBuffer(RTFBuffer_t& rBuffer)
else if (aPair.first == BUFFER_CELLEND)
{
RTFValue::Pointer_t pValue(new RTFValue(1));
- m_aStates.top().aTableCellSprms.push_back(make_pair(NS_sprm::LN_PCell, pValue));
+ m_aStates.top().aTableCellSprms->push_back(make_pair(NS_sprm::LN_PCell, pValue));
writerfilter::Reference<Properties>::Pointer_t const pTableCellProperties(
new RTFReferenceProperties(m_aStates.top().aTableCellAttributes, m_aStates.top().aTableCellSprms)
);
@@ -1004,10 +1004,10 @@ int RTFDocumentImpl::dispatchDestination(RTFKeyword nKeyword)
resolveSubstream(m_nGroupStartPos - 1, nId, aCustomMark);
if (bCustomMark)
{
- m_aStates.top().aCharacterAttributes.clear();
- m_aStates.top().aCharacterSprms.clear();
+ m_aStates.top().aCharacterAttributes->clear();
+ m_aStates.top().aCharacterSprms->clear();
RTFValue::Pointer_t pValue(new RTFValue(1));
- m_aStates.top().aCharacterAttributes.push_back(make_pair(NS_ooxml::LN_CT_FtnEdnRef_customMarkFollows, pValue));
+ m_aStates.top().aCharacterAttributes->push_back(make_pair(NS_ooxml::LN_CT_FtnEdnRef_customMarkFollows, pValue));
text(aCustomMark);
Mapper().endCharacterGroup();
}
@@ -1035,8 +1035,8 @@ int RTFDocumentImpl::dispatchDestination(RTFKeyword nKeyword)
if (m_aAuthor.getLength())
{
RTFValue::Pointer_t pValue(new RTFValue(m_aAuthor));
- RTFSprms_t aAttributes;
- aAttributes.push_back(make_pair(NS_ooxml::LN_CT_TrackChange_author, pValue));
+ RTFSprms aAttributes;
+ aAttributes->push_back(make_pair(NS_ooxml::LN_CT_TrackChange_author, pValue));
writerfilter::Reference<Properties>::Pointer_t const pProperties(new RTFReferenceProperties(aAttributes));
Mapper().props(pProperties);
}
@@ -1225,7 +1225,7 @@ int RTFDocumentImpl::dispatchSymbol(RTFKeyword nKeyword)
NS_ooxml::LN_CT_TblPrBase_tblW, NS_ooxml::LN_CT_TblWidth_w, pWValue);
RTFValue::Pointer_t pRowValue(new RTFValue(1));
- m_aStates.top().aTableRowSprms.push_back(make_pair(NS_sprm::LN_PRow, pRowValue));
+ m_aStates.top().aTableRowSprms->push_back(make_pair(NS_sprm::LN_PRow, pRowValue));
writerfilter::Reference<Properties>::Pointer_t const pTableRowProperties(
new RTFReferenceProperties(m_aStates.top().aTableRowAttributes, m_aStates.top().aTableRowSprms)
);
@@ -1274,7 +1274,7 @@ int RTFDocumentImpl::dispatchFlag(RTFKeyword nKeyword)
if (nParam >= 0)
{
RTFValue::Pointer_t pValue(new RTFValue(nParam));
- m_aStates.top().aParagraphSprms.push_back(make_pair(NS_sprm::LN_PJc, pValue));
+ m_aStates.top().aParagraphSprms->push_back(make_pair(NS_sprm::LN_PJc, pValue));
skipDestination(bParsed);
return 0;
}
@@ -1290,7 +1290,7 @@ int RTFDocumentImpl::dispatchFlag(RTFKeyword nKeyword)
if (nParam >= 0)
{
RTFValue::Pointer_t pValue(new RTFValue(nParam));
- m_aStates.top().aTabAttributes.push_back(make_pair(NS_ooxml::LN_CT_TabStop_val, pValue));
+ m_aStates.top().aTabAttributes->push_back(make_pair(NS_ooxml::LN_CT_TabStop_val, pValue));
skipDestination(bParsed);
return 0;
}
@@ -1309,7 +1309,7 @@ int RTFDocumentImpl::dispatchFlag(RTFKeyword nKeyword)
if (nParam >= 0)
{
RTFValue::Pointer_t pValue(new RTFValue(nParam));
- m_aStates.top().aTabAttributes.push_back(make_pair(NS_ooxml::LN_CT_TabStop_leader, pValue));
+ m_aStates.top().aTabAttributes->push_back(make_pair(NS_ooxml::LN_CT_TabStop_leader, pValue));
skipDestination(bParsed);
return 0;
}
@@ -1357,7 +1357,7 @@ int RTFDocumentImpl::dispatchFlag(RTFKeyword nKeyword)
if (nParam >= 0)
{
RTFValue::Pointer_t pValue(new RTFValue(nParam));
- m_aStates.top().aSectionSprms.push_back(make_pair(NS_sprm::LN_SBkc, pValue));
+ m_aStates.top().aSectionSprms->push_back(make_pair(NS_sprm::LN_SBkc, pValue));
skipDestination(bParsed);
return 0;
}
@@ -1374,7 +1374,7 @@ int RTFDocumentImpl::dispatchFlag(RTFKeyword nKeyword)
if (nParam >= 0)
{
RTFValue::Pointer_t pValue(new RTFValue(1));
- m_aStates.top().aParagraphSprms.push_back(make_pair(nParam, pValue));
+ m_aStates.top().aParagraphSprms->push_back(make_pair(nParam, pValue));
skipDestination(bParsed);
return 0;
}
@@ -1416,17 +1416,17 @@ int RTFDocumentImpl::dispatchFlag(RTFKeyword nKeyword)
case RTF_NOWIDCTLPAR:
{
RTFValue::Pointer_t pValue(new RTFValue(nKeyword == RTF_WIDCTLPAR));
- m_aStates.top().aParagraphSprms.push_back(make_pair(NS_sprm::LN_PFWidowControl, pValue));
+ m_aStates.top().aParagraphSprms->push_back(make_pair(NS_sprm::LN_PFWidowControl, pValue));
}
break;
case RTF_BOX:
{
- RTFSprms_t aAttributes;
+ RTFSprms aAttributes;
RTFValue::Pointer_t pValue(new RTFValue(aAttributes));
- m_aStates.top().aParagraphSprms.push_back(make_pair(NS_sprm::LN_PBrcTop, pValue));
- m_aStates.top().aParagraphSprms.push_back(make_pair(NS_sprm::LN_PBrcLeft, pValue));
- m_aStates.top().aParagraphSprms.push_back(make_pair(NS_sprm::LN_PBrcBottom, pValue));
- m_aStates.top().aParagraphSprms.push_back(make_pair(NS_sprm::LN_PBrcRight, pValue));
+ m_aStates.top().aParagraphSprms->push_back(make_pair(NS_sprm::LN_PBrcTop, pValue));
+ m_aStates.top().aParagraphSprms->push_back(make_pair(NS_sprm::LN_PBrcLeft, pValue));
+ m_aStates.top().aParagraphSprms->push_back(make_pair(NS_sprm::LN_PBrcBottom, pValue));
+ m_aStates.top().aParagraphSprms->push_back(make_pair(NS_sprm::LN_PBrcRight, pValue));
m_aStates.top().nBorderState = BORDER_PARAGRAPH;
}
break;
@@ -1434,21 +1434,21 @@ int RTFDocumentImpl::dispatchFlag(RTFKeyword nKeyword)
case RTF_RTLSECT:
{
RTFValue::Pointer_t pValue(new RTFValue(nKeyword == RTF_LTRSECT ? 0 : 1));
- m_aStates.top().aParagraphSprms.push_back(make_pair(NS_sprm::LN_STextFlow, pValue));
+ m_aStates.top().aParagraphSprms->push_back(make_pair(NS_sprm::LN_STextFlow, pValue));
}
break;
case RTF_LTRPAR:
case RTF_RTLPAR:
{
RTFValue::Pointer_t pValue(new RTFValue(nKeyword == RTF_LTRPAR ? 0 : 1));
- m_aStates.top().aParagraphSprms.push_back(make_pair(NS_sprm::LN_PFrameTextFlow, pValue));
+ m_aStates.top().aParagraphSprms->push_back(make_pair(NS_sprm::LN_PFrameTextFlow, pValue));
}
break;
case RTF_LTRROW:
case RTF_RTLROW:
{
RTFValue::Pointer_t pValue(new RTFValue(nKeyword == RTF_LTRROW ? 0 : 1));
- m_aStates.top().aParagraphSprms.push_back(make_pair(NS_sprm::LN_TTextFlow, pValue));
+ m_aStates.top().aParagraphSprms->push_back(make_pair(NS_sprm::LN_TTextFlow, pValue));
}
break;
case RTF_LTRCH:
@@ -1458,7 +1458,7 @@ int RTFDocumentImpl::dispatchFlag(RTFKeyword nKeyword)
case RTF_ULNONE:
{
RTFValue::Pointer_t pValue(new RTFValue(0));
- m_aStates.top().aCharacterSprms.push_back(make_pair(NS_sprm::LN_CKul, pValue));
+ m_aStates.top().aCharacterSprms->push_back(make_pair(NS_sprm::LN_CKul, pValue));
}
break;
case RTF_NONSHPPICT:
@@ -1469,8 +1469,8 @@ int RTFDocumentImpl::dispatchFlag(RTFKeyword nKeyword)
case RTF_CLBRDRB:
case RTF_CLBRDRR:
{
- RTFSprms_t aAttributes;
- RTFSprms_t aSprms;
+ RTFSprms aAttributes;
+ RTFSprms aSprms;
RTFValue::Pointer_t pValue(new RTFValue(aAttributes, aSprms));
switch (nKeyword)
{
@@ -1489,8 +1489,8 @@ int RTFDocumentImpl::dispatchFlag(RTFKeyword nKeyword)
case RTF_PGBRDRB:
case RTF_PGBRDRR:
{
- RTFSprms_t aAttributes;
- RTFSprms_t aSprms;
+ RTFSprms aAttributes;
+ RTFSprms aSprms;
RTFValue::Pointer_t pValue(new RTFValue(aAttributes, aSprms));
switch (nKeyword)
{
@@ -1507,13 +1507,13 @@ int RTFDocumentImpl::dispatchFlag(RTFKeyword nKeyword)
case RTF_CLVMGF:
{
RTFValue::Pointer_t pValue(new RTFValue(NS_ooxml::LN_Value_ST_Merge_restart));
- m_aStates.top().aTableCellSprms.push_back(make_pair(NS_ooxml::LN_CT_TcPrBase_vMerge, pValue));
+ m_aStates.top().aTableCellSprms->push_back(make_pair(NS_ooxml::LN_CT_TcPrBase_vMerge, pValue));
}
break;
case RTF_CLVMRG:
{
RTFValue::Pointer_t pValue(new RTFValue(NS_ooxml::LN_Value_ST_Merge_continue));
- m_aStates.top().aTableCellSprms.push_back(make_pair(NS_ooxml::LN_CT_TcPrBase_vMerge, pValue));
+ m_aStates.top().aTableCellSprms->push_back(make_pair(NS_ooxml::LN_CT_TcPrBase_vMerge, pValue));
}
break;
case RTF_CLVERTALT:
@@ -1528,18 +1528,18 @@ int RTFDocumentImpl::dispatchFlag(RTFKeyword nKeyword)
default: break;
}
RTFValue::Pointer_t pValue(new RTFValue(nParam));
- m_aStates.top().aTableCellSprms.push_back(make_pair(NS_ooxml::LN_CT_TcPrBase_vAlign, pValue));
+ m_aStates.top().aTableCellSprms->push_back(make_pair(NS_ooxml::LN_CT_TcPrBase_vAlign, pValue));
}
break;
case RTF_TRKEEP:
{
RTFValue::Pointer_t pValue(new RTFValue(1));
- m_aStates.top().aTableRowSprms.push_back(make_pair(NS_sprm::LN_TCantSplit, pValue));
+ m_aStates.top().aTableRowSprms->push_back(make_pair(NS_sprm::LN_TCantSplit, pValue));
}
case RTF_SECTUNLOCKED:
{
RTFValue::Pointer_t pValue(new RTFValue(!nParam));
- m_aStates.top().aSectionSprms.push_back(make_pair(NS_ooxml::LN_EG_SectPrContents_formProt, pValue));
+ m_aStates.top().aSectionSprms->push_back(make_pair(NS_ooxml::LN_EG_SectPrContents_formProt, pValue));
}
case RTF_PGNDEC:
case RTF_PGNUCRM:
@@ -1563,7 +1563,7 @@ int RTFDocumentImpl::dispatchFlag(RTFKeyword nKeyword)
case RTF_TITLEPG:
{
RTFValue::Pointer_t pValue(new RTFValue(1));
- m_aStates.top().aSectionSprms.push_back(make_pair(NS_ooxml::LN_EG_SectPrContents_titlePg, pValue));
+ m_aStates.top().aSectionSprms->push_back(make_pair(NS_ooxml::LN_EG_SectPrContents_titlePg, pValue));
}
break;
case RTF_SUPER:
@@ -1571,14 +1571,14 @@ int RTFDocumentImpl::dispatchFlag(RTFKeyword nKeyword)
m_pCurrentBuffer = &m_aSuperBuffer;
OUString aValue(RTL_CONSTASCII_USTRINGPARAM("superscript"));
RTFValue::Pointer_t pValue(new RTFValue(aValue));
- m_aStates.top().aCharacterSprms.push_back(make_pair(NS_ooxml::LN_EG_RPrBase_vertAlign, pValue));
+ m_aStates.top().aCharacterSprms->push_back(make_pair(NS_ooxml::LN_EG_RPrBase_vertAlign, pValue));
}
break;
case RTF_SUB:
{
OUString aValue(RTL_CONSTASCII_USTRINGPARAM("subscript"));
RTFValue::Pointer_t pValue(new RTFValue(aValue));
- m_aStates.top().aCharacterSprms.push_back(make_pair(NS_ooxml::LN_EG_RPrBase_vertAlign, pValue));
+ m_aStates.top().aCharacterSprms->push_back(make_pair(NS_ooxml::LN_EG_RPrBase_vertAlign, pValue));
}
break;
case RTF_LINEPPAGE:
@@ -1614,7 +1614,7 @@ int RTFDocumentImpl::dispatchValue(RTFKeyword nKeyword, int nParam)
}
if (nSprm > 0)
{
- m_aStates.top().aTableSprms.push_back(make_pair(nSprm, pIntValue));
+ m_aStates.top().aTableSprms->push_back(make_pair(nSprm, pIntValue));
skipDestination(bParsed);
return 0;
}
@@ -1634,7 +1634,7 @@ int RTFDocumentImpl::dispatchValue(RTFKeyword nKeyword, int nParam)
}
if (nSprm > 0)
{
- m_aStates.top().aCharacterSprms.push_back(make_pair(nSprm, pIntValue));
+ m_aStates.top().aCharacterSprms->push_back(make_pair(nSprm, pIntValue));
skipDestination(bParsed);
return 0;
}
@@ -1653,7 +1653,7 @@ int RTFDocumentImpl::dispatchValue(RTFKeyword nKeyword, int nParam)
}
if (nSprm > 0)
{
- m_aStates.top().aParagraphSprms.push_back(make_pair(nSprm, pIntValue));
+ m_aStates.top().aParagraphSprms->push_back(make_pair(nSprm, pIntValue));
skipDestination(bParsed);
return 0;
}
@@ -1667,7 +1667,7 @@ int RTFDocumentImpl::dispatchValue(RTFKeyword nKeyword, int nParam)
}
if (nSprm > 0)
{
- m_aStates.top().aTableAttributes.push_back(make_pair(nSprm, pIntValue));
+ m_aStates.top().aTableAttributes->push_back(make_pair(nSprm, pIntValue));
skipDestination(bParsed);
return 0;
}
@@ -1682,7 +1682,7 @@ int RTFDocumentImpl::dispatchValue(RTFKeyword nKeyword, int nParam)
if (nSprm > 0)
{
RTFValue::Pointer_t pValue(new RTFValue(nParam));
- m_aStates.top().aCharacterAttributes.push_back(make_pair(nSprm, pValue));
+ m_aStates.top().aCharacterAttributes->push_back(make_pair(nSprm, pValue));
skipDestination(bParsed);
return 0;
}
@@ -1711,7 +1711,7 @@ int RTFDocumentImpl::dispatchValue(RTFKeyword nKeyword, int nParam)
m_nCurrentFontIndex = nParam;
else
{
- m_aStates.top().aCharacterSprms.push_back(make_pair(NS_sprm::LN_CRgFtc0, pIntValue));
+ m_aStates.top().aCharacterSprms->push_back(make_pair(NS_sprm::LN_CRgFtc0, pIntValue));
m_aStates.top().nCurrentEncoding = getEncodingTable(nParam);
}
break;
@@ -1743,37 +1743,37 @@ int RTFDocumentImpl::dispatchValue(RTFKeyword nKeyword, int nParam)
case RTF_CF:
{
// NS_sprm::LN_CIco won't work, that would be an index in a static table
- m_aStates.top().aCharacterAttributes.push_back(make_pair(NS_ooxml::LN_CT_Color_val, pIntValue));
+ m_aStates.top().aCharacterAttributes->push_back(make_pair(NS_ooxml::LN_CT_Color_val, pIntValue));
}
break;
case RTF_S:
if (m_aStates.top().nDestinationState == DESTINATION_STYLESHEET || m_aStates.top().nDestinationState == DESTINATION_STYLEENTRY)
{
m_nCurrentStyleIndex = nParam;
- m_aStates.top().aTableAttributes.push_back(make_pair(NS_rtf::LN_ISTD, pIntValue));
+ m_aStates.top().aTableAttributes->push_back(make_pair(NS_rtf::LN_ISTD, pIntValue));
}
else
- m_aStates.top().aParagraphAttributes.push_back(make_pair(NS_rtf::LN_ISTD, pIntValue));
+ m_aStates.top().aParagraphAttributes->push_back(make_pair(NS_rtf::LN_ISTD, pIntValue));
break;
case RTF_CS:
if (m_aStates.top().nDestinationState == DESTINATION_STYLESHEET)
{
m_nCurrentStyleIndex = nParam;
- m_aStates.top().aTableAttributes.push_back(make_pair(NS_rtf::LN_ISTD, pIntValue));
+ m_aStates.top().aTableAttributes->push_back(make_pair(NS_rtf::LN_ISTD, pIntValue));
RTFValue::Pointer_t pValue(new RTFValue(2));
- m_aStates.top().aTableAttributes.push_back(make_pair(NS_rtf::LN_SGC, pValue)); // character style
+ m_aStates.top().aTableAttributes->push_back(make_pair(NS_rtf::LN_SGC, pValue)); // character style
}
else
- m_aStates.top().aCharacterAttributes.push_back(make_pair(NS_rtf::LN_ISTD, pIntValue));
+ m_aStates.top().aCharacterAttributes->push_back(make_pair(NS_rtf::LN_ISTD, pIntValue));
break;
case RTF_DEFF:
- m_aDefaultState.aCharacterSprms.push_back(make_pair(NS_sprm::LN_CRgFtc0, pIntValue));
+ m_aDefaultState.aCharacterSprms->push_back(make_pair(NS_sprm::LN_CRgFtc0, pIntValue));
break;
case RTF_DEFLANG:
- m_aDefaultState.aCharacterSprms.push_back(make_pair(NS_sprm::LN_CRgLid0, pIntValue));
+ m_aDefaultState.aCharacterSprms->push_back(make_pair(NS_sprm::LN_CRgLid0, pIntValue));
break;
case RTF_ADEFLANG:
- m_aDefaultState.aCharacterSprms.push_back(make_pair(NS_sprm::LN_CLidBi, pIntValue));
+ m_aDefaultState.aCharacterSprms->push_back(make_pair(NS_sprm::LN_CLidBi, pIntValue));
break;
case RTF_CHCBPAT:
{
@@ -1797,58 +1797,58 @@ int RTFDocumentImpl::dispatchValue(RTFKeyword nKeyword, int nParam)
case RTF_ULC:
{
RTFValue::Pointer_t pValue(new RTFValue(getColorTable(nParam)));
- m_aStates.top().aCharacterSprms.push_back(make_pair(0x6877, pValue));
+ m_aStates.top().aCharacterSprms->push_back(make_pair(0x6877, pValue));
}
break;
case RTF_UP: // TODO handle when point size is not shrinking
{
OUString aValue(RTL_CONSTASCII_USTRINGPARAM("superscript"));
RTFValue::Pointer_t pValue(new RTFValue(aValue));
- m_aStates.top().aCharacterSprms.push_back(make_pair(NS_ooxml::LN_EG_RPrBase_vertAlign, pValue));
+ m_aStates.top().aCharacterSprms->push_back(make_pair(NS_ooxml::LN_EG_RPrBase_vertAlign, pValue));
}
break;
case RTF_DN:
{
OUString aValue(RTL_CONSTASCII_USTRINGPARAM("subscript"));
RTFValue::Pointer_t pValue(new RTFValue(aValue));
- m_aStates.top().aCharacterSprms.push_back(make_pair(NS_ooxml::LN_EG_RPrBase_vertAlign, pValue));
+ m_aStates.top().aCharacterSprms->push_back(make_pair(NS_ooxml::LN_EG_RPrBase_vertAlign, pValue));
}
break;
case RTF_HORZVERT:
{
RTFValue::Pointer_t pValue(new RTFValue(true));
- m_aStates.top().aCharacterAttributes.push_back(make_pair(NS_ooxml::LN_CT_EastAsianLayout_vert, pValue));
+ m_aStates.top().aCharacterAttributes->push_back(make_pair(NS_ooxml::LN_CT_EastAsianLayout_vert, pValue));
if (nParam)
// rotate fits to a single line
- m_aStates.top().aCharacterAttributes.push_back(make_pair(NS_ooxml::LN_CT_EastAsianLayout_vertCompress, pValue));
+ m_aStates.top().aCharacterAttributes->push_back(make_pair(NS_ooxml::LN_CT_EastAsianLayout_vertCompress, pValue));
}
break;
case RTF_EXPND:
{
RTFValue::Pointer_t pValue(new RTFValue(nParam/5));
- m_aStates.top().aCharacterSprms.push_back(make_pair(NS_sprm::LN_CDxaSpace, pValue));
+ m_aStates.top().aCharacterSprms->push_back(make_pair(NS_sprm::LN_CDxaSpace, pValue));
}
break;
case RTF_TWOINONE:
{
RTFValue::Pointer_t pValue(new RTFValue(true));
- m_aStates.top().aCharacterAttributes.push_back(make_pair(NS_ooxml::LN_CT_EastAsianLayout_combine, pValue));
+ m_aStates.top().aCharacterAttributes->push_back(make_pair(NS_ooxml::LN_CT_EastAsianLayout_combine, pValue));
if (nParam > 0)
- m_aStates.top().aCharacterAttributes.push_back(make_pair(NS_ooxml::LN_CT_EastAsianLayout_combineBrackets, pIntValue));
+ m_aStates.top().aCharacterAttributes->push_back(make_pair(NS_ooxml::LN_CT_EastAsianLayout_combineBrackets, pIntValue));
}
break;
case RTF_SL:
if (nParam > 0)
{
// NS_sprm::LN_PDyaLine could be used, but that won't work with slmult
- m_aStates.top().aParagraphAttributes.push_back(make_pair(nSprm, pIntValue));
+ m_aStates.top().aParagraphAttributes->push_back(make_pair(nSprm, pIntValue));
}
break;
case RTF_SLMULT:
if (nParam > 0)
{
RTFValue::Pointer_t pValue(new RTFValue(NS_ooxml::LN_Value_wordprocessingml_ST_LineSpacingRule_auto));
- m_aStates.top().aParagraphAttributes.push_back(make_pair(NS_ooxml::LN_CT_Spacing_lineRule, pValue));
+ m_aStates.top().aParagraphAttributes->push_back(make_pair(NS_ooxml::LN_CT_Spacing_lineRule, pValue));
}
break;
case RTF_BRDRW:
@@ -1875,16 +1875,16 @@ int RTFDocumentImpl::dispatchValue(RTFKeyword nKeyword, int nParam)
break;
case RTF_TX:
{
- m_aStates.top().aTabAttributes.push_back(make_pair(NS_ooxml::LN_CT_TabStop_pos, pIntValue));
+ m_aStates.top().aTabAttributes->push_back(make_pair(NS_ooxml::LN_CT_TabStop_pos, pIntValue));
RTFValue::Pointer_t pValue(new RTFValue(m_aStates.top().aTabAttributes));
lcl_putNestedSprm(m_aStates.top().aParagraphSprms, NS_ooxml::LN_CT_PPrBase_tabs, NS_ooxml::LN_CT_Tabs_tab, pValue);
- m_aStates.top().aTabAttributes.clear();
+ m_aStates.top().aTabAttributes->clear();
}
break;
case RTF_ILVL:
{
- RTFSprms_t& rSprms = lcl_getNumPr(m_aStates);
- rSprms.push_back(make_pair(NS_sprm::LN_PIlvl, pIntValue));
+ RTFSprms& rSprms = lcl_getNumPr(m_aStates);
+ rSprms->push_back(make_pair(NS_sprm::LN_PIlvl, pIntValue));
}
case RTF_LISTTEMPLATEID:
// This one is not referenced anywhere, so it's pointless to store it at the moment.
@@ -1892,19 +1892,19 @@ int RTFDocumentImpl::dispatchValue(RTFKeyword nKeyword, int nParam)
case RTF_LISTID:
{
if (m_aStates.top().nDestinationState == DESTINATION_LISTENTRY)
- m_aStates.top().aTableAttributes.push_back(make_pair(NS_ooxml::LN_CT_AbstractNum_abstractNumId, pIntValue));
+ m_aStates.top().aTableAttributes->push_back(make_pair(NS_ooxml::LN_CT_AbstractNum_abstractNumId, pIntValue));
else if (m_aStates.top().nDestinationState == DESTINATION_LISTOVERRIDEENTRY)
- m_aStates.top().aTableSprms.push_back(make_pair(NS_ooxml::LN_CT_Num_abstractNumId, pIntValue));
+ m_aStates.top().aTableSprms->push_back(make_pair(NS_ooxml::LN_CT_Num_abstractNumId, pIntValue));
}
break;
case RTF_LS:
{
if (m_aStates.top().nDestinationState == DESTINATION_LISTOVERRIDEENTRY)
- m_aStates.top().aTableAttributes.push_back(make_pair(NS_rtf::LN_LSID, pIntValue));
+ m_aStates.top().aTableAttributes->push_back(make_pair(NS_rtf::LN_LSID, pIntValue));
else
{
- RTFSprms_t& rSprms = lcl_getNumPr(m_aStates);
- rSprms.push_back(make_pair(NS_sprm::LN_PIlfo, pIntValue));
+ RTFSprms& rSprms = lcl_getNumPr(m_aStates);
+ rSprms->push_back(make_pair(NS_sprm::LN_PIlfo, pIntValue));
}
}
break;
@@ -1938,7 +1938,7 @@ int RTFDocumentImpl::dispatchValue(RTFKeyword nKeyword, int nParam)
default: break;
}
RTFValue::Pointer_t pValue(new RTFValue(nValue));
- m_aStates.top().aCharacterAttributes.push_back(make_pair(NS_ooxml::LN_CT_WrapSquare_wrapText, pValue));
+ m_aStates.top().aCharacterAttributes->push_back(make_pair(NS_ooxml::LN_CT_WrapSquare_wrapText, pValue));
}
break;
case RTF_CELLX:
@@ -1946,13 +1946,13 @@ int RTFDocumentImpl::dispatchValue(RTFKeyword nKeyword, int nParam)
int nCellX = nParam - m_aStates.top().nCellX;
m_aStates.top().nCellX = nParam;
RTFValue::Pointer_t pXValue(new RTFValue(nCellX));
- m_aStates.top().aTableRowSprms.push_back(make_pair(NS_ooxml::LN_CT_TblGridBase_gridCol, pXValue));
+ m_aStates.top().aTableRowSprms->push_back(make_pair(NS_ooxml::LN_CT_TblGridBase_gridCol, pXValue));
replayBuffer(m_aTableBuffer);
// Reset cell properties.
- RTFSprms::Pointer_t pTableCellSprms(new RTFSprms_t(m_aStates.top().aTableCellSprms));
- RTFSprms::Pointer_t pTableCellAttributes(new RTFSprms_t(m_aStates.top().aTableCellAttributes));
+ RTFSprms::Pointer_t pTableCellSprms(new RTFSprms(m_aStates.top().aTableCellSprms));
+ RTFSprms::Pointer_t pTableCellAttributes(new RTFSprms(m_aStates.top().aTableCellAttributes));
m_aStates.top().aTableCellSprms = m_aDefaultState.aTableCellSprms;
m_aStates.top().aTableCellAttributes = m_aDefaultState.aTableCellAttributes;
}
@@ -1978,8 +1978,8 @@ int RTFDocumentImpl::dispatchValue(RTFKeyword nKeyword, int nParam)
case RTF_COLW:
case RTF_COLSR:
{
- RTFSprms_t& rAttributes = lcl_getLastAttributes(m_aStates.top().aSectionSprms, NS_ooxml::LN_EG_SectPrContents_cols);
- rAttributes.push_back(make_pair((nKeyword == RTF_COLW ? NS_ooxml::LN_CT_Column_w : NS_ooxml::LN_CT_Column_space),
+ RTFSprms& rAttributes = lcl_getLastAttributes(m_aStates.top().aSectionSprms, NS_ooxml::LN_EG_SectPrContents_cols);
+ rAttributes->push_back(make_pair((nKeyword == RTF_COLW ? NS_ooxml::LN_CT_Column_w : NS_ooxml::LN_CT_Column_space),
pIntValue));
}
break;
@@ -2040,7 +2040,7 @@ int RTFDocumentImpl::dispatchValue(RTFKeyword nKeyword, int nParam)
NS_ooxml::LN_EG_SectPrContents_pgMar, NS_ooxml::LN_CT_PageMar_footer, pIntValue, true);
break;
case RTF_DEFTAB:
- m_aSettingsTableSprms.push_back(make_pair(NS_ooxml::LN_CT_Settings_defaultTabStop, pIntValue));
+ m_aSettingsTableSprms->push_back(make_pair(NS_ooxml::LN_CT_Settings_defaultTabStop, pIntValue));
break;
case RTF_LINEMOD:
lcl_putNestedAttribute(m_aStates.top().aSectionSprms,
@@ -2095,15 +2095,15 @@ int RTFDocumentImpl::dispatchValue(RTFKeyword nKeyword, int nParam)
break;
case RTF_FFDEFRES:
if (m_nFormFieldType == FORMFIELD_CHECKBOX)
- m_aFormfieldSprms.push_back(make_pair(NS_ooxml::LN_CT_FFCheckBox_default, pIntValue));
+ m_aFormfieldSprms->push_back(make_pair(NS_ooxml::LN_CT_FFCheckBox_default, pIntValue));
else if (m_nFormFieldType == FORMFIELD_LIST)
- m_aFormfieldSprms.push_back(make_pair(NS_ooxml::LN_CT_FFDDList_default, pIntValue));
+ m_aFormfieldSprms->push_back(make_pair(NS_ooxml::LN_CT_FFDDList_default, pIntValue));
break;
case RTF_FFRES:
if (m_nFormFieldType == FORMFIELD_CHECKBOX)
- m_aFormfieldSprms.push_back(make_pair(NS_ooxml::LN_CT_FFCheckBox_checked, pIntValue));
+ m_aFormfieldSprms->push_back(make_pair(NS_ooxml::LN_CT_FFCheckBox_checked, pIntValue));
else if (m_nFormFieldType == FORMFIELD_LIST)
- m_aFormfieldSprms.push_back(make_pair(NS_ooxml::LN_CT_FFDDList_result, pIntValue));
+ m_aFormfieldSprms->push_back(make_pair(NS_ooxml::LN_CT_FFDDList_result, pIntValue));
break;
case RTF_EDMINS:
m_xDocumentProperties->setEditingDuration(nParam);
@@ -2186,7 +2186,7 @@ int RTFDocumentImpl::dispatchToggle(RTFKeyword nKeyword, bool bParam, int nParam
if (nSprm >= 0)
{
RTFValue::Pointer_t pValue(new RTFValue((!bParam || nParam != 0) ? nSprm : 0));
- m_aStates.top().aCharacterSprms.push_back(make_pair(NS_sprm::LN_CKul, pValue));
+ m_aStates.top().aCharacterSprms->push_back(make_pair(NS_sprm::LN_CKul, pValue));
skipDestination(bParsed);
return 0;
}
@@ -2204,7 +2204,7 @@ int RTFDocumentImpl::dispatchToggle(RTFKeyword nKeyword, bool bParam, int nParam
if (nSprm >= 0)
{
RTFValue::Pointer_t pValue(new RTFValue((!bParam || nParam != 0) ? nSprm : 0));
- m_aStates.top().aCharacterSprms.push_back(make_pair(NS_sprm::LN_CKcd, pValue));
+ m_aStates.top().aCharacterSprms->push_back(make_pair(NS_sprm::LN_CKcd, pValue));
skipDestination(bParsed);
return 0;
}
@@ -2228,7 +2228,7 @@ int RTFDocumentImpl::dispatchToggle(RTFKeyword nKeyword, bool bParam, int nParam
}
if (nSprm >= 0)
{
- m_aStates.top().aCharacterSprms.push_back(make_pair(nSprm, pBoolValue));
+ m_aStates.top().aCharacterSprms->push_back(make_pair(nSprm, pBoolValue));
skipDestination(bParsed);
return 0;
}
@@ -2236,7 +2236,7 @@ int RTFDocumentImpl::dispatchToggle(RTFKeyword nKeyword, bool bParam, int nParam
switch (nKeyword)
{
case RTF_ASPALPHA:
- m_aStates.top().aParagraphSprms.push_back(make_pair(NS_sprm::LN_PFAutoSpaceDE, pBoolValue));
+ m_aStates.top().aParagraphSprms->push_back(make_pair(NS_sprm::LN_PFAutoSpaceDE, pBoolValue));
break;
case RTF_DELETED:
case RTF_REVISED:
@@ -2275,9 +2275,9 @@ int RTFDocumentImpl::pushState()
m_nGroupStartPos = Strm().Tell();
RTFParserState aState;
if (m_aStates.empty())
- aState = m_aDefaultState.Clone();
+ aState = m_aDefaultState;
else
- aState = m_aStates.top().Clone();
+ aState = m_aStates.top();
m_aStates.push(aState);
m_nGroup++;
@@ -2296,56 +2296,56 @@ int RTFDocumentImpl::pushState()
return 0;
}
-RTFSprms_t RTFDocumentImpl::mergeSprms()
+RTFSprms RTFDocumentImpl::mergeSprms()
{
- RTFSprms_t aSprms;
- for (RTFSprms_t::iterator i = m_aStates.top().aTableSprms.begin();
- i != m_aStates.top().aTableSprms.end(); ++i)
- aSprms.push_back(make_pair(i->first, i->second));
- for (RTFSprms_t::iterator i = m_aStates.top().aCharacterSprms.begin();
- i != m_aStates.top().aCharacterSprms.end(); ++i)
- aSprms.push_back(make_pair(i->first, i->second));
- for (RTFSprms_t::iterator i = m_aStates.top().aParagraphSprms.begin();
- i != m_aStates.top().aParagraphSprms.end(); ++i)
- aSprms.push_back(make_pair(i->first, i->second));
+ RTFSprms aSprms;
+ for (RTFSprms::Iterator_t i = m_aStates.top().aTableSprms->begin();
+ i != m_aStates.top().aTableSprms->end(); ++i)
+ aSprms->push_back(make_pair(i->first, i->second));
+ for (RTFSprms::Iterator_t i = m_aStates.top().aCharacterSprms->begin();
+ i != m_aStates.top().aCharacterSprms->end(); ++i)
+ aSprms->push_back(make_pair(i->first, i->second));
+ for (RTFSprms::Iterator_t i = m_aStates.top().aParagraphSprms->begin();
+ i != m_aStates.top().aParagraphSprms->end(); ++i)
+ aSprms->push_back(make_pair(i->first, i->second));
return aSprms;
}
void RTFDocumentImpl::resetSprms()
{
- m_aStates.top().aTableSprms.clear();
- m_aStates.top().aCharacterSprms.clear();
- m_aStates.top().aParagraphSprms.clear();
+ m_aStates.top().aTableSprms->clear();
+ m_aStates.top().aCharacterSprms->clear();
+ m_aStates.top().aParagraphSprms->clear();
}
-RTFSprms_t RTFDocumentImpl::mergeAttributes()
+RTFSprms RTFDocumentImpl::mergeAttributes()
{
- RTFSprms_t aAttributes;
- for (RTFSprms_t::iterator i = m_aStates.top().aTableAttributes.begin();
- i != m_aStates.top().aTableAttributes.end(); ++i)
- aAttributes.push_back(make_pair(i->first, i->second));
- for (RTFSprms_t::iterator i = m_aStates.top().aCharacterAttributes.begin();
- i != m_aStates.top().aCharacterAttributes.end(); ++i)
- aAttributes.push_back(make_pair(i->first, i->second));
- for (RTFSprms_t::iterator i = m_aStates.top().aParagraphAttributes.begin();
- i != m_aStates.top().aParagraphAttributes.end(); ++i)
- aAttributes.push_back(make_pair(i->first, i->second));
+ RTFSprms aAttributes;
+ for (RTFSprms::Iterator_t i = m_aStates.top().aTableAttributes->begin();
+ i != m_aStates.top().aTableAttributes->end(); ++i)
+ aAttributes->push_back(make_pair(i->first, i->second));
+ for (RTFSprms::Iterator_t i = m_aStates.top().aCharacterAttributes->begin();
+ i != m_aStates.top().aCharacterAttributes->end(); ++i)
+ aAttributes->push_back(make_pair(i->first, i->second));
+ for (RTFSprms::Iterator_t i = m_aStates.top().aParagraphAttributes->begin();
+ i != m_aStates.top().aParagraphAttributes->end(); ++i)
+ aAttributes->push_back(make_pair(i->first, i->second));
return aAttributes;
}
void RTFDocumentImpl::resetAttributes()
{
- m_aStates.top().aTableAttributes.clear();
- m_aStates.top().aCharacterAttributes.clear();
- m_aStates.top().aParagraphAttributes.clear();
+ m_aStates.top().aTableAttributes->clear();
+ m_aStates.top().aCharacterAttributes->clear();
+ m_aStates.top().aParagraphAttributes->clear();
}
int RTFDocumentImpl::popState()
{
//OSL_TRACE("%s before pop: m_nGroup %d, dest state: %d", OSL_THIS_FUNC, m_nGroup, m_aStates.top().nDestinationState);
- RTFSprms_t aSprms;
- RTFSprms_t aAttributes;
+ RTFSprms aSprms;
+ RTFSprms aAttributes;
bool bListEntryEnd = false;
bool bListLevelEnd = false;
bool bListOverrideEntryEnd = false;
@@ -2366,7 +2366,7 @@ int RTFDocumentImpl::popState()
}
else if (m_aStates.top().nDestinationState == DESTINATION_LISTOVERRIDETABLE)
{
- RTFSprms_t aListTableAttributes;
+ RTFSprms aListTableAttributes;
writerfilter::Reference<Properties>::Pointer_t const pProp(new RTFReferenceProperties(aListTableAttributes, m_aListTableSprms));
RTFReferenceTable::Entries_t aListTableEntries;
aListTableEntries.insert(make_pair(0, pProp));
@@ -2377,9 +2377,9 @@ int RTFDocumentImpl::popState()
{
aAttributes = m_aStates.top().aTableAttributes;
aSprms = m_aStates.top().aTableSprms;
- for (RTFSprms_t::iterator i = m_aStates.top().aListLevelEntries.begin();
- i != m_aStates.top().aListLevelEntries.end(); ++i)
- aSprms.push_back(make_pair(i->first, i->second));
+ for (RTFSprms::Iterator_t i = m_aStates.top().aListLevelEntries->begin();
+ i != m_aStates.top().aListLevelEntries->end(); ++i)
+ aSprms->push_back(make_pair(i->first, i->second));
bListEntryEnd = true;
}
else if (m_aStates.top().nDestinationState == DESTINATION_LISTLEVEL)
@@ -2396,16 +2396,16 @@ int RTFDocumentImpl::popState()
}
else if (m_aStates.top().nDestinationState == DESTINATION_FIELDINSTRUCTION)
{
- if (m_aFormfieldAttributes.size() || m_aFormfieldSprms.size())
+ if (m_aFormfieldAttributes->size() || m_aFormfieldSprms->size())
{
RTFValue::Pointer_t pValue(new RTFValue(m_aFormfieldAttributes, m_aFormfieldSprms));
- RTFSprms_t aFFAttributes;
- RTFSprms_t aFFSprms;
- aFFSprms.push_back(make_pair(NS_ooxml::LN_ffdata, pValue));
+ RTFSprms aFFAttributes;
+ RTFSprms aFFSprms;
+ aFFSprms->push_back(make_pair(NS_ooxml::LN_ffdata, pValue));
writerfilter::Reference<Properties>::Pointer_t const pProperties(new RTFReferenceProperties(aFFAttributes, aFFSprms));
Mapper().props(pProperties);
- m_aFormfieldAttributes.clear();
- m_aFormfieldSprms.clear();
+ m_aFormfieldAttributes->clear();
+ m_aFormfieldSprms->clear();
}
sal_uInt8 sFieldSep[] = { 0x14 };
Mapper().startCharacterGroup();
@@ -2427,14 +2427,14 @@ int RTFDocumentImpl::popState()
sal_Int32 nLength(aStr.toChar());
OUString aValue = aStr.copy(1, nLength);
RTFValue::Pointer_t pValue(new RTFValue(aValue, true));
- m_aStates.top().aTableAttributes.push_back(make_pair(NS_ooxml::LN_CT_LevelText_val, pValue));
+ m_aStates.top().aTableAttributes->push_back(make_pair(NS_ooxml::LN_CT_LevelText_val, pValue));
aAttributes = m_aStates.top().aTableAttributes;
bLevelTextEnd = true;
}
else if (m_aStates.top().nDestinationState == DESTINATION_LEVELNUMBERS)
{
- RTFSprms_t& rAttributes = RTFSprm::find(m_aStates.top().aTableSprms, NS_ooxml::LN_CT_Lvl_lvlText)->getAttributes();
+ RTFSprms& rAttributes = RTFSprm::find(m_aStates.top().aTableSprms, NS_ooxml::LN_CT_Lvl_lvlText)->getAttributes();
RTFValue::Pointer_t pValue = RTFSprm::find(rAttributes, NS_ooxml::LN_CT_LevelText_val);
OUString aOrig = pValue->getString();
@@ -2493,12 +2493,12 @@ int RTFDocumentImpl::popState()
else if (m_aStates.top().nDestinationState == DESTINATION_FORMFIELDNAME)
{
RTFValue::Pointer_t pValue(new RTFValue(m_aDestinationText.makeStringAndClear()));
- m_aFormfieldSprms.push_back(make_pair(NS_ooxml::LN_CT_FFData_name, pValue));
+ m_aFormfieldSprms->push_back(make_pair(NS_ooxml::LN_CT_FFData_name, pValue));
}
else if (m_aStates.top().nDestinationState == DESTINATION_FORMFIELDLIST)
{
RTFValue::Pointer_t pValue(new RTFValue(m_aDestinationText.makeStringAndClear()));
- m_aFormfieldSprms.push_back(make_pair(NS_ooxml::LN_CT_FFDDList_listEntry, pValue));
+ m_aFormfieldSprms->push_back(make_pair(NS_ooxml::LN_CT_FFDDList_listEntry, pValue));
}
else if (m_aStates.top().nDestinationState == DESTINATION_DATAFIELD)
{
@@ -2540,9 +2540,9 @@ int RTFDocumentImpl::popState()
aStr = aStr.copy(1);
OString aDefaultText = aStr.copy(0, nLength);
RTFValue::Pointer_t pNValue(new RTFValue(OStringToOUString(aName, m_aStates.top().nCurrentEncoding)));
- m_aFormfieldSprms.push_back(make_pair(NS_ooxml::LN_CT_FFData_name, pNValue));
+ m_aFormfieldSprms->push_back(make_pair(NS_ooxml::LN_CT_FFData_name, pNValue));
RTFValue::Pointer_t pDValue(new RTFValue(OStringToOUString(aDefaultText, m_aStates.top().nCurrentEncoding)));
- m_aFormfieldSprms.push_back(make_pair(NS_ooxml::LN_CT_FFTextInput_default, pDValue));
+ m_aFormfieldSprms->push_back(make_pair(NS_ooxml::LN_CT_FFTextInput_default, pDValue));
}
else if (m_aStates.top().nDestinationState == DESTINATION_CREATIONTIME)
m_xDocumentProperties->setCreationDate(lcl_getDateTime(m_aStates));
@@ -2611,17 +2611,17 @@ int RTFDocumentImpl::popState()
uno::Reference<io::XInputStream> xInputStream(new utl::OInputStreamWrapper(m_pObjectData));
RTFValue::Pointer_t pStreamValue(new RTFValue(xInputStream));
- RTFSprms_t aOLEAttributes;
- aOLEAttributes.push_back(make_pair(NS_ooxml::LN_inputstream, pStreamValue));
+ RTFSprms aOLEAttributes;
+ aOLEAttributes->push_back(make_pair(NS_ooxml::LN_inputstream, pStreamValue));
RTFValue::Pointer_t pValue(new RTFValue(aOLEAttributes));
- m_aObjectSprms.push_back(make_pair(NS_ooxml::LN_OLEObject_OLEObject, pValue));
+ m_aObjectSprms->push_back(make_pair(NS_ooxml::LN_OLEObject_OLEObject, pValue));
}
else if (m_aStates.top().nDestinationState == DESTINATION_OBJECT)
{
- RTFSprms_t aObjAttributes;
- RTFSprms_t aObjSprms;
+ RTFSprms aObjAttributes;
+ RTFSprms aObjSprms;
RTFValue::Pointer_t pValue(new RTFValue(m_aObjectAttributes, m_aObjectSprms));
- aObjSprms.push_back(make_pair(NS_ooxml::LN_object, pValue));
+ aObjSprms->push_back(make_pair(NS_ooxml::LN_object, pValue));
writerfilter::Reference<Properties>::Pointer_t const pProperties(new RTFReferenceProperties(aObjAttributes, aObjSprms));
uno::Reference<drawing::XShape> xShape;
RTFValue::Pointer_t pShape = RTFSprm::find(m_aObjectAttributes, NS_ooxml::LN_shape);
@@ -2631,8 +2631,8 @@ int RTFDocumentImpl::popState()
Mapper().startShape(xShape);
Mapper().props(pProperties);
Mapper().endShape();
- m_aObjectAttributes.clear();
- m_aObjectSprms.clear();
+ m_aObjectAttributes->clear();
+ m_aObjectSprms->clear();
if (m_pObjectData)
{
delete m_pObjectData;
@@ -2645,8 +2645,8 @@ int RTFDocumentImpl::popState()
OUString aStr(OStringToOUString(lcl_DTTM22OString(m_aDestinationText.makeStringAndClear().toInt32()),
m_aStates.top().nCurrentEncoding));
RTFValue::Pointer_t pValue(new RTFValue(aStr));
- RTFSprms_t aAnnAttributes;
- aAnnAttributes.push_back(make_pair(NS_ooxml::LN_CT_TrackChange_date, pValue));
+ RTFSprms aAnnAttributes;
+ aAnnAttributes->push_back(make_pair(NS_ooxml::LN_CT_TrackChange_date, pValue));
writerfilter::Reference<Properties>::Pointer_t const pProperties(new RTFReferenceProperties(aAnnAttributes));
Mapper().props(pProperties);
}
@@ -2657,9 +2657,9 @@ int RTFDocumentImpl::popState()
RTFValue::Pointer_t pTrackchange = RTFSprm::find(m_aStates.top().aCharacterSprms, NS_ooxml::LN_trackchange);
if (pTrackchange.get())
{
- RTFSprms_t aTCAttributes;
+ RTFSprms aTCAttributes;
RTFValue::Pointer_t pValue(new RTFValue(0));
- aTCAttributes.push_back(make_pair(NS_ooxml::LN_endtrackchange, pValue));
+ aTCAttributes->push_back(make_pair(NS_ooxml::LN_endtrackchange, pValue));
writerfilter::Reference<Properties>::Pointer_t const pProperties(new RTFReferenceProperties(aTCAttributes));
Mapper().props(pProperties);
}
@@ -2676,26 +2676,26 @@ int RTFDocumentImpl::popState()
if (bListEntryEnd)
{
RTFValue::Pointer_t pValue(new RTFValue(aAttributes, aSprms));
- m_aListTableSprms.push_back(make_pair(NS_ooxml::LN_CT_Numbering_abstractNum, pValue));
+ m_aListTableSprms->push_back(make_pair(NS_ooxml::LN_CT_Numbering_abstractNum, pValue));
}
else if (bListLevelEnd)
{
RTFValue::Pointer_t pInnerValue(new RTFValue(m_aStates.top().nListLevelNum++));
- aAttributes.push_back(make_pair(NS_ooxml::LN_CT_Lvl_ilvl, pInnerValue));
+ aAttributes->push_back(make_pair(NS_ooxml::LN_CT_Lvl_ilvl, pInnerValue));
RTFValue::Pointer_t pValue(new RTFValue(aAttributes, aSprms));
- m_aStates.top().aListLevelEntries.push_back(make_pair(NS_ooxml::LN_CT_AbstractNum_lvl, pValue));
+ m_aStates.top().aListLevelEntries->push_back(make_pair(NS_ooxml::LN_CT_AbstractNum_lvl, pValue));
}
// list override table
else if (bListOverrideEntryEnd)
{
RTFValue::Pointer_t pValue(new RTFValue(aAttributes, aSprms));
- m_aListTableSprms.push_back(make_pair(NS_ooxml::LN_CT_Numbering_num, pValue));
+ m_aListTableSprms->push_back(make_pair(NS_ooxml::LN_CT_Numbering_num, pValue));
}
else if (bLevelTextEnd)
{
RTFValue::Pointer_t pValue(new RTFValue(aAttributes));
- m_aStates.top().aTableSprms.push_back(make_pair(NS_ooxml::LN_CT_Lvl_lvlText, pValue));
+ m_aStates.top().aTableSprms->push_back(make_pair(NS_ooxml::LN_CT_Lvl_lvlText, pValue));
}
else if (bPopShapeProperties)
{
@@ -2788,26 +2788,6 @@ RTFParserState::RTFParserState()
{
}
-RTFParserState RTFParserState::Clone()
-{
- RTFParserState aRet(*this);
- aRet.aTableSprms = RTFSprm::Clone(aTableSprms);
- aRet.aTableAttributes = RTFSprm::Clone(aTableAttributes);
- aRet.aCharacterSprms = RTFSprm::Clone(aCharacterSprms);
- aRet.aCharacterAttributes = RTFSprm::Clone(aCharacterAttributes);
- aRet.aParagraphSprms = RTFSprm::Clone(aParagraphSprms);
- aRet.aParagraphAttributes = RTFSprm::Clone(aParagraphAttributes);
- aRet.aSectionSprms = RTFSprm::Clone(aSectionSprms);
- aRet.aSectionAttributes = RTFSprm::Clone(aSectionAttributes);
- aRet.aTableRowSprms = RTFSprm::Clone(aTableRowSprms);
- aRet.aTableRowAttributes = RTFSprm::Clone(aTableRowAttributes);
- aRet.aTableCellSprms = RTFSprm::Clone(aTableCellSprms);
- aRet.aTableCellAttributes = RTFSprm::Clone(aTableCellAttributes);
- aRet.aTabAttributes = RTFSprm::Clone(aTabAttributes);
- aRet.aListLevelEntries = RTFSprm::Clone(aListLevelEntries);
- return aRet;
-}
-
RTFColorTableEntry::RTFColorTableEntry()
: nRed(0),
nGreen(0),
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.hxx b/writerfilter/source/rtftok/rtfdocumentimpl.hxx
index 401ea69..1c31e5f 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.hxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.hxx
@@ -180,31 +180,29 @@ namespace writerfilter {
{
public:
RTFParserState();
- /// Does a deep copy of the state data.
- RTFParserState Clone();
RTFInternalState nInternalState;
RTFDesitnationState nDestinationState;
RTFBorderState nBorderState;
// font table, stylesheet table
- RTFSprms_t aTableSprms;
- RTFSprms_t aTableAttributes;
+ RTFSprms aTableSprms;
+ RTFSprms aTableAttributes;
// reset by plain
- RTFSprms_t aCharacterSprms;
- RTFSprms_t aCharacterAttributes;
+ RTFSprms aCharacterSprms;
+ RTFSprms aCharacterAttributes;
// reset by pard
- RTFSprms_t aParagraphSprms;
- RTFSprms_t aParagraphAttributes;
+ RTFSprms aParagraphSprms;
+ RTFSprms aParagraphAttributes;
// reset by sectd
- RTFSprms_t aSectionSprms;
- RTFSprms_t aSectionAttributes;
+ RTFSprms aSectionSprms;
+ RTFSprms aSectionAttributes;
// reset by trowd
- RTFSprms_t aTableRowSprms;
- RTFSprms_t aTableRowAttributes;
+ RTFSprms aTableRowSprms;
+ RTFSprms aTableRowAttributes;
// reset by cellx
- RTFSprms_t aTableCellSprms;
- RTFSprms_t aTableCellAttributes;
+ RTFSprms aTableCellSprms;
+ RTFSprms aTableCellAttributes;
// reset by tx
- RTFSprms_t aTabAttributes;
+ RTFSprms aTabAttributes;
RTFColorTableEntry aCurrentColor;
@@ -218,7 +216,7 @@ namespace writerfilter {
/// Next list level index to use when parsing list table.
int nListLevelNum;
/// List level entries, which will form a list entry later.
- RTFSprms_t aListLevelEntries;
+ RTFSprms aListLevelEntries;
/// List of character positions in leveltext to replace.
std::vector<sal_Int32> aLevelNumbers;
@@ -290,8 +288,8 @@ namespace writerfilter {
SvStream& Strm();
sal_uInt32 getColorTable(sal_uInt32 nIndex);
sal_uInt32 getEncodingTable(sal_uInt32 nFontIndex);
- RTFSprms_t mergeSprms();
- RTFSprms_t mergeAttributes();
+ RTFSprms mergeSprms();
+ RTFSprms mergeAttributes();
void resetSprms();
void resetAttributes();
void resolveSubstream(sal_uInt32 nPos, Id nId);
@@ -329,9 +327,9 @@ namespace writerfilter {
/// If paragraph properties should be emitted on next run.
bool m_bNeedPap;
/// The list table and list override table combined.
- RTFSprms_t m_aListTableSprms;
+ RTFSprms m_aListTableSprms;
/// The settings table.
- RTFSprms_t m_aSettingsTableSprms;
+ RTFSprms m_aSettingsTableSprms;
oox::StorageRef m_xStorage;
oox::GraphicHelper* m_pGraphicHelper;
@@ -361,12 +359,12 @@ namespace writerfilter {
/// Text from special destinations.
rtl::OUStringBuffer m_aDestinationText;
- RTFSprms_t m_aFormfieldSprms;
- RTFSprms_t m_aFormfieldAttributes;
+ RTFSprms m_aFormfieldSprms;
+ RTFSprms m_aFormfieldAttributes;
RTFFormFieldTypes m_nFormFieldType;
- RTFSprms_t m_aObjectSprms;
- RTFSprms_t m_aObjectAttributes;
+ RTFSprms m_aObjectSprms;
+ RTFSprms m_aObjectAttributes;
/// If we are in an object group.
bool m_bObject;
/// Contents of the objdata group, stored here so we can delete it when we leave the object group.
diff --git a/writerfilter/source/rtftok/rtfreferenceproperties.cxx b/writerfilter/source/rtftok/rtfreferenceproperties.cxx
index 6ca5f1d..b1fb8aa 100644
--- a/writerfilter/source/rtftok/rtfreferenceproperties.cxx
+++ b/writerfilter/source/rtftok/rtfreferenceproperties.cxx
@@ -31,13 +31,13 @@
namespace writerfilter {
namespace rtftok {
-RTFReferenceProperties::RTFReferenceProperties(RTFSprms_t rAttributes, RTFSprms_t rSprms)
+RTFReferenceProperties::RTFReferenceProperties(RTFSprms rAttributes, RTFSprms rSprms)
: m_rAttributes(rAttributes),
m_rSprms(rSprms)
{
}
-RTFReferenceProperties::RTFReferenceProperties(RTFSprms_t rAttributes)
+RTFReferenceProperties::RTFReferenceProperties(RTFSprms rAttributes)
: m_rAttributes(rAttributes),
m_rSprms()
{
@@ -49,9 +49,9 @@ RTFReferenceProperties::~RTFReferenceProperties()
void RTFReferenceProperties::resolve(Properties& rHandler)
{
- for (RTFSprms_t::iterator i = m_rAttributes.begin(); i != m_rAttributes.end(); ++i)
+ for (RTFSprms::Iterator_t i = m_rAttributes->begin(); i != m_rAttributes->end(); ++i)
rHandler.attribute(i->first, *i->second.get());
- for (RTFSprms_t::iterator i = m_rSprms.begin(); i != m_rSprms.end(); ++i)
+ for (RTFSprms::Iterator_t i = m_rSprms->begin(); i != m_rSprms->end(); ++i)
{
RTFSprm aSprm(i->first, i->second);
rHandler.sprm(aSprm);
diff --git a/writerfilter/source/rtftok/rtfreferenceproperties.hxx b/writerfilter/source/rtftok/rtfreferenceproperties.hxx
index a689e5f..9dda8a9 100644
--- a/writerfilter/source/rtftok/rtfreferenceproperties.hxx
+++ b/writerfilter/source/rtftok/rtfreferenceproperties.hxx
@@ -41,14 +41,14 @@ namespace writerfilter {
: public writerfilter::Reference<Properties>
{
public:
- RTFReferenceProperties(RTFSprms_t rAttributes, RTFSprms_t rSprms);
- RTFReferenceProperties(RTFSprms_t rAttributes);
+ RTFReferenceProperties(RTFSprms rAttributes, RTFSprms rSprms);
+ RTFReferenceProperties(RTFSprms rAttributes);
virtual ~RTFReferenceProperties();
virtual void resolve(Properties & rHandler);
virtual std::string getType() const;
private:
- RTFSprms_t m_rAttributes;
- RTFSprms_t m_rSprms;
+ RTFSprms m_rAttributes;
+ RTFSprms m_rSprms;
};
} // namespace rtftok
} // namespace writerfilter
diff --git a/writerfilter/source/rtftok/rtfsdrimport.cxx b/writerfilter/source/rtftok/rtfsdrimport.cxx
index c6c4ffa..888d321 100644
--- a/writerfilter/source/rtftok/rtfsdrimport.cxx
+++ b/writerfilter/source/rtftok/rtfsdrimport.cxx
@@ -116,12 +116,12 @@ void RTFSdrImport::resolve(RTFShape& rShape)
else if (i->first.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("wzName")))
{
RTFValue::Pointer_t pValue(new RTFValue(i->second));
- m_rImport.getState().aCharacterAttributes.push_back(make_pair(NS_ooxml::LN_CT_NonVisualDrawingProps_name, pValue));
+ m_rImport.getState().aCharacterAttributes->push_back(make_pair(NS_ooxml::LN_CT_NonVisualDrawingProps_name, pValue));
}
else if (i->first.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("wzDescription")))
{
RTFValue::Pointer_t pValue(new RTFValue(i->second));
- m_rImport.getState().aCharacterAttributes.push_back(make_pair(NS_ooxml::LN_CT_NonVisualDrawingProps_descr, pValue));
+ m_rImport.getState().aCharacterAttributes->push_back(make_pair(NS_ooxml::LN_CT_NonVisualDrawingProps_descr, pValue));
}
else if (i->first.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("pib")))
{
diff --git a/writerfilter/source/rtftok/rtfsprm.cxx b/writerfilter/source/rtftok/rtfsprm.cxx
index 83fd1d2..cb634df 100644
... etc. - the rest is truncated
More information about the Libreoffice-commits
mailing list