diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2014-12-18 13:28:22 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2014-12-18 14:12:29 +0100 |
commit | 26b6387b7ef302d6ff52a41395d0859cd1b9d981 (patch) | |
tree | 1ee3a248150492c0e02fc6f18549d06db82a791f /reportdesign | |
parent | ebf88643f3b749d1789183d8c441e5013c71a3f3 (diff) |
reportdesign: Use appropriate OUString functions on string constants
Change-Id: Ia9cfa61c05b4014a504a419ea0367b5ffd5668ce
Diffstat (limited to 'reportdesign')
-rw-r--r-- | reportdesign/source/filter/xml/xmlCell.cxx | 6 | ||||
-rw-r--r-- | reportdesign/source/filter/xml/xmlExport.cxx | 2 | ||||
-rw-r--r-- | reportdesign/source/filter/xml/xmlFixedContent.cxx | 6 | ||||
-rw-r--r-- | reportdesign/source/ui/dlg/dlgpage.cxx | 4 | ||||
-rw-r--r-- | reportdesign/source/ui/inspection/GeometryHandler.cxx | 25 | ||||
-rw-r--r-- | reportdesign/source/ui/report/ReportController.cxx | 20 | ||||
-rw-r--r-- | reportdesign/source/ui/report/SectionWindow.cxx | 6 |
7 files changed, 37 insertions, 32 deletions
diff --git a/reportdesign/source/filter/xml/xmlCell.cxx b/reportdesign/source/filter/xml/xmlCell.cxx index a5f4a436ce7c..185e7bbee35f 100644 --- a/reportdesign/source/filter/xml/xmlCell.cxx +++ b/reportdesign/source/filter/xml/xmlCell.cxx @@ -117,10 +117,10 @@ SvXMLImportContext* OXMLCell::CreateChildContext( } break; case XML_TOK_PAGE_NUMBER: - m_sText += OUString(s_sStringConcat) + " PageNumber()"; + m_sText += OUStringLiteral(s_sStringConcat) + " PageNumber()"; break; case XML_TOK_PAGE_COUNT: - m_sText += OUString(s_sStringConcat) + " PageCount()"; + m_sText += OUStringLiteral(s_sStringConcat) + " PageCount()"; break; case XML_TOK_FORMATTED_TEXT: { @@ -201,7 +201,7 @@ void OXMLCell::EndElement() Reference<XMultiServiceFactory> xFactor(rImport.GetModel(),uno::UNO_QUERY); uno::Reference< uno::XInterface> xInt = xFactor->createInstance(SERVICE_FORMATTEDFIELD); Reference< report::XFormattedField > xControl(xInt,uno::UNO_QUERY); - xControl->setDataField(OUString("rpt:") + m_sText); + xControl->setDataField("rpt:" + m_sText); OSL_ENSURE(xControl.is(),"Could not create FormattedField!"); setComponent(xControl.get()); diff --git a/reportdesign/source/filter/xml/xmlExport.cxx b/reportdesign/source/filter/xml/xmlExport.cxx index 28942bd3ea5a..27fca7f39cff 100644 --- a/reportdesign/source/filter/xml/xmlExport.cxx +++ b/reportdesign/source/filter/xml/xmlExport.cxx @@ -1003,7 +1003,7 @@ OUString ORptExport::convertFormula(const OUString& _sFormula) { OUString sFormula = _sFormula; if ( _sFormula == "rpt:" ) - sFormula = ""; + sFormula.clear(); return sFormula; } diff --git a/reportdesign/source/filter/xml/xmlFixedContent.cxx b/reportdesign/source/filter/xml/xmlFixedContent.cxx index 5cc8fe1b0774..913445db3c5f 100644 --- a/reportdesign/source/filter/xml/xmlFixedContent.cxx +++ b/reportdesign/source/filter/xml/xmlFixedContent.cxx @@ -164,11 +164,11 @@ SvXMLImportContext* OXMLFixedContent::_CreateChildContext( 0x0020, true ); break; case XML_TOK_PAGE_NUMBER: - m_sPageText += OUString(s_sStringConcat) + " PageNumber()"; + m_sPageText += OUStringLiteral(s_sStringConcat) + " PageNumber()"; m_bFormattedField = true; break; case XML_TOK_PAGE_COUNT: - m_sPageText += OUString(s_sStringConcat) + " PageCount()"; + m_sPageText += OUStringLiteral(s_sStringConcat) + " PageCount()"; m_bFormattedField = true; break; default: @@ -186,7 +186,7 @@ void OXMLFixedContent::EndElement() { uno::Reference< uno::XInterface> xInt = xFactor->createInstance(SERVICE_FORMATTEDFIELD); Reference< report::XFormattedField > xControl(xInt,uno::UNO_QUERY); - xControl->setDataField(OUString("rpt:") + m_sPageText); + xControl->setDataField("rpt:" + m_sPageText); OSL_ENSURE(xControl.is(),"Could not create FormattedField!"); m_pInP->m_xComponent = xControl.get(); m_xComponent = xControl.get(); diff --git a/reportdesign/source/ui/dlg/dlgpage.cxx b/reportdesign/source/ui/dlg/dlgpage.cxx index 10361095e47a..37664f27db99 100644 --- a/reportdesign/source/ui/dlg/dlgpage.cxx +++ b/reportdesign/source/ui/dlg/dlgpage.cxx @@ -38,9 +38,9 @@ namespace rptui \************************************************************************/ ORptPageDialog::ORptPageDialog( vcl::Window* pParent, const SfxItemSet* pAttr, const OUString &rDialog) - : SfxTabDialog (pParent, rDialog, OUString("modules/dbreport/ui/") + + : SfxTabDialog (pParent, rDialog, "modules/dbreport/ui/" + rDialog.toAsciiLowerCase() + - OUString(".ui"), pAttr) + ".ui", pAttr) , rOutAttrs(*pAttr) { SfxAbstractDialogFactory* pFact = SfxAbstractDialogFactory::Create(); diff --git a/reportdesign/source/ui/inspection/GeometryHandler.cxx b/reportdesign/source/ui/inspection/GeometryHandler.cxx index c95f3c46552b..ebf42942bc98 100644 --- a/reportdesign/source/ui/inspection/GeometryHandler.cxx +++ b/reportdesign/source/ui/inspection/GeometryHandler.cxx @@ -317,7 +317,8 @@ void SAL_CALL GeometryHandler::removeEventListener(const uno::Reference< lang::X void SAL_CALL GeometryHandler::inspect( const uno::Reference< uno::XInterface > & _rxInspectee ) throw (uno::RuntimeException, lang::NullPointerException, std::exception) { ::osl::MutexGuard aGuard( m_aMutex ); - m_sScope = m_sDefaultFunction = ""; + m_sScope.clear(); + m_sDefaultFunction.clear(); m_bNewFunction = false; m_nDataFieldType = 0; m_xFunction.clear(); @@ -477,7 +478,8 @@ void SAL_CALL GeometryHandler::setPropertyValue(const OUString & PropertyName, c OUString sDataField; aPropertyValue >>= sDataField; - m_sScope = m_sDefaultFunction = ""; + m_sScope.clear(); + m_sDefaultFunction.clear(); m_xFunction.clear(); const sal_uInt32 nOldDataFieldType = m_nDataFieldType; if ( !sDataField.isEmpty() ) @@ -498,7 +500,8 @@ void SAL_CALL GeometryHandler::setPropertyValue(const OUString & PropertyName, c const OUString sOldFunctionName = m_sDefaultFunction; const OUString sOldScope = m_sScope; - m_sDefaultFunction = m_sScope = ""; + m_sDefaultFunction.clear(); + m_sScope.clear(); if ( m_nDataFieldType == COUNTER ) { @@ -523,7 +526,7 @@ void SAL_CALL GeometryHandler::setPropertyValue(const OUString & PropertyName, c { if ( m_nDataFieldType == FUNCTION ) { - m_sDefaultFunction = ""; + m_sDefaultFunction.clear(); if ( m_bNewFunction ) removeFunction(); m_xFunction.clear(); @@ -531,7 +534,7 @@ void SAL_CALL GeometryHandler::setPropertyValue(const OUString & PropertyName, c beans::PropertyChangeEvent aEvent; aEvent.PropertyName = PROPERTY_SCOPE; aEvent.OldValue <<= m_sScope; - m_sScope = ""; + m_sScope.clear(); aEvent.NewValue <<= m_sScope; aGuard.clear(); m_aPropertyListeners.notify( aEvent, &beans::XPropertyChangeListener::propertyChange ); @@ -551,7 +554,8 @@ void SAL_CALL GeometryHandler::setPropertyValue(const OUString & PropertyName, c { const OUString sOldFunctionName = m_sDefaultFunction; const OUString sOldScope = m_sScope; - m_sScope = m_sDefaultFunction = ""; + m_sScope.clear(); + m_sDefaultFunction.clear(); m_xFunction.clear(); if ( nNewDataType == COUNTER ) impl_isCounterFunction_throw(sFunction,m_sScope); @@ -589,7 +593,7 @@ void SAL_CALL GeometryHandler::setPropertyValue(const OUString & PropertyName, c break; case PROPERTY_ID_SCOPE: if ( !(Value >>= m_sScope) ) - m_sScope = ""; + m_sScope.clear(); else { if ( m_bNewFunction ) @@ -1548,7 +1552,7 @@ sal_Bool SAL_CALL GeometryHandler::suspend(sal_Bool Suspend) throw (uno::Runtime bool GeometryHandler::impl_dialogFilter_nothrow( OUString& _out_rSelectedClause, ::osl::ClearableMutexGuard& _rClearBeforeDialog ) const { - _out_rSelectedClause = ""; + _out_rSelectedClause.clear(); bool bSuccess = false; ::dbtools::SQLExceptionInfo aErrorInfo; uno::Reference< awt::XWindow > xInspectorWindow; @@ -1889,7 +1893,7 @@ void GeometryHandler::loadDefaultFunctions() m_aCounterFunction.m_sFormula = "rpt:[%FunctionName] + 1"; m_aCounterFunction.m_sSearchString = "rpt:\\[[:alpha:]+([:space:]*[:alnum:]*)*\\][:space:]*\\+[:space:]*[:digit:]*"; m_aCounterFunction.m_sInitialFormula.IsPresent = sal_True; - m_aCounterFunction.m_sInitialFormula.Value = OUString("rpt:1"); + m_aCounterFunction.m_sInitialFormula.Value = "rpt:1"; DefaultFunction aDefault; aDefault.m_bDeepTraversing = false; @@ -2188,7 +2192,8 @@ void SAL_CALL GeometryHandler::propertyChange(const beans::PropertyChangeEvent& const sal_uInt32 nOldDataFieldType = m_nDataFieldType; const OUString sOldFunctionName = m_sDefaultFunction; const OUString sOldScope = m_sScope; - m_sDefaultFunction = m_sScope = ""; + m_sDefaultFunction.clear(); + m_sScope.clear(); m_nDataFieldType = impl_getDataFieldType_throw(); if ( UNDEF_DATA == m_nDataFieldType ) m_nDataFieldType = nOldDataFieldType; diff --git a/reportdesign/source/ui/report/ReportController.cxx b/reportdesign/source/ui/report/ReportController.cxx index 86274babe42f..fb4cb41681ed 100644 --- a/reportdesign/source/ui/report/ReportController.cxx +++ b/reportdesign/source/ui/report/ReportController.cxx @@ -2205,7 +2205,7 @@ void SAL_CALL OReportController::propertyChange( const beans::PropertyChangeEven evt.NewValue >>= bShow; if ( evt.Source == m_xReportDefinition ) { - if ( evt.PropertyName.equals( PROPERTY_REPORTHEADERON ) ) + if ( evt.PropertyName == PROPERTY_REPORTHEADERON ) { const sal_uInt16 nPosition = m_xReportDefinition->getPageHeaderOn() ? 1 : 0; if ( bShow ) @@ -2218,7 +2218,7 @@ void SAL_CALL OReportController::propertyChange( const beans::PropertyChangeEven getDesignView()->removeSection(nPosition); } } - else if ( evt.PropertyName.equals( PROPERTY_REPORTFOOTERON ) ) + else if ( evt.PropertyName == PROPERTY_REPORTFOOTERON ) { sal_uInt16 nPosition = getDesignView()->getSectionCount(); if ( m_xReportDefinition->getPageFooterOn() ) @@ -2233,7 +2233,7 @@ void SAL_CALL OReportController::propertyChange( const beans::PropertyChangeEven getDesignView()->removeSection(nPosition - 1); } } - else if ( evt.PropertyName.equals( PROPERTY_PAGEHEADERON ) ) + else if ( evt.PropertyName == PROPERTY_PAGEHEADERON ) { if ( bShow ) { @@ -2245,7 +2245,7 @@ void SAL_CALL OReportController::propertyChange( const beans::PropertyChangeEven getDesignView()->removeSection(sal_uInt16(0)); } } - else if ( evt.PropertyName.equals( PROPERTY_PAGEFOOTERON ) ) + else if ( evt.PropertyName == PROPERTY_PAGEFOOTERON ) { if ( bShow ) { @@ -2257,10 +2257,10 @@ void SAL_CALL OReportController::propertyChange( const beans::PropertyChangeEven getDesignView()->removeSection(getDesignView()->getSectionCount() - 1); } } - else if ( evt.PropertyName.equals( PROPERTY_COMMAND ) - || evt.PropertyName.equals( PROPERTY_COMMANDTYPE ) - || evt.PropertyName.equals( PROPERTY_ESCAPEPROCESSING ) - || evt.PropertyName.equals( PROPERTY_FILTER ) + else if ( evt.PropertyName == PROPERTY_COMMAND + || evt.PropertyName == PROPERTY_COMMANDTYPE + || evt.PropertyName == PROPERTY_ESCAPEPROCESSING + || evt.PropertyName == PROPERTY_FILTER ) { m_xColumns.clear(); @@ -2323,13 +2323,13 @@ void OReportController::groupChange( const uno::Reference< report::XGroup>& _xGr OUString sColor(DBGROUPHEADER); sal_uInt16 nPosition = 0; bool bHandle = false; - if ( _sPropName.equals( PROPERTY_HEADERON ) ) + if ( _sPropName == PROPERTY_HEADERON ) { nPosition = m_xReportDefinition->getPageHeaderOn() ? (m_xReportDefinition->getReportHeaderOn() ? 2 : 1) : (m_xReportDefinition->getReportHeaderOn() ? 1 : 0); nPosition += (static_cast<sal_uInt16>(_nGroupPos) - lcl_getNonVisbleGroupsBefore(m_xReportDefinition->getGroups(),_nGroupPos,pMemFun)); bHandle = true; } - else if ( _sPropName.equals( PROPERTY_FOOTERON ) ) + else if ( _sPropName == PROPERTY_FOOTERON ) { pMemFun = ::std::mem_fun(&OGroupHelper::getFooterOn); pMemFunSection = ::std::mem_fun(&OGroupHelper::getFooter); diff --git a/reportdesign/source/ui/report/SectionWindow.cxx b/reportdesign/source/ui/report/SectionWindow.cxx index ef15b49d9b30..a04f4760f363 100644 --- a/reportdesign/source/ui/report/SectionWindow.cxx +++ b/reportdesign/source/ui/report/SectionWindow.cxx @@ -120,7 +120,7 @@ void OSectionWindow::_propertyChanged(const beans::PropertyChangeEvent& _rEvent) if ( xSection.is() ) { const uno::Reference< report::XSection> xCurrentSection = m_aReportSection.getSection(); - if ( _rEvent.PropertyName.equals(PROPERTY_HEIGHT) ) + if ( _rEvent.PropertyName == PROPERTY_HEIGHT ) { m_pParent->getView()->SetUpdateMode(false); //Resize(); @@ -129,7 +129,7 @@ void OSectionWindow::_propertyChanged(const beans::PropertyChangeEvent& _rEvent) m_pParent->getView()->SetUpdateMode(true); // getViewsWindow()->getView()->getReportView()->getController().resetZoomType(); } - else if ( _rEvent.PropertyName.equals(PROPERTY_NAME) && !xSection->getGroup().is() ) + else if ( _rEvent.PropertyName == PROPERTY_NAME && !xSection->getGroup().is() ) { uno::Reference< report::XReportDefinition > xReport = xSection->getReportDefinition(); if ( setReportSectionTitle(xReport,RID_STR_REPORT_HEADER,::std::mem_fun(&OReportHelper::getReportHeader),::std::mem_fun(&OReportHelper::getReportHeaderOn)) @@ -147,7 +147,7 @@ void OSectionWindow::_propertyChanged(const beans::PropertyChangeEvent& _rEvent) } } } - else if ( _rEvent.PropertyName.equals(PROPERTY_EXPRESSION) ) + else if ( _rEvent.PropertyName == PROPERTY_EXPRESSION ) { uno::Reference< report::XGroup > xGroup(_rEvent.Source,uno::UNO_QUERY); if ( xGroup.is() && !setGroupSectionTitle(xGroup,RID_STR_HEADER,::std::mem_fun(&OGroupHelper::getHeader),::std::mem_fun(&OGroupHelper::getHeaderOn))) |