[Libreoffice-commits] core.git: 3 commits - include/svx svx/source sw/source unusedcode.easy
Miklos Vajna
vmiklos at collabora.co.uk
Tue May 13 12:05:19 PDT 2014
include/svx/xfillit0.hxx | 1
svx/source/xoutdev/xattr.cxx | 5
sw/source/core/doc/docbm.cxx | 3
sw/source/filter/ww8/rtfattributeoutput.cxx | 2740 ++++++++++++++--------------
sw/source/filter/ww8/rtfattributeoutput.hxx | 328 +--
unusedcode.easy | 1
6 files changed, 1582 insertions(+), 1496 deletions(-)
New commits:
commit fe1ddbe3f20bcce6f600c0831b35f42b8d9a7e90
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date: Tue May 13 20:18:58 2014 +0200
sw: fix indentation in rtfattributeoutput
Change-Id: I9e9ac03a6e9eafc1aee787a95368a4b397d7375f
diff --git a/sw/source/filter/ww8/rtfattributeoutput.cxx b/sw/source/filter/ww8/rtfattributeoutput.cxx
index 36d4637..d3fb672 100644
--- a/sw/source/filter/ww8/rtfattributeoutput.cxx
+++ b/sw/source/filter/ww8/rtfattributeoutput.cxx
@@ -108,77 +108,76 @@ using namespace nsFieldFlags;
using namespace sw::util;
using namespace ::com::sun::star;
-static OString OutTBLBorderLine(RtfExport &rExport, const SvxBorderLine* pLine, const sal_Char* pStr)
+static OString OutTBLBorderLine(RtfExport& rExport, const SvxBorderLine* pLine, const sal_Char* pStr)
{
OStringBuffer aRet;
- if ( !pLine->isEmpty() )
+ if (!pLine->isEmpty())
{
aRet.append(pStr);
// single line
switch (pLine->GetBorderLineStyle())
{
- case table::BorderLineStyle::SOLID:
- {
- if( DEF_LINE_WIDTH_0 == pLine->GetWidth() )
- aRet.append(OOO_STRING_SVTOOLS_RTF_BRDRHAIR);
- else
- aRet.append(OOO_STRING_SVTOOLS_RTF_BRDRS);
- }
- break;
- case table::BorderLineStyle::DOTTED:
- aRet.append(OOO_STRING_SVTOOLS_RTF_BRDRDOT);
- break;
- case table::BorderLineStyle::DASHED:
- aRet.append(OOO_STRING_SVTOOLS_RTF_BRDRDASH);
- break;
- case table::BorderLineStyle::DOUBLE:
- aRet.append(OOO_STRING_SVTOOLS_RTF_BRDRDB);
- break;
- case table::BorderLineStyle::THINTHICK_SMALLGAP:
- aRet.append(OOO_STRING_SVTOOLS_RTF_BRDRTNTHSG);
- break;
- case table::BorderLineStyle::THINTHICK_MEDIUMGAP:
- aRet.append(OOO_STRING_SVTOOLS_RTF_BRDRTNTHMG);
- break;
- case table::BorderLineStyle::THINTHICK_LARGEGAP:
- aRet.append(OOO_STRING_SVTOOLS_RTF_BRDRTNTHLG);
- break;
- case table::BorderLineStyle::THICKTHIN_SMALLGAP:
- aRet.append(OOO_STRING_SVTOOLS_RTF_BRDRTHTNSG);
- break;
- case table::BorderLineStyle::THICKTHIN_MEDIUMGAP:
- aRet.append(OOO_STRING_SVTOOLS_RTF_BRDRTHTNMG);
- break;
- case table::BorderLineStyle::THICKTHIN_LARGEGAP:
- aRet.append(OOO_STRING_SVTOOLS_RTF_BRDRTHTNLG);
- break;
- case table::BorderLineStyle::EMBOSSED:
- aRet.append(OOO_STRING_SVTOOLS_RTF_BRDREMBOSS);
- break;
- case table::BorderLineStyle::ENGRAVED:
- aRet.append(OOO_STRING_SVTOOLS_RTF_BRDRENGRAVE);
- break;
- case table::BorderLineStyle::OUTSET:
- aRet.append(OOO_STRING_SVTOOLS_RTF_BRDROUTSET);
- break;
- case table::BorderLineStyle::INSET:
- aRet.append(OOO_STRING_SVTOOLS_RTF_BRDRINSET);
- break;
- case table::BorderLineStyle::NONE:
- default:
- aRet.append(OOO_STRING_SVTOOLS_RTF_BRDRNONE);
- break;
+ case table::BorderLineStyle::SOLID:
+ {
+ if (DEF_LINE_WIDTH_0 == pLine->GetWidth())
+ aRet.append(OOO_STRING_SVTOOLS_RTF_BRDRHAIR);
+ else
+ aRet.append(OOO_STRING_SVTOOLS_RTF_BRDRS);
+ }
+ break;
+ case table::BorderLineStyle::DOTTED:
+ aRet.append(OOO_STRING_SVTOOLS_RTF_BRDRDOT);
+ break;
+ case table::BorderLineStyle::DASHED:
+ aRet.append(OOO_STRING_SVTOOLS_RTF_BRDRDASH);
+ break;
+ case table::BorderLineStyle::DOUBLE:
+ aRet.append(OOO_STRING_SVTOOLS_RTF_BRDRDB);
+ break;
+ case table::BorderLineStyle::THINTHICK_SMALLGAP:
+ aRet.append(OOO_STRING_SVTOOLS_RTF_BRDRTNTHSG);
+ break;
+ case table::BorderLineStyle::THINTHICK_MEDIUMGAP:
+ aRet.append(OOO_STRING_SVTOOLS_RTF_BRDRTNTHMG);
+ break;
+ case table::BorderLineStyle::THINTHICK_LARGEGAP:
+ aRet.append(OOO_STRING_SVTOOLS_RTF_BRDRTNTHLG);
+ break;
+ case table::BorderLineStyle::THICKTHIN_SMALLGAP:
+ aRet.append(OOO_STRING_SVTOOLS_RTF_BRDRTHTNSG);
+ break;
+ case table::BorderLineStyle::THICKTHIN_MEDIUMGAP:
+ aRet.append(OOO_STRING_SVTOOLS_RTF_BRDRTHTNMG);
+ break;
+ case table::BorderLineStyle::THICKTHIN_LARGEGAP:
+ aRet.append(OOO_STRING_SVTOOLS_RTF_BRDRTHTNLG);
+ break;
+ case table::BorderLineStyle::EMBOSSED:
+ aRet.append(OOO_STRING_SVTOOLS_RTF_BRDREMBOSS);
+ break;
+ case table::BorderLineStyle::ENGRAVED:
+ aRet.append(OOO_STRING_SVTOOLS_RTF_BRDRENGRAVE);
+ break;
+ case table::BorderLineStyle::OUTSET:
+ aRet.append(OOO_STRING_SVTOOLS_RTF_BRDROUTSET);
+ break;
+ case table::BorderLineStyle::INSET:
+ aRet.append(OOO_STRING_SVTOOLS_RTF_BRDRINSET);
+ break;
+ case table::BorderLineStyle::NONE:
+ default:
+ aRet.append(OOO_STRING_SVTOOLS_RTF_BRDRNONE);
+ break;
}
- double const fConverted( ::editeng::ConvertBorderWidthToWord(
- pLine->GetBorderLineStyle(), pLine->GetWidth()) );
- if ( 255 >= pLine->GetWidth() ) // That value comes from RTF specs
+ double const fConverted(::editeng::ConvertBorderWidthToWord(pLine->GetBorderLineStyle(), pLine->GetWidth()));
+ if (255 >= pLine->GetWidth()) // That value comes from RTF specs
{
- aRet.append(OOO_STRING_SVTOOLS_RTF_BRDRW).append(
- static_cast<sal_Int32>(fConverted));
+ aRet.append(OOO_STRING_SVTOOLS_RTF_BRDRW).append(static_cast<sal_Int32>(fConverted));
}
else
- { // use \brdrth to double the value range...
+ {
+ // use \brdrth to double the value range...
aRet.append(OOO_STRING_SVTOOLS_RTF_BRDRTH OOO_STRING_SVTOOLS_RTF_BRDRW);
aRet.append(static_cast<sal_Int32>(fConverted) / 2);
}
@@ -189,8 +188,8 @@ static OString OutTBLBorderLine(RtfExport &rExport, const SvxBorderLine* pLine,
return aRet.makeStringAndClear();
}
-static OString OutBorderLine(RtfExport &rExport, const SvxBorderLine* pLine,
- const sal_Char* pStr, sal_uInt16 nDist, SvxShadowLocation eShadowLocation = SVX_SHADOW_NONE)
+static OString OutBorderLine(RtfExport& rExport, const SvxBorderLine* pLine,
+ const sal_Char* pStr, sal_uInt16 nDist, SvxShadowLocation eShadowLocation = SVX_SHADOW_NONE)
{
OStringBuffer aRet;
aRet.append(OutTBLBorderLine(rExport, pLine, pStr));
@@ -201,7 +200,7 @@ static OString OutBorderLine(RtfExport &rExport, const SvxBorderLine* pLine,
return aRet.makeStringAndClear();
}
-void RtfAttributeOutput::RTLAndCJKState( bool bIsRTL, sal_uInt16 nScript )
+void RtfAttributeOutput::RTLAndCJKState(bool bIsRTL, sal_uInt16 nScript)
{
SAL_INFO("sw.rtf", OSL_THIS_FUNC);
/*
@@ -213,56 +212,60 @@ void RtfAttributeOutput::RTLAndCJKState( bool bIsRTL, sal_uInt16 nScript )
strikethrough is some ms developers "something is wrong signal" debugging
code that we're triggering ?
*/
- if (bIsRTL) {
+ if (bIsRTL)
+ {
m_aStylesEnd.append(OOO_STRING_SVTOOLS_RTF_LTRCH);
m_aStylesEnd.append(' ');
m_aStylesEnd.append(OOO_STRING_SVTOOLS_RTF_RTLCH);
- } else {
+ }
+ else
+ {
m_aStylesEnd.append(OOO_STRING_SVTOOLS_RTF_RTLCH);
m_aStylesEnd.append(' ');
m_aStylesEnd.append(OOO_STRING_SVTOOLS_RTF_LTRCH);
}
- switch (nScript) {
- case i18n::ScriptType::LATIN:
- m_aStylesEnd.append(OOO_STRING_SVTOOLS_RTF_LOCH);
- break;
- case i18n::ScriptType::ASIAN:
- m_aStylesEnd.append(OOO_STRING_SVTOOLS_RTF_DBCH);
- break;
- case i18n::ScriptType::COMPLEX:
- /* noop */
- break;
- default:
- /* should not happen? */
- break;
+ switch (nScript)
+ {
+ case i18n::ScriptType::LATIN:
+ m_aStylesEnd.append(OOO_STRING_SVTOOLS_RTF_LOCH);
+ break;
+ case i18n::ScriptType::ASIAN:
+ m_aStylesEnd.append(OOO_STRING_SVTOOLS_RTF_DBCH);
+ break;
+ case i18n::ScriptType::COMPLEX:
+ /* noop */
+ break;
+ default:
+ /* should not happen? */
+ break;
}
}
-void RtfAttributeOutput::StartParagraph( ww8::WW8TableNodeInfo::Pointer_t pTextNodeInfo )
+void RtfAttributeOutput::StartParagraph(ww8::WW8TableNodeInfo::Pointer_t pTextNodeInfo)
{
SAL_INFO("sw.rtf", OSL_THIS_FUNC);
// Output table/table row/table cell starts if needed
- if ( pTextNodeInfo.get() )
+ if (pTextNodeInfo.get())
{
sal_uInt32 nRow = pTextNodeInfo->getRow();
sal_uInt32 nCell = pTextNodeInfo->getCell();
// New cell/row?
- if ( m_nTableDepth > 0 && !m_bTableCellOpen )
+ if (m_nTableDepth > 0 && !m_bTableCellOpen)
{
- ww8::WW8TableNodeInfoInner::Pointer_t pDeepInner( pTextNodeInfo->getInnerForDepth( m_nTableDepth ) );
- OSL_ENSURE( pDeepInner, "TableNodeInfoInner not found");
+ ww8::WW8TableNodeInfoInner::Pointer_t pDeepInner(pTextNodeInfo->getInnerForDepth(m_nTableDepth));
+ OSL_ENSURE(pDeepInner, "TableNodeInfoInner not found");
// Make sure we always start a row between ending one and starting a cell.
// In case of subtables, we may not get the first cell.
if (pDeepInner && (pDeepInner->getCell() == 0 || m_bTableRowEnded))
{
m_bTableRowEnded = false;
- StartTableRow( pDeepInner );
+ StartTableRow(pDeepInner);
}
- StartTableCell( pDeepInner );
+ StartTableCell(pDeepInner);
}
// Again, if depth was incremented, start a new table even if we skipped the first cell.
@@ -273,17 +276,17 @@ void RtfAttributeOutput::StartParagraph( ww8::WW8TableNodeInfo::Pointer_t pTextN
// continue the table cell]
sal_uInt32 nCurrentDepth = pTextNodeInfo->getDepth();
- if ( nCurrentDepth > m_nTableDepth )
+ if (nCurrentDepth > m_nTableDepth)
{
// Start all the tables that begin here
- for ( sal_uInt32 nDepth = m_nTableDepth + 1; nDepth <= pTextNodeInfo->getDepth(); ++nDepth )
+ for (sal_uInt32 nDepth = m_nTableDepth + 1; nDepth <= pTextNodeInfo->getDepth(); ++nDepth)
{
- ww8::WW8TableNodeInfoInner::Pointer_t pInner( pTextNodeInfo->getInnerForDepth( nDepth ) );
+ ww8::WW8TableNodeInfoInner::Pointer_t pInner(pTextNodeInfo->getInnerForDepth(nDepth));
m_bLastTable = (nDepth == pTextNodeInfo->getDepth());
- StartTable( pInner );
- StartTableRow( pInner );
- StartTableCell( pInner );
+ StartTable(pInner);
+ StartTableRow(pInner);
+ StartTableCell(pInner);
}
m_nTableDepth = nCurrentDepth;
@@ -294,7 +297,7 @@ void RtfAttributeOutput::StartParagraph( ww8::WW8TableNodeInfo::Pointer_t pTextN
OSL_ENSURE(m_aRun.getLength() == 0, "m_aRun is not empty");
}
-void RtfAttributeOutput::EndParagraph( ww8::WW8TableNodeInfoInner::Pointer_t pTextNodeInfoInner )
+void RtfAttributeOutput::EndParagraph(ww8::WW8TableNodeInfoInner::Pointer_t pTextNodeInfoInner)
{
SAL_INFO("sw.rtf", OSL_THIS_FUNC);
bool bLastPara = false;
@@ -304,7 +307,7 @@ void RtfAttributeOutput::EndParagraph( ww8::WW8TableNodeInfoInner::Pointer_t pTe
bLastPara = m_rExport.m_nCurrentNodeIndex && m_rExport.m_nCurrentNodeIndex == m_rExport.pCurPam->End()->nNode.GetIndex();
}
- FinishTableRowCell( pTextNodeInfoInner );
+ FinishTableRowCell(pTextNodeInfoInner);
RtfStringBuffer aParagraph;
@@ -338,7 +341,7 @@ void RtfAttributeOutput::EmptyParagraph()
{
SAL_INFO("sw.rtf", OSL_THIS_FUNC);
- m_rExport.Strm().WriteCharPtr( SAL_NEWLINE_STRING ).WriteCharPtr( OOO_STRING_SVTOOLS_RTF_PAR ).WriteChar( ' ' );
+ m_rExport.Strm().WriteCharPtr(SAL_NEWLINE_STRING).WriteCharPtr(OOO_STRING_SVTOOLS_RTF_PAR).WriteChar(' ');
}
void RtfAttributeOutput::SectionBreaks(const SwTxtNode& rNode)
@@ -347,26 +350,26 @@ void RtfAttributeOutput::SectionBreaks(const SwTxtNode& rNode)
OSL_ENSURE(m_aStyles.getLength() == 0, "m_aStyles is not empty");
// output page/section breaks
- SwNodeIndex aNextIndex( rNode, 1 );
- m_rExport.Strm().WriteCharPtr( m_aSectionBreaks.makeStringAndClear().getStr() );
+ SwNodeIndex aNextIndex(rNode, 1);
+ m_rExport.Strm().WriteCharPtr(m_aSectionBreaks.makeStringAndClear().getStr());
m_bBufferSectionBreaks = true;
// output section headers / footers
if (!m_bBufferSectionHeaders)
- m_rExport.Strm().WriteCharPtr( m_aSectionHeaders.makeStringAndClear().getStr() );
+ m_rExport.Strm().WriteCharPtr(m_aSectionHeaders.makeStringAndClear().getStr());
- if ( aNextIndex.GetNode().IsTxtNode() )
+ if (aNextIndex.GetNode().IsTxtNode())
{
- const SwTxtNode* pTxtNode = static_cast< SwTxtNode* >( &aNextIndex.GetNode() );
- m_rExport.OutputSectionBreaks( pTxtNode->GetpSwAttrSet(), *pTxtNode );
+ const SwTxtNode* pTxtNode = static_cast< SwTxtNode* >(&aNextIndex.GetNode());
+ m_rExport.OutputSectionBreaks(pTxtNode->GetpSwAttrSet(), *pTxtNode);
// Save the current page description for now, so later we will be able to access the previous one.
m_pPrevPageDesc = pTxtNode->FindPageDesc(false);
}
- else if ( aNextIndex.GetNode().IsTableNode() )
+ else if (aNextIndex.GetNode().IsTableNode())
{
- const SwTableNode* pTableNode = static_cast< SwTableNode* >( &aNextIndex.GetNode() );
- const SwFrmFmt *pFmt = pTableNode->GetTable().GetFrmFmt();
- m_rExport.OutputSectionBreaks( &(pFmt->GetAttrSet()), *pTableNode );
+ const SwTableNode* pTableNode = static_cast< SwTableNode* >(&aNextIndex.GetNode());
+ const SwFrmFmt* pFmt = pTableNode->GetTable().GetFrmFmt();
+ m_rExport.OutputSectionBreaks(&(pFmt->GetAttrSet()), *pTableNode);
}
m_bBufferSectionBreaks = false;
}
@@ -383,19 +386,19 @@ void RtfAttributeOutput::StartParagraphProperties()
aPar.append(' ');
}
if (!m_bBufferSectionHeaders)
- m_rExport.Strm().WriteCharPtr( aPar.makeStringAndClear().getStr() );
+ m_rExport.Strm().WriteCharPtr(aPar.makeStringAndClear().getStr());
else
m_aSectionHeaders.append(aPar.makeStringAndClear());
}
-void RtfAttributeOutput::EndParagraphProperties( const SfxItemSet* /*pParagraphMarkerProperties*/, const SwRedlineData* /*pRedlineData*/, const SwRedlineData* /*pRedlineParagraphMarkerDeleted*/, const SwRedlineData* /*pRedlineParagraphMarkerInserted*/)
+void RtfAttributeOutput::EndParagraphProperties(const SfxItemSet* /*pParagraphMarkerProperties*/, const SwRedlineData* /*pRedlineData*/, const SwRedlineData* /*pRedlineParagraphMarkerDeleted*/, const SwRedlineData* /*pRedlineParagraphMarkerInserted*/)
{
SAL_INFO("sw.rtf", OSL_THIS_FUNC);
m_aStyles.append(m_aStylesEnd.makeStringAndClear());
- m_rExport.Strm().WriteCharPtr( m_aStyles.makeStringAndClear().getStr() );
+ m_rExport.Strm().WriteCharPtr(m_aStyles.makeStringAndClear().getStr());
}
-void RtfAttributeOutput::StartRun( const SwRedlineData* pRedlineData, bool bSingleEmptyRun )
+void RtfAttributeOutput::StartRun(const SwRedlineData* pRedlineData, bool bSingleEmptyRun)
{
SAL_INFO("sw.rtf", OSL_THIS_FUNC << ", bSingleEmptyRun: " << bSingleEmptyRun);
@@ -405,7 +408,7 @@ void RtfAttributeOutput::StartRun( const SwRedlineData* pRedlineData, bool bSing
m_aRun->append('{');
// if there is some redlining in the document, output it
- Redline( pRedlineData );
+ Redline(pRedlineData);
OSL_ENSURE(m_aRunText.getLength() == 0, "m_aRunText is not empty");
}
@@ -428,17 +431,17 @@ void RtfAttributeOutput::StartRunProperties()
OSL_ENSURE(m_aStyles.getLength() == 0, "m_aStyles is not empty");
}
-void RtfAttributeOutput::EndRunProperties( const SwRedlineData* /*pRedlineData*/ )
+void RtfAttributeOutput::EndRunProperties(const SwRedlineData* /*pRedlineData*/)
{
SAL_INFO("sw.rtf", OSL_THIS_FUNC);
m_aStyles.append(m_aStylesEnd.makeStringAndClear());
m_aRun->append(m_aStyles.makeStringAndClear());
}
-void RtfAttributeOutput::RunText( const OUString& rText, rtl_TextEncoding /*eCharSet*/ )
+void RtfAttributeOutput::RunText(const OUString& rText, rtl_TextEncoding /*eCharSet*/)
{
SAL_INFO("sw.rtf", OSL_THIS_FUNC << ", rText: " << rText);
- RawText( rText, false, m_rExport.eCurrentEncoding );
+ RawText(rText, false, m_rExport.eCurrentEncoding);
}
OStringBuffer& RtfAttributeOutput::RunText()
@@ -451,13 +454,13 @@ OStringBuffer& RtfAttributeOutput::Styles()
return m_aStyles;
}
-void RtfAttributeOutput::RawText( const OUString& rText, bool /*bForceUnicode*/, rtl_TextEncoding eCharSet )
+void RtfAttributeOutput::RawText(const OUString& rText, bool /*bForceUnicode*/, rtl_TextEncoding eCharSet)
{
SAL_INFO("sw.rtf", OSL_THIS_FUNC);
m_aRunText->append(msfilter::rtfutil::OutString(rText, eCharSet));
}
-void RtfAttributeOutput::StartRuby( const SwTxtNode& /*rNode*/, sal_Int32 /*nPos*/, const SwFmtRuby& /*rRuby*/ )
+void RtfAttributeOutput::StartRuby(const SwTxtNode& /*rNode*/, sal_Int32 /*nPos*/, const SwFmtRuby& /*rRuby*/)
{
SAL_INFO("sw.rtf", "TODO: " << OSL_THIS_FUNC);
}
@@ -467,7 +470,7 @@ void RtfAttributeOutput::EndRuby()
SAL_INFO("sw.rtf", "TODO: " << OSL_THIS_FUNC);
}
-bool RtfAttributeOutput::StartURL( const OUString& rUrl, const OUString& rTarget )
+bool RtfAttributeOutput::StartURL(const OUString& rUrl, const OUString& rTarget)
{
SAL_INFO("sw.rtf", OSL_THIS_FUNC);
@@ -478,18 +481,18 @@ bool RtfAttributeOutput::StartURL( const OUString& rUrl, const OUString& rTarget
m_aStyles.append(OOO_STRING_SVTOOLS_RTF_FLDINST);
m_aStyles.append(" HYPERLINK ");
- OUString sURL( rUrl );
- if( !sURL.isEmpty() )
+ OUString sURL(rUrl);
+ if (!sURL.isEmpty())
{
m_aStyles.append("\"");
- m_aStyles.append(msfilter::rtfutil::OutString( sURL, m_rExport.eCurrentEncoding));
+ m_aStyles.append(msfilter::rtfutil::OutString(sURL, m_rExport.eCurrentEncoding));
m_aStyles.append("\" ");
}
- if( !rTarget.isEmpty() )
+ if (!rTarget.isEmpty())
{
m_aStyles.append("\\\\t \"");
- m_aStyles.append(msfilter::rtfutil::OutString( rTarget, m_rExport.eCurrentEncoding));
+ m_aStyles.append(msfilter::rtfutil::OutString(rTarget, m_rExport.eCurrentEncoding));
m_aStyles.append("\" ");
}
@@ -516,12 +519,12 @@ bool RtfAttributeOutput::EndURL()
return true;
}
-void RtfAttributeOutput::FieldVanish( const OUString& /*rTxt*/, ww::eField /*eType*/ )
+void RtfAttributeOutput::FieldVanish(const OUString& /*rTxt*/, ww::eField /*eType*/)
{
SAL_INFO("sw.rtf", "TODO: " << OSL_THIS_FUNC);
}
-void RtfAttributeOutput::Redline( const SwRedlineData* pRedline )
+void RtfAttributeOutput::Redline(const SwRedlineData* pRedline)
{
if (!pRedline)
return;
@@ -535,7 +538,7 @@ void RtfAttributeOutput::Redline( const SwRedlineData* pRedline )
m_aRun->append((sal_Int32)m_rExport.GetRedline(SW_MOD()->GetRedlineAuthor(pRedline->GetAuthor())));
m_aRun->append(OOO_STRING_SVTOOLS_RTF_REVDTTM);
}
- else if(pRedline->GetType() == nsRedlineType_t::REDLINE_DELETE)
+ else if (pRedline->GetType() == nsRedlineType_t::REDLINE_DELETE)
{
m_aRun->append(OOO_STRING_SVTOOLS_RTF_DELETED);
m_aRun->append(OOO_STRING_SVTOOLS_RTF_REVAUTHDEL);
@@ -546,33 +549,33 @@ void RtfAttributeOutput::Redline( const SwRedlineData* pRedline )
m_aRun->append(' ');
}
-void RtfAttributeOutput::FormatDrop( const SwTxtNode& /*rNode*/, const SwFmtDrop& /*rSwFmtDrop*/, sal_uInt16 /*nStyle*/, ww8::WW8TableNodeInfo::Pointer_t /*pTextNodeInfo*/, ww8::WW8TableNodeInfoInner::Pointer_t /*pTextNodeInfoInner*/ )
+void RtfAttributeOutput::FormatDrop(const SwTxtNode& /*rNode*/, const SwFmtDrop& /*rSwFmtDrop*/, sal_uInt16 /*nStyle*/, ww8::WW8TableNodeInfo::Pointer_t /*pTextNodeInfo*/, ww8::WW8TableNodeInfoInner::Pointer_t /*pTextNodeInfoInner*/)
{
SAL_INFO("sw.rtf", "TODO: " << OSL_THIS_FUNC);
}
-void RtfAttributeOutput::ParagraphStyle( sal_uInt16 nStyle )
+void RtfAttributeOutput::ParagraphStyle(sal_uInt16 nStyle)
{
SAL_INFO("sw.rtf", OSL_THIS_FUNC);
- OString *pStyle = m_rExport.GetStyle(nStyle);
+ OString* pStyle = m_rExport.GetStyle(nStyle);
OStringBuffer aStyle;
aStyle.append(OOO_STRING_SVTOOLS_RTF_S);
aStyle.append((sal_Int32)nStyle);
if (pStyle)
aStyle.append(pStyle->getStr());
if (!m_bBufferSectionHeaders)
- m_rExport.Strm().WriteCharPtr( aStyle.makeStringAndClear().getStr() );
+ m_rExport.Strm().WriteCharPtr(aStyle.makeStringAndClear().getStr());
else
m_aSectionHeaders.append(aStyle.makeStringAndClear());
}
-void RtfAttributeOutput::TableInfoCell( ww8::WW8TableNodeInfoInner::Pointer_t /*pTableTextNodeInfoInner*/ )
+void RtfAttributeOutput::TableInfoCell(ww8::WW8TableNodeInfoInner::Pointer_t /*pTableTextNodeInfoInner*/)
{
SAL_INFO("sw.rtf", OSL_THIS_FUNC);
m_aStyles.append(OOO_STRING_SVTOOLS_RTF_INTBL);
- if ( m_nTableDepth > 1 )
+ if (m_nTableDepth > 1)
{
m_aStyles.append(OOO_STRING_SVTOOLS_RTF_ITAP);
m_aStyles.append((sal_Int32)m_nTableDepth);
@@ -580,31 +583,31 @@ void RtfAttributeOutput::TableInfoCell( ww8::WW8TableNodeInfoInner::Pointer_t /*
m_bWroteCellInfo = true;
}
-void RtfAttributeOutput::TableInfoRow( ww8::WW8TableNodeInfoInner::Pointer_t /*pTableTextNodeInfo*/ )
+void RtfAttributeOutput::TableInfoRow(ww8::WW8TableNodeInfoInner::Pointer_t /*pTableTextNodeInfo*/)
{
SAL_INFO("sw.rtf", OSL_THIS_FUNC);
/* noop */
}
-void RtfAttributeOutput::TableDefinition( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner )
+void RtfAttributeOutput::TableDefinition(ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner)
{
SAL_INFO("sw.rtf", OSL_THIS_FUNC);
- if ( !m_pTableWrt )
- InitTableHelper( pTableTextNodeInfoInner );
+ if (!m_pTableWrt)
+ InitTableHelper(pTableTextNodeInfoInner);
- const SwTable *pTbl = pTableTextNodeInfoInner->getTable();
- SwFrmFmt *pFmt = pTbl->GetFrmFmt( );
+ const SwTable* pTbl = pTableTextNodeInfoInner->getTable();
+ SwFrmFmt* pFmt = pTbl->GetFrmFmt();
m_aRowDefs.append(OOO_STRING_SVTOOLS_RTF_TROWD);
- TableOrientation( pTableTextNodeInfoInner );
- TableBidi( pTableTextNodeInfoInner );
- TableHeight( pTableTextNodeInfoInner );
- TableCanSplit( pTableTextNodeInfoInner );
+ TableOrientation(pTableTextNodeInfoInner);
+ TableBidi(pTableTextNodeInfoInner);
+ TableHeight(pTableTextNodeInfoInner);
+ TableCanSplit(pTableTextNodeInfoInner);
// Cell margins
- const SvxBoxItem& rBox = pFmt->GetBox( );
+ const SvxBoxItem& rBox = pFmt->GetBox();
static const sal_uInt16 aBorders[] =
{
BOX_LINE_TOP, BOX_LINE_LEFT, BOX_LINE_BOTTOM, BOX_LINE_RIGHT
@@ -629,34 +632,34 @@ void RtfAttributeOutput::TableDefinition( ww8::WW8TableNodeInfoInner::Pointer_t
}
// The cell-dependent properties
- const SwWriteTableRows& aRows = m_pTableWrt->GetRows( );
- SwWriteTableRow *pRow = aRows[ pTableTextNodeInfoInner->getRow( ) ];
+ const SwWriteTableRows& aRows = m_pTableWrt->GetRows();
+ SwWriteTableRow* pRow = aRows[ pTableTextNodeInfoInner->getRow() ];
SwTwips nSz = 0;
Point aPt;
- SwRect aRect( pFmt->FindLayoutRect( false, &aPt ));
+ SwRect aRect(pFmt->FindLayoutRect(false, &aPt));
SwTwips nPageSize = aRect.Width();
// Handle the page size when not rendered
- if( 0 == nPageSize )
+ if (0 == nPageSize)
{
const SwNode* pNode = pTableTextNodeInfoInner->getNode();
const SwFrmFmt* pFrmFmt = GetExport().mpParentFrame ? &GetExport().mpParentFrame->GetFrmFmt() :
- GetExport().pDoc->GetPageDesc(0).GetPageFmtOfNode(*pNode, false);
+ GetExport().pDoc->GetPageDesc(0).GetPageFmtOfNode(*pNode, false);
const SvxLRSpaceItem& rLR = pFrmFmt->GetLRSpace();
nPageSize = pFrmFmt->GetFrmSize().GetWidth() -
- rLR.GetLeft() - rLR.GetRight();
+ rLR.GetLeft() - rLR.GetRight();
}
SwTwips nTblSz = pFmt->GetFrmSize().GetWidth();
// Not using m_nTableDepth, which is not yet incremented here.
sal_uInt32 nCurrentDepth = pTableTextNodeInfoInner->getDepth();
m_aCells[nCurrentDepth] = pRow->GetCells().size();
- for( sal_uInt16 i = 0; i < m_aCells[nCurrentDepth]; i++ )
+ for (sal_uInt16 i = 0; i < m_aCells[nCurrentDepth]; i++)
{
- const SwWriteTableCell *pCell = &pRow->GetCells( )[ i ];
- const SwFrmFmt *pCellFmt = pCell->GetBox()->GetFrmFmt();
+ const SwWriteTableCell* pCell = &pRow->GetCells()[ i ];
+ const SwFrmFmt* pCellFmt = pCell->GetBox()->GetFrmFmt();
- pTableTextNodeInfoInner->setCell( i );
+ pTableTextNodeInfoInner->setCell(i);
TableCellProperties(pTableTextNodeInfoInner);
// Right boundary: this can't be in TableCellProperties as the old
@@ -666,11 +669,11 @@ void RtfAttributeOutput::TableDefinition( ww8::WW8TableNodeInfoInner::Pointer_t
SwTwips nCalc = nSz;
nCalc *= nPageSize;
nCalc /= nTblSz;
- m_aRowDefs.append( (sal_Int32)(pFmt->GetLRSpace().GetLeft() + nCalc) );
+ m_aRowDefs.append((sal_Int32)(pFmt->GetLRSpace().GetLeft() + nCalc));
}
}
-void RtfAttributeOutput::TableDefaultBorders( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner )
+void RtfAttributeOutput::TableDefaultBorders(ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner)
{
SAL_INFO("sw.rtf", OSL_THIS_FUNC);
@@ -681,13 +684,13 @@ void RtfAttributeOutput::TableDefaultBorders( ww8::WW8TableNodeInfoInner::Pointe
* called for each cell.
*/
- const SwTableBox *pTblBox = pTableTextNodeInfoInner->getTableBox( );
- SwFrmFmt *pFmt = pTblBox->GetFrmFmt( );
- const SvxBoxItem& rDefault = pFmt->GetBox( );
- const SwWriteTableRows& aRows = m_pTableWrt->GetRows( );
- SwWriteTableRow *pRow = aRows[ pTableTextNodeInfoInner->getRow( ) ];
- const SwWriteTableCell *pCell = &pRow->GetCells( )[ pTableTextNodeInfoInner->getCell( ) ];
- const SwFrmFmt *pCellFmt = pCell->GetBox()->GetFrmFmt();
+ const SwTableBox* pTblBox = pTableTextNodeInfoInner->getTableBox();
+ SwFrmFmt* pFmt = pTblBox->GetFrmFmt();
+ const SvxBoxItem& rDefault = pFmt->GetBox();
+ const SwWriteTableRows& aRows = m_pTableWrt->GetRows();
+ SwWriteTableRow* pRow = aRows[ pTableTextNodeInfoInner->getRow() ];
+ const SwWriteTableCell* pCell = &pRow->GetCells()[ pTableTextNodeInfoInner->getCell() ];
+ const SwFrmFmt* pCellFmt = pCell->GetBox()->GetFrmFmt();
const SfxPoolItem* pItem;
if (pCellFmt->GetAttrSet().HasItem(RES_BOX, &pItem))
{
@@ -726,19 +729,19 @@ void RtfAttributeOutput::TableDefaultBorders( ww8::WW8TableNodeInfoInner::Pointe
}
}
-void RtfAttributeOutput::TableBackgrounds( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner )
+void RtfAttributeOutput::TableBackgrounds(ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner)
{
SAL_INFO("sw.rtf", OSL_THIS_FUNC);
- const SwWriteTableRows& aRows = m_pTableWrt->GetRows( );
- SwWriteTableRow *pRow = aRows[ pTableTextNodeInfoInner->getRow( ) ];
- const SwWriteTableCell *pCell = &pRow->GetCells( )[ pTableTextNodeInfoInner->getCell( ) ];
- const SwFrmFmt *pCellFmt = pCell->GetBox()->GetFrmFmt();
+ const SwWriteTableRows& aRows = m_pTableWrt->GetRows();
+ SwWriteTableRow* pRow = aRows[ pTableTextNodeInfoInner->getRow() ];
+ const SwWriteTableCell* pCell = &pRow->GetCells()[ pTableTextNodeInfoInner->getCell() ];
+ const SwFrmFmt* pCellFmt = pCell->GetBox()->GetFrmFmt();
const SfxPoolItem* pItem;
if (pCellFmt->GetAttrSet().HasItem(RES_BACKGROUND, &pItem))
{
const SvxBrushItem& rBack = (SvxBrushItem&)*pItem;
- if( !rBack.GetColor().GetTransparency() )
+ if (!rBack.GetColor().GetTransparency())
{
m_aRowDefs.append(OOO_STRING_SVTOOLS_RTF_CLCBPAT);
m_aRowDefs.append((sal_Int32)m_rExport.GetColor(rBack.GetColor()));
@@ -746,35 +749,40 @@ void RtfAttributeOutput::TableBackgrounds( ww8::WW8TableNodeInfoInner::Pointer_t
}
}
-void RtfAttributeOutput::TableRowRedline( ww8::WW8TableNodeInfoInner::Pointer_t /*pTableTextNodeInfoInner*/ )
+void RtfAttributeOutput::TableRowRedline(ww8::WW8TableNodeInfoInner::Pointer_t /*pTableTextNodeInfoInner*/)
{
}
-void RtfAttributeOutput::TableCellRedline( ww8::WW8TableNodeInfoInner::Pointer_t /*pTableTextNodeInfoInner*/ )
+void RtfAttributeOutput::TableCellRedline(ww8::WW8TableNodeInfoInner::Pointer_t /*pTableTextNodeInfoInner*/)
{
}
-void RtfAttributeOutput::TableHeight( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner )
+void RtfAttributeOutput::TableHeight(ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner)
{
SAL_INFO("sw.rtf", OSL_THIS_FUNC);
- const SwTableBox * pTabBox = pTableTextNodeInfoInner->getTableBox();
- const SwTableLine * pTabLine = pTabBox->GetUpper();
- const SwFrmFmt * pLineFmt = pTabLine->GetFrmFmt();
+ const SwTableBox* pTabBox = pTableTextNodeInfoInner->getTableBox();
+ const SwTableLine* pTabLine = pTabBox->GetUpper();
+ const SwFrmFmt* pLineFmt = pTabLine->GetFrmFmt();
const SwFmtFrmSize& rLSz = pLineFmt->GetFrmSize();
- if ( ATT_VAR_SIZE != rLSz.GetHeightSizeType() && rLSz.GetHeight() )
+ if (ATT_VAR_SIZE != rLSz.GetHeightSizeType() && rLSz.GetHeight())
{
sal_Int32 nHeight = 0;
- switch ( rLSz.GetHeightSizeType() )
+ switch (rLSz.GetHeightSizeType())
{
- case ATT_FIX_SIZE: nHeight = -rLSz.GetHeight(); break;
- case ATT_MIN_SIZE: nHeight = rLSz.GetHeight(); break;
- default: break;
+ case ATT_FIX_SIZE:
+ nHeight = -rLSz.GetHeight();
+ break;
+ case ATT_MIN_SIZE:
+ nHeight = rLSz.GetHeight();
+ break;
+ default:
+ break;
}
- if ( nHeight )
+ if (nHeight)
{
m_aRowDefs.append(OOO_STRING_SVTOOLS_RTF_TRRH);
m_aRowDefs.append(nHeight);
@@ -782,41 +790,41 @@ void RtfAttributeOutput::TableHeight( ww8::WW8TableNodeInfoInner::Pointer_t pTab
}
}
-void RtfAttributeOutput::TableCanSplit( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner )
+void RtfAttributeOutput::TableCanSplit(ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner)
{
SAL_INFO("sw.rtf", OSL_THIS_FUNC);
- const SwTableBox * pTabBox = pTableTextNodeInfoInner->getTableBox();
- const SwTableLine * pTabLine = pTabBox->GetUpper();
- const SwFrmFmt * pLineFmt = pTabLine->GetFrmFmt();
- const SwFmtRowSplit& rSplittable = pLineFmt->GetRowSplit( );
+ const SwTableBox* pTabBox = pTableTextNodeInfoInner->getTableBox();
+ const SwTableLine* pTabLine = pTabBox->GetUpper();
+ const SwFrmFmt* pLineFmt = pTabLine->GetFrmFmt();
+ const SwFmtRowSplit& rSplittable = pLineFmt->GetRowSplit();
// The rtf default is to allow a row to break
if (!rSplittable.GetValue())
m_aRowDefs.append(OOO_STRING_SVTOOLS_RTF_TRKEEP);
}
-void RtfAttributeOutput::TableBidi( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner )
+void RtfAttributeOutput::TableBidi(ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner)
{
SAL_INFO("sw.rtf", OSL_THIS_FUNC);
- const SwTable * pTable = pTableTextNodeInfoInner->getTable();
- const SwFrmFmt * pFrmFmt = pTable->GetFrmFmt();
+ const SwTable* pTable = pTableTextNodeInfoInner->getTable();
+ const SwFrmFmt* pFrmFmt = pTable->GetFrmFmt();
- if ( m_rExport.TrueFrameDirection( *pFrmFmt ) != FRMDIR_HORI_RIGHT_TOP )
+ if (m_rExport.TrueFrameDirection(*pFrmFmt) != FRMDIR_HORI_RIGHT_TOP)
m_aRowDefs.append(OOO_STRING_SVTOOLS_RTF_LTRROW);
else
m_aRowDefs.append(OOO_STRING_SVTOOLS_RTF_RTLROW);
}
-void RtfAttributeOutput::TableVerticalCell( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner )
+void RtfAttributeOutput::TableVerticalCell(ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner)
{
SAL_INFO("sw.rtf", OSL_THIS_FUNC);
- const SwWriteTableRows& aRows = m_pTableWrt->GetRows( );
- SwWriteTableRow *pRow = aRows[ pTableTextNodeInfoInner->getRow( ) ];
- const SwWriteTableCell *pCell = &pRow->GetCells( )[ pTableTextNodeInfoInner->getCell( ) ];
- const SwFrmFmt *pCellFmt = pCell->GetBox()->GetFrmFmt();
+ const SwWriteTableRows& aRows = m_pTableWrt->GetRows();
+ SwWriteTableRow* pRow = aRows[ pTableTextNodeInfoInner->getRow() ];
+ const SwWriteTableCell* pCell = &pRow->GetCells()[ pTableTextNodeInfoInner->getCell() ];
+ const SwFrmFmt* pCellFmt = pCell->GetBox()->GetFrmFmt();
const SfxPoolItem* pItem;
// vertical merges
@@ -827,22 +835,28 @@ void RtfAttributeOutput::TableVerticalCell( ww8::WW8TableNodeInfoInner::Pointer_
// vertical alignment
if (pCellFmt->GetAttrSet().HasItem(RES_VERT_ORIENT, &pItem))
- switch( ((SwFmtVertOrient*)pItem)->GetVertOrient() )
+ switch (((SwFmtVertOrient*)pItem)->GetVertOrient())
{
- case text::VertOrientation::CENTER: m_aRowDefs.append(OOO_STRING_SVTOOLS_RTF_CLVERTALC); break;
- case text::VertOrientation::BOTTOM: m_aRowDefs.append(OOO_STRING_SVTOOLS_RTF_CLVERTALB); break;
- default: m_aRowDefs.append(OOO_STRING_SVTOOLS_RTF_CLVERTALT); break;
+ case text::VertOrientation::CENTER:
+ m_aRowDefs.append(OOO_STRING_SVTOOLS_RTF_CLVERTALC);
+ break;
+ case text::VertOrientation::BOTTOM:
+ m_aRowDefs.append(OOO_STRING_SVTOOLS_RTF_CLVERTALB);
+ break;
+ default:
+ m_aRowDefs.append(OOO_STRING_SVTOOLS_RTF_CLVERTALT);
+ break;
}
}
-void RtfAttributeOutput::TableNodeInfo( ww8::WW8TableNodeInfo::Pointer_t /*pNodeInfo*/ )
+void RtfAttributeOutput::TableNodeInfo(ww8::WW8TableNodeInfo::Pointer_t /*pNodeInfo*/)
{
SAL_INFO("sw.rtf", OSL_THIS_FUNC);
/* noop */
}
-void RtfAttributeOutput::TableNodeInfoInner( ww8::WW8TableNodeInfoInner::Pointer_t pNodeInfoInner )
+void RtfAttributeOutput::TableNodeInfoInner(ww8::WW8TableNodeInfoInner::Pointer_t pNodeInfoInner)
{
SAL_INFO("sw.rtf", OSL_THIS_FUNC);
@@ -850,45 +864,45 @@ void RtfAttributeOutput::TableNodeInfoInner( ww8::WW8TableNodeInfoInner::Pointer
// paragraph benhind that; so we must check for the ends of cell, rows,
// and tables
// ['true' to write an empty paragraph, MS Word insists on that]
- FinishTableRowCell( pNodeInfoInner, true );
+ FinishTableRowCell(pNodeInfoInner, true);
}
-void RtfAttributeOutput::TableOrientation( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner )
+void RtfAttributeOutput::TableOrientation(ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner)
{
SAL_INFO("sw.rtf", OSL_THIS_FUNC);
- const SwTable *pTable = pTableTextNodeInfoInner->getTable();
- SwFrmFmt *pFmt = pTable->GetFrmFmt( );
+ const SwTable* pTable = pTableTextNodeInfoInner->getTable();
+ SwFrmFmt* pFmt = pTable->GetFrmFmt();
- OStringBuffer aTblAdjust( OOO_STRING_SVTOOLS_RTF_TRQL );
+ OStringBuffer aTblAdjust(OOO_STRING_SVTOOLS_RTF_TRQL);
switch (pFmt->GetHoriOrient().GetHoriOrient())
{
- case text::HoriOrientation::CENTER:
- aTblAdjust.setLength(0);
- aTblAdjust.append(OOO_STRING_SVTOOLS_RTF_TRQC);
- break;
- case text::HoriOrientation::RIGHT:
- aTblAdjust.setLength(0);
- aTblAdjust.append(OOO_STRING_SVTOOLS_RTF_TRQR);
- break;
- case text::HoriOrientation::NONE:
- case text::HoriOrientation::LEFT_AND_WIDTH:
- aTblAdjust.append(OOO_STRING_SVTOOLS_RTF_TRLEFT);
- aTblAdjust.append((sal_Int32)pFmt->GetLRSpace().GetLeft());
- break;
- default:
- break;
+ case text::HoriOrientation::CENTER:
+ aTblAdjust.setLength(0);
+ aTblAdjust.append(OOO_STRING_SVTOOLS_RTF_TRQC);
+ break;
+ case text::HoriOrientation::RIGHT:
+ aTblAdjust.setLength(0);
+ aTblAdjust.append(OOO_STRING_SVTOOLS_RTF_TRQR);
+ break;
+ case text::HoriOrientation::NONE:
+ case text::HoriOrientation::LEFT_AND_WIDTH:
+ aTblAdjust.append(OOO_STRING_SVTOOLS_RTF_TRLEFT);
+ aTblAdjust.append((sal_Int32)pFmt->GetLRSpace().GetLeft());
+ break;
+ default:
+ break;
}
m_aRowDefs.append(aTblAdjust.makeStringAndClear());
}
-void RtfAttributeOutput::TableSpacing( ww8::WW8TableNodeInfoInner::Pointer_t /*pTableTextNodeInfoInner*/ )
+void RtfAttributeOutput::TableSpacing(ww8::WW8TableNodeInfoInner::Pointer_t /*pTableTextNodeInfoInner*/)
{
SAL_INFO("sw.rtf", "TODO: " << OSL_THIS_FUNC);
}
-void RtfAttributeOutput::TableRowEnd( sal_uInt32 /*nDepth*/ )
+void RtfAttributeOutput::TableRowEnd(sal_uInt32 /*nDepth*/)
{
SAL_INFO("sw.rtf", OSL_THIS_FUNC);
@@ -899,7 +913,7 @@ void RtfAttributeOutput::TableRowEnd( sal_uInt32 /*nDepth*/ )
* Our private table methods.
*/
-void RtfAttributeOutput::InitTableHelper( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner )
+void RtfAttributeOutput::InitTableHelper(ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner)
{
SAL_INFO("sw.rtf", OSL_THIS_FUNC);
@@ -907,21 +921,21 @@ void RtfAttributeOutput::InitTableHelper( ww8::WW8TableNodeInfoInner::Pointer_t
bool bRelBoxSize = false;
// Create the SwWriteTable instance to use col spans
- GetTablePageSize( pTableTextNodeInfoInner.get(), nPageSize, bRelBoxSize );
+ GetTablePageSize(pTableTextNodeInfoInner.get(), nPageSize, bRelBoxSize);
- const SwTable* pTable = pTableTextNodeInfoInner->getTable( );
- const SwFrmFmt *pFmt = pTable->GetFrmFmt( );
- SwTwips nTblSz = pFmt->GetFrmSize( ).GetWidth( );
+ const SwTable* pTable = pTableTextNodeInfoInner->getTable();
+ const SwFrmFmt* pFmt = pTable->GetFrmFmt();
+ SwTwips nTblSz = pFmt->GetFrmSize().GetWidth();
- const SwHTMLTableLayout *pLayout = pTable->GetHTMLTableLayout();
- if( pLayout && pLayout->IsExportable() )
- m_pTableWrt = new SwWriteTable( pLayout );
+ const SwHTMLTableLayout* pLayout = pTable->GetHTMLTableLayout();
+ if (pLayout && pLayout->IsExportable())
+ m_pTableWrt = new SwWriteTable(pLayout);
else
- m_pTableWrt = new SwWriteTable( pTable->GetTabLines(), (sal_uInt16)nPageSize,
- (sal_uInt16)nTblSz, false);
+ m_pTableWrt = new SwWriteTable(pTable->GetTabLines(), (sal_uInt16)nPageSize,
+ (sal_uInt16)nTblSz, false);
}
-void RtfAttributeOutput::StartTable( ww8::WW8TableNodeInfoInner::Pointer_t /*pTableTextNodeInfoInner*/ )
+void RtfAttributeOutput::StartTable(ww8::WW8TableNodeInfoInner::Pointer_t /*pTableTextNodeInfoInner*/)
{
SAL_INFO("sw.rtf", OSL_THIS_FUNC);
@@ -929,7 +943,7 @@ void RtfAttributeOutput::StartTable( ww8::WW8TableNodeInfoInner::Pointer_t /*pTa
delete m_pTableWrt, m_pTableWrt = NULL;
}
-void RtfAttributeOutput::StartTableRow( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner )
+void RtfAttributeOutput::StartTableRow(ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner)
{
sal_uInt32 nCurrentDepth = pTableTextNodeInfoInner->getDepth();
SAL_INFO("sw.rtf", OSL_THIS_FUNC << ", (depth is " << nCurrentDepth << ")");
@@ -940,22 +954,22 @@ void RtfAttributeOutput::StartTableRow( ww8::WW8TableNodeInfoInner::Pointer_t pT
m_aTables.push_back(m_aRowDefs.makeStringAndClear());
// We'll write the table definition for nested tables later
- if ( nCurrentDepth > 1 )
+ if (nCurrentDepth > 1)
return;
// Empty the previous row closing buffer before starting the new one,
// necessary for subtables.
- m_rExport.Strm().WriteCharPtr( m_aAfterRuns.makeStringAndClear().getStr() );
- m_rExport.Strm().WriteCharPtr( m_aRowDefs.makeStringAndClear().getStr() );
+ m_rExport.Strm().WriteCharPtr(m_aAfterRuns.makeStringAndClear().getStr());
+ m_rExport.Strm().WriteCharPtr(m_aRowDefs.makeStringAndClear().getStr());
}
-void RtfAttributeOutput::StartTableCell( ww8::WW8TableNodeInfoInner::Pointer_t /*pTableTextNodeInfoInner*/ )
+void RtfAttributeOutput::StartTableCell(ww8::WW8TableNodeInfoInner::Pointer_t /*pTableTextNodeInfoInner*/)
{
SAL_INFO("sw.rtf", OSL_THIS_FUNC);
m_bTableCellOpen = true;
}
-void RtfAttributeOutput::TableCellProperties( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner )
+void RtfAttributeOutput::TableCellProperties(ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner)
{
SAL_INFO("sw.rtf", OSL_THIS_FUNC);
@@ -964,7 +978,7 @@ void RtfAttributeOutput::TableCellProperties( ww8::WW8TableNodeInfoInner::Pointe
TableVerticalCell(pTableTextNodeInfoInner);
}
-void RtfAttributeOutput::EndTableCell( )
+void RtfAttributeOutput::EndTableCell()
{
SAL_INFO("sw.rtf", OSL_THIS_FUNC << ", (depth is " << m_nTableDepth << ")");
@@ -974,7 +988,7 @@ void RtfAttributeOutput::EndTableCell( )
m_aAfterRuns.append(OOO_STRING_SVTOOLS_RTF_ITAP);
m_aAfterRuns.append((sal_Int32)m_nTableDepth);
}
- if ( m_nTableDepth > 1 )
+ if (m_nTableDepth > 1)
m_aAfterRuns.append(OOO_STRING_SVTOOLS_RTF_NESTCELL);
else
m_aAfterRuns.append(OOO_STRING_SVTOOLS_RTF_CELL);
@@ -986,15 +1000,15 @@ void RtfAttributeOutput::EndTableCell( )
m_aCells[m_nTableDepth]--;
}
-void RtfAttributeOutput::EndTableRow( )
+void RtfAttributeOutput::EndTableRow()
{
SAL_INFO("sw.rtf", OSL_THIS_FUNC << ", (depth is " << m_nTableDepth << ")");
// Trying to end the row without writing the required number of cells? Fill with empty ones.
- for( sal_uInt16 i = 0; i < m_aCells[m_nTableDepth]; i++ )
+ for (sal_uInt16 i = 0; i < m_aCells[m_nTableDepth]; i++)
m_aAfterRuns.append(OOO_STRING_SVTOOLS_RTF_CELL);
- if ( m_nTableDepth > 1 )
+ if (m_nTableDepth > 1)
{
m_aAfterRuns.append("{" OOO_STRING_SVTOOLS_RTF_IGNORE OOO_STRING_SVTOOLS_RTF_NESTTABLEPROPRS);
if (!m_aRowDefs.isEmpty())
@@ -1022,7 +1036,8 @@ void RtfAttributeOutput::EndTable()
{
SAL_INFO("sw.rtf", OSL_THIS_FUNC);
- if ( m_nTableDepth > 0 ) {
+ if (m_nTableDepth > 0)
+ {
m_nTableDepth--;
delete m_pTableWrt, m_pTableWrt = NULL;
}
@@ -1035,28 +1050,28 @@ void RtfAttributeOutput::EndTable()
delete m_pTableWrt, m_pTableWrt = NULL;
}
-void RtfAttributeOutput::FinishTableRowCell( ww8::WW8TableNodeInfoInner::Pointer_t pInner, bool /*bForceEmptyParagraph*/ )
+void RtfAttributeOutput::FinishTableRowCell(ww8::WW8TableNodeInfoInner::Pointer_t pInner, bool /*bForceEmptyParagraph*/)
{
SAL_INFO("sw.rtf", OSL_THIS_FUNC);
- if ( pInner.get() )
+ if (pInner.get())
{
// Where are we in the table
- sal_uInt32 nRow = pInner->getRow( );
+ sal_uInt32 nRow = pInner->getRow();
- const SwTable *pTable = pInner->getTable( );
- const SwTableLines& rLines = pTable->GetTabLines( );
- sal_uInt16 nLinesCount = rLines.size( );
+ const SwTable* pTable = pInner->getTable();
+ const SwTableLines& rLines = pTable->GetTabLines();
+ sal_uInt16 nLinesCount = rLines.size();
- if ( pInner->isEndOfCell() )
+ if (pInner->isEndOfCell())
EndTableCell();
// This is a line end
- if ( pInner->isEndOfLine() )
+ if (pInner->isEndOfLine())
EndTableRow();
// This is the end of the table
- if ( pInner->isEndOfLine( ) && ( nRow + 1 ) == nLinesCount )
+ if (pInner->isEndOfLine() && (nRow + 1) == nLinesCount)
EndTable();
}
}
@@ -1064,7 +1079,7 @@ void RtfAttributeOutput::FinishTableRowCell( ww8::WW8TableNodeInfoInner::Pointer
void RtfAttributeOutput::StartStyles()
{
SAL_INFO("sw.rtf", OSL_THIS_FUNC);
- m_rExport.Strm().WriteCharPtr( SAL_NEWLINE_STRING ).WriteChar( '{' ).WriteCharPtr( OOO_STRING_SVTOOLS_RTF_COLORTBL );
+ m_rExport.Strm().WriteCharPtr(SAL_NEWLINE_STRING).WriteChar('{').WriteCharPtr(OOO_STRING_SVTOOLS_RTF_COLORTBL);
m_rExport.OutColorTable();
OSL_ENSURE(m_aStylesheet.getLength() == 0, "m_aStylesheet is not empty");
m_aStylesheet.append(SAL_NEWLINE_STRING);
@@ -1072,24 +1087,24 @@ void RtfAttributeOutput::StartStyles()
m_aStylesheet.append(OOO_STRING_SVTOOLS_RTF_STYLESHEET);
}
-void RtfAttributeOutput::EndStyles( sal_uInt16 /*nNumberOfStyles*/ )
+void RtfAttributeOutput::EndStyles(sal_uInt16 /*nNumberOfStyles*/)
{
SAL_INFO("sw.rtf", OSL_THIS_FUNC);
- m_rExport.Strm().WriteChar( '}' );
- m_rExport.Strm().WriteCharPtr( m_aStylesheet.makeStringAndClear().getStr() );
- m_rExport.Strm().WriteChar( '}' );
+ m_rExport.Strm().WriteChar('}');
+ m_rExport.Strm().WriteCharPtr(m_aStylesheet.makeStringAndClear().getStr());
+ m_rExport.Strm().WriteChar('}');
}
-void RtfAttributeOutput::DefaultStyle( sal_uInt16 /*nStyle*/ )
+void RtfAttributeOutput::DefaultStyle(sal_uInt16 /*nStyle*/)
{
SAL_INFO("sw.rtf", OSL_THIS_FUNC);
/* noop, the default style is always 0 in RTF */
}
-void RtfAttributeOutput::StartStyle( const OUString& rName, StyleType eType,
- sal_uInt16 nBase, sal_uInt16 nNext, sal_uInt16 /*nWwId*/, sal_uInt16 nId,
- bool /* bAutoUpdate */ )
+void RtfAttributeOutput::StartStyle(const OUString& rName, StyleType eType,
+ sal_uInt16 nBase, sal_uInt16 nNext, sal_uInt16 /*nWwId*/, sal_uInt16 nId,
+ bool /* bAutoUpdate */)
{
SAL_INFO("sw.rtf", OSL_THIS_FUNC << ", rName = '" << rName << "'");
@@ -1097,10 +1112,10 @@ void RtfAttributeOutput::StartStyle( const OUString& rName, StyleType eType,
if (eType == STYLE_TYPE_PARA)
m_aStylesheet.append(OOO_STRING_SVTOOLS_RTF_S);
else
- m_aStylesheet.append( OOO_STRING_SVTOOLS_RTF_IGNORE OOO_STRING_SVTOOLS_RTF_CS);
- m_aStylesheet.append( (sal_Int32)nId );
+ m_aStylesheet.append(OOO_STRING_SVTOOLS_RTF_IGNORE OOO_STRING_SVTOOLS_RTF_CS);
+ m_aStylesheet.append((sal_Int32)nId);
- if ( nBase != 0x0FFF )
+ if (nBase != 0x0FFF)
{
m_aStylesheet.append(OOO_STRING_SVTOOLS_RTF_SBASEDON);
m_aStylesheet.append((sal_Int32)nBase);
@@ -1126,23 +1141,23 @@ void RtfAttributeOutput::EndStyle()
m_aStylesheet.append(SAL_NEWLINE_STRING);
}
-void RtfAttributeOutput::StartStyleProperties( bool /*bParProp*/, sal_uInt16 /*nStyle*/ )
+void RtfAttributeOutput::StartStyleProperties(bool /*bParProp*/, sal_uInt16 /*nStyle*/)
{
SAL_INFO("sw.rtf", OSL_THIS_FUNC);
/* noop */
}
-void RtfAttributeOutput::EndStyleProperties( bool /*bParProp*/ )
+void RtfAttributeOutput::EndStyleProperties(bool /*bParProp*/)
{
SAL_INFO("sw.rtf", OSL_THIS_FUNC);
/* noop */
}
-void RtfAttributeOutput::OutlineNumbering( sal_uInt8 nLvl, const SwNumFmt& /*rNFmt*/, const SwFmt& /*rFmt*/ )
+void RtfAttributeOutput::OutlineNumbering(sal_uInt8 nLvl, const SwNumFmt& /*rNFmt*/, const SwFmt& /*rFmt*/)
{
SAL_INFO("sw.rtf", OSL_THIS_FUNC);
- if ( nLvl >= WW8ListManager::nMaxLevel )
+ if (nLvl >= WW8ListManager::nMaxLevel)
nLvl = WW8ListManager::nMaxLevel - 1;
m_aStyles.append(OOO_STRING_SVTOOLS_RTF_ILVL);
@@ -1151,29 +1166,29 @@ void RtfAttributeOutput::OutlineNumbering( sal_uInt8 nLvl, const SwNumFmt& /*rNF
m_aStyles.append((sal_Int32)nLvl);
}
-void RtfAttributeOutput::PageBreakBefore( bool bBreak )
+void RtfAttributeOutput::PageBreakBefore(bool bBreak)
{
SAL_INFO("sw.rtf", OSL_THIS_FUNC);
if (bBreak)
{
- m_rExport.Strm().WriteCharPtr( OOO_STRING_SVTOOLS_RTF_PAGEBB );
+ m_rExport.Strm().WriteCharPtr(OOO_STRING_SVTOOLS_RTF_PAGEBB);
}
}
-void RtfAttributeOutput::SectionBreak( sal_uInt8 nC, const WW8_SepInfo* pSectionInfo )
+void RtfAttributeOutput::SectionBreak(sal_uInt8 nC, const WW8_SepInfo* pSectionInfo)
{
SAL_INFO("sw.rtf", OSL_THIS_FUNC);
switch (nC)
{
- case msword::ColumnBreak:
- m_nColBreakNeeded = true;
- break;
- case msword::PageBreak:
- if ( pSectionInfo )
- m_rExport.SectionProperties( *pSectionInfo );
- break;
+ case msword::ColumnBreak:
+ m_nColBreakNeeded = true;
+ break;
+ case msword::PageBreak:
+ if (pSectionInfo)
+ m_rExport.SectionProperties(*pSectionInfo);
+ break;
}
}
@@ -1183,7 +1198,7 @@ void RtfAttributeOutput::StartSection()
m_aSectionBreaks.append(OOO_STRING_SVTOOLS_RTF_SECT OOO_STRING_SVTOOLS_RTF_SECTD);
if (!m_bBufferSectionBreaks)
- m_rExport.Strm().WriteCharPtr( m_aSectionBreaks.makeStringAndClear().getStr() );
+ m_rExport.Strm().WriteCharPtr(m_aSectionBreaks.makeStringAndClear().getStr());
}
void RtfAttributeOutput::EndSection()
@@ -1196,7 +1211,7 @@ void RtfAttributeOutput::EndSection()
*/
}
-void RtfAttributeOutput::SectionFormProtection( bool bProtected )
+void RtfAttributeOutput::SectionFormProtection(bool bProtected)
{
SAL_INFO("sw.rtf", OSL_THIS_FUNC);
@@ -1204,16 +1219,16 @@ void RtfAttributeOutput::SectionFormProtection( bool bProtected )
m_aSectionBreaks.append((sal_Int32)!bProtected);
}
-void RtfAttributeOutput::SectionLineNumbering( sal_uLong /*nRestartNo*/, const SwLineNumberInfo& rLnNumInfo )
+void RtfAttributeOutput::SectionLineNumbering(sal_uLong /*nRestartNo*/, const SwLineNumberInfo& rLnNumInfo)
{
SAL_INFO("sw.rtf", OSL_THIS_FUNC);
- m_rExport.Strm().WriteCharPtr( OOO_STRING_SVTOOLS_RTF_LINEMOD );
+ m_rExport.Strm().WriteCharPtr(OOO_STRING_SVTOOLS_RTF_LINEMOD);
m_rExport.OutLong(rLnNumInfo.GetCountBy());
- m_rExport.Strm().WriteCharPtr( OOO_STRING_SVTOOLS_RTF_LINEX );
+ m_rExport.Strm().WriteCharPtr(OOO_STRING_SVTOOLS_RTF_LINEX);
m_rExport.OutLong(rLnNumInfo.GetPosFromLeft());
if (!rLnNumInfo.IsRestartEachPage())
- m_rExport.Strm().WriteCharPtr( OOO_STRING_SVTOOLS_RTF_LINECONT );
+ m_rExport.Strm().WriteCharPtr(OOO_STRING_SVTOOLS_RTF_LINECONT);
}
void RtfAttributeOutput::SectionTitlePage()
@@ -1225,45 +1240,45 @@ void RtfAttributeOutput::SectionTitlePage()
*/
}
-void RtfAttributeOutput::SectionPageBorders( const SwFrmFmt* pFmt, const SwFrmFmt* /*pFirstPageFmt*/ )
+void RtfAttributeOutput::SectionPageBorders(const SwFrmFmt* pFmt, const SwFrmFmt* /*pFirstPageFmt*/)
{
SAL_INFO("sw.rtf", OSL_THIS_FUNC);
const SvxBoxItem& rBox = pFmt->GetBox();
- const SvxBorderLine *pLine = rBox.GetTop();
- if(pLine)
- m_aSectionBreaks.append(OutBorderLine( m_rExport, pLine,
- OOO_STRING_SVTOOLS_RTF_PGBRDRT,
- rBox.GetDistance(BOX_LINE_TOP) ));
+ const SvxBorderLine* pLine = rBox.GetTop();
+ if (pLine)
+ m_aSectionBreaks.append(OutBorderLine(m_rExport, pLine,
+ OOO_STRING_SVTOOLS_RTF_PGBRDRT,
+ rBox.GetDistance(BOX_LINE_TOP)));
pLine = rBox.GetBottom();
- if(pLine)
- m_aSectionBreaks.append(OutBorderLine( m_rExport, pLine,
- OOO_STRING_SVTOOLS_RTF_PGBRDRB,
- rBox.GetDistance(BOX_LINE_BOTTOM) ));
+ if (pLine)
+ m_aSectionBreaks.append(OutBorderLine(m_rExport, pLine,
+ OOO_STRING_SVTOOLS_RTF_PGBRDRB,
+ rBox.GetDistance(BOX_LINE_BOTTOM)));
pLine = rBox.GetLeft();
- if(pLine)
- m_aSectionBreaks.append(OutBorderLine( m_rExport, pLine,
- OOO_STRING_SVTOOLS_RTF_PGBRDRL,
- rBox.GetDistance(BOX_LINE_LEFT) ));
+ if (pLine)
+ m_aSectionBreaks.append(OutBorderLine(m_rExport, pLine,
+ OOO_STRING_SVTOOLS_RTF_PGBRDRL,
+ rBox.GetDistance(BOX_LINE_LEFT)));
pLine = rBox.GetRight();
- if(pLine)
- m_aSectionBreaks.append(OutBorderLine( m_rExport, pLine,
- OOO_STRING_SVTOOLS_RTF_PGBRDRR,
- rBox.GetDistance(BOX_LINE_RIGHT) ));
+ if (pLine)
+ m_aSectionBreaks.append(OutBorderLine(m_rExport, pLine,
+ OOO_STRING_SVTOOLS_RTF_PGBRDRR,
+ rBox.GetDistance(BOX_LINE_RIGHT)));
}
-void RtfAttributeOutput::SectionBiDi( bool bBiDi )
+void RtfAttributeOutput::SectionBiDi(bool bBiDi)
{
SAL_INFO("sw.rtf", OSL_THIS_FUNC);
- m_rExport.Strm().WriteCharPtr( (bBiDi ? OOO_STRING_SVTOOLS_RTF_RTLSECT : OOO_STRING_SVTOOLS_RTF_LTRSECT) );
+ m_rExport.Strm().WriteCharPtr((bBiDi ? OOO_STRING_SVTOOLS_RTF_RTLSECT : OOO_STRING_SVTOOLS_RTF_LTRSECT));
}
-void RtfAttributeOutput::SectionPageNumbering( sal_uInt16 nNumType, ::boost::optional<sal_uInt16> oPageRestartNumber )
+void RtfAttributeOutput::SectionPageNumbering(sal_uInt16 nNumType, ::boost::optional<sal_uInt16> oPageRestartNumber)
{
SAL_INFO("sw.rtf", OSL_THIS_FUNC);
- if ( oPageRestartNumber )
+ if (oPageRestartNumber)
{
m_aSectionBreaks.append(OOO_STRING_SVTOOLS_RTF_PGNSTARTS);
m_aSectionBreaks.append((sal_Int32)oPageRestartNumber.get());
@@ -1271,22 +1286,32 @@ void RtfAttributeOutput::SectionPageNumbering( sal_uInt16 nNumType, ::boost::opt
}
const char* pStr = 0;
- switch ( nNumType )
- {
- case SVX_NUM_CHARS_UPPER_LETTER:
- case SVX_NUM_CHARS_UPPER_LETTER_N: pStr = OOO_STRING_SVTOOLS_RTF_PGNUCLTR; break;
- case SVX_NUM_CHARS_LOWER_LETTER:
- case SVX_NUM_CHARS_LOWER_LETTER_N: pStr = OOO_STRING_SVTOOLS_RTF_PGNLCLTR; break;
- case SVX_NUM_ROMAN_UPPER: pStr = OOO_STRING_SVTOOLS_RTF_PGNUCRM; break;
- case SVX_NUM_ROMAN_LOWER: pStr = OOO_STRING_SVTOOLS_RTF_PGNLCRM; break;
-
- case SVX_NUM_ARABIC: pStr = OOO_STRING_SVTOOLS_RTF_PGNDEC; break;
+ switch (nNumType)
+ {
+ case SVX_NUM_CHARS_UPPER_LETTER:
+ case SVX_NUM_CHARS_UPPER_LETTER_N:
+ pStr = OOO_STRING_SVTOOLS_RTF_PGNUCLTR;
+ break;
+ case SVX_NUM_CHARS_LOWER_LETTER:
+ case SVX_NUM_CHARS_LOWER_LETTER_N:
+ pStr = OOO_STRING_SVTOOLS_RTF_PGNLCLTR;
+ break;
+ case SVX_NUM_ROMAN_UPPER:
+ pStr = OOO_STRING_SVTOOLS_RTF_PGNUCRM;
+ break;
+ case SVX_NUM_ROMAN_LOWER:
+ pStr = OOO_STRING_SVTOOLS_RTF_PGNLCRM;
+ break;
+
+ case SVX_NUM_ARABIC:
+ pStr = OOO_STRING_SVTOOLS_RTF_PGNDEC;
+ break;
}
if (pStr)
m_aSectionBreaks.append(pStr);
}
-void RtfAttributeOutput::SectionType( sal_uInt8 nBreakCode )
+void RtfAttributeOutput::SectionType(sal_uInt8 nBreakCode)
{
SAL_INFO("sw.rtf", OSL_THIS_FUNC << ", nBreakCode = " << int(nBreakCode));
@@ -1295,37 +1320,47 @@ void RtfAttributeOutput::SectionType( sal_uInt8 nBreakCode )
* 2 New page, 3 Even page, 4 Odd page
*/
const char* sType = NULL;
- switch ( nBreakCode )
- {
- case 1: sType = OOO_STRING_SVTOOLS_RTF_SBKCOL; break;
- case 2: sType = OOO_STRING_SVTOOLS_RTF_SBKPAGE; break;
- case 3: sType = OOO_STRING_SVTOOLS_RTF_SBKEVEN; break;
- case 4: sType = OOO_STRING_SVTOOLS_RTF_SBKODD; break;
- default: sType = OOO_STRING_SVTOOLS_RTF_SBKNONE; break;
+ switch (nBreakCode)
+ {
+ case 1:
+ sType = OOO_STRING_SVTOOLS_RTF_SBKCOL;
+ break;
+ case 2:
+ sType = OOO_STRING_SVTOOLS_RTF_SBKPAGE;
+ break;
+ case 3:
+ sType = OOO_STRING_SVTOOLS_RTF_SBKEVEN;
+ break;
+ case 4:
+ sType = OOO_STRING_SVTOOLS_RTF_SBKODD;
+ break;
+ default:
+ sType = OOO_STRING_SVTOOLS_RTF_SBKNONE;
+ break;
}
m_aSectionBreaks.append(sType);
if (!m_bBufferSectionBreaks)
- m_rExport.Strm().WriteCharPtr( m_aSectionBreaks.makeStringAndClear().getStr() );
+ m_rExport.Strm().WriteCharPtr(m_aSectionBreaks.makeStringAndClear().getStr());
}
-void RtfAttributeOutput::NumberingDefinition( sal_uInt16 nId, const SwNumRule &/*rRule*/ )
+void RtfAttributeOutput::NumberingDefinition(sal_uInt16 nId, const SwNumRule& /*rRule*/)
{
SAL_INFO("sw.rtf", OSL_THIS_FUNC);
- m_rExport.Strm().WriteChar( '{' ).WriteCharPtr( OOO_STRING_SVTOOLS_RTF_LISTOVERRIDE );
- m_rExport.Strm().WriteCharPtr( OOO_STRING_SVTOOLS_RTF_LISTID );
+ m_rExport.Strm().WriteChar('{').WriteCharPtr(OOO_STRING_SVTOOLS_RTF_LISTOVERRIDE);
+ m_rExport.Strm().WriteCharPtr(OOO_STRING_SVTOOLS_RTF_LISTID);
m_rExport.OutULong(nId);
- m_rExport.Strm().WriteCharPtr( OOO_STRING_SVTOOLS_RTF_LISTOVERRIDECOUNT ).WriteChar( '0' );
- m_rExport.Strm().WriteCharPtr( OOO_STRING_SVTOOLS_RTF_LS );
- m_rExport.OutULong(nId).WriteChar( '}' );
+ m_rExport.Strm().WriteCharPtr(OOO_STRING_SVTOOLS_RTF_LISTOVERRIDECOUNT).WriteChar('0');
+ m_rExport.Strm().WriteCharPtr(OOO_STRING_SVTOOLS_RTF_LS);
+ m_rExport.OutULong(nId).WriteChar('}');
}
-void RtfAttributeOutput::StartAbstractNumbering( sal_uInt16 nId )
+void RtfAttributeOutput::StartAbstractNumbering(sal_uInt16 nId)
{
SAL_INFO("sw.rtf", OSL_THIS_FUNC);
- m_rExport.Strm().WriteChar( '{' ).WriteCharPtr( OOO_STRING_SVTOOLS_RTF_LIST ).WriteCharPtr( OOO_STRING_SVTOOLS_RTF_LISTTEMPLATEID );
- m_rExport.OutULong( nId );
+ m_rExport.Strm().WriteChar('{').WriteCharPtr(OOO_STRING_SVTOOLS_RTF_LIST).WriteCharPtr(OOO_STRING_SVTOOLS_RTF_LISTTEMPLATEID);
+ m_rExport.OutULong(nId);
m_nListId = nId;
}
@@ -1333,57 +1368,75 @@ void RtfAttributeOutput::EndAbstractNumbering()
{
SAL_INFO("sw.rtf", OSL_THIS_FUNC);
- m_rExport.Strm().WriteCharPtr( OOO_STRING_SVTOOLS_RTF_LISTID );
- m_rExport.OutULong( m_nListId ).WriteChar( '}' ).WriteCharPtr( SAL_NEWLINE_STRING );
+ m_rExport.Strm().WriteCharPtr(OOO_STRING_SVTOOLS_RTF_LISTID);
+ m_rExport.OutULong(m_nListId).WriteChar('}').WriteCharPtr(SAL_NEWLINE_STRING);
}
-void RtfAttributeOutput::NumberingLevel( sal_uInt8 nLevel,
- sal_uInt16 nStart,
- sal_uInt16 nNumberingType,
- SvxAdjust eAdjust,
- const sal_uInt8 * pNumLvlPos,
- sal_uInt8 nFollow,
- const wwFont * pFont,
- const SfxItemSet * pOutSet,
- sal_Int16 nIndentAt,
- sal_Int16 nFirstLineIndex,
- sal_Int16 /*nListTabPos*/,
- const OUString &rNumberingString,
- const SvxBrushItem* pBrush)
+void RtfAttributeOutput::NumberingLevel(sal_uInt8 nLevel,
+ sal_uInt16 nStart,
+ sal_uInt16 nNumberingType,
+ SvxAdjust eAdjust,
+ const sal_uInt8* pNumLvlPos,
+ sal_uInt8 nFollow,
+ const wwFont* pFont,
+ const SfxItemSet* pOutSet,
+ sal_Int16 nIndentAt,
+ sal_Int16 nFirstLineIndex,
+ sal_Int16 /*nListTabPos*/,
+ const OUString& rNumberingString,
+ const SvxBrushItem* pBrush)
{
SAL_INFO("sw.rtf", OSL_THIS_FUNC);
- m_rExport.Strm().WriteCharPtr( SAL_NEWLINE_STRING );
- if( nLevel > 8 ) // RTF knows only 9 levels
- m_rExport.Strm().WriteCharPtr( OOO_STRING_SVTOOLS_RTF_IGNORE ).WriteCharPtr( OOO_STRING_SVTOOLS_RTF_SOUTLVL );
+ m_rExport.Strm().WriteCharPtr(SAL_NEWLINE_STRING);
+ if (nLevel > 8) // RTF knows only 9 levels
+ m_rExport.Strm().WriteCharPtr(OOO_STRING_SVTOOLS_RTF_IGNORE).WriteCharPtr(OOO_STRING_SVTOOLS_RTF_SOUTLVL);
- m_rExport.Strm().WriteChar( '{' ).WriteCharPtr( OOO_STRING_SVTOOLS_RTF_LISTLEVEL );
+ m_rExport.Strm().WriteChar('{').WriteCharPtr(OOO_STRING_SVTOOLS_RTF_LISTLEVEL);
sal_uInt16 nVal = 0;
- switch( nNumberingType )
- {
- case SVX_NUM_ROMAN_UPPER: nVal = 1; break;
- case SVX_NUM_ROMAN_LOWER: nVal = 2; break;
- case SVX_NUM_CHARS_UPPER_LETTER:
- case SVX_NUM_CHARS_UPPER_LETTER_N: nVal = 3; break;
- case SVX_NUM_CHARS_LOWER_LETTER:
- case SVX_NUM_CHARS_LOWER_LETTER_N: nVal = 4; break;
-
- case SVX_NUM_BITMAP:
- case SVX_NUM_CHAR_SPECIAL: nVal = 23; break;
- case SVX_NUM_NUMBER_NONE: nVal = 255; break;
- }
- m_rExport.Strm().WriteCharPtr( OOO_STRING_SVTOOLS_RTF_LEVELNFC );
- m_rExport.OutULong( nVal );
+ switch (nNumberingType)
+ {
+ case SVX_NUM_ROMAN_UPPER:
+ nVal = 1;
+ break;
+ case SVX_NUM_ROMAN_LOWER:
+ nVal = 2;
+ break;
+ case SVX_NUM_CHARS_UPPER_LETTER:
+ case SVX_NUM_CHARS_UPPER_LETTER_N:
+ nVal = 3;
+ break;
+ case SVX_NUM_CHARS_LOWER_LETTER:
+ case SVX_NUM_CHARS_LOWER_LETTER_N:
+ nVal = 4;
+ break;
+
+ case SVX_NUM_BITMAP:
+ case SVX_NUM_CHAR_SPECIAL:
+ nVal = 23;
+ break;
+ case SVX_NUM_NUMBER_NONE:
+ nVal = 255;
+ break;
+ }
+ m_rExport.Strm().WriteCharPtr(OOO_STRING_SVTOOLS_RTF_LEVELNFC);
+ m_rExport.OutULong(nVal);
- switch( eAdjust )
+ switch (eAdjust)
{
- case SVX_ADJUST_CENTER: nVal = 1; break;
- case SVX_ADJUST_RIGHT: nVal = 2; break;
- default: nVal = 0; break;
+ case SVX_ADJUST_CENTER:
+ nVal = 1;
+ break;
+ case SVX_ADJUST_RIGHT:
+ nVal = 2;
+ break;
+ default:
+ nVal = 0;
+ break;
}
- m_rExport.Strm().WriteCharPtr( OOO_STRING_SVTOOLS_RTF_LEVELJC );
- m_rExport.OutULong( nVal );
+ m_rExport.Strm().WriteCharPtr(OOO_STRING_SVTOOLS_RTF_LEVELJC);
+ m_rExport.OutULong(nVal);
// bullet
if (nNumberingType == SVX_NUM_BITMAP && pBrush)
@@ -1391,66 +1444,66 @@ void RtfAttributeOutput::NumberingLevel( sal_uInt8 nLevel,
int nIndex = m_rExport.GetGrfIndex(*pBrush);
if (nIndex != -1)
{
- m_rExport.Strm().WriteCharPtr( LO_STRING_SVTOOLS_RTF_LEVELPICTURE );
+ m_rExport.Strm().WriteCharPtr(LO_STRING_SVTOOLS_RTF_LEVELPICTURE);
m_rExport.OutULong(nIndex);
}
}
- m_rExport.Strm().WriteCharPtr( OOO_STRING_SVTOOLS_RTF_LEVELSTARTAT );
- m_rExport.OutULong( nStart );
+ m_rExport.Strm().WriteCharPtr(OOO_STRING_SVTOOLS_RTF_LEVELSTARTAT);
+ m_rExport.OutULong(nStart);
- m_rExport.Strm().WriteCharPtr( OOO_STRING_SVTOOLS_RTF_LEVELFOLLOW );
- m_rExport.OutULong( nFollow );
+ m_rExport.Strm().WriteCharPtr(OOO_STRING_SVTOOLS_RTF_LEVELFOLLOW);
+ m_rExport.OutULong(nFollow);
// leveltext group
- m_rExport.Strm().WriteChar( '{' ).WriteCharPtr( OOO_STRING_SVTOOLS_RTF_LEVELTEXT ).WriteChar( ' ' );
+ m_rExport.Strm().WriteChar('{').WriteCharPtr(OOO_STRING_SVTOOLS_RTF_LEVELTEXT).WriteChar(' ');
- if( SVX_NUM_CHAR_SPECIAL == nNumberingType ||
- SVX_NUM_BITMAP == nNumberingType )
+ if (SVX_NUM_CHAR_SPECIAL == nNumberingType ||
+ SVX_NUM_BITMAP == nNumberingType)
{
- m_rExport.Strm().WriteCharPtr( "\\'01" );
+ m_rExport.Strm().WriteCharPtr("\\'01");
sal_Unicode cChar = rNumberingString[0];
- m_rExport.Strm().WriteCharPtr( "\\u" );
+ m_rExport.Strm().WriteCharPtr("\\u");
m_rExport.OutULong(cChar);
- m_rExport.Strm().WriteCharPtr( " ?" );
+ m_rExport.Strm().WriteCharPtr(" ?");
}
else
{
- m_rExport.Strm().WriteCharPtr( "\\'" ).WriteCharPtr( msfilter::rtfutil::OutHex( rNumberingString.getLength(), 2 ).getStr() );
- m_rExport.Strm().WriteCharPtr( msfilter::rtfutil::OutString( rNumberingString, m_rExport.eDefaultEncoding, /*bUnicode =*/ false ).getStr() );
+ m_rExport.Strm().WriteCharPtr("\\'").WriteCharPtr(msfilter::rtfutil::OutHex(rNumberingString.getLength(), 2).getStr());
+ m_rExport.Strm().WriteCharPtr(msfilter::rtfutil::OutString(rNumberingString, m_rExport.eDefaultEncoding, /*bUnicode =*/ false).getStr());
}
- m_rExport.Strm().WriteCharPtr( ";}" );
+ m_rExport.Strm().WriteCharPtr(";}");
// write the levelnumbers
- m_rExport.Strm().WriteCharPtr( "{" ).WriteCharPtr( OOO_STRING_SVTOOLS_RTF_LEVELNUMBERS );
- for( sal_uInt8 i = 0; i <= nLevel && pNumLvlPos[ i ]; ++i )
+ m_rExport.Strm().WriteCharPtr("{").WriteCharPtr(OOO_STRING_SVTOOLS_RTF_LEVELNUMBERS);
+ for (sal_uInt8 i = 0; i <= nLevel && pNumLvlPos[ i ]; ++i)
{
- m_rExport.Strm().WriteCharPtr( "\\'" ).WriteCharPtr( msfilter::rtfutil::OutHex(pNumLvlPos[ i ], 2).getStr() );
+ m_rExport.Strm().WriteCharPtr("\\'").WriteCharPtr(msfilter::rtfutil::OutHex(pNumLvlPos[ i ], 2).getStr());
}
- m_rExport.Strm().WriteCharPtr( ";}" );
+ m_rExport.Strm().WriteCharPtr(";}");
- if( pOutSet )
+ if (pOutSet)
{
if (pFont)
{
- m_rExport.Strm().WriteCharPtr( OOO_STRING_SVTOOLS_RTF_F );
+ m_rExport.Strm().WriteCharPtr(OOO_STRING_SVTOOLS_RTF_F);
m_rExport.OutULong(m_rExport.maFontHelper.GetId(*pFont));
}
- m_rExport.OutputItemSet( *pOutSet, false, true, i18n::ScriptType::LATIN, m_rExport.mbExportModeRTF );
- m_rExport.Strm().WriteCharPtr( m_aStyles.makeStringAndClear().getStr() );
+ m_rExport.OutputItemSet(*pOutSet, false, true, i18n::ScriptType::LATIN, m_rExport.mbExportModeRTF);
+ m_rExport.Strm().WriteCharPtr(m_aStyles.makeStringAndClear().getStr());
}
- m_rExport.Strm().WriteCharPtr( OOO_STRING_SVTOOLS_RTF_FI );
- m_rExport.OutLong( nFirstLineIndex ).WriteCharPtr( OOO_STRING_SVTOOLS_RTF_LI );
- m_rExport.OutLong( nIndentAt );
+ m_rExport.Strm().WriteCharPtr(OOO_STRING_SVTOOLS_RTF_FI);
+ m_rExport.OutLong(nFirstLineIndex).WriteCharPtr(OOO_STRING_SVTOOLS_RTF_LI);
+ m_rExport.OutLong(nIndentAt);
- m_rExport.Strm().WriteChar( '}' );
- if( nLevel > 8 )
- m_rExport.Strm().WriteChar( '}' );
+ m_rExport.Strm().WriteChar('}');
+ if (nLevel > 8)
+ m_rExport.Strm().WriteChar('}');
}
-void RtfAttributeOutput::WriteField_Impl( const SwField* pFld, ww::eField /*eType*/, const OUString& rFldCmd, sal_uInt8 /*nMode*/ )
+void RtfAttributeOutput::WriteField_Impl(const SwField* pFld, ww::eField /*eType*/, const OUString& rFldCmd, sal_uInt8 /*nMode*/)
{
SAL_INFO("sw.rtf", OSL_THIS_FUNC);
@@ -1469,9 +1522,9 @@ void RtfAttributeOutput::WriteField_Impl( const SwField* pFld, ww::eField /*eTyp
m_aRunText->append("}}");
}
-void RtfAttributeOutput::WriteBookmarks_Impl( std::vector< OUString >& rStarts, std::vector< OUString >& rEnds )
+void RtfAttributeOutput::WriteBookmarks_Impl(std::vector< OUString >& rStarts, std::vector< OUString >& rEnds)
{
- for ( std::vector< OUString >::const_iterator it = rStarts.begin(), end = rStarts.end(); it != end; ++it )
+ for (std::vector< OUString >::const_iterator it = rStarts.begin(), end = rStarts.end(); it != end; ++it)
{
m_aRun->append("{" OOO_STRING_SVTOOLS_RTF_IGNORE OOO_STRING_SVTOOLS_RTF_BKMKSTART " ");
m_aRun->append(msfilter::rtfutil::OutString(*it, m_rExport.eCurrentEncoding));
@@ -1479,7 +1532,7 @@ void RtfAttributeOutput::WriteBookmarks_Impl( std::vector< OUString >& rStarts,
}
rStarts.clear();
- for ( std::vector< OUString >::const_iterator it = rEnds.begin(), end = rEnds.end(); it != end; ++it )
+ for (std::vector< OUString >::const_iterator it = rEnds.begin(), end = rEnds.end(); it != end; ++it)
{
m_aRun->append("{" OOO_STRING_SVTOOLS_RTF_IGNORE OOO_STRING_SVTOOLS_RTF_BKMKEND " ");
m_aRun->append(msfilter::rtfutil::OutString(*it, m_rExport.eCurrentEncoding));
@@ -1488,11 +1541,11 @@ void RtfAttributeOutput::WriteBookmarks_Impl( std::vector< OUString >& rStarts,
rEnds.clear();
}
-void RtfAttributeOutput::WriteAnnotationMarks_Impl( std::vector< OUString >& rStarts, std::vector< OUString >& rEnds )
+void RtfAttributeOutput::WriteAnnotationMarks_Impl(std::vector< OUString >& rStarts, std::vector< OUString >& rEnds)
{
- for ( std::vector< OUString >::const_iterator i = rStarts.begin(), end = rStarts.end(); i != end; ++i )
+ for (std::vector< OUString >::const_iterator i = rStarts.begin(), end = rStarts.end(); i != end; ++i)
{
- OString rName = OUStringToOString( *i, RTL_TEXTENCODING_UTF8 );
+ OString rName = OUStringToOString(*i, RTL_TEXTENCODING_UTF8);
// Output the annotation mark
sal_uInt16 nId = m_nNextAnnotationMarkId++;
@@ -1503,9 +1556,9 @@ void RtfAttributeOutput::WriteAnnotationMarks_Impl( std::vector< OUString >& rSt
}
rStarts.clear();
- for ( std::vector< OUString >::const_iterator i = rEnds.begin(), end = rEnds.end(); i != end; ++i )
+ for (std::vector< OUString >::const_iterator i = rEnds.begin(), end = rEnds.end(); i != end; ++i)
{
- OString rName = OUStringToOString( *i, RTL_TEXTENCODING_UTF8 );
+ OString rName = OUStringToOString(*i, RTL_TEXTENCODING_UTF8);
// Get the id of the annotation mark
std::map<OString, sal_uInt16>::iterator it = m_rOpenedAnnotationMarksIds.find(rName);
@@ -1515,7 +1568,7 @@ void RtfAttributeOutput::WriteAnnotationMarks_Impl( std::vector< OUString >& rSt
m_aRun->append("{" OOO_STRING_SVTOOLS_RTF_IGNORE OOO_STRING_SVTOOLS_RTF_ATRFEND " ");
m_aRun->append(OString::number(nId).getStr());
m_aRun->append('}');
- m_rOpenedAnnotationMarksIds.erase( rName );
+ m_rOpenedAnnotationMarksIds.erase(rName);
if (m_aPostitFields.find(nId) != m_aPostitFields.end())
{
@@ -1530,7 +1583,7 @@ void RtfAttributeOutput::WriteAnnotationMarks_Impl( std::vector< OUString >& rSt
rEnds.clear();
}
-void RtfAttributeOutput::WriteHeaderFooter_Impl( const SwFrmFmt& rFmt, bool bHeader, const sal_Char* pStr, bool bTitlepg )
+void RtfAttributeOutput::WriteHeaderFooter_Impl(const SwFrmFmt& rFmt, bool bHeader, const sal_Char* pStr, bool bTitlepg)
{
OStringBuffer aSectionBreaks = m_aSectionBreaks;
m_aSectionBreaks.setLength(0);
@@ -1570,13 +1623,25 @@ void lcl_TextFrameShadow(std::vector< std::pair<OString, OString> >& rFlyPropert
OString aOffsetY;
switch (aShadowItem.GetLocation())
{
- case SVX_SHADOW_TOPLEFT: aOffsetX = "-" + aShadowWidth; aOffsetY = "-" + aShadowWidth; break;
- case SVX_SHADOW_TOPRIGHT: aOffsetX = aShadowWidth; aOffsetY = "-" + aShadowWidth; break;
- case SVX_SHADOW_BOTTOMLEFT: aOffsetX = "-" + aShadowWidth; aOffsetY = aShadowWidth; break;
- case SVX_SHADOW_BOTTOMRIGHT: aOffsetX = aShadowWidth; aOffsetY = aShadowWidth; break;
- case SVX_SHADOW_NONE:
- case SVX_SHADOW_END:
- break;
+ case SVX_SHADOW_TOPLEFT:
+ aOffsetX = "-" + aShadowWidth;
+ aOffsetY = "-" + aShadowWidth;
+ break;
+ case SVX_SHADOW_TOPRIGHT:
+ aOffsetX = aShadowWidth;
+ aOffsetY = "-" + aShadowWidth;
+ break;
+ case SVX_SHADOW_BOTTOMLEFT:
+ aOffsetX = "-" + aShadowWidth;
+ aOffsetY = aShadowWidth;
+ break;
+ case SVX_SHADOW_BOTTOMRIGHT:
+ aOffsetX = aShadowWidth;
+ aOffsetY = aShadowWidth;
+ break;
+ case SVX_SHADOW_NONE:
+ case SVX_SHADOW_END:
+ break;
}
if (!aOffsetX.isEmpty())
rFlyProperties.push_back(std::make_pair<OString, OString>("shadowOffsetX", OString(aOffsetX)));
@@ -1623,457 +1688,457 @@ void lcl_TextFrameRelativeSize(std::vector< std::pair<OString, OString> >& rFlyP
}
}
-void RtfAttributeOutput::OutputFlyFrame_Impl( const sw::Frame& rFrame, const Point& /*rNdTopLeft*/ )
+void RtfAttributeOutput::OutputFlyFrame_Impl(const sw::Frame& rFrame, const Point& /*rNdTopLeft*/)
{
SAL_INFO("sw.rtf", OSL_THIS_FUNC);
- const SwNode *pNode = rFrame.GetContent();
- const SwGrfNode *pGrfNode = pNode ? pNode->GetGrfNode() : 0;
+ const SwNode* pNode = rFrame.GetContent();
+ const SwGrfNode* pGrfNode = pNode ? pNode->GetGrfNode() : 0;
- switch ( rFrame.GetWriterType() )
+ switch (rFrame.GetWriterType())
{
- case sw::Frame::eTxtBox:
- {
- OSL_ENSURE(m_aRunText.getLength() == 0, "m_aRunText is not empty");
- m_rExport.mpParentFrame = &rFrame;
+ case sw::Frame::eTxtBox:
+ {
+ OSL_ENSURE(m_aRunText.getLength() == 0, "m_aRunText is not empty");
+ m_rExport.mpParentFrame = &rFrame;
- m_rExport.Strm().WriteCharPtr( "{" OOO_STRING_SVTOOLS_RTF_SHP );
- m_rExport.Strm().WriteCharPtr( "{" OOO_STRING_SVTOOLS_RTF_IGNORE OOO_STRING_SVTOOLS_RTF_SHPINST );
+ m_rExport.Strm().WriteCharPtr("{" OOO_STRING_SVTOOLS_RTF_SHP);
+ m_rExport.Strm().WriteCharPtr("{" OOO_STRING_SVTOOLS_RTF_IGNORE OOO_STRING_SVTOOLS_RTF_SHPINST);
- // Shape properties.
- m_aFlyProperties.push_back(std::make_pair<OString, OString>("shapeType", OString::number(ESCHER_ShpInst_TextBox)));
+ // Shape properties.
+ m_aFlyProperties.push_back(std::make_pair<OString, OString>("shapeType", OString::number(ESCHER_ShpInst_TextBox)));
- // When a frame has some low height, but automatically expanded due
- // to lots of contents, this size contains the real size.
- const Size aSize = rFrame.GetSize();
- m_pFlyFrameSize = &aSize;
+ // When a frame has some low height, but automatically expanded due
+ // to lots of contents, this size contains the real size.
+ const Size aSize = rFrame.GetSize();
+ m_pFlyFrameSize = &aSize;
- m_rExport.bOutFlyFrmAttrs = m_rExport.bRTFFlySyntax = true;
- m_rExport.OutputFormat( rFrame.GetFrmFmt(), false, false, true );
- m_rExport.Strm().WriteCharPtr( m_aRunText.makeStringAndClear().getStr() );
- m_rExport.Strm().WriteCharPtr( m_aStyles.makeStringAndClear().getStr() );
- m_rExport.bOutFlyFrmAttrs = m_rExport.bRTFFlySyntax = false;
- m_pFlyFrameSize = 0;
+ m_rExport.bOutFlyFrmAttrs = m_rExport.bRTFFlySyntax = true;
+ m_rExport.OutputFormat(rFrame.GetFrmFmt(), false, false, true);
+ m_rExport.Strm().WriteCharPtr(m_aRunText.makeStringAndClear().getStr());
+ m_rExport.Strm().WriteCharPtr(m_aStyles.makeStringAndClear().getStr());
+ m_rExport.bOutFlyFrmAttrs = m_rExport.bRTFFlySyntax = false;
+ m_pFlyFrameSize = 0;
- const SwFrmFmt& rFrmFmt = rFrame.GetFrmFmt();
- lcl_TextFrameShadow(m_aFlyProperties, rFrmFmt);
- lcl_TextFrameRelativeSize(m_aFlyProperties, rFrmFmt);
+ const SwFrmFmt& rFrmFmt = rFrame.GetFrmFmt();
+ lcl_TextFrameShadow(m_aFlyProperties, rFrmFmt);
+ lcl_TextFrameRelativeSize(m_aFlyProperties, rFrmFmt);
- for (size_t i = 0; i < m_aFlyProperties.size(); ++i)
- {
- m_rExport.Strm().WriteCharPtr( "{" OOO_STRING_SVTOOLS_RTF_SP "{" );
- m_rExport.Strm().WriteCharPtr( OOO_STRING_SVTOOLS_RTF_SN " " );
- m_rExport.Strm().WriteCharPtr( m_aFlyProperties[i].first.getStr() );
- m_rExport.Strm().WriteCharPtr( "}{" OOO_STRING_SVTOOLS_RTF_SV " " );
- m_rExport.Strm().WriteCharPtr( m_aFlyProperties[i].second.getStr() );
- m_rExport.Strm().WriteCharPtr( "}}" );
- }
- m_aFlyProperties.clear();
+ for (size_t i = 0; i < m_aFlyProperties.size(); ++i)
+ {
+ m_rExport.Strm().WriteCharPtr("{" OOO_STRING_SVTOOLS_RTF_SP "{");
+ m_rExport.Strm().WriteCharPtr(OOO_STRING_SVTOOLS_RTF_SN " ");
+ m_rExport.Strm().WriteCharPtr(m_aFlyProperties[i].first.getStr());
+ m_rExport.Strm().WriteCharPtr("}{" OOO_STRING_SVTOOLS_RTF_SV " ");
+ m_rExport.Strm().WriteCharPtr(m_aFlyProperties[i].second.getStr());
+ m_rExport.Strm().WriteCharPtr("}}");
+ }
+ m_aFlyProperties.clear();
- m_rExport.Strm().WriteCharPtr( "{" OOO_STRING_SVTOOLS_RTF_SHPTXT );
+ m_rExport.Strm().WriteCharPtr("{" OOO_STRING_SVTOOLS_RTF_SHPTXT);
- {
- // Save table state, in case the inner text also contains a table.
- ww8::WW8TableInfo::Pointer_t pTableInfoOrig = m_rExport.mpTableInfo;
- m_rExport.mpTableInfo = ww8::WW8TableInfo::Pointer_t(new ww8::WW8TableInfo());
- SwWriteTable* pTableWrt = m_pTableWrt;
- m_pTableWrt = 0;
- sal_uInt32 nTableDepth = m_nTableDepth;
-
- m_nTableDepth = 0;
- /*
- * Save m_aRun as we should not loose the opening brace.
- * OTOH, just drop the contents of m_aRunText in case something
- * would be there, causing a problem later.
- */
- OString aSave = m_aRun.makeStringAndClear();
- // Also back m_bInRun and m_bSingleEmptyRun up.
- bool bInRunOrig = m_bInRun;
- m_bInRun = false;
- bool bSingleEmptyRunOrig = m_bSingleEmptyRun;
- m_bSingleEmptyRun = false;
- m_rExport.bRTFFlySyntax = true;
-
- const SwNodeIndex* pNodeIndex = rFrmFmt.GetCntnt().GetCntntIdx();
- sal_uLong nStt = pNodeIndex ? pNodeIndex->GetIndex()+1 : 0;
- sal_uLong nEnd = pNodeIndex ? pNodeIndex->GetNode().EndOfSectionIndex() : 0;
- m_rExport.SaveData( nStt, nEnd );
- m_rExport.mpParentFrame = &rFrame;
- m_rExport.WriteText( );
- m_rExport.RestoreData();
-
- m_rExport.Strm().WriteCharPtr( OOO_STRING_SVTOOLS_RTF_PARD );
- m_rExport.bRTFFlySyntax = false;
- m_aRun->append(aSave);
- m_aRunText.clear();
- m_bInRun = bInRunOrig;
- m_bSingleEmptyRun = bSingleEmptyRunOrig;
-
- // Restore table state.
- m_rExport.mpTableInfo = pTableInfoOrig;
- delete m_pTableWrt;
- m_pTableWrt = pTableWrt;
- m_nTableDepth = nTableDepth;
- }
+ {
+ // Save table state, in case the inner text also contains a table.
+ ww8::WW8TableInfo::Pointer_t pTableInfoOrig = m_rExport.mpTableInfo;
+ m_rExport.mpTableInfo = ww8::WW8TableInfo::Pointer_t(new ww8::WW8TableInfo());
+ SwWriteTable* pTableWrt = m_pTableWrt;
+ m_pTableWrt = 0;
+ sal_uInt32 nTableDepth = m_nTableDepth;
+
+ m_nTableDepth = 0;
+ /*
+ * Save m_aRun as we should not loose the opening brace.
+ * OTOH, just drop the contents of m_aRunText in case something
+ * would be there, causing a problem later.
+ */
+ OString aSave = m_aRun.makeStringAndClear();
+ // Also back m_bInRun and m_bSingleEmptyRun up.
+ bool bInRunOrig = m_bInRun;
+ m_bInRun = false;
+ bool bSingleEmptyRunOrig = m_bSingleEmptyRun;
+ m_bSingleEmptyRun = false;
+ m_rExport.bRTFFlySyntax = true;
+
+ const SwNodeIndex* pNodeIndex = rFrmFmt.GetCntnt().GetCntntIdx();
+ sal_uLong nStt = pNodeIndex ? pNodeIndex->GetIndex()+1 : 0;
+ sal_uLong nEnd = pNodeIndex ? pNodeIndex->GetNode().EndOfSectionIndex() : 0;
+ m_rExport.SaveData(nStt, nEnd);
+ m_rExport.mpParentFrame = &rFrame;
+ m_rExport.WriteText();
+ m_rExport.RestoreData();
+
+ m_rExport.Strm().WriteCharPtr(OOO_STRING_SVTOOLS_RTF_PARD);
+ m_rExport.bRTFFlySyntax = false;
+ m_aRun->append(aSave);
+ m_aRunText.clear();
+ m_bInRun = bInRunOrig;
+ m_bSingleEmptyRun = bSingleEmptyRunOrig;
+
+ // Restore table state.
+ m_rExport.mpTableInfo = pTableInfoOrig;
+ delete m_pTableWrt;
+ m_pTableWrt = pTableWrt;
+ m_nTableDepth = nTableDepth;
+ }
- m_rExport.mpParentFrame = NULL;
+ m_rExport.mpParentFrame = NULL;
- m_rExport.Strm().WriteChar( '}' ); // shptxt
- m_rExport.Strm().WriteChar( '}' ); // shpinst
- m_rExport.Strm().WriteChar( '}' ); // shp
+ m_rExport.Strm().WriteChar('}'); // shptxt
+ m_rExport.Strm().WriteChar('}'); // shpinst
+ m_rExport.Strm().WriteChar('}'); // shp
- m_rExport.Strm().WriteCharPtr( SAL_NEWLINE_STRING );
- }
- break;
- case sw::Frame::eGraphic:
- if (!rFrame.IsInline())
- {
- m_rExport.mpParentFrame = &rFrame;
- m_rExport.bRTFFlySyntax = true;
- m_rExport.OutputFormat( rFrame.GetFrmFmt(), false, false, true );
- m_rExport.bRTFFlySyntax = false;
- m_aRunText->append("{" OOO_STRING_SVTOOLS_RTF_IGNORE);
- m_rExport.OutputFormat( rFrame.GetFrmFmt(), false, false, true );
- m_aRunText->append('}');
- m_rExport.mpParentFrame = NULL;
- }
+ m_rExport.Strm().WriteCharPtr(SAL_NEWLINE_STRING);
+ }
+ break;
+ case sw::Frame::eGraphic:
+ if (!rFrame.IsInline())
+ {
+ m_rExport.mpParentFrame = &rFrame;
+ m_rExport.bRTFFlySyntax = true;
+ m_rExport.OutputFormat(rFrame.GetFrmFmt(), false, false, true);
+ m_rExport.bRTFFlySyntax = false;
+ m_aRunText->append("{" OOO_STRING_SVTOOLS_RTF_IGNORE);
+ m_rExport.OutputFormat(rFrame.GetFrmFmt(), false, false, true);
+ m_aRunText->append('}');
+ m_rExport.mpParentFrame = NULL;
+ }
- if ( pGrfNode )
- m_aRunText.append(dynamic_cast<const SwFlyFrmFmt*>( &rFrame.GetFrmFmt() ), pGrfNode);
- break;
- case sw::Frame::eDrawing:
+ if (pGrfNode)
+ m_aRunText.append(dynamic_cast<const SwFlyFrmFmt*>(&rFrame.GetFrmFmt()), pGrfNode);
+ break;
+ case sw::Frame::eDrawing:
+ {
+ const SdrObject* pSdrObj = rFrame.GetFrmFmt().FindRealSdrObject();
+ if (pSdrObj)
+ {
+ bool bSwapInPage = false;
+ if (!pSdrObj->GetPage())
{
- const SdrObject* pSdrObj = rFrame.GetFrmFmt().FindRealSdrObject();
- if ( pSdrObj )
+ if (SdrModel* pModel = m_rExport.pDoc->GetDrawModel())
{
- bool bSwapInPage = false;
- if ( !pSdrObj->GetPage() )
+ if (SdrPage* pPage = pModel->GetPage(0))
{
- if ( SdrModel* pModel = m_rExport.pDoc->GetDrawModel() )
- {
- if ( SdrPage *pPage = pModel->GetPage( 0 ) )
- {
- bSwapInPage = true;
- const_cast< SdrObject* >( pSdrObj )->SetPage( pPage );
- }
- }
+ bSwapInPage = true;
+ const_cast< SdrObject* >(pSdrObj)->SetPage(pPage);
}
+ }
+ }
- m_aRunText->append("{" OOO_STRING_SVTOOLS_RTF_FIELD "{");
- m_aRunText->append(OOO_STRING_SVTOOLS_RTF_IGNORE);
- m_aRunText->append(OOO_STRING_SVTOOLS_RTF_FLDINST);
- m_aRunText->append(" SHAPE ");
- m_aRunText->append("}" "{" OOO_STRING_SVTOOLS_RTF_FLDRSLT);
+ m_aRunText->append("{" OOO_STRING_SVTOOLS_RTF_FIELD "{");
+ m_aRunText->append(OOO_STRING_SVTOOLS_RTF_IGNORE);
+ m_aRunText->append(OOO_STRING_SVTOOLS_RTF_FLDINST);
+ m_aRunText->append(" SHAPE ");
+ m_aRunText->append("}" "{" OOO_STRING_SVTOOLS_RTF_FLDRSLT);
- m_rExport.SdrExporter().AddSdrObject( *pSdrObj );
+ m_rExport.SdrExporter().AddSdrObject(*pSdrObj);
- m_aRunText->append('}');
- m_aRunText->append('}');
+ m_aRunText->append('}');
+ m_aRunText->append('}');
- if ( bSwapInPage )
- const_cast< SdrObject* >( pSdrObj )->SetPage( 0 );
- }
- }
- break;
- case sw::Frame::eFormControl:
- {
- const SwFrmFmt &rFrmFmt = rFrame.GetFrmFmt();
- const SdrObject *pObject = rFrmFmt.FindRealSdrObject();
+ if (bSwapInPage)
+ const_cast< SdrObject* >(pSdrObj)->SetPage(0);
+ }
+ }
+ break;
+ case sw::Frame::eFormControl:
+ {
+ const SwFrmFmt& rFrmFmt = rFrame.GetFrmFmt();
+ const SdrObject* pObject = rFrmFmt.FindRealSdrObject();
- m_aRun->append("{" OOO_STRING_SVTOOLS_RTF_FIELD);
- m_aRun->append("{" OOO_STRING_SVTOOLS_RTF_IGNORE OOO_STRING_SVTOOLS_RTF_FLDINST);
+ m_aRun->append("{" OOO_STRING_SVTOOLS_RTF_FIELD);
+ m_aRun->append("{" OOO_STRING_SVTOOLS_RTF_IGNORE OOO_STRING_SVTOOLS_RTF_FLDINST);
- if (pObject && pObject->GetObjInventor() == FmFormInventor)
+ if (pObject && pObject->GetObjInventor() == FmFormInventor)
+ {
+ if (SdrUnoObj* pFormObj = PTR_CAST(SdrUnoObj,pObject))
+ {
+ uno::Reference< awt::XControlModel > xControlModel =
+ pFormObj->GetUnoControlModel();
+ uno::Reference< lang::XServiceInfo > xInfo(xControlModel, uno::UNO_QUERY);
+ uno::Reference<beans::XPropertySet> xPropSet(xControlModel, uno::UNO_QUERY);
+ uno::Reference<beans::XPropertySetInfo> xPropSetInfo = xPropSet->getPropertySetInfo();
+ OUString sName;
+ if (xInfo->supportsService("com.sun.star.form.component.CheckBox"))
{
- if (SdrUnoObj *pFormObj = PTR_CAST(SdrUnoObj,pObject))
+
+ m_aRun->append(OUStringToOString(OUString(FieldString(ww::eFORMCHECKBOX)), m_rExport.eCurrentEncoding));
+ m_aRun->append("{" OOO_STRING_SVTOOLS_RTF_IGNORE OOO_STRING_SVTOOLS_RTF_FORMFIELD "{");
+ m_aRun->append(OOO_STRING_SVTOOLS_RTF_FFTYPE "1"); // 1 = checkbox
+ // checkbox size in half points, this seems to be always 20, see WW8Export::DoCheckBox()
+ m_aRun->append(OOO_STRING_SVTOOLS_RTF_FFHPS "20");
+
+ OUString aStr;
+ sName = "Name";
+ if (xPropSetInfo->hasPropertyByName(sName))
+ {
+ xPropSet->getPropertyValue(sName) >>= aStr;
+ m_aRun->append("{" OOO_STRING_SVTOOLS_RTF_IGNORE OOO_STRING_SVTOOLS_RTF_FFNAME " ");
+ m_aRun->append(OUStringToOString(aStr, m_rExport.eCurrentEncoding));
+ m_aRun->append('}');
+ }
+
+ sName = "HelpText";
+ if (xPropSetInfo->hasPropertyByName(sName))
+ {
+ xPropSet->getPropertyValue(sName) >>= aStr;
+ m_aRun->append(OOO_STRING_SVTOOLS_RTF_FFOWNHELP);
+ m_aRun->append("{" OOO_STRING_SVTOOLS_RTF_IGNORE OOO_STRING_SVTOOLS_RTF_FFHELPTEXT " ");
+ m_aRun->append(OUStringToOString(aStr, m_rExport.eCurrentEncoding));
+ m_aRun->append('}');
+ }
+
+ sName = "HelpF1Text";
+ if (xPropSetInfo->hasPropertyByName(sName))
{
- uno::Reference< awt::XControlModel > xControlModel =
- pFormObj->GetUnoControlModel();
- uno::Reference< lang::XServiceInfo > xInfo(xControlModel, uno::UNO_QUERY);
- uno::Reference<beans::XPropertySet> xPropSet(xControlModel, uno::UNO_QUERY);
- uno::Reference<beans::XPropertySetInfo> xPropSetInfo = xPropSet->getPropertySetInfo();
- OUString sName;
- if (xInfo->supportsService("com.sun.star.form.component.CheckBox"))
- {
-
- m_aRun->append(OUStringToOString(OUString(FieldString(ww::eFORMCHECKBOX)), m_rExport.eCurrentEncoding));
- m_aRun->append("{" OOO_STRING_SVTOOLS_RTF_IGNORE OOO_STRING_SVTOOLS_RTF_FORMFIELD "{");
- m_aRun->append(OOO_STRING_SVTOOLS_RTF_FFTYPE "1"); // 1 = checkbox
- // checkbox size in half points, this seems to be always 20, see WW8Export::DoCheckBox()
- m_aRun->append(OOO_STRING_SVTOOLS_RTF_FFHPS "20");
-
- OUString aStr;
- sName = "Name";
- if (xPropSetInfo->hasPropertyByName(sName))
- {
- xPropSet->getPropertyValue(sName) >>= aStr;
- m_aRun->append("{" OOO_STRING_SVTOOLS_RTF_IGNORE OOO_STRING_SVTOOLS_RTF_FFNAME " ");
- m_aRun->append(OUStringToOString(aStr, m_rExport.eCurrentEncoding));
- m_aRun->append('}');
- }
-
- sName = "HelpText";
- if (xPropSetInfo->hasPropertyByName(sName))
- {
- xPropSet->getPropertyValue(sName) >>= aStr;
- m_aRun->append(OOO_STRING_SVTOOLS_RTF_FFOWNHELP);
- m_aRun->append("{" OOO_STRING_SVTOOLS_RTF_IGNORE OOO_STRING_SVTOOLS_RTF_FFHELPTEXT " ");
- m_aRun->append(OUStringToOString(aStr, m_rExport.eCurrentEncoding));
- m_aRun->append('}');
- }
-
- sName = "HelpF1Text";
- if (xPropSetInfo->hasPropertyByName(sName))
- {
- xPropSet->getPropertyValue(sName) >>= aStr;
- m_aRun->append(OOO_STRING_SVTOOLS_RTF_FFOWNSTAT);
- m_aRun->append("{" OOO_STRING_SVTOOLS_RTF_IGNORE OOO_STRING_SVTOOLS_RTF_FFSTATTEXT " ");
- m_aRun->append(OUStringToOString(aStr, m_rExport.eCurrentEncoding));
- m_aRun->append('}');
- }
-
- sal_Int16 nTemp = 0;
- xPropSet->getPropertyValue("DefaultState") >>= nTemp;
- m_aRun->append(OOO_STRING_SVTOOLS_RTF_FFDEFRES);
- m_aRun->append((sal_Int32)nTemp);
- xPropSet->getPropertyValue("State") >>= nTemp;
- m_aRun->append(OOO_STRING_SVTOOLS_RTF_FFRES);
- m_aRun->append((sal_Int32)nTemp);
-
- m_aRun->append("}}");
-
- // field result is empty, ffres already contains the form result
- m_aRun->append("}{" OOO_STRING_SVTOOLS_RTF_FLDRSLT " ");
- }
- else if (xInfo->supportsService("com.sun.star.form.component.TextField"))
- {
- OStringBuffer aBuf;
- OString aStr;
- OUString aTmp;
- const sal_Char* pStr;
-
- m_aRun->append(OUStringToOString(OUString(FieldString(ww::eFORMTEXT)), m_rExport.eCurrentEncoding));
- m_aRun->append("{" OOO_STRING_SVTOOLS_RTF_IGNORE OOO_STRING_SVTOOLS_RTF_DATAFIELD " ");
- for (int i = 0; i < 8; i++) aBuf.append((sal_Char)0x00);
- xPropSet->getPropertyValue("Name") >>= aTmp;
- aStr = OUStringToOString(aTmp, m_rExport.eCurrentEncoding);
- aBuf.append((sal_Char)aStr.getLength());
- aBuf.append(aStr);
- aBuf.append((sal_Char)0x00);
- xPropSet->getPropertyValue("DefaultText") >>= aTmp;
- aStr = OUStringToOString(aTmp, m_rExport.eCurrentEncoding);
- aBuf.append((sal_Char)aStr.getLength());
- aBuf.append(aStr);
- for (int i = 0; i < 11; i++) aBuf.append((sal_Char)0x00);
- aStr = aBuf.makeStringAndClear();
- pStr = aStr.getStr();
- for (int i = 0; i < aStr.getLength(); i++, pStr++)
- m_aRun->append(msfilter::rtfutil::OutHex(*pStr, 2));
- m_aRun->append('}');
- m_aRun->append("}{" OOO_STRING_SVTOOLS_RTF_FLDRSLT " ");
- xPropSet->getPropertyValue("Text") >>= aTmp;
- m_aRun->append(OUStringToOString(aTmp, m_rExport.eCurrentEncoding));
- m_aRun->append('}');
- m_aRun->append("{" OOO_STRING_SVTOOLS_RTF_IGNORE OOO_STRING_SVTOOLS_RTF_FORMFIELD "{");
- sName = "HelpText";
- if (xPropSetInfo->hasPropertyByName(sName))
- {
- xPropSet->getPropertyValue(sName) >>= aTmp;
- m_aRun->append(OOO_STRING_SVTOOLS_RTF_FFOWNHELP);
- m_aRun->append("{" OOO_STRING_SVTOOLS_RTF_IGNORE OOO_STRING_SVTOOLS_RTF_FFHELPTEXT " ");
- m_aRun->append(OUStringToOString(aTmp, m_rExport.eCurrentEncoding));
- m_aRun->append('}');
- }
-
- sName = "HelpF1Text";
- if (xPropSetInfo->hasPropertyByName(sName))
- {
- xPropSet->getPropertyValue(sName) >>= aTmp;
- m_aRun->append(OOO_STRING_SVTOOLS_RTF_FFOWNSTAT);
- m_aRun->append("{" OOO_STRING_SVTOOLS_RTF_IGNORE OOO_STRING_SVTOOLS_RTF_FFSTATTEXT " ");
- m_aRun->append(OUStringToOString(aTmp, m_rExport.eCurrentEncoding));
- m_aRun->append('}');
- }
- m_aRun->append("}");
- }
- else if (xInfo->supportsService("com.sun.star.form.component.ListBox"))
- {
- OUString aStr;
- uno::Sequence<sal_Int16> aIntSeq;
- uno::Sequence<OUString> aStrSeq;
-
- m_aRun->append(OUStringToOString(OUString(FieldString(ww::eFORMDROPDOWN)), m_rExport.eCurrentEncoding));
- m_aRun->append("{" OOO_STRING_SVTOOLS_RTF_IGNORE OOO_STRING_SVTOOLS_RTF_FORMFIELD "{");
- m_aRun->append(OOO_STRING_SVTOOLS_RTF_FFTYPE "2"); // 2 = list
- m_aRun->append(OOO_STRING_SVTOOLS_RTF_FFHASLISTBOX);
-
- xPropSet->getPropertyValue("DefaultSelection") >>= aIntSeq;
- if( aIntSeq.getLength() )
- {
- m_aRun->append(OOO_STRING_SVTOOLS_RTF_FFDEFRES);
- // a dropdown list can have only one 'selected item by default'
- m_aRun->append((sal_Int32)aIntSeq[0]);
- }
-
- xPropSet->getPropertyValue("SelectedItems") >>= aIntSeq;
- if( aIntSeq.getLength() )
- {
- m_aRun->append(OOO_STRING_SVTOOLS_RTF_FFRES);
- // a dropdown list can have only one 'currently selected item'
- m_aRun->append((sal_Int32)aIntSeq[0]);
- }
-
- sName = "Name";
- if (xPropSetInfo->hasPropertyByName(sName))
- {
- xPropSet->getPropertyValue(sName) >>= aStr;
- m_aRun->append("{" OOO_STRING_SVTOOLS_RTF_IGNORE OOO_STRING_SVTOOLS_RTF_FFNAME " ");
- m_aRun->append(OUStringToOString(aStr, m_rExport.eCurrentEncoding));
- m_aRun->append('}');
- }
-
- sName = "HelpText";
- if (xPropSetInfo->hasPropertyByName(sName))
- {
- xPropSet->getPropertyValue(sName) >>= aStr;
- m_aRun->append(OOO_STRING_SVTOOLS_RTF_FFOWNHELP);
- m_aRun->append("{" OOO_STRING_SVTOOLS_RTF_IGNORE OOO_STRING_SVTOOLS_RTF_FFHELPTEXT " ");
- m_aRun->append(OUStringToOString(aStr, m_rExport.eCurrentEncoding));
- m_aRun->append('}');
- }
-
... etc. - the rest is truncated
More information about the Libreoffice-commits
mailing list