summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2014-06-14 11:24:39 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2014-06-14 11:38:32 +0200
commitb577c99adca2e4c2f506cb9107a6d4489f5a2744 (patch)
tree5b80ba9e195f360c6ea09bb77da306d4c139ee75
parent57b563273351c5d3eb176ba8768b173853b7e362 (diff)
sw, writerfilter: identation fixes
Change-Id: I1f1db08447006515e7e6842792241aca992984c0
-rw-r--r--sw/qa/extras/rtfexport/rtfexport.cxx4
-rw-r--r--sw/qa/extras/rtfimport/rtfimport.cxx9
-rw-r--r--sw/source/core/doc/textboxhelper.cxx20
-rw-r--r--sw/source/filter/ww8/rtfattributeoutput.cxx5
-rw-r--r--writerfilter/source/dmapper/SdtHelper.hxx5
-rw-r--r--writerfilter/source/rtftok/rtfdocumentimpl.cxx20
-rw-r--r--writerfilter/source/rtftok/rtfdocumentimpl.hxx5
-rw-r--r--writerfilter/source/rtftok/rtflookahead.hxx5
-rw-r--r--writerfilter/source/rtftok/rtfsdrimport.cxx19
-rw-r--r--writerfilter/source/rtftok/rtfsdrimport.hxx4
-rw-r--r--writerfilter/source/rtftok/rtftokenizer.hxx10
11 files changed, 61 insertions, 45 deletions
diff --git a/sw/qa/extras/rtfexport/rtfexport.cxx b/sw/qa/extras/rtfexport/rtfexport.cxx
index 0c78227aaca8..71113f1ae46a 100644
--- a/sw/qa/extras/rtfexport/rtfexport.cxx
+++ b/sw/qa/extras/rtfexport/rtfexport.cxx
@@ -320,8 +320,8 @@ DECLARE_RTFEXPORT_TEST(testMathRuns, "math-runs.rtf")
DECLARE_RTFEXPORT_TEST(testFdo77979, "fdo77979.odt")
{
// font name is encoded with \fcharset of font
- CPPUNIT_ASSERT_EQUAL(OUString("\xE5\xBE\xAE\xE8\xBD\xAF\xE9\x9B\x85\xE9\xBB\x91", 12, RTL_TEXTENCODING_UTF8),
- getProperty<OUString>(getRun(getParagraph(1), 1), "CharFontName"));
+ OUString aExpected("\xE5\xBE\xAE\xE8\xBD\xAF\xE9\x9B\x85\xE9\xBB\x91", 12, RTL_TEXTENCODING_UTF8);
+ CPPUNIT_ASSERT_EQUAL(aExpected, getProperty<OUString>(getRun(getParagraph(1), 1), "CharFontName"));
}
DECLARE_RTFEXPORT_TEST(testFdo53113, "fdo53113.odt")
diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx b/sw/qa/extras/rtfimport/rtfimport.cxx
index 89366d03b347..2eba05aa0861 100644
--- a/sw/qa/extras/rtfimport/rtfimport.cxx
+++ b/sw/qa/extras/rtfimport/rtfimport.cxx
@@ -578,10 +578,15 @@ DECLARE_RTFIMPORT_TEST(testFdo76633, "fdo76633.rtf")
uno::Reference<lang::XServiceInfo> xShape(getShape(1), uno::UNO_QUERY);
CPPUNIT_ASSERT(xShape.is());
CPPUNIT_ASSERT(xShape->supportsService("com.sun.star.text.TextGraphicObject"));
- try {
+ try
+ {
uno::Reference<drawing::XShape> xShape2(getShape(2), uno::UNO_QUERY);
CPPUNIT_FAIL("exception expected");
- } catch (lang::IndexOutOfBoundsException const&) { /* expected */ }
+ }
+ catch (lang::IndexOutOfBoundsException const&)
+ {
+ /* expected */
+ }
}
DECLARE_RTFIMPORT_TEST(testFdo48033, "fdo48033.rtf")
diff --git a/sw/source/core/doc/textboxhelper.cxx b/sw/source/core/doc/textboxhelper.cxx
index c7fbb8d0625e..39e9828c8e57 100644
--- a/sw/source/core/doc/textboxhelper.cxx
+++ b/sw/source/core/doc/textboxhelper.cxx
@@ -371,18 +371,18 @@ void SwTextBoxHelper::syncProperty(SwFrmFmt* pShape, sal_uInt16 nWID, sal_uInt8
}
break;
case FN_TEXT_RANGE:
+ {
+ uno::Reference<text::XTextRange> xRange;
+ rValue >>= xRange;
+ SwUnoInternalPaM aInternalPaM(*pFmt->GetDoc());
+ if (sw::XTextRangeToSwPaM(aInternalPaM, xRange))
{
- uno::Reference<text::XTextRange> xRange;
- rValue >>= xRange;
- SwUnoInternalPaM aInternalPaM(*pFmt->GetDoc());
- if (sw::XTextRangeToSwPaM(aInternalPaM, xRange))
- {
- SwFmtAnchor aAnchor(pFmt->GetAnchor());
- aAnchor.SetAnchor(aInternalPaM.Start());
- pFmt->SetFmtAttr(aAnchor);
- }
+ SwFmtAnchor aAnchor(pFmt->GetAnchor());
+ aAnchor.SetAnchor(aInternalPaM.Start());
+ pFmt->SetFmtAttr(aAnchor);
}
- break;
+ }
+ break;
case RES_CHAIN:
switch (nMemberId)
{
diff --git a/sw/source/filter/ww8/rtfattributeoutput.cxx b/sw/source/filter/ww8/rtfattributeoutput.cxx
index 162b6cc9fc53..0020e0504707 100644
--- a/sw/source/filter/ww8/rtfattributeoutput.cxx
+++ b/sw/source/filter/ww8/rtfattributeoutput.cxx
@@ -2076,9 +2076,8 @@ void RtfAttributeOutput::CharFont(const SvxFontItem& rFont)
// FIXME: this may be a tad expensive... but the charset needs to be
// consistent with what wwFont::WriteRtf() does
FontMapExport aTmp(rFont.GetFamilyName());
- m_rExport.eCurrentEncoding = rtl_getTextEncodingFromWindowsCharset(
- sw::ms::rtl_TextEncodingToWinCharsetRTF(
- aTmp.msPrimary, aTmp.msSecondary, rFont.GetCharSet()));
+ sal_uInt8 nWindowsCharset = sw::ms::rtl_TextEncodingToWinCharsetRTF(aTmp.msPrimary, aTmp.msSecondary, rFont.GetCharSet());
+ m_rExport.eCurrentEncoding = rtl_getTextEncodingFromWindowsCharset(nWindowsCharset);
if (m_rExport.eCurrentEncoding == RTL_TEXTENCODING_DONTKNOW)
m_rExport.eCurrentEncoding = m_rExport.eDefaultEncoding;
}
diff --git a/writerfilter/source/dmapper/SdtHelper.hxx b/writerfilter/source/dmapper/SdtHelper.hxx
index 9472c714d845..b9d9cdf2462a 100644
--- a/writerfilter/source/dmapper/SdtHelper.hxx
+++ b/writerfilter/source/dmapper/SdtHelper.hxx
@@ -75,7 +75,10 @@ public:
OUStringBuffer& getDateFormat();
OUStringBuffer& getLocale();
/// If createControlShape() was ever called.
- bool hasElements() { return m_bHasElements;}
+ bool hasElements()
+ {
+ return m_bHasElements;
+ }
/// Create drop-down control from w:sdt's w:dropDownList.
void createDropDownControl();
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index 5f6743277c31..d8ccd492ed82 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -780,14 +780,11 @@ int RTFDocumentImpl::resolvePict(bool bInline)
else
{
if (m_xModelFactory.is())
- xShape.set(m_xModelFactory->createInstance(
- "com.sun.star.drawing.GraphicObjectShape"), uno::UNO_QUERY);
- uno::Reference<drawing::XDrawPageSupplier> const xDrawSupplier(
- m_xDstDoc, uno::UNO_QUERY);
+ xShape.set(m_xModelFactory->createInstance("com.sun.star.drawing.GraphicObjectShape"), uno::UNO_QUERY);
+ uno::Reference<drawing::XDrawPageSupplier> const xDrawSupplier(m_xDstDoc, uno::UNO_QUERY);
if (xDrawSupplier.is())
{
- uno::Reference<drawing::XShapes> xShapes(
- xDrawSupplier->getDrawPage(), uno::UNO_QUERY);
+ uno::Reference<drawing::XShapes> xShapes(xDrawSupplier->getDrawPage(), uno::UNO_QUERY);
if (xShapes.is())
xShapes->add(xShape);
}
@@ -1427,8 +1424,7 @@ void RTFDocumentImpl::replayBuffer(RTFBuffer_t& rBuffer,
else if (boost::get<0>(aTuple) == BUFFER_PAR)
parBreak();
else if (boost::get<0>(aTuple) == BUFFER_STARTSHAPE)
- m_pSdrImport->resolve(boost::get<1>(aTuple)->getShape(), false,
- RTFSdrImport::SHAPE);
+ m_pSdrImport->resolve(boost::get<1>(aTuple)->getShape(), false, RTFSdrImport::SHAPE);
else if (boost::get<0>(aTuple) == BUFFER_ENDSHAPE)
m_pSdrImport->close();
else
@@ -1714,8 +1710,7 @@ int RTFDocumentImpl::dispatchDestination(RTFKeyword nKeyword)
if (nKeyword == RTF_SHPTXT)
{
if (!m_aStates.top().pCurrentBuffer)
- m_pSdrImport->resolve(m_aStates.top().aShape, false,
- RTFSdrImport::SHAPE);
+ m_pSdrImport->resolve(m_aStates.top().aShape, false, RTFSdrImport::SHAPE);
else
{
RTFValue::Pointer_t pValue(new RTFValue(m_aStates.top().aShape));
@@ -4853,9 +4848,8 @@ int RTFDocumentImpl::popState()
// Don't trigger a shape import in case we're only leaving the \shpinst of the groupshape itself.
if (!m_bObject && !aState.bInListpicture && !aState.bHadShapeText && !(aState.bInShapeGroup && !aState.bInShape))
{
- m_pSdrImport->resolve(m_aStates.top().aShape, true,
- (aState.nDestinationState == DESTINATION_SHAPEINSTRUCTION)
- ? RTFSdrImport::SHAPE : RTFSdrImport::PICT);
+ RTFSdrImport::ShapeOrPict eType = (aState.nDestinationState == DESTINATION_SHAPEINSTRUCTION) ? RTFSdrImport::SHAPE : RTFSdrImport::PICT;
+ m_pSdrImport->resolve(m_aStates.top().aShape, true, eType);
}
else if (aState.bInShapeGroup && !aState.bInShape)
{
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.hxx b/writerfilter/source/rtftok/rtfdocumentimpl.hxx
index 2f73a8fa288d..d4007421c621 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.hxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.hxx
@@ -361,7 +361,10 @@ public:
/// If this is the first run of the document, starts the initial paragraph.
void checkFirstRun();
/// If the initial paragraph is started.
- bool getFirstRun() { return m_bFirstRun;}
+ bool getFirstRun()
+ {
+ return m_bFirstRun;
+ }
/// If we need to add a dummy paragraph before a section break.
void setNeedPar(bool bNeedPar);
/// Return the dmapper index of an RTF index for fonts.
diff --git a/writerfilter/source/rtftok/rtflookahead.hxx b/writerfilter/source/rtftok/rtflookahead.hxx
index 682878cba506..2f5fed1bcab8 100644
--- a/writerfilter/source/rtftok/rtflookahead.hxx
+++ b/writerfilter/source/rtftok/rtflookahead.hxx
@@ -44,7 +44,10 @@ public:
virtual void setSkipUnknown(bool bSkipUnknown) SAL_OVERRIDE;
virtual void finishSubstream() SAL_OVERRIDE;
virtual bool isSubstream() const SAL_OVERRIDE;
- bool hasTable() { return m_bHasTable;}
+ bool hasTable()
+ {
+ return m_bHasTable;
+ }
private:
boost::shared_ptr<RTFTokenizer> m_pTokenizer;
SvStream& m_rStream;
diff --git a/writerfilter/source/rtftok/rtfsdrimport.cxx b/writerfilter/source/rtftok/rtfsdrimport.cxx
index a47731d9c7a0..05c4e12a95c0 100644
--- a/writerfilter/source/rtftok/rtfsdrimport.cxx
+++ b/writerfilter/source/rtftok/rtfsdrimport.cxx
@@ -215,8 +215,7 @@ void RTFSdrImport::applyProperty(uno::Reference<drawing::XShape> xShape, const O
}
}
-void RTFSdrImport::resolve(RTFShape& rShape, bool bClose,
- ShapeOrPict const shapeOrPict)
+void RTFSdrImport::resolve(RTFShape& rShape, bool bClose, ShapeOrPict const shapeOrPict)
{
int nType = -1;
bool bPib = false;
@@ -253,13 +252,15 @@ void RTFSdrImport::resolve(RTFShape& rShape, bool bClose,
sal_Int16 nRelativeWidthRelation = text::RelOrientation::PAGE_FRAME;
sal_Int16 nRelativeHeightRelation = text::RelOrientation::PAGE_FRAME;
- // The spec doesn't state what is the default for shapeType, Word seems to implement it as a rectangle.
- if (SHAPE == shapeOrPict &&
- std::find_if(rShape.aProperties.begin(),
- rShape.aProperties.end(),
- boost::bind(&OUString::equals, boost::bind(&std::pair<OUString, OUString>::first, _1), OUString("shapeType")))
- == rShape.aProperties.end())
- rShape.aProperties.insert(rShape.aProperties.begin(), std::pair<OUString, OUString>("shapeType", OUString::number(ESCHER_ShpInst_Rectangle)));
+ if (SHAPE == shapeOrPict)
+ {
+ // The spec doesn't state what is the default for shapeType, Word seems to implement it as a rectangle.
+ if (std::find_if(rShape.aProperties.begin(),
+ rShape.aProperties.end(),
+ boost::bind(&OUString::equals, boost::bind(&std::pair<OUString, OUString>::first, _1), OUString("shapeType")))
+ == rShape.aProperties.end())
+ rShape.aProperties.insert(rShape.aProperties.begin(), std::pair<OUString, OUString>("shapeType", OUString::number(ESCHER_ShpInst_Rectangle)));
+ }
for (std::vector< std::pair<OUString, OUString> >::iterator i = rShape.aProperties.begin();
i != rShape.aProperties.end(); ++i)
diff --git a/writerfilter/source/rtftok/rtfsdrimport.hxx b/writerfilter/source/rtftok/rtfsdrimport.hxx
index 0b6958993bb2..5cf8fa4dff60 100644
--- a/writerfilter/source/rtftok/rtfsdrimport.hxx
+++ b/writerfilter/source/rtftok/rtfsdrimport.hxx
@@ -44,7 +44,9 @@ public:
/// Pop the current group shape from the parent stack.
void popParent();
css::uno::Reference<css::drawing::XShape> const& getCurrentShape()
- { return m_xShape; }
+ {
+ return m_xShape;
+ }
private:
void createShape(const OUString& aService, css::uno::Reference<css::drawing::XShape>& xShape, css::uno::Reference<css::beans::XPropertySet>& xPropertySet);
void applyProperty(css::uno::Reference<css::drawing::XShape> xShape, const OUString& aKey, const OUString& aValue);
diff --git a/writerfilter/source/rtftok/rtftokenizer.hxx b/writerfilter/source/rtftok/rtftokenizer.hxx
index 36be2b526854..b2ce73b77646 100644
--- a/writerfilter/source/rtftok/rtftokenizer.hxx
+++ b/writerfilter/source/rtftok/rtftokenizer.hxx
@@ -29,13 +29,19 @@ public:
int resolveParse();
int asHex(char ch);
/// Number of states on the stack.
- int getGroup() const { return m_nGroup;}
+ int getGroup() const
+ {
+ return m_nGroup;
+ }
/// To be invoked by the pushState() callback to signal when the importer enters a group.
void pushGroup();
/// To be invoked by the popState() callback to single when the importer leaves a group.
void popGroup();
OUString getPosition();
- sal_Size getGroupStart() { return m_nGroupStart;}
+ sal_Size getGroupStart()
+ {
+ return m_nGroupStart;
+ }
/// To look up additional properties of a math symbol.
static bool lookupMathKeyword(RTFMathSymbol& rSymbol);
private: