[Libreoffice-commits] core.git: sw/qa sw/source
Miklos Vajna
vmiklos at collabora.co.uk
Wed Sep 2 23:40:43 PDT 2015
sw/qa/extras/rtfexport/rtfexport.cxx | 4 -
sw/source/core/doc/docnum.cxx | 4 -
sw/source/core/text/itradj.cxx | 2
sw/source/filter/ww8/rtfattributeoutput.cxx | 100 ++++++++++++++--------------
4 files changed, 56 insertions(+), 54 deletions(-)
New commits:
commit 84945163ab6496d22ca814880cfd14ceb33c5f14
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date: Thu Sep 3 08:38:31 2015 +0200
sw: indentation fixes
Change-Id: Ic4cb73340b7c91198e982c2f7be030a4d6299d4e
diff --git a/sw/qa/extras/rtfexport/rtfexport.cxx b/sw/qa/extras/rtfexport/rtfexport.cxx
index 9f8818e..4abea40 100644
--- a/sw/qa/extras/rtfexport/rtfexport.cxx
+++ b/sw/qa/extras/rtfexport/rtfexport.cxx
@@ -355,8 +355,8 @@ DECLARE_RTFEXPORT_TEST(testTdf49073, "tdf49073.rtf")
sal_Unicode aRuby[3] = {0x304D,0x3082,0x3093};
OUString sRuby = OUString(aRuby, SAL_N_ELEMENTS(aRuby));
CPPUNIT_ASSERT_EQUAL(sRuby,getProperty<OUString>(getParagraph(1)->getStart(), "RubyText"));
- OUString sStyle = getProperty<OUString>( getParagraph(1)->getStart(), "RubyCharStyleName");
- uno::Reference<beans::XPropertySet> xPropertySet(getStyles("CharacterStyles")->getByName(sStyle), uno::UNO_QUERY );
+ OUString sStyle = getProperty<OUString>(getParagraph(1)->getStart(), "RubyCharStyleName");
+ uno::Reference<beans::XPropertySet> xPropertySet(getStyles("CharacterStyles")->getByName(sStyle), uno::UNO_QUERY);
CPPUNIT_ASSERT_EQUAL(5.f, getProperty<float>(xPropertySet, "CharHeight"));
CPPUNIT_ASSERT_EQUAL(sal_Int16(text::RubyAdjust_CENTER) ,getProperty<sal_Int16>(getParagraph(2)->getStart(),"RubyAdjust"));
CPPUNIT_ASSERT_EQUAL(sal_Int16(text::RubyAdjust_BLOCK) ,getProperty<sal_Int16>(getParagraph(3)->getStart(),"RubyAdjust"));
diff --git a/sw/source/core/doc/docnum.cxx b/sw/source/core/doc/docnum.cxx
index c45a7ef..787558f 100644
--- a/sw/source/core/doc/docnum.cxx
+++ b/sw/source/core/doc/docnum.cxx
@@ -1507,7 +1507,7 @@ static bool lcl_GotoNextPrevNum( SwPosition& rPos, bool bNext,
bool SwDoc::GotoNextNum( SwPosition& rPos, bool bOverUpper,
sal_uInt8* pUpper, sal_uInt8* pLower )
{
- return ::lcl_GotoNextPrevNum( rPos, true, bOverUpper, pUpper, pLower );
+ return ::lcl_GotoNextPrevNum( rPos, true, bOverUpper, pUpper, pLower );
}
const SwNumRule * SwDoc::SearchNumRule(const SwPosition & rPos,
@@ -1588,7 +1588,7 @@ const SwNumRule * SwDoc::SearchNumRule(const SwPosition & rPos,
bool SwDoc::GotoPrevNum( SwPosition& rPos, bool bOverUpper,
sal_uInt8* pUpper, sal_uInt8* pLower )
{
- return ::lcl_GotoNextPrevNum( rPos, false, bOverUpper, pUpper, pLower );
+ return ::lcl_GotoNextPrevNum( rPos, false, bOverUpper, pUpper, pLower );
}
bool SwDoc::NumUpDown( const SwPaM& rPam, bool bDown )
diff --git a/sw/source/core/text/itradj.cxx b/sw/source/core/text/itradj.cxx
index 0c78977..022d07a 100644
--- a/sw/source/core/text/itradj.cxx
+++ b/sw/source/core/text/itradj.cxx
@@ -241,7 +241,7 @@ static bool lcl_CheckKashidaWidth ( SwScriptInfo& rSI, SwTextSizeInfo& rInf, SwT
if ( !bAddSpaceChanged )
break; // everything was OK
}
- return true;
+ return true;
}
// CalcNewBlock() must only be called _after_ CalcLine()!
diff --git a/sw/source/filter/ww8/rtfattributeoutput.cxx b/sw/source/filter/ww8/rtfattributeoutput.cxx
index bebcd00..e8e2006 100644
--- a/sw/source/filter/ww8/rtfattributeoutput.cxx
+++ b/sw/source/filter/ww8/rtfattributeoutput.cxx
@@ -417,36 +417,36 @@ void RtfAttributeOutput::RawText(const OUString& rText, rtl_TextEncoding eCharSe
void RtfAttributeOutput::StartRuby(const SwTextNode& rNode, sal_Int32 /*nPos*/, const SwFormatRuby& rRuby)
{
- OUString aStr( FieldString( ww::eEQ ) );
+ OUString aStr(FieldString(ww::eEQ));
aStr += "\\* jc";
sal_Int32 nJC = 0;
sal_Char cDirective = 0;
- switch ( rRuby.GetAdjustment() )
+ switch (rRuby.GetAdjustment())
{
- case 0:
- nJC = 3;
- cDirective = 'l';
- break;
- case 1:
- //defaults to 0
- break;
- case 2:
- nJC = 4;
- cDirective = 'r';
- break;
- case 3:
- nJC = 1;
- cDirective = 'd';
- break;
- case 4:
- nJC = 2;
- cDirective = 'd';
- break;
- default:
- OSL_ENSURE( false,"Unhandled Ruby justication code" );
- break;
+ case 0:
+ nJC = 3;
+ cDirective = 'l';
+ break;
+ case 1:
+ //defaults to 0
+ break;
+ case 2:
+ nJC = 4;
+ cDirective = 'r';
+ break;
+ case 3:
+ nJC = 1;
+ cDirective = 'd';
+ break;
+ case 4:
+ nJC = 2;
+ cDirective = 'd';
+ break;
+ default:
+ OSL_ENSURE(false,"Unhandled Ruby justication code");
+ break;
}
- aStr += OUString::number( nJC );
+ aStr += OUString::number(nJC);
/*
MS needs to know the name and size of the font used in the ruby item,
@@ -456,8 +456,8 @@ void RtfAttributeOutput::StartRuby(const SwTextNode& rNode, sal_Int32 /*nPos*/,
defaulting to asian.
*/
sal_uInt16 nRubyScript;
- if( g_pBreakIt->GetBreakIter().is() )
- nRubyScript = g_pBreakIt->GetBreakIter()->getScriptType( rRuby.GetText(), 0);
+ if (g_pBreakIt->GetBreakIter().is())
+ nRubyScript = g_pBreakIt->GetBreakIter()->getScriptType(rRuby.GetText(), 0);
else
nRubyScript = i18n::ScriptType::ASIAN;
@@ -465,29 +465,29 @@ void RtfAttributeOutput::StartRuby(const SwTextNode& rNode, sal_Int32 /*nPos*/,
const SwCharFormat* pFormat = pRubyText ? pRubyText->GetCharFormat() : 0;
OUString sFamilyName;
long nHeight;
- if ( pFormat )
+ if (pFormat)
{
- const SvxFontItem &rFont = ItemGet< SvxFontItem >( *pFormat,
- GetWhichOfScript(RES_CHRATR_FONT,nRubyScript) );
+ const SvxFontItem& rFont = ItemGet< SvxFontItem >(*pFormat,
+ GetWhichOfScript(RES_CHRATR_FONT,nRubyScript));
sFamilyName = rFont.GetFamilyName();
- const SvxFontHeightItem &rHeight = ItemGet< SvxFontHeightItem >( *pFormat,
- GetWhichOfScript( RES_CHRATR_FONTSIZE, nRubyScript ) );
+ const SvxFontHeightItem& rHeight = ItemGet< SvxFontHeightItem >(*pFormat,
+ GetWhichOfScript(RES_CHRATR_FONTSIZE, nRubyScript));
nHeight = rHeight.GetHeight();
}
else
{
/*Get defaults if no formatting on ruby text*/
- const SfxItemPool *pPool = rNode.GetSwAttrSet().GetPool();
+ const SfxItemPool* pPool = rNode.GetSwAttrSet().GetPool();
pPool = pPool ? pPool : &m_rExport.m_pDoc->GetAttrPool();
- const SvxFontItem &rFont = DefaultItemGet< SvxFontItem >( *pPool,
- GetWhichOfScript( RES_CHRATR_FONT,nRubyScript ) );
+ const SvxFontItem& rFont = DefaultItemGet< SvxFontItem >(*pPool,
+ GetWhichOfScript(RES_CHRATR_FONT,nRubyScript));
sFamilyName = rFont.GetFamilyName();
- const SvxFontHeightItem &rHeight = DefaultItemGet< SvxFontHeightItem >
- ( *pPool, GetWhichOfScript( RES_CHRATR_FONTSIZE, nRubyScript ) );
+ const SvxFontHeightItem& rHeight = DefaultItemGet< SvxFontHeightItem >
+ (*pPool, GetWhichOfScript(RES_CHRATR_FONTSIZE, nRubyScript));
nHeight = rHeight.GetHeight();
}
nHeight = (nHeight + 5)/10;
@@ -495,39 +495,39 @@ void RtfAttributeOutput::StartRuby(const SwTextNode& rNode, sal_Int32 /*nPos*/,
aStr += " \\* \"Font:";
aStr += sFamilyName;
aStr += "\" \\* hps";
- aStr += OUString::number( nHeight );
+ aStr += OUString::number(nHeight);
aStr += " \\o";
- if ( cDirective )
+ if (cDirective)
{
aStr += "\\a" + OUString(cDirective);
}
aStr += "(\\s\\up ";
- if ( g_pBreakIt->GetBreakIter().is() )
- nRubyScript = g_pBreakIt->GetBreakIter()->getScriptType( rNode.GetText(),
- pRubyText->GetStart() );
+ if (g_pBreakIt->GetBreakIter().is())
+ nRubyScript = g_pBreakIt->GetBreakIter()->getScriptType(rNode.GetText(),
+ pRubyText->GetStart());
else
nRubyScript = i18n::ScriptType::ASIAN;
const SwAttrSet& rSet = rNode.GetSwAttrSet();
- const SvxFontHeightItem &rHeightItem =
+ const SvxFontHeightItem& rHeightItem =
static_cast< const SvxFontHeightItem& >(rSet.Get(
- GetWhichOfScript( RES_CHRATR_FONTSIZE, nRubyScript ) ));
+ GetWhichOfScript(RES_CHRATR_FONTSIZE, nRubyScript)));
nHeight = (rHeightItem.GetHeight() + 10)/20-1;
aStr += OUString::number(nHeight);
aStr += "(";
EndRun();
- m_rExport.OutputField( 0, ww::eEQ, aStr, WRITEFIELD_START | WRITEFIELD_CMD_START );
+ m_rExport.OutputField(0, ww::eEQ, aStr, WRITEFIELD_START | WRITEFIELD_CMD_START);
aStr = rRuby.GetText();
aStr += ")";
aStr += ",";
- m_rExport.OutputField( 0, ww::eEQ, aStr, 0);
+ m_rExport.OutputField(0, ww::eEQ, aStr, 0);
}
void RtfAttributeOutput::EndRuby()
{
- m_rExport.OutputField( 0, ww::eEQ, OUString(")"), WRITEFIELD_END | WRITEFIELD_CLOSE );
- EndRun( );
+ m_rExport.OutputField(0, ww::eEQ, OUString(")"), WRITEFIELD_END | WRITEFIELD_CLOSE);
+ EndRun();
}
bool RtfAttributeOutput::StartURL(const OUString& rUrl, const OUString& rTarget)
@@ -1568,7 +1568,9 @@ void RtfAttributeOutput::WriteField_Impl(const SwField* pField, ww::eField eType
m_aRunText->append(msfilter::rtfutil::OutString(pField->ExpandField(true), m_rExport.eDefaultEncoding));
if (bHasInstructions)
m_aRunText->append("}}");
- } else if (eType == ww::eEQ) {
+ }
+ else if (eType == ww::eEQ)
+ {
if (WRITEFIELD_START & nMode)
{
m_aRunText->append("{" OOO_STRING_SVTOOLS_RTF_FIELD);
More information about the Libreoffice-commits
mailing list