summaryrefslogtreecommitdiff
path: root/sw/source/uibase/uno
diff options
context:
space:
mode:
authorMatteo Casalin <matteo.casalin@yahoo.com>2014-06-29 10:55:56 +0200
committerMatteo Casalin <matteo.casalin@yahoo.com>2014-07-22 23:50:38 +0200
commit5fb6c690df80b43043b88a4bd2648926f7bc546b (patch)
treead605165d409625c014dffdc0f70d54ae1b6da67 /sw/source/uibase/uno
parent11eda446535a62dd9874a8149955bc27196e3c9e (diff)
sal_uInt16 to more proper integer types, constify
Change-Id: Ie64a7c761a553e3a70250f56b26ea7de196ebc29
Diffstat (limited to 'sw/source/uibase/uno')
-rw-r--r--sw/source/uibase/uno/unotxdoc.cxx35
-rw-r--r--sw/source/uibase/uno/unotxvw.cxx6
2 files changed, 21 insertions, 20 deletions
diff --git a/sw/source/uibase/uno/unotxdoc.cxx b/sw/source/uibase/uno/unotxdoc.cxx
index 4a036065ab8a..7d51eca23cfc 100644
--- a/sw/source/uibase/uno/unotxdoc.cxx
+++ b/sw/source/uibase/uno/unotxdoc.cxx
@@ -195,7 +195,8 @@ static SwTxtFmtColl *lcl_GetParaStyle(const OUString& rCollName, SwDoc* pDoc)
SwTxtFmtColl* pColl = pDoc->FindTxtFmtCollByName( rCollName );
if( !pColl )
{
- sal_uInt16 nId = SwStyleNameMapper::GetPoolIdFromUIName( rCollName, nsSwGetPoolIdFromName::GET_POOLID_TXTCOLL );
+ const sal_uInt16 nId = SwStyleNameMapper::GetPoolIdFromUIName(
+ rCollName, nsSwGetPoolIdFromName::GET_POOLID_TXTCOLL );
if( USHRT_MAX != nId )
pColl = pDoc->GetTxtCollFromPool( nId );
}
@@ -1038,7 +1039,7 @@ static sal_uInt32 lcl_Any_To_ULONG(const Any& rValue, bool& bException)
return nRet;
}
-static OUString lcl_CreateOutlineString( sal_uInt16 nIndex,
+static OUString lcl_CreateOutlineString( size_t nIndex,
const SwOutlineNodes& rOutlineNodes, const SwNumRule* pOutlRule)
{
OUString sEntry;
@@ -1634,7 +1635,7 @@ css::uno::Reference<css::uno::XInterface> SwXTextDocument::create(
{
throw RuntimeException();
}
- sal_uInt16 nType = SwXServiceProvider::GetProviderType(rServiceName);
+ const sal_uInt16 nType = SwXServiceProvider::GetProviderType(rServiceName);
if (nType != SW_SERVICE_INVALID)
{
return SwXServiceProvider::MakeInstance(nType, pDocShell->GetDoc());
@@ -2033,11 +2034,12 @@ Any SwXTextDocument::getPropertyValue(const OUString& rPropertyName)
case WID_DOC_CHANGES_RECORD:
case WID_DOC_CHANGES_SHOW:
{
- sal_uInt16 eMode = pDocShell->GetDoc()->GetRedlineMode();
+ const sal_uInt16 eMode = pDocShell->GetDoc()->GetRedlineMode();
bool bSet = false;
if(WID_DOC_CHANGES_SHOW == pEntry->nWID)
{
- sal_uInt16 nMask = nsRedlineMode_t::REDLINE_SHOW_INSERT | nsRedlineMode_t::REDLINE_SHOW_DELETE;
+ const sal_uInt16 nMask = nsRedlineMode_t::REDLINE_SHOW_INSERT |
+ nsRedlineMode_t::REDLINE_SHOW_DELETE;
bSet = (eMode & nMask) == nMask;
}
else if(WID_DOC_CHANGES_RECORD == pEntry->nWID)
@@ -2719,7 +2721,7 @@ uno::Sequence< beans::PropertyValue > SAL_CALL SwXTextDocument::getRenderer(
// determine the correct page number from the renderer index
// #i114875
// consider brochure print
- const sal_uInt16 nPage = bPrintProspect
+ const sal_Int32 nPage = bPrintProspect
? nRenderer + 1
: m_pRenderData->GetPagesToPrint()[ nRenderer ];
@@ -3199,7 +3201,7 @@ uno::Sequence< lang::Locale > SAL_CALL SwXTextDocument::getDocumentLanguages(
//USER STYLES
const SwCharFmts *pFmts = pDoc->GetCharFmts();
- for(sal_uInt16 i = 0; i < pFmts->size(); ++i)
+ for(size_t i = 0; i < pFmts->size(); ++i)
{
const SwAttrSet &rAttrSet = (*pFmts)[i]->GetAttrSet();
LanguageType nLang = LANGUAGE_DONTKNOW;
@@ -3224,7 +3226,7 @@ uno::Sequence< lang::Locale > SAL_CALL SwXTextDocument::getDocumentLanguages(
}
const SwTxtFmtColls *pColls = pDoc->GetTxtFmtColls();
- for (sal_uInt16 i = 0; i < pColls->size(); ++i)
+ for (size_t i = 0; i < pColls->size(); ++i)
{
const SwAttrSet &rAttrSet = (*pColls)[i]->GetAttrSet();
LanguageType nLang = LANGUAGE_DONTKNOW;
@@ -3254,7 +3256,7 @@ uno::Sequence< lang::Locale > SAL_CALL SwXTextDocument::getDocumentLanguages(
IStyleAccess::AUTO_STYLE_CHAR,
IStyleAccess::AUTO_STYLE_PARA
};
- for (sal_uInt16 i = 0; i < 2; ++i)
+ for (int i = 0; i < 2; ++i)
{
std::vector< SfxItemSet_Pointer_t > rStyles;
pDoc->GetIStyleAccess().getAllStyles(rStyles, aFam[i]);
@@ -3553,14 +3555,13 @@ Any SwXLinkNameAccessWrapper::getByName(const OUString& rName)
if(!pxDoc->GetDocShell())
throw RuntimeException();
SwDoc* pDoc = pxDoc->GetDocShell()->GetDoc();
- sal_uInt16 nOutlineCount = pDoc->GetNodes().GetOutLineNds().size();
+ const size_t nOutlineCount = pDoc->GetNodes().GetOutLineNds().size();
- for (sal_uInt16 i = 0; i < nOutlineCount && !bFound; ++i)
+ for (size_t i = 0; i < nOutlineCount && !bFound; ++i)
{
const SwOutlineNodes& rOutlineNodes = pDoc->GetNodes().GetOutLineNds();
const SwNumRule* pOutlRule = pDoc->GetOutlineNumRule();
- if(sParam ==
- lcl_CreateOutlineString(i, rOutlineNodes, pOutlRule))
+ if(sParam == lcl_CreateOutlineString(i, rOutlineNodes, pOutlRule))
{
Reference< XPropertySet > xOutline = new SwXOutlineTarget(sParam);
aRet.setValue(&xOutline, cppu::UnoType<XPropertySet>::get());
@@ -3596,12 +3597,12 @@ Sequence< OUString > SwXLinkNameAccessWrapper::getElementNames(void)
SwDoc* pDoc = pxDoc->GetDocShell()->GetDoc();
const SwOutlineNodes& rOutlineNodes = pDoc->GetNodes().GetOutLineNds();
- sal_uInt16 nOutlineCount = rOutlineNodes.size();
+ const size_t nOutlineCount = rOutlineNodes.size();
aRet.realloc(nOutlineCount);
OUString* pResArr = aRet.getArray();
OUString sSuffix("|outline");
const SwNumRule* pOutlRule = pDoc->GetOutlineNumRule();
- for (sal_uInt16 i = 0; i < nOutlineCount; ++i)
+ for (size_t i = 0; i < nOutlineCount; ++i)
{
OUString sEntry = lcl_CreateOutlineString(i, rOutlineNodes, pOutlRule);
sEntry += sSuffix;
@@ -3639,9 +3640,9 @@ sal_Bool SwXLinkNameAccessWrapper::hasByName(const OUString& rName)
if(!pxDoc->GetDocShell())
throw RuntimeException();
SwDoc* pDoc = pxDoc->GetDocShell()->GetDoc();
- sal_uInt16 nOutlineCount = pDoc->GetNodes().GetOutLineNds().size();
+ const size_t nOutlineCount = pDoc->GetNodes().GetOutLineNds().size();
- for (sal_uInt16 i = 0; i < nOutlineCount && !bRet; ++i)
+ for (size_t i = 0; i < nOutlineCount && !bRet; ++i)
{
const SwOutlineNodes& rOutlineNodes = pDoc->GetNodes().GetOutLineNds();
const SwNumRule* pOutlRule = pDoc->GetOutlineNumRule();
diff --git a/sw/source/uibase/uno/unotxvw.cxx b/sw/source/uibase/uno/unotxvw.cxx
index 75d94dbab393..b2100afb8030 100644
--- a/sw/source/uibase/uno/unotxvw.cxx
+++ b/sw/source/uibase/uno/unotxvw.cxx
@@ -407,7 +407,7 @@ uno::Any SwXTextView::getSelection()
comphelper::getProcessComponentContext());
const SdrMarkList& rMarkList = rSh.GetDrawView()->GetMarkedObjectList();
- for(sal_uInt16 i = 0; i < rMarkList.GetMarkCount(); i++)
+ for(sal_uLong i = 0; i < rMarkList.GetMarkCount(); ++i)
{
SdrObject* pObj = rMarkList.GetMark(i)->GetMarkedSdrObj();
uno::Reference< uno::XInterface > xInt = pSvxDrawPage->GetInterface( pObj );
@@ -549,7 +549,7 @@ Sequence< Sequence< PropertyValue > > SwXTextView::getRubyList( sal_Bool /*bAuto
SwDoc* pDoc = m_pView->GetDocShell()->GetDoc();
SwRubyList aList;
- sal_uInt16 nCount = pDoc->FillRubyList( *rSh.GetCrsr(), aList, 0 );
+ const sal_uInt16 nCount = pDoc->FillRubyList( *rSh.GetCrsr(), aList, 0 );
Sequence< Sequence< PropertyValue > > aRet(nCount);
Sequence< PropertyValue >* pRet = aRet.getArray();
OUString aString;
@@ -620,7 +620,7 @@ void SAL_CALL SwXTextView::setRubyList(
{
OUString sName;
SwStyleNameMapper::FillUIName(sTmp, sName, nsSwGetPoolIdFromName::GET_POOLID_CHRFMT, true );
- sal_uInt16 nPoolId = sName.isEmpty() ? 0
+ const sal_uInt16 nPoolId = sName.isEmpty() ? 0
: SwStyleNameMapper::GetPoolIdFromUIName(sName,
nsSwGetPoolIdFromName::GET_POOLID_CHRFMT );