summaryrefslogtreecommitdiff
path: root/dbaccess
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2016-06-24 12:57:04 +0200
committerNoel Grandin <noelgrandin@gmail.com>2016-06-27 05:18:07 +0000
commit22864b44fd00b5a778ef597f8dfcb407d4166306 (patch)
treefbdaa2e7c1aae149dab6194f9033b9543c74b441 /dbaccess
parentcea4c1afdf4ae0cbda8ae531f2e26d911d0fd6e1 (diff)
loplugin:singlevalfields in dbaccess
Change-Id: I5c8990187b2b488eb75369c2a3e3dc7f855ce06a Reviewed-on: https://gerrit.libreoffice.org/26633 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'dbaccess')
-rw-r--r--dbaccess/source/ui/control/SqlNameEdit.cxx2
-rw-r--r--dbaccess/source/ui/control/VertSplitView.cxx81
-rw-r--r--dbaccess/source/ui/control/dbtreelistbox.cxx3
-rw-r--r--dbaccess/source/ui/dlg/dbfindex.cxx15
-rw-r--r--dbaccess/source/ui/dlg/dbfindex.hxx3
-rw-r--r--dbaccess/source/ui/inc/SqlNameEdit.hxx2
-rw-r--r--dbaccess/source/ui/inc/TableDesignControl.hxx3
-rw-r--r--dbaccess/source/ui/inc/VertSplitView.hxx1
-rw-r--r--dbaccess/source/ui/inc/dbtreelistbox.hxx2
-rw-r--r--dbaccess/source/ui/tabledesign/TableDesignControl.cxx3
10 files changed, 29 insertions, 86 deletions
diff --git a/dbaccess/source/ui/control/SqlNameEdit.cxx b/dbaccess/source/ui/control/SqlNameEdit.cxx
index 5c025afd9655..4f89d37dd8fe 100644
--- a/dbaccess/source/ui/control/SqlNameEdit.cxx
+++ b/dbaccess/source/ui/control/SqlNameEdit.cxx
@@ -41,7 +41,7 @@ namespace dbaui
sal_Int32 nMatch = 0;
for (sal_Int32 i = nMatch; i < _sToCheck.getLength(); ++i)
{
- if ( !isCharOk( _sToCheck[i], i == 0, m_bOnlyUpperCase, m_sAllowedChars ) )
+ if ( !isCharOk( _sToCheck[i], i == 0, false/*bOnlyUpperCase*/, m_sAllowedChars ) )
{
_rsCorrected += _sToCheck.copy(nMatch, i - nMatch);
bCorrected = true;
diff --git a/dbaccess/source/ui/control/VertSplitView.cxx b/dbaccess/source/ui/control/VertSplitView.cxx
index bf9dd114b3cf..4b79daa64ca8 100644
--- a/dbaccess/source/ui/control/VertSplitView.cxx
+++ b/dbaccess/source/ui/control/VertSplitView.cxx
@@ -32,7 +32,6 @@ OSplitterView::OSplitterView(vcl::Window* _pParent) : Window(_pParent,WB_DIALOGC
,m_pSplitter( nullptr )
,m_pLeft(nullptr)
,m_pRight(nullptr)
- ,m_bVertical(false)
{
ImplInitSettings();
}
@@ -53,13 +52,7 @@ void OSplitterView::dispose()
IMPL_LINK_NOARG_TYPED( OSplitterView, SplitHdl, Splitter*, void )
{
OSL_ENSURE(m_pSplitter, "Splitter is NULL!");
- if ( m_bVertical )
- {
- long nPosY = m_pSplitter->GetPosPixel().Y();
- m_pSplitter->SetPosPixel( Point( m_pSplitter->GetSplitPosPixel(), nPosY ) );
- }
- else
- m_pSplitter->SetPosPixel( Point( m_pSplitter->GetPosPixel().X(),m_pSplitter->GetSplitPosPixel() ) );
+ m_pSplitter->SetPosPixel( Point( m_pSplitter->GetPosPixel().X(),m_pSplitter->GetSplitPosPixel() ) );
Resize();
}
@@ -123,61 +116,31 @@ void OSplitterView::Resize()
{
aSplitPos = m_pSplitter->GetPosPixel();
aSplitSize = m_pSplitter->GetOutputSizePixel();
- if ( m_bVertical )
- {
- // calculate the splitter pos and size
- aSplitPos.Y() = aPlaygroundPos.Y();
- aSplitSize.Height() = aPlaygroundSize.Height();
-
- if( ( aSplitPos.X() + aSplitSize.Width() ) > ( aPlaygroundSize.Width() ))
- aSplitPos.X() = aPlaygroundSize.Width() - aSplitSize.Width();
-
- if( aSplitPos.X() <= aPlaygroundPos.X() )
- aSplitPos.X() = aPlaygroundPos.X() + sal_Int32(aPlaygroundSize.Width() * 0.3);
-
- // the tree pos and size
- Point aTreeViewPos( aPlaygroundPos );
- Size aTreeViewSize( aSplitPos.X(), aPlaygroundSize.Height() );
-
- // set the size of treelistbox
- m_pLeft->SetPosSizePixel( aTreeViewPos, aTreeViewSize );
-
- //set the size of the splitter
- m_pSplitter->SetPosSizePixel( aSplitPos, Size( aSplitSize.Width(), aPlaygroundSize.Height() ) );
- m_pSplitter->SetDragRectPixel( Rectangle(aPlaygroundPos,aPlaygroundSize) );
- }
- else
- {
- aSplitPos.X() = aPlaygroundPos.X();
- aSplitSize.Width() = aPlaygroundSize.Width();
-
- if( ( aSplitPos.Y() + aSplitSize.Height() ) > ( aPlaygroundSize.Height() ))
- aSplitPos.Y() = aPlaygroundSize.Height() - aSplitSize.Height();
-
- if( aSplitPos.Y() <= aPlaygroundPos.Y() )
- aSplitPos.Y() = aPlaygroundPos.Y() + sal_Int32(aPlaygroundSize.Height() * 0.3);
-
- // the tree pos and size
- Point aTreeViewPos( aPlaygroundPos );
- Size aTreeViewSize( aPlaygroundSize.Width() ,aSplitPos.Y());
-
- // set the size of treelistbox
- m_pLeft->SetPosSizePixel( aTreeViewPos, aTreeViewSize );
-
- //set the size of the splitter
- m_pSplitter->SetPosSizePixel( aSplitPos, Size( aPlaygroundSize.Width(), aSplitSize.Height() ) );
- m_pSplitter->SetDragRectPixel( Rectangle(aPlaygroundPos,aPlaygroundSize) );
- }
+ aSplitPos.X() = aPlaygroundPos.X();
+ aSplitSize.Width() = aPlaygroundSize.Width();
+
+ if( ( aSplitPos.Y() + aSplitSize.Height() ) > ( aPlaygroundSize.Height() ))
+ aSplitPos.Y() = aPlaygroundSize.Height() - aSplitSize.Height();
+
+ if( aSplitPos.Y() <= aPlaygroundPos.Y() )
+ aSplitPos.Y() = aPlaygroundPos.Y() + sal_Int32(aPlaygroundSize.Height() * 0.3);
+
+ // the tree pos and size
+ Point aTreeViewPos( aPlaygroundPos );
+ Size aTreeViewSize( aPlaygroundSize.Width() ,aSplitPos.Y());
+
+ // set the size of treelistbox
+ m_pLeft->SetPosSizePixel( aTreeViewPos, aTreeViewSize );
+
+ //set the size of the splitter
+ m_pSplitter->SetPosSizePixel( aSplitPos, Size( aPlaygroundSize.Width(), aSplitSize.Height() ) );
+ m_pSplitter->SetDragRectPixel( Rectangle(aPlaygroundPos,aPlaygroundSize) );
}
if ( m_pRight )
{
- if ( m_bVertical )
- m_pRight->setPosSizePixel( aSplitPos.X() + aSplitSize.Width(), aPlaygroundPos.Y(),
- aPlaygroundSize.Width() - aSplitSize.Width() - aSplitPos.X(), aPlaygroundSize.Height());
- else
- m_pRight->setPosSizePixel( aSplitPos.X(), aPlaygroundPos.Y() + aSplitPos.Y() + aSplitSize.Height(),
- aPlaygroundSize.Width() , aPlaygroundSize.Height() - aSplitSize.Height() - aSplitPos.Y());
+ m_pRight->setPosSizePixel( aSplitPos.X() + aSplitSize.Width(), aPlaygroundPos.Y(),
+ aPlaygroundSize.Width() - aSplitSize.Width() - aSplitPos.X(), aPlaygroundSize.Height());
}
}
diff --git a/dbaccess/source/ui/control/dbtreelistbox.cxx b/dbaccess/source/ui/control/dbtreelistbox.cxx
index d212bd2ce689..a2747862723a 100644
--- a/dbaccess/source/ui/control/dbtreelistbox.cxx
+++ b/dbaccess/source/ui/control/dbtreelistbox.cxx
@@ -59,7 +59,6 @@ DBTreeListBox::DBTreeListBox( vcl::Window* pParent, WinBits nWinStyle )
,m_pDragedEntry(nullptr)
,m_pActionListener(nullptr)
,m_pContextMenuProvider( nullptr )
- ,m_bHandleEnterKey(false)
{
init();
}
@@ -339,7 +338,7 @@ void DBTreeListBox::KeyInput( const KeyEvent& rKEvt )
if ( KEY_RETURN == nCode )
{
- bHandled = m_bHandleEnterKey;
+ bHandled = false;
m_aEnterKeyHdl.Call(this);
// this is a HACK. If the data source browser is opened in the "beamer", while the main frame
//
diff --git a/dbaccess/source/ui/dlg/dbfindex.cxx b/dbaccess/source/ui/dlg/dbfindex.cxx
index 8a6a50d1d6a5..c9860820633e 100644
--- a/dbaccess/source/ui/dlg/dbfindex.cxx
+++ b/dbaccess/source/ui/dlg/dbfindex.cxx
@@ -44,7 +44,6 @@ const OString aGroupIdent("dBase III");
ODbaseIndexDialog::ODbaseIndexDialog(vcl::Window * pParent, const OUString& aDataSrcName)
: ModalDialog(pParent, "DBaseIndexDialog", "dbaccess/ui/dbaseindexdialog.ui")
, m_aDSN(aDataSrcName)
- , m_bCaseSensitiv(true)
{
get(m_pPB_OK, "ok");
get(m_pCB_Tables, "table");
@@ -103,16 +102,8 @@ bool ODbaseIndexDialog::GetTable(const OUString& _rName, TableInfoList::iterator
++_rPosition
)
{
- if (m_bCaseSensitiv)
- {
- if (_rPosition->aTableName == _rName)
- return true;
- }
- else
- {
- if (_rPosition->aTableName.equalsIgnoreAsciiCase(_rName))
- return true;
- }
+ if (_rPosition->aTableName == _rName)
+ return true;
}
return false;
}
@@ -138,7 +129,7 @@ OTableIndex ODbaseIndexDialog::implRemoveIndex(const OUString& _rName, TableInde
++aSearch, ++nPos
)
{
- if ( m_bCaseSensitiv ? aSearch->GetIndexFileName() == _rName : aSearch->GetIndexFileName().equalsIgnoreAsciiCase(_rName) )
+ if ( aSearch->GetIndexFileName() == _rName )
{
aReturn = *aSearch;
diff --git a/dbaccess/source/ui/dlg/dbfindex.hxx b/dbaccess/source/ui/dlg/dbfindex.hxx
index 53358165c356..a2991475c683 100644
--- a/dbaccess/source/ui/dlg/dbfindex.hxx
+++ b/dbaccess/source/ui/dlg/dbfindex.hxx
@@ -93,13 +93,12 @@ protected:
OUString m_aDSN;
TableInfoList m_aTableInfoList;
TableIndexList m_aFreeIndexList;
- bool m_bCaseSensitiv;
void Init();
void SetCtrls();
bool GetTable(const OUString& rName, TableInfoList::iterator& _rPosition);
- OTableIndex implRemoveIndex(const OUString& _rName, TableIndexList& _rList, ListBox& _rDisplay, bool _bMustExist);
+ static OTableIndex implRemoveIndex(const OUString& _rName, TableIndexList& _rList, ListBox& _rDisplay, bool _bMustExist);
static void implInsertIndex(const OTableIndex& _rIndex, TableIndexList& _rList, ListBox& _rDisplay);
OTableIndex RemoveFreeIndex( const OUString& _rName, bool _bMustExist ) { return implRemoveIndex(_rName, m_aFreeIndexList, *m_pLB_FreeIndexes, _bMustExist); }
diff --git a/dbaccess/source/ui/inc/SqlNameEdit.hxx b/dbaccess/source/ui/inc/SqlNameEdit.hxx
index 9889c9815d48..253fc5432400 100644
--- a/dbaccess/source/ui/inc/SqlNameEdit.hxx
+++ b/dbaccess/source/ui/inc/SqlNameEdit.hxx
@@ -27,12 +27,10 @@ namespace dbaui
class OSQLNameChecker
{
OUString m_sAllowedChars;
- bool m_bOnlyUpperCase;
bool m_bCheck; // true when we should check for invalid chars
public:
OSQLNameChecker(const OUString& _rAllowedChars)
:m_sAllowedChars(_rAllowedChars)
- ,m_bOnlyUpperCase(false)
,m_bCheck(true)
{
}
diff --git a/dbaccess/source/ui/inc/TableDesignControl.hxx b/dbaccess/source/ui/inc/TableDesignControl.hxx
index a4845f45e13e..46d356531a16 100644
--- a/dbaccess/source/ui/inc/TableDesignControl.hxx
+++ b/dbaccess/source/ui/inc/TableDesignControl.hxx
@@ -40,9 +40,6 @@ namespace dbaui
private:
sal_uInt16 m_nCurUndoActId;
- protected:
- bool m_bClipboardFilled;
-
public:
OTableRowView(vcl::Window* pParent);
diff --git a/dbaccess/source/ui/inc/VertSplitView.hxx b/dbaccess/source/ui/inc/VertSplitView.hxx
index 03e40961992d..a7bf3fc886c6 100644
--- a/dbaccess/source/ui/inc/VertSplitView.hxx
+++ b/dbaccess/source/ui/inc/VertSplitView.hxx
@@ -30,7 +30,6 @@ namespace dbaui
VclPtr<Splitter> m_pSplitter;
VclPtr<vcl::Window> m_pLeft;
VclPtr<vcl::Window> m_pRight;
- bool m_bVertical;
void ImplInitSettings();
DECL_LINK_TYPED( SplitHdl, Splitter*, void );
diff --git a/dbaccess/source/ui/inc/dbtreelistbox.hxx b/dbaccess/source/ui/inc/dbtreelistbox.hxx
index 9a7413a6f0f0..0e57fcf40b4a 100644
--- a/dbaccess/source/ui/inc/dbtreelistbox.hxx
+++ b/dbaccess/source/ui/inc/dbtreelistbox.hxx
@@ -68,8 +68,6 @@ namespace dbaui
Link<LinkParamNone*,void> m_aDeleteHandler; // called when someone press DELETE Key
Link<DBTreeListBox*,void> m_aEnterKeyHdl;
- bool m_bHandleEnterKey;
-
private:
void init();
DECL_LINK_TYPED( OnTimeOut, Timer*, void );
diff --git a/dbaccess/source/ui/tabledesign/TableDesignControl.cxx b/dbaccess/source/ui/tabledesign/TableDesignControl.cxx
index 668edcd69958..62dc378f5aa6 100644
--- a/dbaccess/source/ui/tabledesign/TableDesignControl.cxx
+++ b/dbaccess/source/ui/tabledesign/TableDesignControl.cxx
@@ -41,7 +41,6 @@ OTableRowView::OTableRowView(vcl::Window* pParent)
,m_nDataPos(-1)
,m_nCurrentPos(-1)
,m_nCurUndoActId(0)
- ,m_bClipboardFilled(false)
{
}
@@ -111,7 +110,7 @@ void OTableRowView::Command(const CommandEvent& rEvt)
long nSelectRowCount = GetSelectRowCount();
aContextMenu->EnableItem( SID_CUT, nSelectRowCount != 0);
aContextMenu->EnableItem( SID_COPY, nSelectRowCount != 0);
- aContextMenu->EnableItem( SID_PASTE, m_bClipboardFilled );
+ aContextMenu->EnableItem( SID_PASTE, false );
aContextMenu->EnableItem( SID_DELETE, false );
switch (aContextMenu->Execute(this, rEvt.GetMousePosPixel()))
{