summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2014-03-13 08:38:29 +0200
committerNoel Grandin <noel@peralex.com>2014-03-13 08:39:26 +0200
commit78a2020846b855ed925ab88f06fa70a282a75e5a (patch)
treedd316d41417704fc02387700f2b664b55945773b /vcl
parent39c7532933bb4f1630e821a2a38b213eb05dcc59 (diff)
vcl: prefer passing OUString and OString by reference
Change-Id: I6c2c6f597ca62c004ad7dc606cef3a3b10e810b6
Diffstat (limited to 'vcl')
-rw-r--r--vcl/inc/graphite_features.hxx4
-rw-r--r--vcl/inc/outfont.hxx6
-rw-r--r--vcl/inc/unx/saldisp.hxx2
-rw-r--r--vcl/qa/cppunit/graphicfilter/filters-test.cxx4
-rw-r--r--vcl/source/filter/GraphicNativeTransform.cxx2
-rw-r--r--vcl/source/filter/wmf/emfwr.cxx2
-rw-r--r--vcl/source/filter/wmf/emfwr.hxx2
-rw-r--r--vcl/source/gdi/outdev3.cxx3
-rw-r--r--vcl/source/gdi/outdevnative.cxx4
-rw-r--r--vcl/source/glyphs/graphite_features.cxx4
-rw-r--r--vcl/source/window/builder.cxx22
-rw-r--r--vcl/unx/generic/app/keysymnames.cxx2
-rw-r--r--vcl/unx/gtk/a11y/atkimage.cxx2
-rw-r--r--vcl/unx/gtk/a11y/atktable.cxx2
14 files changed, 31 insertions, 30 deletions
diff --git a/vcl/inc/graphite_features.hxx b/vcl/inc/graphite_features.hxx
index 0202497ae95a..d1587fda0c14 100644
--- a/vcl/inc/graphite_features.hxx
+++ b/vcl/inc/graphite_features.hxx
@@ -41,8 +41,8 @@ namespace grutils
static const char FEAT_PREFIX;
static const char FEAT_SEPARATOR;
static const char FEAT_ID_VALUE_SEPARATOR;
- GrFeatureParser(const gr_face * face, const OString features, const OString lang);
- GrFeatureParser(const gr_face * face, const OString lang);
+ GrFeatureParser(const gr_face * face, const OString& features, const OString& lang);
+ GrFeatureParser(const gr_face * face, const OString& lang);
~GrFeatureParser();
//size_t getFontFeatures(gr::FeatureSetting settings[MAX_FEATURES]) const;
bool parseErrors() { return mbErrors; };
diff --git a/vcl/inc/outfont.hxx b/vcl/inc/outfont.hxx
index 77a35205a040..a6d4def4e547 100644
--- a/vcl/inc/outfont.hxx
+++ b/vcl/inc/outfont.hxx
@@ -61,9 +61,9 @@ public: // TODO: create matching interface class
FontPitch GetPitch() const { return mePitch; }
FontWidth GetWidthType() const { return meWidthType; }
bool IsSymbolFont() const { return mbSymbolFlag; }
- void SetFamilyName(const OUString sFamilyName) { maName = sFamilyName; }
- void SetStyleName( const OUString sStyleName) { maStyleName = sStyleName; }
- void SetFamilyType(const FontFamily eFontFamily) { meFamily = eFontFamily; }
+ void SetFamilyName(const OUString& sFamilyName) { maName = sFamilyName; }
+ void SetStyleName( const OUString& sStyleName) { maStyleName = sStyleName; }
+ void SetFamilyType(const FontFamily eFontFamily) { meFamily = eFontFamily; }
void SetPitch(const FontPitch ePitch ) { mePitch = ePitch; }
void SetItalic(const FontItalic eItalic ) { meItalic = eItalic; }
void SetWeight(const FontWeight eWeight ) { meWeight = eWeight; }
diff --git a/vcl/inc/unx/saldisp.hxx b/vcl/inc/unx/saldisp.hxx
index 9b98a762175d..5d179e71b89a 100644
--- a/vcl/inc/unx/saldisp.hxx
+++ b/vcl/inc/unx/saldisp.hxx
@@ -409,7 +409,7 @@ public:
// get foreign key names
namespace vcl_sal {
OUString getKeysymReplacementName(
- OUString pLang,
+ const OUString& pLang,
KeySym nSymbol );
}
diff --git a/vcl/qa/cppunit/graphicfilter/filters-test.cxx b/vcl/qa/cppunit/graphicfilter/filters-test.cxx
index 811c2a16cbea..f7faae4c056c 100644
--- a/vcl/qa/cppunit/graphicfilter/filters-test.cxx
+++ b/vcl/qa/cppunit/graphicfilter/filters-test.cxx
@@ -34,7 +34,7 @@ public:
const OUString &rURL, const OUString &,
unsigned int, unsigned int, unsigned int);
- void checkExportImport(OUString aFilterShortName);
+ void checkExportImport(const OUString& aFilterShortName);
/**
* Ensure CVEs remain unbroken
@@ -77,7 +77,7 @@ void VclFiltersTest::testScaling()
}
}
-void VclFiltersTest::checkExportImport(OUString aFilterShortName)
+void VclFiltersTest::checkExportImport(const OUString& aFilterShortName)
{
Bitmap aBitmap( Size( 100, 100 ), 24 );
aBitmap.Erase(COL_WHITE);
diff --git a/vcl/source/filter/GraphicNativeTransform.cxx b/vcl/source/filter/GraphicNativeTransform.cxx
index 69a10bdc65c2..9661d4a67f97 100644
--- a/vcl/source/filter/GraphicNativeTransform.cxx
+++ b/vcl/source/filter/GraphicNativeTransform.cxx
@@ -104,7 +104,7 @@ bool GraphicNativeTransform::rotateBitmapOnly(sal_uInt16 aRotation)
return true;
}
-bool GraphicNativeTransform::rotateGeneric(sal_uInt16 aRotation, OUString aType)
+bool GraphicNativeTransform::rotateGeneric(sal_uInt16 aRotation, const OUString& aType)
{
// Can't rotate animations yet
if (mrGraphic.IsAnimated())
diff --git a/vcl/source/filter/wmf/emfwr.cxx b/vcl/source/filter/wmf/emfwr.cxx
index abd2adabab26..ea0e32c5c32d 100644
--- a/vcl/source/filter/wmf/emfwr.cxx
+++ b/vcl/source/filter/wmf/emfwr.cxx
@@ -872,7 +872,7 @@ void EMFWriter::ImplWriteBmpRecord( const Bitmap& rBmp, const Point& rPt,
}
}
-void EMFWriter::ImplWriteTextRecord( const Point& rPos, const OUString rText, const sal_Int32* pDXArray, sal_uInt32 nWidth )
+void EMFWriter::ImplWriteTextRecord( const Point& rPos, const OUString& rText, const sal_Int32* pDXArray, sal_uInt32 nWidth )
{
sal_Int32 nLen = rText.getLength(), i;
diff --git a/vcl/source/filter/wmf/emfwr.hxx b/vcl/source/filter/wmf/emfwr.hxx
index 03b5225c5dcb..62f0b281b7f8 100644
--- a/vcl/source/filter/wmf/emfwr.hxx
+++ b/vcl/source/filter/wmf/emfwr.hxx
@@ -79,7 +79,7 @@ private:
void ImplWritePolygonRecord( const Polygon& rPoly, bool bClose );
void ImplWritePolyPolygonRecord( const PolyPolygon& rPolyPoly );
void ImplWriteBmpRecord( const Bitmap& rBmp, const Point& rPt, const Size& rSz, sal_uInt32 nROP );
- void ImplWriteTextRecord( const Point& rPos, const OUString rText, const sal_Int32* pDXArray, sal_uInt32 nWidth );
+ void ImplWriteTextRecord( const Point& rPos, const OUString& rText, const sal_Int32* pDXArray, sal_uInt32 nWidth );
void Impl_handleLineInfoPolyPolygons(const LineInfo& rInfo, const basegfx::B2DPolygon& rLinePolygon);
void ImplWrite( const GDIMetaFile& rMtf );
diff --git a/vcl/source/gdi/outdev3.cxx b/vcl/source/gdi/outdev3.cxx
index 628d309c5934..bfcccbd0002c 100644
--- a/vcl/source/gdi/outdev3.cxx
+++ b/vcl/source/gdi/outdev3.cxx
@@ -2341,7 +2341,7 @@ ImplFontEntry* ImplFontCache::GetFontEntry( ImplDevFontList* pFontList,
namespace
{
- OUString stripCharSetFromName(OUString aName)
+ OUString stripCharSetFromName(const OUString& _aName)
{
// I worry that someone will have a font which *does* have
// e.g. "Greek" legitimately at the end of its name :-(
@@ -2358,6 +2358,7 @@ namespace
" (vietnamese)"
};
+ OUString aName = _aName;
// These can be crazily piled up, e.g. Times New Roman CYR Greek
bool bFinished = false;
while (!bFinished)
diff --git a/vcl/source/gdi/outdevnative.cxx b/vcl/source/gdi/outdevnative.cxx
index 33296903fbb2..bef50d8d4ec1 100644
--- a/vcl/source/gdi/outdevnative.cxx
+++ b/vcl/source/gdi/outdevnative.cxx
@@ -268,7 +268,7 @@ bool OutputDevice::DrawNativeControl( ControlType nType,
const Rectangle& rControlRegion,
ControlState nState,
const ImplControlValue& aValue,
- OUString aCaption )
+ const OUString& aCaption )
{
if( !lcl_enableNativeWidget( *this ) )
return false;
@@ -310,7 +310,7 @@ bool OutputDevice::GetNativeControlRegion( ControlType nType,
const Rectangle& rControlRegion,
ControlState nState,
const ImplControlValue& aValue,
- OUString aCaption,
+ const OUString& aCaption,
Rectangle &rNativeBoundingRegion,
Rectangle &rNativeContentRegion ) const
{
diff --git a/vcl/source/glyphs/graphite_features.cxx b/vcl/source/glyphs/graphite_features.cxx
index 690193146f8d..2e999b4aa66f 100644
--- a/vcl/source/glyphs/graphite_features.cxx
+++ b/vcl/source/glyphs/graphite_features.cxx
@@ -38,14 +38,14 @@ const char GrFeatureParser::FEAT_PREFIX = ':';
const char GrFeatureParser::FEAT_SEPARATOR = '&';
const char GrFeatureParser::FEAT_ID_VALUE_SEPARATOR = '=';
-GrFeatureParser::GrFeatureParser(const gr_face * pFace, const OString lang)
+GrFeatureParser::GrFeatureParser(const gr_face * pFace, const OString& lang)
: mnNumSettings(0), mbErrors(false), mpSettings(NULL)
{
maLang.label[0] = maLang.label[1] = maLang.label[2] = maLang.label[3] = '\0';
setLang(pFace, lang);
}
-GrFeatureParser::GrFeatureParser(const gr_face * pFace, const OString features, const OString lang)
+GrFeatureParser::GrFeatureParser(const gr_face * pFace, const OString& features, const OString& lang)
: mnNumSettings(0), mbErrors(false), mpSettings(NULL)
{
sal_Int32 nEquals = 0;
diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx
index 535222c4bfbc..c4fe9acce6ff 100644
--- a/vcl/source/window/builder.cxx
+++ b/vcl/source/window/builder.cxx
@@ -45,7 +45,7 @@ using namespace com::sun::star;
namespace
{
- sal_uInt16 mapStockToImageResource(OString sType)
+ sal_uInt16 mapStockToImageResource(const OString& sType)
{
sal_uInt16 nRet = 0;
if (sType == "gtk-index")
@@ -55,7 +55,7 @@ namespace
return nRet;
}
- SymbolType mapStockToSymbol(OString sType)
+ SymbolType mapStockToSymbol(const OString& sType)
{
SymbolType eRet = SYMBOL_NOSYMBOL;
if (sType == "gtk-media-next")
@@ -167,7 +167,7 @@ namespace
}
#endif
-VclBuilder::VclBuilder(Window *pParent, OUString sUIDir, OUString sUIFile, OString sID, const uno::Reference<frame::XFrame>& rFrame)
+VclBuilder::VclBuilder(Window *pParent, const OUString& sUIDir, const OUString& sUIFile, const OString& sID, const uno::Reference<frame::XFrame>& rFrame)
: m_sID(sID)
, m_sHelpRoot(OUStringToOString(sUIFile, RTL_TEXTENCODING_UTF8))
, m_pStringReplace(ResMgr::GetReadStringHook())
@@ -851,7 +851,7 @@ namespace
return nDigits;
}
- FieldUnit detectMetricUnit(OString sUnit)
+ FieldUnit detectMetricUnit(const OString& sUnit)
{
FieldUnit eUnit = FUNIT_NONE;
@@ -2906,7 +2906,7 @@ Window *VclBuilder::get_widget_root()
return m_aChildren.empty() ? NULL : m_aChildren[0].m_pWindow;
}
-Window *VclBuilder::get_by_name(OString sID)
+Window *VclBuilder::get_by_name(const OString& sID)
{
for (std::vector<WinAndId>::iterator aI = m_aChildren.begin(),
aEnd = m_aChildren.end(); aI != aEnd; ++aI)
@@ -2918,7 +2918,7 @@ Window *VclBuilder::get_by_name(OString sID)
return NULL;
}
-PopupMenu *VclBuilder::get_menu(OString sID)
+PopupMenu *VclBuilder::get_menu(const OString& sID)
{
for (std::vector<MenuAndId>::iterator aI = m_aMenus.begin(),
aEnd = m_aMenus.end(); aI != aEnd; ++aI)
@@ -2946,7 +2946,7 @@ short VclBuilder::get_response(const Window *pWindow) const
return RET_CANCEL;
}
-void VclBuilder::set_response(OString sID, short nResponse)
+void VclBuilder::set_response(const OString& sID, short nResponse)
{
for (std::vector<WinAndId>::iterator aI = m_aChildren.begin(),
aEnd = m_aChildren.end(); aI != aEnd; ++aI)
@@ -2962,7 +2962,7 @@ void VclBuilder::set_response(OString sID, short nResponse)
assert(false);
}
-void VclBuilder::delete_by_name(OString sID)
+void VclBuilder::delete_by_name(const OString& sID)
{
for (std::vector<WinAndId>::iterator aI = m_aChildren.begin(),
aEnd = m_aChildren.end(); aI != aEnd; ++aI)
@@ -3031,7 +3031,7 @@ void VclBuilder::set_window_packing_position(const Window *pWindow, sal_Int32 nP
}
}
-const VclBuilder::ListStore *VclBuilder::get_model_by_name(OString sID) const
+const VclBuilder::ListStore *VclBuilder::get_model_by_name(const OString& sID) const
{
std::map<OString, ListStore>::const_iterator aI = m_pParserState->m_aModels.find(sID);
if (aI != m_pParserState->m_aModels.end())
@@ -3039,7 +3039,7 @@ const VclBuilder::ListStore *VclBuilder::get_model_by_name(OString sID) const
return NULL;
}
-const VclBuilder::TextBuffer *VclBuilder::get_buffer_by_name(OString sID) const
+const VclBuilder::TextBuffer *VclBuilder::get_buffer_by_name(const OString& sID) const
{
std::map<OString, TextBuffer>::const_iterator aI = m_pParserState->m_aTextBuffers.find(sID);
if (aI != m_pParserState->m_aTextBuffers.end())
@@ -3047,7 +3047,7 @@ const VclBuilder::TextBuffer *VclBuilder::get_buffer_by_name(OString sID) const
return NULL;
}
-const VclBuilder::Adjustment *VclBuilder::get_adjustment_by_name(OString sID) const
+const VclBuilder::Adjustment *VclBuilder::get_adjustment_by_name(const OString& sID) const
{
std::map<OString, Adjustment>::const_iterator aI = m_pParserState->m_aAdjustments.find(sID);
if (aI != m_pParserState->m_aAdjustments.end())
diff --git a/vcl/unx/generic/app/keysymnames.cxx b/vcl/unx/generic/app/keysymnames.cxx
index 50c53696acce..a2d411786c28 100644
--- a/vcl/unx/generic/app/keysymnames.cxx
+++ b/vcl/unx/generic/app/keysymnames.cxx
@@ -474,7 +474,7 @@ namespace vcl_sal {
};
// translate keycodes, used within the displayed menu shortcuts
- OUString getKeysymReplacementName( OUString pLang, KeySym nSymbol )
+ OUString getKeysymReplacementName( const OUString& pLang, KeySym nSymbol )
{
for( unsigned int n = 0; n < SAL_N_ELEMENTS(aKeyboards); n++ )
{
diff --git a/vcl/unx/gtk/a11y/atkimage.cxx b/vcl/unx/gtk/a11y/atkimage.cxx
index b413daae130d..d9f93edc4a9d 100644
--- a/vcl/unx/gtk/a11y/atkimage.cxx
+++ b/vcl/unx/gtk/a11y/atkimage.cxx
@@ -28,7 +28,7 @@ using namespace ::com::sun::star;
// FIXME
static G_CONST_RETURN gchar *
-getAsConst( OUString rString )
+getAsConst( const OUString& rString )
{
static const int nMax = 10;
static OString aUgly[nMax];
diff --git a/vcl/unx/gtk/a11y/atktable.cxx b/vcl/unx/gtk/a11y/atktable.cxx
index bf30e41eabdb..7094a7caf4b9 100644
--- a/vcl/unx/gtk/a11y/atktable.cxx
+++ b/vcl/unx/gtk/a11y/atktable.cxx
@@ -45,7 +45,7 @@ atk_object_wrapper_conditional_ref( const uno::Reference< accessibility::XAccess
// FIXME
static G_CONST_RETURN gchar *
-getAsConst( OUString rString )
+getAsConst( const OUString& rString )
{
static const int nMax = 10;
static OString aUgly[nMax];