[Libreoffice-commits] .: 2 commits - writerfilter/inc writerfilter/source writerfilter/util
Cédric Bosdonnat
cbosdo at kemper.freedesktop.org
Tue Dec 7 15:32:32 PST 2010
writerfilter/inc/resourcemodel/TagLogger.hxx | 115 ---
writerfilter/source/dmapper/BorderHandler.cxx | 4
writerfilter/source/dmapper/DomainMapper.cxx | 30
writerfilter/source/dmapper/DomainMapperTableHandler.cxx | 62 -
writerfilter/source/dmapper/DomainMapperTableManager.cxx | 24
writerfilter/source/dmapper/DomainMapper_Impl.cxx | 8
writerfilter/source/dmapper/FFDataHandler.cxx | 4
writerfilter/source/dmapper/GraphicImport.cxx | 4
writerfilter/source/dmapper/PropertyMap.cxx | 84 +-
writerfilter/source/dmapper/PropertyMap.hxx | 2
writerfilter/source/dmapper/PropertyMapHelper.cxx | 93 +-
writerfilter/source/dmapper/PropertyMapHelper.hxx | 12
writerfilter/source/dmapper/SettingsTable.cxx | 4
writerfilter/source/dmapper/StyleSheetTable.cxx | 81 +-
writerfilter/source/dmapper/StyleSheetTable.hxx | 4
writerfilter/source/dmapper/TablePropertiesHandler.cxx | 4
writerfilter/source/dmapper/TblStylePrHandler.cxx | 4
writerfilter/source/dmapper/ThemeTable.cxx | 6
writerfilter/source/doctok/WW8DocumentImpl.cxx | 417 ++++++------
writerfilter/source/filter/ImportFilter.cxx | 4
writerfilter/source/ooxml/OOXMLDocumentImpl.cxx | 4
writerfilter/source/ooxml/OOXMLFactory.cxx | 10
writerfilter/source/ooxml/OOXMLFastContextHandler.cxx | 254 +++----
writerfilter/source/ooxml/OOXMLFastContextHandler.hxx | 7
writerfilter/source/ooxml/OOXMLFastHelper.hxx | 12
writerfilter/source/ooxml/OOXMLParserState.cxx | 53 -
writerfilter/source/ooxml/OOXMLParserState.hxx | 3
writerfilter/source/ooxml/OOXMLPropertySetImpl.cxx | 2
writerfilter/source/ooxml/RefAndPointer.hxx | 13
writerfilter/source/resourcemodel/Protocol.cxx | 16
writerfilter/source/resourcemodel/TagLogger.cxx | 512 +++++----------
writerfilter/source/resourcemodel/makefile.mk | 4
writerfilter/util/makefile.mk | 4
33 files changed, 827 insertions(+), 1033 deletions(-)
New commits:
commit 06469ac1351adb934b492d0e6dba922fafc9e522
Author: Cédric Bosdonnat <cedricbosdo at openoffice.org>
Date: Wed Dec 8 00:31:50 2010 +0100
Removed trailing blanks in some writerfilter files
diff --git a/writerfilter/source/dmapper/PropertyMap.cxx b/writerfilter/source/dmapper/PropertyMap.cxx
index cf31345..4dd378b 100644
--- a/writerfilter/source/dmapper/PropertyMap.cxx
+++ b/writerfilter/source/dmapper/PropertyMap.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -137,15 +137,15 @@ void PropertyMap::Insert( PropertyIds eId, bool bIsTextProperty, const uno::Any&
void PropertyMap::dumpXml( const TagLogger::Pointer_t pLogger ) const
{
pLogger->startElement("PropertyMap");
-
+
PropertyNameSupplier& rPropNameSupplier = PropertyNameSupplier::GetPropertyNameSupplier();
PropertyMap::const_iterator aMapIter = begin();
while (aMapIter != end())
{
pLogger->startElement("property");
-
+
pLogger->attribute("name", rPropNameSupplier.GetName( aMapIter->first.eId ));
-
+
switch (aMapIter->first.eId)
{
case PROP_TABLE_COLUMN_SEPARATORS:
@@ -161,26 +161,26 @@ void PropertyMap::dumpXml( const TagLogger::Pointer_t pLogger ) const
sal_uInt32 auInt;
aMapIter->second >>= auInt;
pLogger->attribute("unsignedValue", auInt);
-
+
float aFloat;
aMapIter->second >>= aFloat;
pLogger->attribute("floatValue", aFloat);
-
+
::rtl::OUString aStr;
aMapIter->second >>= auInt;
- pLogger->attribute("stringValue", aStr);
+ pLogger->attribute("stringValue", aStr);
}
catch (...) {
}
}
break;
}
-
+
pLogger->endElement();
-
+
++aMapIter;
}
-
+
pLogger->endElement();
}
#endif
@@ -212,14 +212,14 @@ void PropertyMap::insert( const PropertyMapPtr pMap, bool bOverwrite )
::std::for_each( pMap->begin(), pMap->end(), removeExistingElements<PropertyMap::value_type>(*this) );
_PropertyMap::insert(pMap->begin(), pMap->end());
insertTableProperties(pMap.get());
-
+
Invalidate();
}
}
/*-- 06.06.2007 15:49:09---------------------------------------------------
-----------------------------------------------------------------------*/
-const uno::Reference< text::XFootnote>& PropertyMap::GetFootnote() const
+const uno::Reference< text::XFootnote>& PropertyMap::GetFootnote() const
{
return m_xFootnote;
}
@@ -476,7 +476,7 @@ void SectionPropertyMap::ApplyBorderToPageStyles(
PROP_TOP_BORDER_DISTANCE,
PROP_BOTTOM_BORDER_DISTANCE
};
- static const PropertyIds aMarginIds[4] =
+ static const PropertyIds aMarginIds[4] =
{
PROP_LEFT_MARGIN,
PROP_RIGHT_MARGIN,
@@ -505,9 +505,9 @@ void SectionPropertyMap::ApplyBorderToPageStyles(
}
}
-void SectionPropertyMap::SetBorderDistance( uno::Reference< beans::XPropertySet > xStyle,
+void SectionPropertyMap::SetBorderDistance( uno::Reference< beans::XPropertySet > xStyle,
PropertyIds eMarginId, PropertyIds eDistId, sal_Int32 nDistance, sal_Int32 nOffsetFrom )
-{
+{
PropertyNameSupplier& rPropNameSupplier = PropertyNameSupplier::GetPropertyNameSupplier();
sal_Int32 nDist = nDistance;
@@ -517,10 +517,10 @@ void SectionPropertyMap::SetBorderDistance( uno::Reference< beans::XPropertySet
uno::Any aMargin = xStyle->getPropertyValue( sMarginName );
sal_Int32 nMargin = 0;
aMargin >>= nMargin;
-
+
// Change the margins with the border distance
xStyle->setPropertyValue( sMarginName, uno::makeAny( nDistance ) );
-
+
// Set the distance to ( Margin - distance )
nDist = nMargin - nDistance;
}
@@ -924,7 +924,7 @@ void SectionPropertyMap::CloseSectionGroup( DomainMapper_Impl& rDM_Impl )
operator[]( PropertyDefinition( PROP_GRID_RUBY_HEIGHT, false )) = uno::makeAny( nRubyHeight );
sal_Int16 nGridMode = text::TextGridMode::NONE;
-
+
switch (m_nGridType)
{
case NS_ooxml::LN_Value_wordprocessingml_ST_DocGrid_lines:
@@ -936,9 +936,9 @@ void SectionPropertyMap::CloseSectionGroup( DomainMapper_Impl& rDM_Impl )
default:
break;
}
-
+
operator[](PropertyDefinition(PROP_GRID_MODE, false)) = uno::makeAny(nGridMode);
-
+
_ApplyProperties( xFollowPageStyle );
//todo: creating a "First Page" style depends on HasTitlePage und _fFacingPage_
@@ -957,7 +957,7 @@ void SectionPropertyMap::CloseSectionGroup( DomainMapper_Impl& rDM_Impl )
xFollowPageStyle->setPropertyValue(
rPropNameSupplier.GetName( PROP_TEXT_COLUMNS ), uno::makeAny( xColumns ));
}
-
+
ApplyBorderToPageStyles( rDM_Impl.GetPageStyles( ), rDM_Impl.GetTextFactory( ), m_nBorderParams );
try
@@ -1098,7 +1098,7 @@ ParagraphProperties::ParagraphProperties() :
/*-- 28.12.2007 08:28:24---------------------------------------------------
-----------------------------------------------------------------------*/
-ParagraphProperties::ParagraphProperties(const ParagraphProperties& rCopy) :
+ParagraphProperties::ParagraphProperties(const ParagraphProperties& rCopy) :
m_bFrameMode ( rCopy.m_bFrameMode),
m_nDropCap ( rCopy.m_nDropCap),
m_nLines ( rCopy.m_nLines),
@@ -1124,7 +1124,7 @@ ParagraphProperties::ParagraphProperties(const ParagraphProperties& rCopy) :
{
}
/*-- 28.12.2007 11:29:18---------------------------------------------------
-
+
-----------------------------------------------------------------------*/
ParagraphProperties::~ParagraphProperties()
{
@@ -1134,7 +1134,7 @@ ParagraphProperties::~ParagraphProperties()
-----------------------------------------------------------------------*/
int ParagraphProperties::operator==(const ParagraphProperties& rCompare)
{
- return
+ return
m_bFrameMode == rCompare.m_bFrameMode &&
m_nDropCap == rCompare.m_nDropCap &&
m_nLines == rCompare.m_nLines &&
@@ -1194,7 +1194,7 @@ bool TablePropertyMap::getValue( TablePropertyMapTarget eWhich, sal_Int32& nFill
OSL_ENSURE( false, "invalid TablePropertyMapTarget");
return false;
}
-}
+}
/*-- 18.02.2008 10:07:11---------------------------------------------------
-----------------------------------------------------------------------*/
@@ -1216,12 +1216,12 @@ void TablePropertyMap::insertTableProperties( const PropertyMap* pMap )
#ifdef DEBUG_DOMAINMAPPER
dmapper_logger->startElement("TablePropertyMap.insertTableProperties");
pMap->dumpXml(dmapper_logger);
-#endif
-
+#endif
+
const TablePropertyMap* pSource = dynamic_cast< const TablePropertyMap* >(pMap);
if( pSource )
{
- for( sal_Int32 eTarget = TablePropertyMapTarget_START;
+ for( sal_Int32 eTarget = TablePropertyMapTarget_START;
eTarget < TablePropertyMapTarget_MAX; ++eTarget )
{
if( pSource->m_aValidValues[eTarget].bValid )
@@ -1229,7 +1229,7 @@ void TablePropertyMap::insertTableProperties( const PropertyMap* pMap )
m_aValidValues[eTarget].bValid = true;
m_aValidValues[eTarget].nValue = pSource->m_aValidValues[eTarget].nValue;
}
- }
+ }
}
#ifdef DEBUG_DOMAINMAPPER
dumpXml( dmapper_logger );
diff --git a/writerfilter/source/doctok/WW8DocumentImpl.cxx b/writerfilter/source/doctok/WW8DocumentImpl.cxx
index f1f84bf..084af25 100644
--- a/writerfilter/source/doctok/WW8DocumentImpl.cxx
+++ b/writerfilter/source/doctok/WW8DocumentImpl.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -98,13 +98,13 @@ WW8DocumentIterator & WW8DocumentIteratorImpl::operator--()
bool WW8DocumentIteratorImpl::equal(const WW8DocumentIterator & rIt_) const
{
- const WW8DocumentIteratorImpl & rIt =
+ const WW8DocumentIteratorImpl & rIt =
dynamic_cast<const WW8DocumentIteratorImpl &>(rIt_);
return mCpAndFc == rIt.mCpAndFc && mpDocument == rIt.mpDocument;
}
-writerfilter::Reference<Properties>::Pointer_t
+writerfilter::Reference<Properties>::Pointer_t
WW8DocumentIteratorImpl::getProperties() const
{
return mpDocument->getProperties(mCpAndFc);
@@ -164,14 +164,14 @@ class WW8IdToString : public IdToString
public:
WW8IdToString() : IdToString() {}
virtual ~WW8IdToString() {}
-
+
virtual string toString(const Id & rId) const
{
string s((*SprmIdToString::Instance())(rId));
-
+
if (s.size() == 0)
s = (*QNameToString::Instance())(rId);
-
+
return s;
}
};
@@ -184,7 +184,7 @@ WW8DocumentImpl::~WW8DocumentImpl()
WW8DocumentImpl::WW8DocumentImpl(WW8Stream::Pointer_t rpStream)
: bSubDocument(false), mfcPicLoc(0), mbPicIsData(false), mpStream(rpStream),
mbInSection(false), mbInParagraphGroup(false), mbInCharacterGroup(false)
-{
+{
mpDocStream = getSubStream(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM
("WordDocument")));
@@ -197,7 +197,7 @@ mbInSection(false), mbInParagraphGroup(false), mbInCharacterGroup(false)
("Data")));
}
catch (ExceptionNotFound e)
- {
+ {
}
try
@@ -209,11 +209,11 @@ mbInSection(false), mbInParagraphGroup(false), mbInCharacterGroup(false)
{
}
- mpCHPFKPCache =
+ mpCHPFKPCache =
WW8FKPCache::Pointer_t(new WW8CHPFKPCacheImpl(mpDocStream, 5));
- mpPAPFKPCache =
+ mpPAPFKPCache =
WW8FKPCache::Pointer_t(new WW8PAPFKPCacheImpl(mpDocStream, 5));
-
+
mpFib = WW8Fib::Pointer_t(new WW8Fib(*mpDocStream));
switch (mpFib->get_fWhichTblStm())
@@ -242,9 +242,9 @@ mbInSection(false), mbInParagraphGroup(false), mbInCharacterGroup(false)
if (mpTableStream.get() == NULL)
throw ExceptionNotFound("Table stream not found.");
- mpPieceTable =
+ mpPieceTable =
WW8PieceTable::Pointer_t
- (new WW8PieceTableImpl(*mpTableStream, mpFib->get_fcClx(),
+ (new WW8PieceTableImpl(*mpTableStream, mpFib->get_fcClx(),
mpFib->get_lcbClx()));
{
@@ -256,13 +256,13 @@ mbInSection(false), mbInParagraphGroup(false), mbInCharacterGroup(false)
{
Cp aCp(mpFib->get_ccpText());
-
- mDocumentEndCpAndFc = CpAndFc(aCp, mpPieceTable->cp2fc(aCp),
+
+ mDocumentEndCpAndFc = CpAndFc(aCp, mpPieceTable->cp2fc(aCp),
PROP_DOC);
mCpAndFcs.insert(mDocumentEndCpAndFc);
aCp += mpFib->get_ccpFtn();
- mFootnoteEndCpAndFc = CpAndFc(aCp, mpPieceTable->cp2fc(aCp),
+ mFootnoteEndCpAndFc = CpAndFc(aCp, mpPieceTable->cp2fc(aCp),
PROP_DOC);
mCpAndFcs.insert(mFootnoteEndCpAndFc);
@@ -292,10 +292,10 @@ mbInSection(false), mbInParagraphGroup(false), mbInCharacterGroup(false)
mCpAndFcs.insert(mTextboxHeaderEndCpAndFc);
}
- mpBinTablePAPX =
+ mpBinTablePAPX =
WW8BinTable::Pointer_t(new WW8BinTableImpl
- (*mpTableStream,
- mpFib->get_fcPlcfbtePapx(),
+ (*mpTableStream,
+ mpFib->get_fcPlcfbtePapx(),
mpFib->get_lcbPlcfbtePapx()));
//clog << "BinTable(PAP):" << mpBinTablePAPX->toString();
@@ -304,8 +304,8 @@ mbInSection(false), mbInParagraphGroup(false), mbInCharacterGroup(false)
mpBinTableCHPX =
WW8BinTable::Pointer_t(new WW8BinTableImpl
- (*mpTableStream,
- mpFib->get_fcPlcfbteChpx(),
+ (*mpTableStream,
+ mpFib->get_fcPlcfbteChpx(),
mpFib->get_lcbPlcfbteChpx()));
//clog << "BinTable(CHP):" << mpBinTableCHPX->toString();
@@ -313,8 +313,8 @@ mbInSection(false), mbInParagraphGroup(false), mbInCharacterGroup(false)
parseBinTableCpAndFcs(*mpBinTableCHPX, PROP_CHP);
mpSEDs = PLCF<WW8SED>::Pointer_t(new PLCF<WW8SED>
- (*mpTableStream,
- mpFib->get_fcPlcfsed(),
+ (*mpTableStream,
+ mpFib->get_fcPlcfsed(),
mpFib->get_lcbPlcfsed()));
//mpSEDs->dump(clog);
@@ -329,10 +329,10 @@ mbInSection(false), mbInParagraphGroup(false), mbInCharacterGroup(false)
if (nHeaders > 0)
{
mpHeaderOffsets = WW8StructBase::Pointer_t
- (new WW8StructBase(*mpTableStream,
- mpFib->get_fcPlcfhdd(),
+ (new WW8StructBase(*mpTableStream,
+ mpFib->get_fcPlcfhdd(),
mpFib->get_lcbPlcfhdd()));
-
+
{
for (sal_uInt32 n = 0; n <= nHeaders; ++n)
{
@@ -340,26 +340,26 @@ mbInSection(false), mbInParagraphGroup(false), mbInCharacterGroup(false)
mCpAndFcs.insert(aCpAndFc);
}
- }
+ }
}
-
+
if (mpFib->get_lcbPlcffndTxt() > 0)
{
WW8StructBase::Pointer_t pCps
(new WW8StructBase(*mpTableStream,
mpFib->get_fcPlcffndTxt(),
mpFib->get_lcbPlcffndTxt()));
-
+
PLCF<WW8FRD>::Pointer_t pRefs
(new PLCF<WW8FRD>(*mpTableStream,
mpFib->get_fcPlcffndRef(),
mpFib->get_lcbPlcffndRef()));
-
+
mpFootnoteHelper = XNoteHelper<WW8FRD>::Pointer_t
- (new XNoteHelper<WW8FRD>(pCps, pRefs, mpPieceTable, this,
+ (new XNoteHelper<WW8FRD>(pCps, pRefs, mpPieceTable, this,
PROP_FOOTNOTE, getDocumentEndCp()));
-
- mpFootnoteHelper->init();
+
+ mpFootnoteHelper->init();
}
if (mpFib->get_lcbPlcfendTxt() > 0)
@@ -368,16 +368,16 @@ mbInSection(false), mbInParagraphGroup(false), mbInCharacterGroup(false)
(new WW8StructBase(*mpTableStream,
mpFib->get_fcPlcfendTxt(),
mpFib->get_lcbPlcfendTxt()));
-
+
PLCF<WW8FRD>::Pointer_t pRefs
(new PLCF<WW8FRD>(*mpTableStream,
mpFib->get_fcPlcfendRef(),
mpFib->get_lcbPlcfendRef()));
-
+
mpEndnoteHelper = XNoteHelper<WW8FRD>::Pointer_t
- (new XNoteHelper<WW8FRD>(pCps, pRefs, mpPieceTable, this,
+ (new XNoteHelper<WW8FRD>(pCps, pRefs, mpPieceTable, this,
PROP_ENDNOTE, getAnnotationEndCp()));
-
+
mpEndnoteHelper->init();
}
@@ -387,23 +387,23 @@ mbInSection(false), mbInParagraphGroup(false), mbInCharacterGroup(false)
(new WW8StructBase(*mpTableStream,
mpFib->get_fcPlcfandTxt(),
mpFib->get_lcbPlcfandTxt()));
-
+
PLCF<WW8ATRD>::Pointer_t pRefs
(new PLCF<WW8ATRD>(*mpTableStream,
mpFib->get_fcPlcfandRef(),
mpFib->get_lcbPlcfandRef()));
-
+
mpAnnotationHelper = XNoteHelper<WW8ATRD>::Pointer_t
- (new XNoteHelper<WW8ATRD>(pCps, pRefs, mpPieceTable, this,
+ (new XNoteHelper<WW8ATRD>(pCps, pRefs, mpPieceTable, this,
PROP_ANNOTATION, getHeaderEndCp()));
-
- mpAnnotationHelper->init();
+
+ mpAnnotationHelper->init();
}
if (mpFib->get_lcbSttbfbkmk() > 0)
{
PLCF<WW8BKF>::Pointer_t pStartCps
- (new PLCF<WW8BKF>(*mpTableStream, mpFib->get_fcPlcfbkf(),
+ (new PLCF<WW8BKF>(*mpTableStream, mpFib->get_fcPlcfbkf(),
mpFib->get_lcbPlcfbkf()));
WW8StructBase::Pointer_t pEndCps
@@ -426,8 +426,8 @@ mbInSection(false), mbInParagraphGroup(false), mbInCharacterGroup(false)
if (mpFib->get_lcbPlcffldMom() > 0)
{
pPlcffldMom = PLCF<WW8FLD>::Pointer_t
- (new PLCF<WW8FLD>(*mpTableStream,
- mpFib->get_fcPlcffldMom(),
+ (new PLCF<WW8FLD>(*mpTableStream,
+ mpFib->get_fcPlcffldMom(),
mpFib->get_lcbPlcffldMom()));
mpFieldHelper = FieldHelper::Pointer_t
@@ -443,7 +443,7 @@ mbInSection(false), mbInParagraphGroup(false), mbInCharacterGroup(false)
{
pPlcspaMom = PLCF<WW8FSPA>::Pointer_t
(new PLCF<WW8FSPA>
- (*mpTableStream, mpFib->get_fcPlcspaMom(),
+ (*mpTableStream, mpFib->get_fcPlcspaMom(),
mpFib->get_lcbPlcspaMom()));
}
@@ -487,12 +487,12 @@ mbInSection(false), mbInParagraphGroup(false), mbInCharacterGroup(false)
if (mpFib->get_lcbPlcftxbxTxt() > 0)
{
mpTextBoxStories = PLCF<WW8FTXBXS>::Pointer_t
- (new PLCF<WW8FTXBXS>(*mpTableStream,
+ (new PLCF<WW8FTXBXS>(*mpTableStream,
mpFib->get_fcPlcftxbxTxt(),
mpFib->get_lcbPlcftxbxTxt()));
PLCFHelper<WW8FTXBXS>::processPLCFCpAndFcs
- (*this, mpPieceTable, mpTextBoxStories, PROP_DOC,
+ (*this, mpPieceTable, mpTextBoxStories, PROP_DOC,
mEndnoteEndCpAndFc.getCp().get());
}
@@ -532,7 +532,7 @@ bool WW8DocumentImpl::isSpecial(sal_uInt32 nChar)
return bResult;
}
-WW8DocumentImpl::WW8DocumentImpl(const WW8DocumentImpl & rSrc,
+WW8DocumentImpl::WW8DocumentImpl(const WW8DocumentImpl & rSrc,
const CpAndFc & rStart, const CpAndFc & rEnd)
: bSubDocument(true), mfcPicLoc(0), mbPicIsData(false)
{
@@ -545,7 +545,7 @@ WW8DocumentImpl::WW8DocumentImpl(const WW8DocumentImpl & rSrc,
WW8DocumentImpl & WW8DocumentImpl::Assign(const WW8DocumentImpl & rSrc)
{
mCpAndFcs = rSrc.mCpAndFcs;
-
+
mpCHPFKPCache = rSrc.mpCHPFKPCache;
mpPAPFKPCache = rSrc.mpPAPFKPCache;
@@ -577,7 +577,7 @@ WW8DocumentImpl & WW8DocumentImpl::Assign(const WW8DocumentImpl & rSrc)
mpTextBoxStories = rSrc.mpTextBoxStories;
mDocumentEndCpAndFc = rSrc.mDocumentEndCpAndFc;
- mFootnoteEndCpAndFc = rSrc.mFootnoteEndCpAndFc;
+ mFootnoteEndCpAndFc = rSrc.mFootnoteEndCpAndFc;
return *this;
}
@@ -587,7 +587,7 @@ string WW8DocumentImpl::getType() const
return "WW8DocumentImpl";
}
-void WW8DocumentImpl::parseBinTableCpAndFcs(WW8BinTable & rTable,
+void WW8DocumentImpl::parseBinTableCpAndFcs(WW8BinTable & rTable,
PropertyType eType_)
{
//clog << "<bintable type=\"" << propertyTypeToString(eType_) << "\">" << endl;
@@ -621,16 +621,16 @@ void WW8DocumentImpl::parseBinTableCpAndFcs(WW8BinTable & rTable,
switch (eType_)
{
case PROP_CHP:
- pFKP = getFKPCHPX(rTable.getPageNumber(i),
+ pFKP = getFKPCHPX(rTable.getPageNumber(i),
aCpAndFcFromTable.isComplex());
break;
-
+
case PROP_PAP:
pFKP = getFKPPAPX(rTable.getPageNumber(i),
aCpAndFcFromTable.isComplex());
-
- break;
+
+ break;
default:
break;
}
@@ -650,7 +650,7 @@ void WW8DocumentImpl::parseBinTableCpAndFcs(WW8BinTable & rTable,
try
{
Cp aCp = mpPieceTable->fc2cp(aFc);
-
+
CpAndFc aCpAndFc(aCp, aFc, eType_);
mCpAndFcs.insert(aCpAndFc);
@@ -685,7 +685,7 @@ WW8Document::Pointer_t WW8DocumentImpl::getSubDocument(SubDocumentId /*nId*/)
return WW8Document::Pointer_t(new WW8DocumentImpl(*this));
}
-WW8DocumentIterator::Pointer_t
+WW8DocumentIterator::Pointer_t
WW8DocumentImpl::getIterator(const CpAndFc & rCpAndFc)
{
return WW8DocumentIterator::Pointer_t
@@ -719,19 +719,19 @@ sal_uInt32 WW8DocumentImpl::getByteLength(const CpAndFc & rCpAndFc) const
sal_uInt32 nResult = 3;
if (rCpAndFc < aEnd)
- nResult = (aEnd - rCpAndFc) *
+ nResult = (aEnd - rCpAndFc) *
(mpPieceTable->isComplex(rCpAndFc.getCp()) ? 1 : 2);
return nResult;
}
-WW8Stream::Sequence
+WW8Stream::Sequence
WW8DocumentImpl::getText(const CpAndFc & rStart)
{
return mpDocStream->get(rStart.getFc().get(), getByteLength(rStart));
}
-const CpAndFc & WW8DocumentImpl::getFirstCp() const
+const CpAndFc & WW8DocumentImpl::getFirstCp() const
{
return mCpAndFcStart;
}
@@ -822,7 +822,7 @@ WW8FKP::Pointer_t WW8DocumentImpl::getFKP(const CpAndFc & rCpAndFc)
{
case PROP_PAP:
{
- nPageNumber =
+ nPageNumber =
mpBinTablePAPX->getPageNumber(rCpAndFc.getFc());
pResult = getFKPPAPX(nPageNumber, rCpAndFc.isComplex());
@@ -830,7 +830,7 @@ WW8FKP::Pointer_t WW8DocumentImpl::getFKP(const CpAndFc & rCpAndFc)
break;
case PROP_CHP:
{
- nPageNumber =
+ nPageNumber =
mpBinTableCHPX->getPageNumber(rCpAndFc.getFc());
pResult = getFKPCHPX(nPageNumber, rCpAndFc.isComplex());
@@ -846,7 +846,7 @@ WW8FKP::Pointer_t WW8DocumentImpl::getFKP(const CpAndFc & rCpAndFc)
return pResult;
}
-WW8FKP::Pointer_t WW8DocumentImpl::getFKPCHPX(sal_uInt32 nIndex,
+WW8FKP::Pointer_t WW8DocumentImpl::getFKPCHPX(sal_uInt32 nIndex,
bool bComplex)
{
return mpCHPFKPCache->get(nIndex, bComplex);
@@ -868,10 +868,10 @@ writerfilter::Reference<Properties>::Pointer_t WW8DocumentImpl::getProperties
case PROP_CHP:
case PROP_PAP:
{
- try
+ try
{
WW8FKP::Pointer_t pFKP = getFKP(rCpAndFc);
-
+
pResult = pFKP->getProperties(rCpAndFc.getFc());
}
catch (ExceptionOutOfBounds e)
@@ -882,7 +882,7 @@ writerfilter::Reference<Properties>::Pointer_t WW8DocumentImpl::getProperties
break;
case PROP_SEC:
- {
+ {
pResult = writerfilter::Reference<Properties>::Pointer_t
(getSED(rCpAndFc));
}
@@ -938,15 +938,15 @@ writerfilter::Reference<Properties>::Pointer_t WW8DocumentImpl::getProperties
default:
break;
}
-
+
return pResult;
}
-writerfilter::Reference<Stream>::Pointer_t
+writerfilter::Reference<Stream>::Pointer_t
WW8DocumentImpl::getSubDocument(const CpAndFc & rCpAndFc)
{
writerfilter::Reference<Stream>::Pointer_t pResult;
-
+
switch (rCpAndFc.getType())
{
case PROP_FOOTNOTE:
@@ -960,7 +960,7 @@ WW8DocumentImpl::getSubDocument(const CpAndFc & rCpAndFc)
case PROP_ANNOTATION:
pResult = getAnnotation(rCpAndFc);
break;
-
+
default:
break;
}
@@ -980,19 +980,19 @@ WW8SED * WW8DocumentImpl::getSED(const CpAndFc & rCpAndFc) const
writerfilter::Reference<Table>::Pointer_t WW8DocumentImpl::getListTplcs() const
{
writerfilter::Reference<Table>::Pointer_t pResult;
-
+
if (mpFibRgFcLcb2000.get() != NULL &&
mpFibRgFcLcb2000->get_fcSttbRgtplc() != 0 &&
mpFibRgFcLcb2000->get_lcbSttbRgtplc() != 0)
{
- WW8SttbRgtplc * pSttbRgtplc =
+ WW8SttbRgtplc * pSttbRgtplc =
new WW8SttbRgtplc(*mpTableStream,
mpFibRgFcLcb2000->get_fcSttbRgtplc(),
mpFibRgFcLcb2000->get_lcbSttbRgtplc());
-
+
pResult = writerfilter::Reference<Table>::Pointer_t(pSttbRgtplc);
}
-
+
return pResult;
}
@@ -1002,9 +1002,9 @@ writerfilter::Reference<Table>::Pointer_t WW8DocumentImpl::getListTable() const
if (mpFib->get_fcPlcfLst() != 0 && mpFib->get_lcbPlcfLst() > 0)
{
- try
+ try
{
- WW8ListTable * pList = new WW8ListTable(*mpTableStream,
+ WW8ListTable * pList = new WW8ListTable(*mpTableStream,
mpFib->get_fcPlcfLst(),
mpFib->get_fcPlfLfo() -
mpFib->get_fcPlcfLst());
@@ -1014,7 +1014,7 @@ writerfilter::Reference<Table>::Pointer_t WW8DocumentImpl::getListTable() const
pResult = writerfilter::Reference<Table>::Pointer_t(pList);
}
- catch (ExceptionOutOfBounds aException) {
+ catch (ExceptionOutOfBounds aException) {
}
}
@@ -1027,15 +1027,15 @@ writerfilter::Reference<Table>::Pointer_t WW8DocumentImpl::getLFOTable() const
if (mpFib->get_fcPlfLfo() != 0 && mpFib->get_lcbPlfLfo() > 0)
{
- try
+ try
{
- WW8LFOTable * pLFOs = new WW8LFOTable(*mpTableStream,
+ WW8LFOTable * pLFOs = new WW8LFOTable(*mpTableStream,
mpFib->get_fcPlfLfo(),
mpFib->get_lcbPlfLfo());
-
+
pLFOs->setPayloadOffset(mpFib->get_lcbPlcfLst());
pLFOs->initPayload();
-
+
pResult = writerfilter::Reference<Table>::Pointer_t(pLFOs);
}
catch (Exception e)
@@ -1044,7 +1044,7 @@ writerfilter::Reference<Table>::Pointer_t WW8DocumentImpl::getLFOTable() const
}
}
- return pResult;
+ return pResult;
}
writerfilter::Reference<Table>::Pointer_t WW8DocumentImpl::getFontTable() const
@@ -1053,7 +1053,7 @@ writerfilter::Reference<Table>::Pointer_t WW8DocumentImpl::getFontTable() const
if (mpFib->get_fcSttbfffn() != 0 && mpFib->get_lcbSttbfffn() > 0)
{
- WW8FontTable * pFonts = new WW8FontTable(*mpTableStream,
+ WW8FontTable * pFonts = new WW8FontTable(*mpTableStream,
mpFib->get_fcSttbfffn(),
mpFib->get_lcbSttbfffn());
@@ -1062,7 +1062,7 @@ writerfilter::Reference<Table>::Pointer_t WW8DocumentImpl::getFontTable() const
pResult = writerfilter::Reference<Table>::Pointer_t(pFonts);
}
- return pResult;
+ return pResult;
}
writerfilter::Reference<Table>::Pointer_t WW8DocumentImpl::getStyleSheet() const
@@ -1071,7 +1071,7 @@ writerfilter::Reference<Table>::Pointer_t WW8DocumentImpl::getStyleSheet() const
if (mpFib->get_lcbStshf() > 0)
{
- WW8StyleSheet * pStyles = new WW8StyleSheet(*mpTableStream,
+ WW8StyleSheet * pStyles = new WW8StyleSheet(*mpTableStream,
mpFib->get_fcStshf(),
mpFib->get_lcbStshf());
@@ -1080,7 +1080,7 @@ writerfilter::Reference<Table>::Pointer_t WW8DocumentImpl::getStyleSheet() const
pResult = writerfilter::Reference<Table>::Pointer_t(pStyles);
}
- return pResult;
+ return pResult;
}
writerfilter::Reference<Table>::Pointer_t WW8DocumentImpl::getAssocTable() const
@@ -1127,7 +1127,7 @@ CpAndFc WW8DocumentImpl::getHeaderCpAndFc(sal_uInt32 nPos)
Cp aCp(getFootnodeEndCp().getCp() + mpHeaderOffsets->getU32(nPos * 4));
Fc aFc(mpPieceTable->cp2fc(aCp));
CpAndFc aCpAndFc(aCp, aFc, PROP_DOC);
-
+
return aCpAndFc;
}
@@ -1143,17 +1143,17 @@ writerfilter::Reference<Stream>::Pointer_t WW8DocumentImpl::getHeader(sal_uInt32
CpAndFc aCpAndFcStart(getHeaderCpAndFc(nPos));
CpAndFc aCpAndFcEnd(getHeaderCpAndFc(nPos + 1));
-
+
#if 0
sal_uInt32 nEquals = 1;
while (aCpAndFcEnd == aCpAndFcStart && nPos + nEquals < getHeaderCount())
{
++nEquals;
-
+
aCpAndFcEnd = getHeaderCpAndFc(nPos + nEquals);
}
#endif
-
+
if (aCpAndFcStart < aCpAndFcEnd)
pResult = writerfilter::Reference<Stream>::Pointer_t
(new WW8DocumentImpl(*this, aCpAndFcStart, aCpAndFcEnd));
@@ -1166,7 +1166,7 @@ sal_uInt32 WW8DocumentImpl::getFootnoteCount() const
return (mpFootnoteHelper.get() != NULL) ? mpFootnoteHelper->getCount() : 0;
}
-writerfilter::Reference<Stream>::Pointer_t
+writerfilter::Reference<Stream>::Pointer_t
WW8DocumentImpl::getFootnote(sal_uInt32 nPos)
{
writerfilter::Reference<Stream>::Pointer_t pResult;
@@ -1177,7 +1177,7 @@ WW8DocumentImpl::getFootnote(sal_uInt32 nPos)
return pResult;
}
-writerfilter::Reference<Stream>::Pointer_t
+writerfilter::Reference<Stream>::Pointer_t
WW8DocumentImpl::getFootnote(const CpAndFc & rCpAndFc)
{
writerfilter::Reference<Stream>::Pointer_t pResult;
@@ -1193,7 +1193,7 @@ sal_uInt32 WW8DocumentImpl::getEndnoteCount() const
return mpEndnoteHelper.get() != NULL ? mpEndnoteHelper->getCount() : 0;
}
-writerfilter::Reference<Stream>::Pointer_t
+writerfilter::Reference<Stream>::Pointer_t
WW8DocumentImpl::getEndnote(sal_uInt32 nPos)
{
writerfilter::Reference<Stream>::Pointer_t pResult;
@@ -1204,7 +1204,7 @@ WW8DocumentImpl::getEndnote(sal_uInt32 nPos)
return pResult;
}
-writerfilter::Reference<Stream>::Pointer_t
+writerfilter::Reference<Stream>::Pointer_t
WW8DocumentImpl::getEndnote(const CpAndFc & rCpAndFc)
{
writerfilter::Reference<Stream>::Pointer_t pResult;
@@ -1217,11 +1217,11 @@ WW8DocumentImpl::getEndnote(const CpAndFc & rCpAndFc)
sal_uInt32 WW8DocumentImpl::getAnnotationCount() const
{
- return mpAnnotationHelper.get() != NULL ?
+ return mpAnnotationHelper.get() != NULL ?
mpAnnotationHelper->getCount() : 0;
}
-writerfilter::Reference<Stream>::Pointer_t
+writerfilter::Reference<Stream>::Pointer_t
WW8DocumentImpl::getAnnotation(sal_uInt32 nPos)
{
writerfilter::Reference<Stream>::Pointer_t pResult;
@@ -1232,7 +1232,7 @@ WW8DocumentImpl::getAnnotation(sal_uInt32 nPos)
return pResult;
}
-writerfilter::Reference<Stream>::Pointer_t
+writerfilter::Reference<Stream>::Pointer_t
WW8DocumentImpl::getAnnotation(const CpAndFc & rCpAndFc)
{
writerfilter::Reference<Stream>::Pointer_t pResult;
@@ -1272,13 +1272,13 @@ WW8DocumentImpl::getShape(sal_uInt32 nSpid)
return pResult;
}
-writerfilter::Reference<Properties>::Pointer_t
+writerfilter::Reference<Properties>::Pointer_t
WW8DocumentImpl::getBreak(const CpAndFc & rCpAndFc) const
{
return mpBreakHelper->getBreak(rCpAndFc);
}
-writerfilter::Reference<Properties>::Pointer_t
+writerfilter::Reference<Properties>::Pointer_t
WW8DocumentImpl::getBlip(sal_uInt32 nBid)
{
writerfilter::Reference<Properties>::Pointer_t pResult;
@@ -1286,11 +1286,11 @@ WW8DocumentImpl::getBlip(sal_uInt32 nBid)
if (mpDffBlock != NULL)
{
DffRecord::Pointer_t pDffRecord(mpDffBlock->getBlip(nBid));
-
+
if (pDffRecord.get() != NULL)
{
DffBSE * pBlip = new DffBSE(*pDffRecord);
-
+
if (pBlip != NULL)
pResult = writerfilter::Reference<Properties>::Pointer_t(pBlip);
}
@@ -1351,7 +1351,7 @@ WW8DocumentImpl::getTextboxText(sal_uInt32 nShpId) const
if (mpTextBoxStories.get() != NULL)
{
sal_uInt32 nCount = mpTextBoxStories->getEntryCount();
-
+
sal_uInt32 n = 0;
while (n < nCount)
{
@@ -1365,14 +1365,14 @@ WW8DocumentImpl::getTextboxText(sal_uInt32 nShpId) const
if (n < nCount)
{
- Cp aCpStart(mpTextBoxStories->getFc(n));
+ Cp aCpStart(mpTextBoxStories->getFc(n));
aCpStart += getEndnoteEndCp().getCp().get();
- CpAndFc aCpAndFcStart =
+ CpAndFc aCpAndFcStart =
mpPieceTable->createCpAndFc(aCpStart, PROP_DOC);
Cp aCpEnd(mpTextBoxStories->getFc(n + 1));
aCpEnd += getEndnoteEndCp().getCp().get();
CpAndFc aCpAndFcEnd = mpPieceTable->createCpAndFc(aCpEnd, PROP_DOC);
-
+
pResult = writerfilter::Reference<Stream>::Pointer_t
(new WW8DocumentImpl(*this, aCpAndFcStart, aCpAndFcEnd));
}
@@ -1384,41 +1384,41 @@ WW8DocumentImpl::getTextboxText(sal_uInt32 nShpId) const
Id lcl_headerQName(sal_uInt32 nIndex)
{
Id qName = NS_rtf::LN_header;
-
+
if (nIndex > 5)
{
switch ((nIndex - 6) % 6)
{
case 0:
qName = NS_rtf::LN_headerl;
-
+
break;
case 1:
qName = NS_rtf::LN_headerr;
-
+
break;
case 2:
qName = NS_rtf::LN_footerl;
-
+
break;
case 3:
qName = NS_rtf::LN_footerr;
-
+
break;
case 4:
qName = NS_rtf::LN_headerf;
-
+
break;
case 5:
qName = NS_rtf::LN_footerf;
-
+
break;
}
}
return qName;
}
-
+
Fc WW8DocumentImpl::cp2fc(const Cp & cp) const
{
return mpPieceTable->cp2fc(cp);
@@ -1432,7 +1432,7 @@ Cp WW8DocumentImpl::fc2cp(const Fc & fc) const
CpAndFc WW8DocumentImpl::getCpAndFc(const Cp & cp, PropertyType type) const
{
Fc aFc = cp2fc(cp);
-
+
return CpAndFc(cp, aFc, type);
}
@@ -1451,7 +1451,7 @@ void WW8DocumentImpl::resolvePicture(Stream & rStream)
{
WW8StructBase aStruct(*pStream, mfcPicLoc, 4);
sal_uInt32 nCount = aStruct.getU32(0);
-
+
{
WW8PICF * pPicf = new WW8PICF(*pStream, mfcPicLoc, nCount);
pPicf->setDocument(this);
@@ -1490,19 +1490,19 @@ void WW8DocumentImpl::utext(Stream & rStream, const sal_uInt8 * data, size_t len
{
#ifdef DEBUG_ELEMENT
debug_logger->startElement("utext");
-
+
::rtl::OUString sText;
::rtl::OUStringBuffer aBuffer = ::rtl:: OUStringBuffer(len);
aBuffer.append( (const sal_Unicode *) data, len);
sText = aBuffer.makeStringAndClear();
-
+
debug_logger->chars(OUStringToOString(sText, RTL_TEXTENCODING_ASCII_US).getStr());
debug_logger->endElement();
#endif
rStream.utext(data, len);
}
-
-
+
+
void WW8DocumentImpl::resolveText(WW8DocumentIterator::Pointer_t pIt,
Stream & rStream)
{
@@ -1512,13 +1512,13 @@ void WW8DocumentImpl::resolveText(WW8DocumentIterator::Pointer_t pIt,
bool bComplex = pIt->isComplex();
/*
- Assumption: Special characters are always at the beginning or end of a
+ Assumption: Special characters are always at the beginning or end of a
run.
*/
if (nCount > 0)
{
if (nCount == 1)
- bComplex = true;
+ bComplex = true;
if (bComplex)
{
@@ -1526,11 +1526,11 @@ void WW8DocumentImpl::resolveText(WW8DocumentIterator::Pointer_t pIt,
sal_uInt32 nEndIndex = nCount - 1;
sal_uInt32 nCharFirst = aSeq[0];
- sal_uInt32 nCharLast = aSeq[nEndIndex];
-
+ sal_uInt32 nCharLast = aSeq[nEndIndex];
+
if (isSpecial(nCharFirst))
{
- nStartIndex += 1;
+ nStartIndex += 1;
resolveSpecialChar(nCharFirst, rStream);
text(rStream, &aSeq[0], 1);
}
@@ -1554,7 +1554,7 @@ void WW8DocumentImpl::resolveText(WW8DocumentIterator::Pointer_t pIt,
{
sal_uInt32 nStartIndex = 0;
sal_uInt32 nEndIndex = nCount - 2;
-
+
sal_uInt32 nCharFirst = aSeq[0] + (aSeq[1] << 8);
sal_uInt32 nCharLast = aSeq[nEndIndex] + (aSeq[nEndIndex + 1]);
@@ -1587,7 +1587,7 @@ void WW8DocumentImpl::startCharacterGroup(Stream & rStream)
{
if (mbInCharacterGroup)
endCharacterGroup(rStream);
-
+
#ifdef DEBUG_ELEMENT
debug_logger->startElement("charactergroup");
#endif
@@ -1595,17 +1595,17 @@ void WW8DocumentImpl::startCharacterGroup(Stream & rStream)
rStream.startCharacterGroup();
mbInCharacterGroup = true;
}
-
+
void WW8DocumentImpl::endCharacterGroup(Stream & rStream)
{
-#ifdef DEBUG_ELEMENT
+#ifdef DEBUG_ELEMENT
debug_logger->endElement();
#endif
-
+
rStream.endCharacterGroup();
mbInCharacterGroup = false;
}
-
+
void WW8DocumentImpl::startParagraphGroup(Stream & rStream)
{
if (mbInParagraphGroup)
@@ -1614,11 +1614,11 @@ void WW8DocumentImpl::startParagraphGroup(Stream & rStream)
#ifdef DEBUG_ELEMENT
debug_logger->startElement("paragraphgroup");
#endif
-
+
rStream.startParagraphGroup();
mbInParagraphGroup = true;
}
-
+
void WW8DocumentImpl::endParagraphGroup(Stream & rStream)
{
if (mbInCharacterGroup)
@@ -1630,39 +1630,39 @@ void WW8DocumentImpl::endParagraphGroup(Stream & rStream)
rStream.endParagraphGroup();
mbInParagraphGroup = false;
}
-
+
void WW8DocumentImpl::startSectionGroup(Stream & rStream)
{
if (mbInSection)
endSectionGroup(rStream);
-
+
#ifdef DEBUG_ELEMENT
debug_logger->startElement("sectiongroup");
#endif
-
+
rStream.startSectionGroup();
mbInSection = true;
}
-
+
void WW8DocumentImpl::endSectionGroup(Stream & rStream)
{
if (mbInParagraphGroup)
endParagraphGroup(rStream);
-
+
#ifdef DEBUG_ELEMENT
debug_logger->endElement();
#endif
rStream.endSectionGroup();
mbInSection = false;
}
-
+
void WW8DocumentImpl::resolve(Stream & rStream)
{
if (! bSubDocument)
{
//mpPieceTable->dump(clog);
-
+
//copy(mCpAndFcs.begin(), mCpAndFcs.end(), ostream_iterator<CpAndFc>(clog, ", "));
//mpDocStream->dump(output);
@@ -1688,7 +1688,7 @@ void WW8DocumentImpl::resolve(Stream & rStream)
writerfilter::Reference<Properties>::Pointer_t pFib
(new WW8Fib(*mpFib));
rStream.props(pFib);
-
+
if (mpFibRgFcLcb2000.get() != NULL)
{
writerfilter::Reference<Properties>::Pointer_t pFibRgFcLcb2000
@@ -1706,7 +1706,7 @@ void WW8DocumentImpl::resolve(Stream & rStream)
#endif
if (mpFib->get_lcbPlcftxbxBkd() > 0)
{
- PLCF<WW8BKD> aPLCF(*mpTableStream,
+ PLCF<WW8BKD> aPLCF(*mpTableStream,
mpFib->get_fcPlcftxbxBkd(),
mpFib->get_lcbPlcftxbxBkd());
#if 0
@@ -1736,7 +1736,7 @@ void WW8DocumentImpl::resolve(Stream & rStream)
rStream.info("/headers");
}
-#if 0
+#if 0
{
sal_uInt32 nFootnoteCount = getFootnoteCount();
for (sal_uInt32 n = 0; n < nFootnoteCount; ++n)
@@ -1744,7 +1744,7 @@ void WW8DocumentImpl::resolve(Stream & rStream)
//clog << "<footnote num=\"" << n << "\"/>" << endl;
writerfilter::Reference<Stream>::Pointer_t pFootnote(getFootnote(n));
-
+
if (pFootnote.get() != NULL)
rStream.substream(NS_rtf::LN_footnote, pFootnote);
}
@@ -1756,27 +1756,27 @@ void WW8DocumentImpl::resolve(Stream & rStream)
//clog << "<endnote num=\"" << n << "\"/>" << endl;
writerfilter::Reference<Stream>::Pointer_t pEndnote(getEndnote(n));
-
+
if (pEndnote.get() != NULL)
rStream.substream(NS_rtf::LN_endnote, pEndnote);
}
}
#endif
-
+
writerfilter::Reference<Table>::Pointer_t pSttbRgtplc = getListTplcs();
-
+
if (pSttbRgtplc.get() != NULL)
rStream.table(NS_rtf::LN_SttbRgtplc, pSttbRgtplc);
-
+
writerfilter::Reference<Table>::Pointer_t pFontTable = getFontTable();
-
+
if (pFontTable.get() != NULL)
rStream.table(NS_rtf::LN_FONTTABLE, pFontTable);
-
+
try
{
writerfilter::Reference<Table>::Pointer_t pStyleSheet = getStyleSheet();
-
+
if (pStyleSheet.get() != NULL)
rStream.table(NS_rtf::LN_STYLESHEET, pStyleSheet);
}
@@ -1789,14 +1789,14 @@ void WW8DocumentImpl::resolve(Stream & rStream)
if (pAssocTable.get() != NULL)
rStream.table(NS_rtf::LN_SttbAssoc, pAssocTable);
-
+
writerfilter::Reference<Table>::Pointer_t pListTable = getListTable();
-
+
if (pListTable.get() != NULL)
rStream.table(NS_rtf::LN_LISTTABLE, pListTable);
-
+
writerfilter::Reference<Table>::Pointer_t pLFOTable = getLFOTable();
-
+
if (pLFOTable.get() != NULL)
rStream.table(NS_rtf::LN_LFOTABLE, pLFOTable);
}
@@ -1812,18 +1812,18 @@ void WW8DocumentImpl::resolve(Stream & rStream)
rStream.info(pIt->toString());
rStream.info(pItEnd->toString());
-
+
while (! pIt->equal(*pItEnd))
{
- writerfilter::Reference<Properties>::Pointer_t
+ writerfilter::Reference<Properties>::Pointer_t
pProperties(pIt->getProperties());
-
+
switch (pIt->getPropertyType())
{
case PROP_FOOTNOTE:
{
rStream.info(pIt->toString());
- writerfilter::Reference<Stream>::Pointer_t
+ writerfilter::Reference<Stream>::Pointer_t
pFootnote(pIt->getSubDocument());
if (pFootnote.get() != NULL)
@@ -1841,7 +1841,7 @@ void WW8DocumentImpl::resolve(Stream & rStream)
case PROP_ENDNOTE:
{
rStream.info(pIt->toString());
- writerfilter::Reference<Stream>::Pointer_t
+ writerfilter::Reference<Stream>::Pointer_t
pEndnote(pIt->getSubDocument());
if (pEndnote.get() != NULL)
@@ -1859,7 +1859,7 @@ void WW8DocumentImpl::resolve(Stream & rStream)
case PROP_ANNOTATION:
{
rStream.info(pIt->toString());
- writerfilter::Reference<Stream>::Pointer_t
+ writerfilter::Reference<Stream>::Pointer_t
pAnnotation(pIt->getSubDocument());
if (pAnnotation.get() != NULL)
@@ -1882,8 +1882,8 @@ void WW8DocumentImpl::resolve(Stream & rStream)
break;
case PROP_PAP:
{
- startParagraphGroup(rStream);
- rStream.info(pIt->toString());
+ startParagraphGroup(rStream);
+ rStream.info(pIt->toString());
}
break;
@@ -1906,30 +1906,30 @@ void WW8DocumentImpl::resolve(Stream & rStream)
for (sal_uInt32 n = nHeaderStartIndex; n < nHeaderEndIndex; ++n)
{
- writerfilter::Reference<Stream>::Pointer_t
+ writerfilter::Reference<Stream>::Pointer_t
pHeader(getHeader(n));
-
+
Id qName = lcl_headerQName(n);
-
+
if (pHeader.get() != NULL)
rStream.substream(qName, pHeader);
}
-
+
++nSectionIndex;
}
break;
default:
- rStream.info(pIt->toString());
- }
-
+ rStream.info(pIt->toString());
+ }
+
if (pProperties.get() != NULL)
{
#ifdef DEBUG_PROPERTIES
- debug_logger->propertySet(pProperties,
+ debug_logger->propertySet(pProperties,
IdToString::Pointer_t(new WW8IdToString()));
#endif
-
+
rStream.props(pProperties);
}
@@ -1954,8 +1954,8 @@ void WW8DocumentImpl::resolve(Stream & rStream)
}
-WW8Stream::Pointer_t
-WW8DocumentFactory::createStream(uno::Reference<uno::XComponentContext> rContext,
+WW8Stream::Pointer_t
+WW8DocumentFactory::createStream(uno::Reference<uno::XComponentContext> rContext,
uno::Reference<io::XInputStream> rStream)
{
return WW8Stream::Pointer_t(new WW8StreamImpl(rContext, rStream));
@@ -1977,7 +1977,7 @@ WW8SED::get_sepx()
WW8StructBase aTmp(*mpDoc->getDocStream(), get_fcSepx(), 2);
pResult = writerfilter::Reference<Properties>::Pointer_t
(new WW8PropertySetImpl
- (*mpDoc->getDocStream(), get_fcSepx() + 2,
+ (*mpDoc->getDocStream(), get_fcSepx() + 2,
(sal_uInt32) aTmp.getU16(0), false));
}
@@ -2009,7 +2009,7 @@ string propertyTypeToString(PropertyType nType)
break;
case PROP_BOOKMARKEND:
result = "BOOKMARKEND";
-
+
break;
case PROP_ENDNOTE:
result = "ENDNOTE";
@@ -2035,7 +2035,7 @@ string propertyTypeToString(PropertyType nType)
case PROP_PAP:
result = "PAP";
-
+
break;
case PROP_CHP:
@@ -2058,7 +2058,7 @@ string CpAndFc::toString() const
result += ", ";
result += getFc().toString();
result += ", ";
-
+
result += propertyTypeToString(getType());
result += ")";
@@ -2069,17 +2069,17 @@ string CpAndFc::toString() const
// Bookmark
-Bookmark::Bookmark(writerfilter::Reference<Properties>::Pointer_t pBKF,
+Bookmark::Bookmark(writerfilter::Reference<Properties>::Pointer_t pBKF,
rtl::OUString & rName)
: mpBKF(pBKF), mName(rName)
-{
+{
}
void Bookmark::resolve(Properties & rHandler)
{
mpBKF->resolve(rHandler);
-
- WW8Value::Pointer_t pValue = createValue(mName);
+
+ WW8Value::Pointer_t pValue = createValue(mName);
rHandler.attribute(NS_rtf::LN_BOOKMARKNAME, *pValue);
}
@@ -2131,7 +2131,7 @@ sal_uInt32 BookmarkHelper::getIndex(const CpAndFc & rCpAndFc)
if (nCp == mpStartCps->getFc(n))
{
nResult = n;
-
+
break;
}
}
@@ -2166,22 +2166,22 @@ sal_uInt32 BookmarkHelper::getIndex(const CpAndFc & rCpAndFc)
for (n = 0; n < nStartsCount; ++n)
{
WW8BKF::Pointer_t pBKF(mpStartCps->getEntry(n));
-
- if (pBKF->get_ibkl() ==
+
+ if (pBKF->get_ibkl() ==
sal::static_int_cast<sal_Int32>(nIndex))
{
nResult = n;
-
+
break;
}
}
-
+
if (n == nStartsCount)
throw ExceptionNotFound("BookmarkHelper::getIndex");
}
}
}
-
+
break;
default:
break;
@@ -2194,7 +2194,7 @@ void BookmarkHelper::init()
{
{
sal_uInt32 nStartsCount = mpStartCps->getEntryCount();
-
+
for (sal_uInt32 n = 0; n < nStartsCount; ++n)
mpDoc->insertCpAndFc(getStartCpAndFc(n));
}
@@ -2207,12 +2207,12 @@ void BookmarkHelper::init()
}
}
-writerfilter::Reference<Properties>::Pointer_t
+writerfilter::Reference<Properties>::Pointer_t
BookmarkHelper::getBKF(const CpAndFc & rCpAndFc)
{
sal_uInt32 nIndex = getIndex(rCpAndFc);
-
- return writerfilter::Reference<Properties>::Pointer_t
+
+ return writerfilter::Reference<Properties>::Pointer_t
(mpStartCps->getEntryPointer(nIndex));
}
@@ -2241,7 +2241,7 @@ rtl::OUString BookmarkHelper::getName(const CpAndFc & rCpAndFc)
rtl::OUString sResult;
sal_uInt32 nIndex = getIndex(rCpAndFc);
-
+
sResult = getName(nIndex);
return sResult;
@@ -2250,7 +2250,7 @@ rtl::OUString BookmarkHelper::getName(const CpAndFc & rCpAndFc)
template <class T, class Helper>
struct ProcessPLCF2Map
{
- void process(typename PLCF<T>::Pointer_t pPlcf,
+ void process(typename PLCF<T>::Pointer_t pPlcf,
typename Helper::Map_t & rMap,
PropertyType type,
WW8DocumentImpl * pDoc)
@@ -2258,13 +2258,13 @@ struct ProcessPLCF2Map
if (pPlcf.get() != NULL)
{
sal_uInt32 nCount = pPlcf->getEntryCount();
-
+
for (sal_uInt32 n = 0; n < nCount; n++)
{
Cp aCp(pPlcf->getFc(n));
CpAndFc aCpAndFc(pDoc->getCpAndFc(aCp, type));
typename T::Pointer_t pT = pPlcf->getEntry(n);
-
+
rMap[aCpAndFc] = pT;
}
}
@@ -2281,7 +2281,7 @@ FieldHelper::FieldHelper(PLCF<WW8FLD>::Pointer_t pPlcffldMom,
void FieldHelper::init()
{
- Map_t::iterator aIt;
+ Map_t::iterator aIt;
for (aIt = mMap.begin(); aIt != mMap.end(); aIt++)
{
@@ -2317,13 +2317,13 @@ ShapeHelper::ShapeHelper(PLCF<WW8FSPA>::Pointer_t pPlcspaMom,
void ShapeHelper::init()
{
- Map_t::iterator aIt;
+ Map_t::iterator aIt;
for (aIt = mMap.begin(); aIt != mMap.end(); aIt++)
{
mpDoc->insertCpAndFc(aIt->first);
aIt->second->setDocument(mpDoc);
- }
+ }
}
writerfilter::Reference<Properties>::Pointer_t
diff --git a/writerfilter/source/ooxml/OOXMLFastContextHandler.cxx b/writerfilter/source/ooxml/OOXMLFastContextHandler.cxx
index 7ec809e..35e9f3e 100644
--- a/writerfilter/source/ooxml/OOXMLFastContextHandler.cxx
+++ b/writerfilter/source/ooxml/OOXMLFastContextHandler.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -943,9 +943,9 @@ void OOXMLFastContextHandler::sendCellProperties()
#ifdef DEBUG_ELEMENT
debug_logger->startElement("sendCellProperties");
#endif
-
+
mpParserState->resolveCellProperties(*mpStream);
-
+
#ifdef DEBUG_ELEMENT
debug_logger->endElement();
#endif
@@ -956,9 +956,9 @@ void OOXMLFastContextHandler::sendRowProperties()
#ifdef DEBUG_ELEMENT
debug_logger->startElement("sendRowProperties");
#endif
-
+
mpParserState->resolveRowProperties(*mpStream);
-
+
#ifdef DEBUG_ELEMENT
debug_logger->endElement();
#endif
@@ -969,9 +969,9 @@ void OOXMLFastContextHandler::sendTableProperties()
#ifdef DEBUG_ELEMENT
debug_logger->startElement("sendTableProperties");
#endif
-
+
mpParserState->resolveTableProperties(*mpStream);
-
+
#ifdef DEBUG_ELEMENT
debug_logger->endElement();
#endif
@@ -982,7 +982,7 @@ void OOXMLFastContextHandler::clearTableProps()
#ifdef DEBUG_ELEMENT
debug_logger->element("clearTableProps");
#endif
-
+
mpParserState->setTableProperties(OOXMLPropertySet::Pointer_t
(new OOXMLPropertySetImpl()));
}
@@ -1152,7 +1152,7 @@ void OOXMLFastContextHandler::sendPropertyToParent()
pProp(new OOXMLPropertyImpl(mId, getValue(),
OOXMLPropertyImpl::SPRM));
pProps->add(pProp);
-
+
#ifdef DEBUG_ELEMENT
debug_logger->propertySet(pProps,
IdToString::Pointer_t(new OOXMLIdToString()));
@@ -1173,34 +1173,34 @@ void OOXMLFastContextHandler::sendPropertiesToParent()
if (mpParent != NULL)
{
OOXMLPropertySet::Pointer_t pParentProps(mpParent->getPropertySet());
-
+
if (pParentProps.get() != NULL)
{
OOXMLPropertySet::Pointer_t pProps(getPropertySet());
-
+
#ifdef DEBUG_ELEMENT
debug_logger->startElement("me");
debug_logger->propertySet(pProps,
IdToString::Pointer_t(new OOXMLIdToString()));
debug_logger->endElement();
#endif
-
+
if (pProps.get() != NULL)
- {
+ {
OOXMLValue::Pointer_t pValue
(new OOXMLPropertySetValue(getPropertySet()));
-
+
OOXMLProperty::Pointer_t pProp
(new OOXMLPropertyImpl(getId(), pValue, OOXMLPropertyImpl::SPRM));
-
+
#ifdef DEBUG_ELEMENT
debug_logger->startElement("propertyForSet");
debug_logger->chars(pProp->toString());
debug_logger->endElement();
#endif
-
+
pParentProps->add(pProp);
-
+
#ifdef DEBUG_ELEMENT
debug_logger->startElement("parent");
debug_logger->propertySet(pParentProps,
@@ -1366,7 +1366,7 @@ void OOXMLFastContextHandlerProperties::dumpXml( const TagLogger::Pointer_t pLog
pLogger->attribute("value", pVal->toString());
else
pLogger->attribute("value", "(null)");
-
+
pLogger->attribute("resolve", mbResolve ? "resolve" : "noResolve");
pLogger->propertySet(getPropertySet(),
@@ -1566,7 +1566,7 @@ void OOXMLFastContextHandlerValue::lcl_endFastElement
throw (uno::RuntimeException, xml::sax::SAXException)
{
sendPropertyToParent();
-
+
endAction(Element);
}
@@ -1588,7 +1588,7 @@ void OOXMLFastContextHandlerValue::setDefaultIntegerValue()
#ifdef DEBUG_ELEMENT
debug_logger->element("setDefaultIntegerValue");
#endif
-
+
if (mpValue.get() == NULL)
{
OOXMLValue::Pointer_t pValue(new OOXMLIntegerValue(0));
@@ -1601,7 +1601,7 @@ void OOXMLFastContextHandlerValue::setDefaultHexValue()
#ifdef DEBUG_ELEMENT
debug_logger->element("setDefaultHexValue");
#endif
-
+
if (mpValue.get() == NULL)
{
OOXMLValue::Pointer_t pValue(new OOXMLHexValue(0));
@@ -1614,7 +1614,7 @@ void OOXMLFastContextHandlerValue::setDefaultStringValue()
#ifdef DEBUG_ELEMENT
debug_logger->element("setDefaultStringValue");
#endif
-
+
if (mpValue.get() == NULL)
{
OOXMLValue::Pointer_t pValue(new OOXMLStringValue(::rtl::OUString()));
@@ -1791,7 +1791,7 @@ void OOXMLFastContextHandlerTextTableCell::endCell()
IdToString::Pointer_t(new OOXMLIdToString()));
debug_logger->endElement();
#endif
- mpStream->props(writerfilter::Reference<Properties>::Pointer_t(pProps));
+ mpStream->props(writerfilter::Reference<Properties>::Pointer_t(pProps));
}
}
@@ -1883,7 +1883,7 @@ void OOXMLFastContextHandlerTextTable::lcl_startFastElement
{
mpParserState->startTable();
mnTableDepth++;
-
+
boost::shared_ptr<OOXMLPropertySet> pProps( new OOXMLPropertySetImpl );
{
OOXMLValue::Pointer_t pVal
@@ -1913,7 +1913,7 @@ void OOXMLFastContextHandlerTextTable::lcl_endFastElement
OOXMLFastContextHandlerShape::OOXMLFastContextHandlerShape
(OOXMLFastContextHandler * pContext)
-: OOXMLFastContextHandlerProperties(pContext), m_bShapeSent( false ),
+: OOXMLFastContextHandlerProperties(pContext), m_bShapeSent( false ),
m_bShapeStarted(false)
{
uno::Reference<uno::XComponentContext> xContext(getComponentContext());
@@ -1991,7 +1991,7 @@ void SAL_CALL OOXMLFastContextHandlerShape::startUnknownElement
void OOXMLFastContextHandlerShape::setToken(Token_t nToken)
{
OOXMLFastContextHandler::setToken(nToken);
-
+
if (mrShapeContext.is())
mrShapeContext->setStartToken(nToken);
}
@@ -2007,9 +2007,9 @@ void OOXMLFastContextHandlerShape::sendShape( Token_t Element )
pValue(new OOXMLShapeValue(xShape));
newProperty(NS_ooxml::LN_shape, pValue);
m_bShapeSent = true;
-
+
bool bIsPicture = Element == ( NS_picture | OOXML_pic );
-
+
// Notify the dmapper that the shape is ready to use
if ( !bIsPicture )
{
@@ -2031,7 +2031,7 @@ void OOXMLFastContextHandlerShape::lcl_endFastElement
}
OOXMLFastContextHandlerProperties::lcl_endFastElement(Element);
-
+
// Ending the shape should be the last thing to do
bool bIsPicture = Element == ( NS_picture | OOXML_pic );
if ( !bIsPicture && m_bShapeStarted)
@@ -2084,7 +2084,7 @@ OOXMLFastContextHandlerShape::lcl_createFastChildContext
xContextHandler.set(this);
break;
}
-
+
return xContextHandler;
}
@@ -2258,7 +2258,7 @@ OOXMLFastContextHandlerWrapper::lcl_createFastChildContext
}
else
xResult.set(this);
-
+
if ( bInTokens )
{
OOXMLFastContextHandlerShape* pShapeCtx = (OOXMLFastContextHandlerShape*)mpParent;
diff --git a/writerfilter/source/ooxml/OOXMLParserState.cxx b/writerfilter/source/ooxml/OOXMLParserState.cxx
index 4e9b4f4..cd319dc 100644
--- a/writerfilter/source/ooxml/OOXMLParserState.cxx
+++ b/writerfilter/source/ooxml/OOXMLParserState.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -42,7 +42,7 @@ OOXMLParserState::OOXMLParserState() :
mbInSectionGroup(false),
mbInParagraphGroup(false),
mbInCharacterGroup(false),
- mbLastParagraphInSection(false),
+ mbLastParagraphInSection(false),
mbForwardEvents(true),
mnContexts(0),
mnHandle(0),
@@ -92,7 +92,7 @@ bool OOXMLParserState::isInCharacterGroup() const
void OOXMLParserState::setInCharacterGroup(bool bInCharacterGroup)
{
mbInCharacterGroup = bInCharacterGroup;
-}
+}
void OOXMLParserState::setForwardEvents(bool bForwardEvents)
{
@@ -175,24 +175,24 @@ void OOXMLParserState::setCellProperties
if (mCellProps.size() > 0)
{
OOXMLPropertySet::Pointer_t & rCellProps = mCellProps.top();
-
+
if (rCellProps.get() == NULL)
rCellProps = pProps;
- else
+ else
rCellProps->add(pProps);
}
}
-
+
void OOXMLParserState::setRowProperties
(OOXMLPropertySet::Pointer_t pProps)
{
if (mRowProps.size() > 0)
{
OOXMLPropertySet::Pointer_t & rRowProps = mRowProps.top();
-
+
if (rRowProps.get() == NULL)
rRowProps = pProps;
- else
+ else
rRowProps->add(pProps);
}
}
@@ -202,7 +202,7 @@ void OOXMLParserState::resolveCellProperties(Stream & rStream)
if (mCellProps.size() > 0)
{
OOXMLPropertySet::Pointer_t & rCellProps = mCellProps.top();
-
+
if (rCellProps.get() != NULL)
{
rStream.props(rCellProps);
@@ -216,7 +216,7 @@ void OOXMLParserState::resolveRowProperties(Stream & rStream)
if (mRowProps.size() > 0)
{
OOXMLPropertySet::Pointer_t & rRowProps = mRowProps.top();
-
+
if (rRowProps.get() != NULL)
{
rStream.props(rRowProps);
@@ -230,7 +230,7 @@ void OOXMLParserState::resolveTableProperties(Stream & rStream)
if (mTableProps.size() > 0)
{
OOXMLPropertySet::Pointer_t & rTableProps = mTableProps.top();
-
+
if (rTableProps.get() != NULL)
{
rStream.props(rTableProps);
@@ -245,7 +245,7 @@ void OOXMLParserState::setTableProperties
if (mTableProps.size() > 0)
{
OOXMLPropertySet::Pointer_t & rTableProps = mTableProps.top();
- if (rTableProps.get() == NULL)
+ if (rTableProps.get() == NULL)
rTableProps = pProps;
else
rTableProps->add(pProps);
@@ -257,12 +257,12 @@ void OOXMLParserState::startTable()
OOXMLPropertySet::Pointer_t pCellProps;
OOXMLPropertySet::Pointer_t pRowProps;
OOXMLPropertySet::Pointer_t pTableProps;
-
+
mCellProps.push(pCellProps);
mRowProps.push(pRowProps);
mTableProps.push(pTableProps);
}
-
+
void OOXMLParserState::endTable()
{
mCellProps.pop();
@@ -285,7 +285,7 @@ void OOXMLParserState::dumpXml( const TagLogger::Pointer_t& pLogger )
{
pLogger->startElement("parserstate");
- string sTmp;
+ string sTmp;
if (isInSectionGroup())
sTmp += "s";
@@ -301,15 +301,15 @@ void OOXMLParserState::dumpXml( const TagLogger::Pointer_t& pLogger )
sTmp += "c";
else
sTmp += "-";
-
+
if (isForwardEvents())
sTmp += "f";
else
sTmp += "-";
pLogger->attribute("state", sTmp);
- pLogger->attribute("XNoteId",
- OUStringToOString(getXNoteId(),
+ pLogger->attribute("XNoteId",
+ OUStringToOString(getXNoteId(),
RTL_TEXTENCODING_ASCII_US).getStr());
if (mpCharacterProps != OOXMLPropertySet::Pointer_t())
pLogger->chars(mpCharacterProps->toString());
diff --git a/writerfilter/source/resourcemodel/TagLogger.cxx b/writerfilter/source/resourcemodel/TagLogger.cxx
index ae37572..1809392 100644
--- a/writerfilter/source/resourcemodel/TagLogger.cxx
+++ b/writerfilter/source/resourcemodel/TagLogger.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -56,7 +56,7 @@ namespace writerfilter
pWriter = NULL;
pName = NULL;
}
-
+
void TagLogger::setFileName( const string & filename )
{
if ( pWriter )
@@ -64,12 +64,12 @@ namespace writerfilter
string fileName;
char * temp = getenv("TAGLOGGERTMP");
-
+
if (temp != NULL)
fileName += temp;
else
fileName += "/tmp";
-
+
string sPrefix = filename;
size_t nLastSlash = sPrefix.find_last_of('/');
size_t nLastBackslash = sPrefix.find_last_of('\\');
@@ -78,7 +78,7 @@ namespace writerfilter
nCutPos = nLastBackslash;
if (nCutPos < sPrefix.size())
sPrefix = sPrefix.substr(nCutPos + 1);
-
+
fileName += "/";
fileName += sPrefix;
fileName += ".";
@@ -127,17 +127,17 @@ namespace writerfilter
xmlTextWriterStartElement( pWriter, xmlName );
xmlFree( xmlName );
}
-
+
void TagLogger::attribute(const string & name, const string & value)
{
xmlChar* xmlName = xmlCharStrdup( name.c_str() );
xmlChar* xmlValue = xmlCharStrdup( value.c_str() );
xmlTextWriterWriteAttribute( pWriter, xmlName, xmlValue );
-
+
xmlFree( xmlValue );
xmlFree( xmlName );
}
-
+
void TagLogger::attribute(const string & name, const ::rtl::OUString & value)
{
attribute( name, OUStringToOString( value, RTL_TEXTENCODING_ASCII_US ).getStr() );
@@ -178,43 +178,43 @@ namespace writerfilter
}
xmlFree( xmlName );
}
-
+
void TagLogger::chars(const string & rChars)
{
xmlChar* xmlChars = xmlCharStrdup( rChars.c_str() );
xmlTextWriterWriteString( pWriter, xmlChars );
xmlFree( xmlChars );
}
-
+
void TagLogger::chars(const ::rtl::OUString & rChars)
{
chars(OUStringToOString(rChars, RTL_TEXTENCODING_ASCII_US).getStr());
}
-
+
void TagLogger::endElement()
{
xmlTextWriterEndElement( pWriter );
}
-
+
void TagLogger::endDocument()
{
xmlTextWriterEndDocument( pWriter );
xmlFreeTextWriter( pWriter );
}
-
-
+
+
class PropertySetDumpHandler : public Properties
{
IdToString::Pointer_t mpIdToString;
TagLogger::Pointer_t m_pLogger;
-
+
public:
- PropertySetDumpHandler(TagLogger::Pointer_t pLogger,
- IdToString::Pointer_t pIdToString);
+ PropertySetDumpHandler(TagLogger::Pointer_t pLogger,
+ IdToString::Pointer_t pIdToString);
virtual ~PropertySetDumpHandler();
-
+
void resolve(writerfilter::Reference<Properties>::Pointer_t props);
-
+
virtual void attribute(Id name, Value & val);
virtual void sprm(Sprm & sprm);
};
@@ -229,45 +229,45 @@ namespace writerfilter
PropertySetDumpHandler::~PropertySetDumpHandler()
{
}
-
+
void PropertySetDumpHandler::resolve(
writerfilter::Reference<Properties>::Pointer_t pProps)
{
if (pProps.get() != NULL)
pProps->resolve( *this );
}
-
+
void PropertySetDumpHandler::attribute(Id name, Value & val)
{
m_pLogger->startElement( "attribute" );
-
+
m_pLogger->attribute("name", (*QNameToString::Instance())(name));
m_pLogger->attribute("value", val.toString());
-
+
resolve(val.getProperties());
-
+
m_pLogger->endElement();
}
-
+
void PropertySetDumpHandler::sprm(Sprm & rSprm)
{
m_pLogger->startElement( "sprm" );
-
+
string sName;
-
+
if (mpIdToString != IdToString::Pointer_t())
sName = mpIdToString->toString(rSprm.getId());
-
+
m_pLogger->attribute( "name", sName );
-
+
m_pLogger->attribute( "id", rSprm.getId() );
m_pLogger->attribute( "value", rSprm.getValue()->toString() );
-
+
resolve( rSprm.getProps() );
-
+
m_pLogger->endElement();
}
-
+
void TagLogger::propertySet(writerfilter::Reference<Properties>::Pointer_t props,
IdToString::Pointer_t pIdToString)
{
@@ -279,7 +279,7 @@ namespace writerfilter
endElement( );
}
-
+
void TagLogger::unoPropertySet(uno::Reference<beans::XPropertySet> rPropSet)
{
uno::Reference<beans::XPropertySetInfo> xPropSetInfo(rPropSet->getPropertySetInfo());
@@ -291,16 +291,16 @@ namespace writerfilter
{
startElement( "property" );
::rtl::OUString sName(aProps[i].Name);
-
+
attribute( "name", sName );
- try
+ try
{
attribute( "value", rPropSet->getPropertyValue( sName ) );
}
catch (uno::Exception aException)
{
startElement( "exception" );
-
+
chars("getPropertyValue(\"");
chars(sName);
chars("\")");
commit cbb4106a61c0ca1b5a5aa821146f92ec6ba4eb69
Author: Cédric Bosdonnat <cedricbosdo at openoffice.org>
Date: Wed Dec 8 00:27:52 2010 +0100
Using libxml2 instead of homemade stuffs for the debug output
This also seems to fix a memory leak that was present only with some
debug output enabled.
diff --git a/writerfilter/inc/resourcemodel/TagLogger.hxx b/writerfilter/inc/resourcemodel/TagLogger.hxx
index 40444bc..dd45e0e 100644
--- a/writerfilter/inc/resourcemodel/TagLogger.hxx
+++ b/writerfilter/inc/resourcemodel/TagLogger.hxx
@@ -36,124 +36,53 @@
#include <WriterFilterDllApi.hxx>
#include <resourcemodel/WW8ResourceModel.hxx>
#include <string>
-#include <vector>
-#include <stack>
#include <hash_map>
#include <boost/shared_ptr.hpp>
-#include <iostream>
+#include <libxml/xmlwriter.h>
namespace writerfilter
{
- using namespace::std;
-
- struct XMLAttribute
+ class IdToString
{
- string mName;
- string mValue;
public:
- XMLAttribute(string sName, string sValue)
- : mName(sName), mValue(sValue)
- {
- }
+ typedef boost::shared_ptr<IdToString> Pointer_t;
+ virtual std::string toString(const Id & id) const = 0;
};
- class WRITERFILTER_DLLPUBLIC XMLTag
- {
- public:
- enum eMode { START, END, COMPLETE };
- typedef boost::shared_ptr<XMLTag> Pointer_t;
- static Pointer_t NIL;
-
- private:
- string mTag;
- string mChars;
-
- typedef vector<XMLAttribute> XMLAttributes_t;
- XMLAttributes_t mAttrs;
- typedef vector<XMLTag::Pointer_t> XMLTags_t;
- XMLTags_t mTags;
- eMode mMode;
-
- public:
- XMLTag(string sTag, eMode mode = COMPLETE) : mTag(sTag), mMode(mode) {}
-
- void addAttr(string name, string value);
- void addAttr(string name, const ::rtl::OUString & value);
- void addAttr(string name, sal_uInt32 nValue);
- void addAttr(string name, uno::Any rAny);
- void addTag(Pointer_t pTag);
- void chars(const string & rChars);
- void chars(const ::rtl::OUString & rChars);
- const string & getTag() const;
- string toString() const;
-
- ostream & output(ostream & o) const;
- };
-
class WRITERFILTER_DLLPUBLIC TagLogger
{
public:
- typedef boost::shared_ptr<TagLogger> Pointer_t;
+ typedef TagLogger* Pointer_t;
private:
- stack<XMLTag::Pointer_t> mTags;
- XMLTag::Pointer_t currentTag() const;
- XMLTag::Pointer_t mpRoot;
- string mFileName;
+ xmlTextWriterPtr pWriter;
+ const char* pName;
- TagLogger();
+ TagLogger(const char* name);
public:
~TagLogger();
static Pointer_t getInstance(const char * name);
- void setFileName(const string & rName);
-
+ void setFileName(const std::string & filename);
+
void startDocument();
- void element(const string & name);
- void startElement(const string & name);
- void attribute(const string & name, const string & value);
- void attribute(const string & name, const ::rtl::OUString & value);
- void attribute(const string & name, sal_uInt32 value);
- void attribute(const string & name, const uno::Any aAny);
- void addTag(XMLTag::Pointer_t pTag);
- void chars(const string & chars);
+ void element(const std::string & name);
+ void startElement(const std::string & name);
+ void attribute(const std::string & name, const std::string & value);
+ void attribute(const std::string & name, const ::rtl::OUString & value);
+ void attribute(const std::string & name, sal_uInt32 value);
+ void attribute(const std::string & name, const uno::Any aAny);
+ void chars(const std::string & chars);
void chars(const ::rtl::OUString & chars);
- void endElement(const string & name);
+ void endElement();
void endDocument();
-
- ostream & output(ostream & o) const;
- static void dump(const char * name);
- };
-
- class IdToString
- {
- public:
- typedef boost::shared_ptr<IdToString> Pointer_t;
- virtual string toString(const Id & id) const = 0;
- };
-
- class WRITERFILTER_DLLPUBLIC PropertySetToTagHandler : public Properties
- {
- XMLTag::Pointer_t mpTag;
- IdToString::Pointer_t mpIdToString;
-
- public:
- PropertySetToTagHandler(IdToString::Pointer_t pIdToString)
- : mpTag(new XMLTag("propertyset")), mpIdToString(pIdToString) {}
- virtual ~PropertySetToTagHandler();
-
- XMLTag::Pointer_t getTag() const { return mpTag; }
-
- void resolve(XMLTag & rTag,
- writerfilter::Reference<Properties>::Pointer_t props);
-
- virtual void attribute(Id name, Value & val);
- virtual void sprm(Sprm & sprm);
- };
-WRITERFILTER_DLLPUBLIC XMLTag::Pointer_t unoPropertySetToTag(uno::Reference<beans::XPropertySet> rPropSet);
+ void unoPropertySet(uno::Reference<beans::XPropertySet> rPropSet);
+ void propertySet(writerfilter::Reference<Properties>::Pointer_t props,
+ IdToString::Pointer_t pIdToString);
+ };
}
#endif // DEBUG
diff --git a/writerfilter/source/dmapper/BorderHandler.cxx b/writerfilter/source/dmapper/BorderHandler.cxx
index b96be38..07c885c 100644
--- a/writerfilter/source/dmapper/BorderHandler.cxx
+++ b/writerfilter/source/dmapper/BorderHandler.cxx
@@ -70,7 +70,7 @@ void BorderHandler::attribute(Id rName, Value & rVal)
#ifdef DEBUG_DOMAINMAPPER
dmapper_logger->startElement("BorderHandler.attribute");
dmapper_logger->attribute("id", (*QNameToString::Instance())(rName));
- dmapper_logger->endElement("BorderHandler.attribute");
+ dmapper_logger->endElement();
#endif
sal_Int32 nIntValue = rVal.getInt();
@@ -147,7 +147,7 @@ void BorderHandler::sprm(Sprm & rSprm)
}
#ifdef DEBUG_DOMAINMAPPER
- dmapper_logger->endElement("BorderHandler.sprm");
+ dmapper_logger->endElement();
#endif
}
diff --git a/writerfilter/source/dmapper/DomainMapper.cxx b/writerfilter/source/dmapper/DomainMapper.cxx
index 6f7e6d5..6865b5d 100644
--- a/writerfilter/source/dmapper/DomainMapper.cxx
+++ b/writerfilter/source/dmapper/DomainMapper.cxx
@@ -200,7 +200,7 @@ void DomainMapper::attribute(Id nName, Value & val)
dmapper_logger->startElement("attribute");
dmapper_logger->attribute("name", (*QNameToString::Instance())(nName));
dmapper_logger->attribute("value", val.toString());
- dmapper_logger->endElement("attribute");
+ dmapper_logger->endElement();
#endif
static ::rtl::OUString sLocalBookmarkName;
sal_Int32 nIntValue = val.getInt();
@@ -2244,7 +2244,7 @@ void DomainMapper::sprm( Sprm& rSprm, PropertyMapPtr rContext, SprmType eSprmTyp
#ifdef DEBUG_DOMAINMAPPER
dmapper_logger->startElement("charWeight");
dmapper_logger->attribute("weight", nIntValue ? awt::FontWeight::BOLD : awt::FontWeight::NORMAL);
- dmapper_logger->endElement("charWeight");
+ dmapper_logger->endElement();
#endif
rContext->Insert(ePropertyId, true, aBold );
@@ -3397,14 +3397,14 @@ void DomainMapper::sprm( Sprm& rSprm, PropertyMapPtr rContext, SprmType eSprmTyp
dmapper_logger->startElement("unhandled");
dmapper_logger->attribute("id", nSprmId);
dmapper_logger->attribute("name", rSprm.getName());
- dmapper_logger->endElement("unhandled");
+ dmapper_logger->endElement();
#endif
}
}
#ifdef DEBUG_DOMAINMAPPER
- dmapper_logger->addTag(rContext->toTag());
- dmapper_logger->endElement("DomainMapper.sprm");
+ rContext->dumpXml(dmapper_logger);
+ dmapper_logger->endElement();
#endif
}
/*-- 09.06.2006 09:52:13---------------------------------------------------
@@ -3420,7 +3420,7 @@ void DomainMapper::entry(int /*pos*/,
ref->resolve(*this);
#ifdef DEBUG_DOMAINMAPPER
- dmapper_logger->endElement("DomainMapper.entry");
+ dmapper_logger->endElement();
#endif
}
/*-- 09.06.2006 09:52:13---------------------------------------------------
@@ -3453,7 +3453,7 @@ void DomainMapper::endSectionGroup()
m_pImpl->PopProperties(CONTEXT_SECTION);
#ifdef DEBUG_DOMAINMAPPER
- dmapper_logger->endElement("section");
+ dmapper_logger->endElement();
#endif
}
/*-- 09.06.2006 09:52:13---------------------------------------------------
@@ -3488,7 +3488,7 @@ void DomainMapper::endParagraphGroup()
//frame conversion has to be executed after table conversion
m_pImpl->ExecuteFrameConversion();
#ifdef DEBUG_DOMAINMAPPER
- dmapper_logger->endElement("paragraph");
+ dmapper_logger->endElement();
#endif
}
@@ -3513,7 +3513,7 @@ void DomainMapper::endShape( )
m_pImpl->PopShapeContext( );
#ifdef DEBUG_DOMAINMAPPER
- dmapper_logger->endElement("shape");
+ dmapper_logger->endElement();
#endif
}
@@ -3578,7 +3578,7 @@ void DomainMapper::endCharacterGroup()
m_pImpl->PopProperties(CONTEXT_CHARACTER);
#ifdef DEBUG_DOMAINMAPPER
- dmapper_logger->endElement("charactergroup");
+ dmapper_logger->endElement();
#endif
}
/*-- 09.06.2006 09:52:14---------------------------------------------------
@@ -3591,7 +3591,7 @@ void DomainMapper::text(const sal_uInt8 * data_, size_t len)
#ifdef DEBUG_DOMAINMAPPER
dmapper_logger->startElement("text");
dmapper_logger->chars(sText);
- dmapper_logger->endElement("text");
+ dmapper_logger->endElement();
#endif
try
@@ -3680,7 +3680,7 @@ void DomainMapper::utext(const sal_uInt8 * data_, size_t len)
#ifdef DEBUG_DOMAINMAPPER
dmapper_logger->startElement("utext");
dmapper_logger->chars(sText);
- dmapper_logger->endElement("utext");
+ dmapper_logger->endElement();
#endif
try
@@ -3759,7 +3759,7 @@ void DomainMapper::props(writerfilter::Reference<Properties>::Pointer_t ref)
ref->resolve(*this);
#ifdef DEBUG_DOMAINMAPPER
- dmapper_logger->endElement("props");
+ dmapper_logger->endElement();
#endif
}
/*-- 09.06.2006 09:52:15---------------------------------------------------
@@ -3819,7 +3819,7 @@ void DomainMapper::table(Id name, writerfilter::Reference<Table>::Pointer_t ref)
m_pImpl->SetAnyTableImport(false);
#ifdef DEBUG_DOMAINMAPPER
- dmapper_logger->endElement("table");
+ dmapper_logger->endElement();
#endif
}
/*-- 09.06.2006 09:52:16---------------------------------------------------
@@ -3897,7 +3897,7 @@ void DomainMapper::substream(Id rName, ::writerfilter::Reference<Stream>::Pointe
m_pImpl->popTableManager( );
#ifdef DEBUG_DOMAINMAPPER
- dmapper_logger->endElement("substream");
+ dmapper_logger->endElement();
#endif
}
/*-- 09.06.2006 09:52:16---------------------------------------------------
diff --git a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx
index ab46cad..ace17aa 100644
--- a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx
+++ b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx
@@ -75,17 +75,17 @@ static void lcl_printProperties( PropertyMapPtr pProps )
dmapper_logger->attribute("color", aLine.Color);
dmapper_logger->attribute("inner", aLine.InnerLineWidth);
dmapper_logger->attribute("outer", aLine.OuterLineWidth);
- dmapper_logger->endElement("borderline");
+ dmapper_logger->endElement();
}
else if ( aMapIter->second >>= nColor )
{
dmapper_logger->startElement("color");
dmapper_logger->attribute("number", nColor);
- dmapper_logger->endElement("color");
+ dmapper_logger->endElement();
}
}
- dmapper_logger->endElement("properties");
+ dmapper_logger->endElement();
}
}
#endif
@@ -115,7 +115,7 @@ void DomainMapperTableHandler::startTable(unsigned int nRows,
dmapper_logger->attribute("rows", nRows);
if (pProps.get() != NULL)
- dmapper_logger->addTag(pProps->toTag());
+ pProps->dumpXml( dmapper_logger );
#endif
}
@@ -126,7 +126,7 @@ PropertyMapPtr lcl_SearchParentStyleSheetAndMergeProperties(const StyleSheetEntr
{
#ifdef DEBUG_DOMAINMAPPER
dmapper_logger->startElement("lcl_SearchParentStyleSheetAndMergeProperties");
- dmapper_logger->addTag(pStyleSheet->toTag());
+ pStyleSheet->dumpXml( dmapper_logger );
#endif
PropertyMapPtr pRet;
@@ -143,7 +143,7 @@ PropertyMapPtr lcl_SearchParentStyleSheetAndMergeProperties(const StyleSheetEntr
pRet->insert( pStyleSheet->pProperties, true );
#ifdef DEBUG_DOMAINMAPPER
- dmapper_logger->endElement("lcl_SearchParentStyleSheetAndMergeProperties");
+ dmapper_logger->endElement();
#endif
return pRet;
@@ -256,7 +256,7 @@ void lcl_debug_BorderLine(table::BorderLine & rLine)
dmapper_logger->attribute("InnerLineWidth", rLine.InnerLineWidth);
dmapper_logger->attribute("OuterLineWidth", rLine.OuterLineWidth);
dmapper_logger->attribute("LineDistance", rLine.LineDistance);
- dmapper_logger->endElement("BorderLine");
+ dmapper_logger->endElement();
}
void lcl_debug_TableBorder(table::TableBorder & rBorder)
@@ -276,7 +276,7 @@ void lcl_debug_TableBorder(table::TableBorder & rBorder)
dmapper_logger->attribute("IsHorizontalLineValid", rBorder.IsHorizontalLineValid);
dmapper_logger->attribute("Distance", rBorder.Distance);
dmapper_logger->attribute("IsDistanceValid", rBorder.IsDistanceValid);
- dmapper_logger->endElement("TableBorder");
+ dmapper_logger->endElement();
}
#endif
@@ -342,8 +342,8 @@ TableStyleSheetEntry * DomainMapperTableHandler::endTableGetTableStyle(TableInfo
#ifdef DEBUG_DOMAINMAPPER
dmapper_logger->startElement("mergedProps");
- dmapper_logger->addTag(pMergedProperties->toTag());
- dmapper_logger->endElement("mergedProps");
+ pMergedProperties->dumpXml( dmapper_logger );
+ dmapper_logger->endElement();
#endif
m_aTableProperties->insert( pMergedProperties );
@@ -351,8 +351,8 @@ TableStyleSheetEntry * DomainMapperTableHandler::endTableGetTableStyle(TableInfo
#ifdef DEBUG_DOMAINMAPPER
dmapper_logger->startElement("TableProperties");
- dmapper_logger->addTag(m_aTableProperties->toTag());
- dmapper_logger->endElement("TableProperties");
+ m_aTableProperties->dumpXml( dmapper_logger );
+ dmapper_logger->endElement();
#endif
}
}
@@ -362,8 +362,8 @@ TableStyleSheetEntry * DomainMapperTableHandler::endTableGetTableStyle(TableInfo
#ifdef DEBUG_DOMAINMAPPER
dmapper_logger->startElement("TableDefaults");
- dmapper_logger->addTag(rInfo.pTableDefaults->toTag());
- dmapper_logger->endElement("TableDefaults");
+ rInfo.pTableDefaults->dumpXml( dmapper_logger );
+ dmapper_logger->endElement();
#endif
m_aTableProperties->getValue( TablePropertyMap::GAP_HALF, nGapHalf );
@@ -502,8 +502,8 @@ TableStyleSheetEntry * DomainMapperTableHandler::endTableGetTableStyle(TableInfo
#ifdef DEBUG_DOMAINMAPPER
dmapper_logger->startElement("debug.tableprops");
- dmapper_logger->addTag(m_aTableProperties->toTag());
- dmapper_logger->endElement("debug.tableprops");
+ m_aTableProperties->dumpXml( dmapper_logger );
+ dmapper_logger->endElement();
#endif
}
@@ -633,7 +633,7 @@ CellPropertyValuesSeq_t DomainMapperTableHandler::endTableGetCellProperties(Tabl
pSingleCellProperties[nCell] = aCellIterator->get()->GetPropertyValues();
#ifdef DEBUG_DOMAINMAPPER
- dmapper_logger->endElement("cell");
+ dmapper_logger->endElement();
#endif
}
++nCell;
@@ -667,7 +667,7 @@ CellPropertyValuesSeq_t DomainMapperTableHandler::endTableGetCellProperties(Tabl
}
#ifdef DEBUG_DOMAINMAPPER
- dmapper_logger->endElement("getCellProperties");
+ dmapper_logger->endElement();
#endif
return aCellProperties;
@@ -696,19 +696,19 @@ RowPropertyValuesSeq_t DomainMapperTableHandler::endTableGetRowProperties()
aRowProperties[nRow] = (*aRowIter)->GetPropertyValues();
#ifdef DEBUG_DOMAINMAPPER
- dmapper_logger->addTag((*aRowIter)->toTag());
- dmapper_logger->addTag(lcl_PropertyValuesToTag(aRowProperties[nRow]));
+ ((*aRowIter)->dumpXml( dmapper_logger ));
+ lcl_DumpPropertyValues(dmapper_logger, aRowProperties[nRow]);
#endif
}
++nRow;
++aRowIter;
#ifdef DEBUG_DOMAINMAPPER
- dmapper_logger->endElement("rowProps.row");
+ dmapper_logger->endElement();
#endif
}
#ifdef DEBUG_DOMAINMAPPER
- dmapper_logger->endElement("getRowProperties");
+ dmapper_logger->endElement();
#endif
return aRowProperties;
@@ -729,7 +729,7 @@ void DomainMapperTableHandler::endTable()
RowPropertyValuesSeq_t aRowProperties = endTableGetRowProperties();
#ifdef DEBUG_DOMAINMAPPER
- dmapper_logger->addTag(lcl_PropertyValueSeqToTag(aRowProperties));
+ lcl_DumpPropertyValueSeq(dmapper_logger, aRowProperties);
#endif
if (m_pTableSeq->getLength() > 0)
@@ -754,7 +754,7 @@ void DomainMapperTableHandler::endTable()
{
dmapper_logger->startElement("exception");
dmapper_logger->chars(rtl::OUStringToOString( e.Message, RTL_TEXTENCODING_UTF8 ).getStr( ));
- dmapper_logger->endElement("exeception");
+ dmapper_logger->endElement();
}
#endif
}
@@ -764,8 +764,8 @@ void DomainMapperTableHandler::endTable()
m_aRowProperties.clear();
#ifdef DEBUG_DOMAINMAPPER
- dmapper_logger->endElement("tablehandler.endTable");
- dmapper_logger->endElement("tablehandler.table");
+ dmapper_logger->endElement();
+ dmapper_logger->endElement();
#endif
}
@@ -779,7 +779,7 @@ void DomainMapperTableHandler::startRow(unsigned int nCells,
dmapper_logger->startElement("table.row");
dmapper_logger->attribute("cells", nCells);
if (pProps != NULL)
- dmapper_logger->addTag(pProps->toTag());
+ pProps->dumpXml(dmapper_logger);
#endif
m_pRowSeq = RowSequencePointer_t(new RowSequence_t(nCells));
@@ -792,7 +792,7 @@ void DomainMapperTableHandler::endRow()
++m_nRowIndex;
m_nCellIndex = 0;
#ifdef DEBUG_DOMAINMAPPER
- dmapper_logger->endElement("table.row");
+ dmapper_logger->endElement();
#endif
}
@@ -814,7 +814,7 @@ void DomainMapperTableHandler::startCell(const Handle_t & start,
dmapper_logger->startElement("table.cell");
dmapper_logger->startElement("table.cell.start");
dmapper_logger->chars(toString(start));
- dmapper_logger->endElement("table.cell.start");
+ dmapper_logger->endElement();
lcl_printProperties( pProps );
#endif
@@ -833,8 +833,8 @@ void DomainMapperTableHandler::endCell(const Handle_t & end)
#ifdef DEBUG_DOMAINMAPPER
dmapper_logger->startElement("table.cell.end");
dmapper_logger->chars(toString(end));
- dmapper_logger->endElement("table.cell.end");
- dmapper_logger->endElement("table.cell");
+ dmapper_logger->endElement();
+ dmapper_logger->endElement();
clog << "</table.cell>" << endl;
#endif
diff --git a/writerfilter/source/dmapper/DomainMapperTableManager.cxx b/writerfilter/source/dmapper/DomainMapperTableManager.cxx
index 39a98fa..b5509e8 100644
--- a/writerfilter/source/dmapper/DomainMapperTableManager.cxx
+++ b/writerfilter/source/dmapper/DomainMapperTableManager.cxx
@@ -84,7 +84,7 @@ bool DomainMapperTableManager::sprm(Sprm & rSprm)
dmapper_logger->startElement("tablemanager.sprm");
string sSprm = rSprm.toString();
dmapper_logger->chars(sSprm);
- dmapper_logger->endElement("tablemanager.sprm");
+ dmapper_logger->endElement();
#endif
bool bRet = DomainMapperTableManager_Base_t::sprm(rSprm);
if( !bRet )
@@ -123,7 +123,7 @@ bool DomainMapperTableManager::sprm(Sprm & rSprm)
pPropMap->setValue( TablePropertyMap::TABLE_WIDTH, m_nTableWidth );
}
#ifdef DEBUG_DOMAINMAPPER
- dmapper_logger->addTag(pPropMap->toTag());
+ pPropMap->dumpXml( dmapper_logger );
#endif
insertTableProps(pPropMap);
}
@@ -245,7 +245,7 @@ bool DomainMapperTableManager::sprm(Sprm & rSprm)
#if DEBUG_DOMAINMAPPER
dmapper_logger->startElement("tablemanager.GridSpan");
dmapper_logger->attribute("gridSpan", nIntValue);
- dmapper_logger->endElement("tablemanager.GridSpan");
+ dmapper_logger->endElement();
#endif
m_nGridSpan = nIntValue;
}
@@ -352,9 +352,9 @@ void DomainMapperTableManager::endLevel( )
dmapper_logger->startElement("dmappertablemanager.endLevel");
PropertyMapPtr pProps = getTableProps();
if (pProps.get() != NULL)
- dmapper_logger->addTag(getTableProps()->toTag());
+ getTableProps()->dumpXml( dmapper_logger );
- dmapper_logger->endElement("dmappertablemanager.endLevel");
+ dmapper_logger->endElement();
#endif
}
@@ -394,7 +394,7 @@ void DomainMapperTableManager::endOfRowAction()
#ifdef DEBUG_DOMAINMAPPER
dmapper_logger->startElement("col");
dmapper_logger->attribute("width", *aCellIter);
- dmapper_logger->endElement("col");
+ dmapper_logger->endElement();
#endif
m_nTableWidth += *aCellIter++;
@@ -409,7 +409,7 @@ void DomainMapperTableManager::endOfRowAction()
}
#ifdef DEBUG_DOMAINMAPPER
- dmapper_logger->endElement("tableWidth");
+ dmapper_logger->endElement();
#endif
}
@@ -430,12 +430,12 @@ void DomainMapperTableManager::endOfRowAction()
{
dmapper_logger->startElement("gridSpan");
dmapper_logger->attribute("span", *aGridSpanIter);
- dmapper_logger->endElement("gridSpan");
+ dmapper_logger->endElement();
aGridSpanIter++;
}
}
- dmapper_logger->endElement("gridSpans");
+ dmapper_logger->endElement();
#endif
//calculate number of used grids - it has to match the size of m_aTableGrid
@@ -478,8 +478,8 @@ void DomainMapperTableManager::endOfRowAction()
#ifdef DEBUG_DOMAINMAPPER
dmapper_logger->startElement("rowProperties");
- dmapper_logger->addTag(pPropMap->toTag());
- dmapper_logger->endElement("rowProperties");
+ pPropMap->dumpXml( dmapper_logger );
+ dmapper_logger->endElement();
#endif
insertRowProps(pPropMap);
}
@@ -490,7 +490,7 @@ void DomainMapperTableManager::endOfRowAction()
pCurrentSpans->clear();
#ifdef DEBUG_DOMAINMAPPER
- dmapper_logger->endElement("endOfRowAction");
+ dmapper_logger->endElement();
#endif
}
/*-- 18.06.2007 10:34:37---------------------------------------------------
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index 54ca809..84c9a7a 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -888,7 +888,7 @@ void DomainMapper_Impl::finishParagraph( PropertyMapPtr pPropertyMap )
}
#ifdef DEBUG_DOMAINMAPPER
- dmapper_logger->endElement("finishParagraph");
+ dmapper_logger->endElement();
#endif
}
/*-------------------------------------------------------------------------
@@ -2394,7 +2394,7 @@ void DomainMapper_Impl::AppendFieldCommand(::rtl::OUString& rPartOfCommand)
#ifdef DEBUG_DOMAINMAPPER
dmapper_logger->startElement("appendFieldCommand");
dmapper_logger->chars(rPartOfCommand);
- dmapper_logger->endElement("appendFieldCommand");
+ dmapper_logger->endElement();
#endif
FieldContextPtr pContext = m_aFieldStack.top();
@@ -2936,7 +2936,7 @@ void DomainMapper_Impl::CloseFieldCommand()
#ifdef DEBUG_DOMAINMAPPER
dmapper_logger->startElement("fieldService");
dmapper_logger->chars(sServiceName);
- dmapper_logger->endElement("fieldService");
+ dmapper_logger->endElement();
#endif
xFieldInterface = m_xTextFactory->createInstance(sServiceName);
@@ -3370,7 +3370,7 @@ void DomainMapper_Impl::SetFieldFFData(FFDataHandler::Pointer_t pFFDataHandler)
}
#ifdef DEBUG_DOMAINMAPPER
- dmapper_logger->endElement("setFieldFFData");
+ dmapper_logger->endElement();
#endif
}
diff --git a/writerfilter/source/dmapper/FFDataHandler.cxx b/writerfilter/source/dmapper/FFDataHandler.cxx
index 7b09fc5..9261b76 100644
--- a/writerfilter/source/dmapper/FFDataHandler.cxx
+++ b/writerfilter/source/dmapper/FFDataHandler.cxx
@@ -407,7 +407,7 @@ void FFDataHandler::sprm(Sprm & r_Sprm)
break;
}
#ifdef DEBUG_DOMAINMAPPER
- dmapper_logger->endElement("FFDataHandler.sprm");
+ dmapper_logger->endElement();
#endif
}
@@ -424,7 +424,7 @@ void FFDataHandler::attribute(Id name, Value & val)
dmapper_logger->startElement("FFDataHandler.attribute");
dmapper_logger->attribute("name", (*QNameToString::Instance())(name));
dmapper_logger->attribute("value", val.toString());
- dmapper_logger->endElement("FFDataHandler.attribute");
+ dmapper_logger->endElement();
#endif
switch (name)
{
diff --git a/writerfilter/source/dmapper/GraphicImport.cxx b/writerfilter/source/dmapper/GraphicImport.cxx
index c3b8765..8f7fdce 100644
--- a/writerfilter/source/dmapper/GraphicImport.cxx
+++ b/writerfilter/source/dmapper/GraphicImport.cxx
@@ -1032,7 +1032,7 @@ void GraphicImport::attribute(Id nName, Value & val)
;
}
#ifdef DEBUG_DOMAINMAPPER
- dmapper_logger->endElement("attribute");
+ dmapper_logger->endElement();
#endif
}
@@ -1341,7 +1341,7 @@ void GraphicImport::sprm(Sprm & rSprm)
#ifdef DEBUG_DOMAINMAPPER
- dmapper_logger->endElement("sprm");
+ dmapper_logger->endElement();
#endif
}
/*-- 01.11.2006 09:45:02---------------------------------------------------
diff --git a/writerfilter/source/dmapper/PropertyMap.cxx b/writerfilter/source/dmapper/PropertyMap.cxx
index bb4cb35..cf31345 100644
--- a/writerfilter/source/dmapper/PropertyMap.cxx
+++ b/writerfilter/source/dmapper/PropertyMap.cxx
@@ -134,41 +134,41 @@ void PropertyMap::Insert( PropertyIds eId, bool bIsTextProperty, const uno::Any&
}
#ifdef DEBUG_DOMAINMAPPER
-XMLTag::Pointer_t PropertyMap::toTag() const
+void PropertyMap::dumpXml( const TagLogger::Pointer_t pLogger ) const
{
- XMLTag::Pointer_t pResult(new XMLTag("PropertyMap"));
+ pLogger->startElement("PropertyMap");
PropertyNameSupplier& rPropNameSupplier = PropertyNameSupplier::GetPropertyNameSupplier();
PropertyMap::const_iterator aMapIter = begin();
while (aMapIter != end())
{
- XMLTag::Pointer_t pTag(new XMLTag("property"));
+ pLogger->startElement("property");
- pTag->addAttr("name", rPropNameSupplier.GetName( aMapIter->first.eId ));
+ pLogger->attribute("name", rPropNameSupplier.GetName( aMapIter->first.eId ));
switch (aMapIter->first.eId)
{
case PROP_TABLE_COLUMN_SEPARATORS:
- pTag->addTag(lcl_TableColumnSeparatorsToTag(aMapIter->second));
+ lcl_DumpTableColumnSeparators(pLogger, aMapIter->second);
break;
default:
{
try {
sal_Int32 aInt;
aMapIter->second >>= aInt;
- pTag->addAttr("value", aInt);
+ pLogger->attribute("value", aInt);
sal_uInt32 auInt;
aMapIter->second >>= auInt;
- pTag->addAttr("unsignedValue", auInt);
+ pLogger->attribute("unsignedValue", auInt);
float aFloat;
aMapIter->second >>= aFloat;
- pTag->addAttr("floatValue", aFloat);
+ pLogger->attribute("floatValue", aFloat);
::rtl::OUString aStr;
aMapIter->second >>= auInt;
- pTag->addAttr("stringValue", aStr);
+ pLogger->attribute("stringValue", aStr);
}
catch (...) {
}
@@ -176,12 +176,12 @@ XMLTag::Pointer_t PropertyMap::toTag() const
break;
}
- pResult->addTag(pTag);
+ pLogger->endElement();
++aMapIter;
}
- return pResult;
+ pLogger->endElement();
}
#endif
@@ -1215,7 +1215,7 @@ void TablePropertyMap::insertTableProperties( const PropertyMap* pMap )
{
#ifdef DEBUG_DOMAINMAPPER
dmapper_logger->startElement("TablePropertyMap.insertTableProperties");
- dmapper_logger->addTag(pMap->toTag());
+ pMap->dumpXml(dmapper_logger);
#endif
const TablePropertyMap* pSource = dynamic_cast< const TablePropertyMap* >(pMap);
@@ -1232,8 +1232,8 @@ void TablePropertyMap::insertTableProperties( const PropertyMap* pMap )
}
}
#ifdef DEBUG_DOMAINMAPPER
- dmapper_logger->addTag(toTag());
- dmapper_logger->endElement("TablePropertyMap.insertTableProperties");
+ dumpXml( dmapper_logger );
+ dmapper_logger->endElement();
#endif
}
diff --git a/writerfilter/source/dmapper/PropertyMap.hxx b/writerfilter/source/dmapper/PropertyMap.hxx
index e95f8dc..084041b 100644
--- a/writerfilter/source/dmapper/PropertyMap.hxx
+++ b/writerfilter/source/dmapper/PropertyMap.hxx
@@ -136,7 +136,7 @@ public:
virtual void insertTableProperties( const PropertyMap* );
#ifdef DEBUG_DOMAINMAPPER
- virtual XMLTag::Pointer_t toTag() const;
+ virtual void dumpXml( const TagLogger::Pointer_t pLogger ) const;
#endif
};
diff --git a/writerfilter/source/dmapper/PropertyMapHelper.cxx b/writerfilter/source/dmapper/PropertyMapHelper.cxx
index f559661..5d32678 100644
--- a/writerfilter/source/dmapper/PropertyMapHelper.cxx
+++ b/writerfilter/source/dmapper/PropertyMapHelper.cxx
@@ -41,92 +41,87 @@ namespace dmapper
using namespace ::com::sun::star;
-XMLTag::Pointer_t lcl_TableColumnSeparatorsToTag(const uno::Any & rTableColumnSeparators)
+void lcl_DumpTableColumnSeparators(const TagLogger::Pointer_t pLogger, const uno::Any & rTableColumnSeparators)
{
uno::Sequence<text::TableColumnSeparator> aSeq;
rTableColumnSeparators >>= aSeq;
-
- XMLTag::Pointer_t pResult(new XMLTag("property.TableColumnSeparators"));
-
+
+ pLogger->startElement("property.TableColumnSeparators");
+
... etc. - the rest is truncated
More information about the Libreoffice-commits
mailing list