summaryrefslogtreecommitdiff
path: root/dbaccess/source/ui
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2016-11-04 12:29:35 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2016-11-04 13:15:41 +0000
commitc1805c48ae6057d370a35f2e059f3ee82396c407 (patch)
tree2da65ded84bbcfee66db65a24f71750ceb5e77f3 /dbaccess/source/ui
parent2dfc4c0845c72b3a1cf19546a1606907f36eea42 (diff)
loplugin:oncevar in dbaccess
Change-Id: I956063bb354fbbd002e922bb06d0b3863a2750fc Reviewed-on: https://gerrit.libreoffice.org/30565 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'dbaccess/source/ui')
-rw-r--r--dbaccess/source/ui/control/FieldDescControl.cxx3
-rw-r--r--dbaccess/source/ui/dlg/indexdialog.cxx16
-rw-r--r--dbaccess/source/ui/dlg/queryfilter.cxx3
-rw-r--r--dbaccess/source/ui/dlg/queryorder.cxx6
-rw-r--r--dbaccess/source/ui/dlg/tablespage.cxx3
-rw-r--r--dbaccess/source/ui/misc/TokenWriter.cxx22
-rw-r--r--dbaccess/source/ui/misc/UITools.cxx6
-rw-r--r--dbaccess/source/ui/misc/indexcollection.cxx19
-rw-r--r--dbaccess/source/ui/querydesign/QueryDesignView.cxx7
-rw-r--r--dbaccess/source/ui/querydesign/querycontroller.cxx3
10 files changed, 28 insertions, 60 deletions
diff --git a/dbaccess/source/ui/control/FieldDescControl.cxx b/dbaccess/source/ui/control/FieldDescControl.cxx
index ad41b38aaa70..48bad58c95db 100644
--- a/dbaccess/source/ui/control/FieldDescControl.cxx
+++ b/dbaccess/source/ui/control/FieldDescControl.cxx
@@ -1146,8 +1146,7 @@ void OFieldDescControl::DisplayData(OFieldDescription* pFieldDescr )
ActivateAggregate( tpScale );
pScale->SetMax(::std::max<sal_Int32>(pFieldType->nMaximumScale,pFieldDescr->GetScale()));
pScale->SetMin(pFieldType->nMinimumScale);
- static const char s_sPRECISION[] = "PRECISION";
- pScale->SetSpecialReadOnly(pFieldType->aCreateParams.isEmpty() || pFieldType->aCreateParams == s_sPRECISION);
+ pScale->SetSpecialReadOnly(pFieldType->aCreateParams.isEmpty() || pFieldType->aCreateParams == "PRECISION");
}
else
DeactivateAggregate( tpScale );
diff --git a/dbaccess/source/ui/dlg/indexdialog.cxx b/dbaccess/source/ui/dlg/indexdialog.cxx
index d2758b0d51ac..d094ae91da98 100644
--- a/dbaccess/source/ui/dlg/indexdialog.cxx
+++ b/dbaccess/source/ui/dlg/indexdialog.cxx
@@ -37,12 +37,6 @@
#include <connectivity/dbtools.hxx>
#include <osl/diagnose.h>
-const char INDEX_NEW_CMD[] = ".index:createNew";
-const char INDEX_DROP_CMD[] = ".index:dropCurrent";
-const char INDEX_RENAME_CMD[] = ".index:renameCurrent";
-const char INDEX_SAVE_CMD[] = ".index:saveCurrent";
-const char INDEX_RESET_CMD[] = ".index:resetCurrent";
-
namespace dbaui
{
@@ -175,11 +169,11 @@ namespace dbaui
{
get(m_pActions, "ACTIONS");
- mnNewCmdId = m_pActions->GetItemId(INDEX_NEW_CMD);
- mnDropCmdId = m_pActions->GetItemId(INDEX_DROP_CMD);
- mnRenameCmdId = m_pActions->GetItemId(INDEX_RENAME_CMD);
- mnSaveCmdId = m_pActions->GetItemId(INDEX_SAVE_CMD);
- mnResetCmdId = m_pActions->GetItemId(INDEX_RESET_CMD);
+ mnNewCmdId = m_pActions->GetItemId(".index:createNew");
+ mnDropCmdId = m_pActions->GetItemId(".index:dropCurrent");
+ mnRenameCmdId = m_pActions->GetItemId(".index:renameCurrent");
+ mnSaveCmdId = m_pActions->GetItemId(".index:saveCurrent");
+ mnResetCmdId = m_pActions->GetItemId(".index:resetCurrent");
maScNewCmdImg = m_pActions->GetItemImage(mnNewCmdId);
maScDropCmdImg = m_pActions->GetItemImage(mnDropCmdId);
diff --git a/dbaccess/source/ui/dlg/queryfilter.cxx b/dbaccess/source/ui/dlg/queryfilter.cxx
index 710c5329ec56..acfc9376d32a 100644
--- a/dbaccess/source/ui/dlg/queryfilter.cxx
+++ b/dbaccess/source/ui/dlg/queryfilter.cxx
@@ -348,8 +348,7 @@ bool DlgFilterCrit::getCondition(const ListBox& _rField,const ListBox& _rComp,co
_rFilter.Name = ::dbtools::quoteName(aQuote,_rFilter.Name);
if ( !sTableName.isEmpty() )
{
- static const char sSep[] = ".";
- sTableName += sSep;
+ sTableName += ".";
sTableName += _rFilter.Name;
_rFilter.Name = sTableName;
}
diff --git a/dbaccess/source/ui/dlg/queryorder.cxx b/dbaccess/source/ui/dlg/queryorder.cxx
index b4952833a769..5e3c1205a07c 100644
--- a/dbaccess/source/ui/dlg/queryorder.cxx
+++ b/dbaccess/source/ui/dlg/queryorder.cxx
@@ -216,8 +216,6 @@ OUString DlgOrderCrit::GetOrderList( ) const
{
Reference<XDatabaseMetaData> xMetaData = m_xConnection->getMetaData();
OUString sQuote = xMetaData.is() ? xMetaData->getIdentifierQuoteString() : OUString();
- static const char sDESC[] = " DESC ";
- static const char sASC[] = " ASC ";
Reference< XNameAccess> xColumns = Reference< XColumnsSupplier >(m_xQueryComposer,UNO_QUERY)->getColumns();
@@ -232,9 +230,9 @@ OUString DlgOrderCrit::GetOrderList( ) const
OUString sName = m_aColumnList[i]->GetSelectEntry();
sOrder += ::dbtools::quoteName(sQuote,sName);
if(m_aValueList[i]->GetSelectEntryPos())
- sOrder += sDESC;
+ sOrder += " DESC ";
else
- sOrder += sASC;
+ sOrder += " ASC ";
}
}
return sOrder;
diff --git a/dbaccess/source/ui/dlg/tablespage.cxx b/dbaccess/source/ui/dlg/tablespage.cxx
index 7886c4483a81..365716964d6c 100644
--- a/dbaccess/source/ui/dlg/tablespage.cxx
+++ b/dbaccess/source/ui/dlg/tablespage.cxx
@@ -440,7 +440,6 @@ namespace dbaui
Sequence< OUString > OTableSubscriptionPage::collectDetailedSelection() const
{
Sequence< OUString > aTableFilter;
- static const char sDot[] = ".";
static const char sWildcard[] = "%";
OUString sComposedName;
@@ -494,7 +493,7 @@ namespace dbaui
}
}
bSchemaWildcard = OTableTreeListBox::isWildcardChecked(pSchema);
- sComposedName += m_pTablesList->GetEntryText( pSchema ) + sDot;
+ sComposedName += m_pTablesList->GetEntryText( pSchema ) + ".";
}
if (bSchemaWildcard)
diff --git a/dbaccess/source/ui/misc/TokenWriter.cxx b/dbaccess/source/ui/misc/TokenWriter.cxx
index cb7d8873356c..ba5e4b083079 100644
--- a/dbaccess/source/ui/misc/TokenWriter.cxx
+++ b/dbaccess/source/ui/misc/TokenWriter.cxx
@@ -74,11 +74,6 @@ using namespace ::com::sun::star::sdbcx;
using namespace ::com::sun::star::awt;
using namespace ::com::sun::star::util;
-const static char sMyBegComment[] = "<!-- ";
-const static char sMyEndComment[] = " -->";
-const static char sFontFamily[] = "font-family: ";
-const static char sFontSize[] = "font-size: ";
-
#define SBA_FORMAT_SELECTION_COUNT 4
#define CELL_X 1437
@@ -410,8 +405,6 @@ bool ORTFImportExport::Write()
m_pStream->WriteCharPtr( ";\\red255\\green255\\blue255;\\red192\\green192\\blue192;}" )
.WriteCharPtr( SAL_NEWLINE_STRING );
- static char const aTRRH[] = "\\trrh-270\\pard\\intbl";
- static char const aFS[] = "\\fs20\\f0\\cf0\\cb2";
static char const aCell1[] = "\\clbrdrl\\brdrs\\brdrcf0\\clbrdrt\\brdrs\\brdrcf0\\clbrdrb\\brdrs\\brdrcf0\\clbrdrr\\brdrs\\brdrcf0\\clshdng10000\\clcfpat2\\cellx";
m_pStream->WriteCharPtr( OOO_STRING_SVTOOLS_RTF_TROWD ).WriteCharPtr( OOO_STRING_SVTOOLS_RTF_TRGAPH );
@@ -442,7 +435,7 @@ bool ORTFImportExport::Write()
// column description
m_pStream->WriteChar( '{' ).WriteCharPtr( SAL_NEWLINE_STRING );
- m_pStream->WriteCharPtr( aTRRH );
+ m_pStream->WriteCharPtr( "\\trrh-270\\pard\\intbl" );
std::unique_ptr<OString[]> pHorzChar(new OString[nCount]);
@@ -481,7 +474,7 @@ bool ORTFImportExport::Write()
if ( bUnderline ) m_pStream->WriteCharPtr( OOO_STRING_SVTOOLS_RTF_UL );
if ( bStrikeout ) m_pStream->WriteCharPtr( OOO_STRING_SVTOOLS_RTF_STRIKE );
- m_pStream->WriteCharPtr( aFS );
+ m_pStream->WriteCharPtr( "\\fs20\\f0\\cf0\\cb2" );
m_pStream->WriteChar( ' ' );
RTFOutFuncs::Out_String(*m_pStream,sColumnName,eDestEnc);
@@ -546,7 +539,6 @@ void ORTFImportExport::appendRow(OString* pHorzChar,sal_Int32 _nColumnCount,sal_
m_pStream->WriteCharPtr( SAL_NEWLINE_STRING );
static char const aCell2[] = "\\clbrdrl\\brdrs\\brdrcf2\\clbrdrt\\brdrs\\brdrcf2\\clbrdrb\\brdrs\\brdrcf2\\clbrdrr\\brdrs\\brdrcf2\\clshdng10000\\clcfpat1\\cellx";
- static char const aTRRH[] = "\\trrh-270\\pard\\intbl";
for ( sal_Int32 i=1; i<=_nColumnCount; ++i )
{
@@ -562,7 +554,7 @@ void ORTFImportExport::appendRow(OString* pHorzChar,sal_Int32 _nColumnCount,sal_
Reference< XRowSet > xRowSet(m_xRow,UNO_QUERY);
m_pStream->WriteChar( '{' );
- m_pStream->WriteCharPtr( aTRRH );
+ m_pStream->WriteCharPtr( "\\trrh-270\\pard\\intbl" );
for ( sal_Int32 i=1; i <= _nColumnCount; ++i )
{
m_pStream->WriteCharPtr( SAL_NEWLINE_STRING );
@@ -711,15 +703,15 @@ void OHTMLImportExport::WriteBody()
IncIndent(1);
m_pStream->WriteCharPtr( "<" ).WriteCharPtr( OOO_STRING_SVTOOLS_HTML_style ).WriteCharPtr( " " ).WriteCharPtr( OOO_STRING_SVTOOLS_HTML_O_type ).WriteCharPtr( "=\"text/css\">" );
- m_pStream->WriteCharPtr( sMyBegComment ); OUT_LF();
- m_pStream->WriteCharPtr( OOO_STRING_SVTOOLS_HTML_body ).WriteCharPtr( " { " ).WriteCharPtr( sFontFamily ).WriteChar( '"' ).WriteCharPtr( OUStringToOString(m_aFont.Name, osl_getThreadTextEncoding()).getStr() ).WriteChar( '\"' );
+ m_pStream->WriteCharPtr( "<!-- " ); OUT_LF();
+ m_pStream->WriteCharPtr( OOO_STRING_SVTOOLS_HTML_body ).WriteCharPtr( " { " ).WriteCharPtr( "font-family: " ).WriteChar( '"' ).WriteCharPtr( OUStringToOString(m_aFont.Name, osl_getThreadTextEncoding()).getStr() ).WriteChar( '\"' );
// TODO : think about the encoding of the font name
- m_pStream->WriteCharPtr( "; " ).WriteCharPtr( sFontSize );
+ m_pStream->WriteCharPtr( "; " ).WriteCharPtr( "font-size: " );
m_pStream->WriteInt32AsString(m_aFont.Height);
m_pStream->WriteChar( '}' );
OUT_LF();
- m_pStream->WriteCharPtr( sMyEndComment );
+ m_pStream->WriteCharPtr( " -->" );
IncIndent(-1); OUT_LF(); TAG_OFF_LF( OOO_STRING_SVTOOLS_HTML_style );
OUT_LF();
diff --git a/dbaccess/source/ui/misc/UITools.cxx b/dbaccess/source/ui/misc/UITools.cxx
index 35ba9385d185..f416675c298e 100644
--- a/dbaccess/source/ui/misc/UITools.cxx
+++ b/dbaccess/source/ui/misc/UITools.cxx
@@ -436,8 +436,6 @@ void fillTypeInfo( const Reference< css::sdbc::XConnection>& _rxConnection,
// Information for a single SQL type
if(xRs.is())
{
- static const char aB1[] = " [ ";
- static const char aB2[] = " ]";
Reference<XResultSetMetaData> xResultSetMetaData = Reference<XResultSetMetaDataSupplier>(xRs,UNO_QUERY)->getMetaData();
::connectivity::ORowSetValue aValue;
::std::vector<sal_Int32> aTypes;
@@ -620,11 +618,11 @@ void fillTypeInfo( const Reference< css::sdbc::XConnection>& _rxConnection,
if ( !aName.isEmpty() )
{
pInfo->aUIName = aName;
- pInfo->aUIName += aB1;
+ pInfo->aUIName += " [ ";
}
pInfo->aUIName += pInfo->aTypeName;
if ( !aName.isEmpty() )
- pInfo->aUIName += aB2;
+ pInfo->aUIName += " ]";
// Now that we have the type info, save it in the multimap
_rTypeInfoMap.insert(OTypeInfoMap::value_type(pInfo->nType,pInfo));
}
diff --git a/dbaccess/source/ui/misc/indexcollection.cxx b/dbaccess/source/ui/misc/indexcollection.cxx
index b45dbd4df956..96e70108a69c 100644
--- a/dbaccess/source/ui/misc/indexcollection.cxx
+++ b/dbaccess/source/ui/misc/indexcollection.cxx
@@ -142,11 +142,9 @@ namespace dbaui
}
// set the properties
- static const char s_sUniquePropertyName[] = "IsUnique";
- static const char s_sSortPropertyName[] = "IsAscending";
static const char s_sNamePropertyName[] = "Name";
// the index' own props
- xIndexDescriptor->setPropertyValue(s_sUniquePropertyName, css::uno::makeAny(_rPos->bUnique));
+ xIndexDescriptor->setPropertyValue("IsUnique", css::uno::makeAny(_rPos->bUnique));
xIndexDescriptor->setPropertyValue(s_sNamePropertyName, makeAny(_rPos->sName));
// the fields
@@ -161,7 +159,7 @@ namespace dbaui
OSL_ENSURE(xColDescriptor.is(), "OIndexCollection::commitNewIndex: invalid column descriptor!");
if (xColDescriptor.is())
{
- xColDescriptor->setPropertyValue(s_sSortPropertyName, css::uno::makeAny(aFieldLoop->bSortAscending));
+ xColDescriptor->setPropertyValue("IsAscending", css::uno::makeAny(aFieldLoop->bSortAscending));
xColDescriptor->setPropertyValue(s_sNamePropertyName, makeAny(OUString(aFieldLoop->sFieldName)));
xAppendCols->appendByDescriptor(xColDescriptor);
}
@@ -244,14 +242,9 @@ namespace dbaui
void OIndexCollection::implFillIndexInfo(OIndex& _rIndex, const Reference< XPropertySet >& _rxDescriptor)
{
- static const char s_sPrimaryIndexPropertyName[] = "IsPrimaryKeyIndex";
- static const char s_sUniquePropertyName[] = "IsUnique";
- static const char s_sSortPropertyName[] = "IsAscending";
- static const char s_sCatalogPropertyName[] = "Catalog";
-
- _rIndex.bPrimaryKey = ::cppu::any2bool(_rxDescriptor->getPropertyValue(s_sPrimaryIndexPropertyName));
- _rIndex.bUnique = ::cppu::any2bool(_rxDescriptor->getPropertyValue(s_sUniquePropertyName));
- _rxDescriptor->getPropertyValue(s_sCatalogPropertyName) >>= _rIndex.sDescription;
+ _rIndex.bPrimaryKey = ::cppu::any2bool(_rxDescriptor->getPropertyValue("IsPrimaryKeyIndex"));
+ _rIndex.bUnique = ::cppu::any2bool(_rxDescriptor->getPropertyValue("IsUnique"));
+ _rxDescriptor->getPropertyValue("Catalog") >>= _rIndex.sDescription;
// the columns
Reference< XColumnsSupplier > xSuppCols(_rxDescriptor, UNO_QUERY);
@@ -283,7 +276,7 @@ namespace dbaui
// get the relevant properties
aCopyTo->sFieldName = *pFieldNames;
- aCopyTo->bSortAscending = ::cppu::any2bool(xIndexColumn->getPropertyValue(s_sSortPropertyName));
+ aCopyTo->bSortAscending = ::cppu::any2bool(xIndexColumn->getPropertyValue("IsAscending"));
}
_rIndex.aFields.resize(aCopyTo - _rIndex.aFields.begin());
diff --git a/dbaccess/source/ui/querydesign/QueryDesignView.cxx b/dbaccess/source/ui/querydesign/QueryDesignView.cxx
index e5186d843a83..09228c144435 100644
--- a/dbaccess/source/ui/querydesign/QueryDesignView.cxx
+++ b/dbaccess/source/ui/querydesign/QueryDesignView.cxx
@@ -630,9 +630,6 @@ namespace
OJoinTableView::OTableWindowMap& rTabList = _pView->getTableView()->GetTabWinMap();
- static const char sFieldSeparator[] = ", ";
- static const char s_sAs[] = " AS ";
-
aIter = _rFieldList.begin();
for(;aIter != aEnd;++aIter)
{
@@ -689,11 +686,11 @@ namespace
pEntryField->isNumericOrAggreateFunction() ||
pEntryField->isOtherFunction()))
{
- aTmpStr.append(s_sAs);
+ aTmpStr.append(" AS ");
aTmpStr.append(::dbtools::quoteName(aQuote, rFieldAlias));
}
aFieldListStr.append(aTmpStr.makeStringAndClear());
- aFieldListStr.append(sFieldSeparator);
+ aFieldListStr.append(", ");
}
}
if(!aFieldListStr.isEmpty())
diff --git a/dbaccess/source/ui/querydesign/querycontroller.cxx b/dbaccess/source/ui/querydesign/querycontroller.cxx
index 3fa97d7c37bb..6dac16d1492c 100644
--- a/dbaccess/source/ui/querydesign/querycontroller.cxx
+++ b/dbaccess/source/ui/querydesign/querycontroller.cxx
@@ -279,9 +279,8 @@ namespace
*/
void grabFocusFromLimitBox( OQueryController& _rController )
{
- static const char sResourceURL[] = "private:resource/toolbar/designobjectbar";
Reference< XLayoutManager > xLayoutManager = OGenericUnoController::getLayoutManager( _rController.getFrame() );
- Reference< XUIElement > xUIElement = xLayoutManager->getElement(sResourceURL);
+ Reference< XUIElement > xUIElement = xLayoutManager->getElement("private:resource/toolbar/designobjectbar");
if (xUIElement.is())
{
Reference< XWindow > xWindow(xUIElement->getRealInterface(), css::uno::UNO_QUERY);