Kaydet (Commit) 22864b44 authored tarafından Noel Grandin's avatar Noel Grandin Kaydeden (comit) Noel Grandin

loplugin:singlevalfields in dbaccess

Change-Id: I5c8990187b2b488eb75369c2a3e3dc7f855ce06a
Reviewed-on: https://gerrit.libreoffice.org/26633Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarNoel Grandin <noelgrandin@gmail.com>
üst cea4c1af
......@@ -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;
......
......@@ -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());
}
}
......
......@@ -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
//
......
......@@ -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;
......
......@@ -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); }
......
......@@ -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)
{
}
......
......@@ -40,9 +40,6 @@ namespace dbaui
private:
sal_uInt16 m_nCurUndoActId;
protected:
bool m_bClipboardFilled;
public:
OTableRowView(vcl::Window* pParent);
......
......@@ -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 );
......
......@@ -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 );
......
......@@ -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()))
{
......
......@@ -123,7 +123,6 @@ class ProgressCmdEnv
DialogHelper* m_pDialogHelper;
OUString m_sTitle;
bool m_bAborted;
bool m_bWarnUser;
sal_Int32 m_nCurrentProgress;
......@@ -147,7 +146,6 @@ public:
: m_xContext( rContext )
, m_pDialogHelper( pDialogHelper )
, m_sTitle( rTitle )
, m_bAborted( false )
, m_bWarnUser( false )
, m_nCurrentProgress(0)
{}
......@@ -158,7 +156,6 @@ public:
void stopProgress();
void progressSection( const OUString &rText,
const uno::Reference< task::XAbortChannel > &xAbortChannel = nullptr );
inline bool isAborted() const { return m_bAborted; }
inline void setWarnUser( bool bNewVal ) { m_bWarnUser = bNewVal; }
// XCommandEnvironment
......@@ -295,26 +292,20 @@ void ProgressCmdEnv::progressSection( const OUString &rText,
const uno::Reference< task::XAbortChannel > &xAbortChannel )
{
m_xAbortChannel = xAbortChannel;
if (! m_bAborted)
m_nCurrentProgress = 0;
if ( m_pDialogHelper )
{
m_nCurrentProgress = 0;
if ( m_pDialogHelper )
{
m_pDialogHelper->updateProgress( rText, xAbortChannel );
m_pDialogHelper->updateProgress( 5 );
}
m_pDialogHelper->updateProgress( rText, xAbortChannel );
m_pDialogHelper->updateProgress( 5 );
}
}
void ProgressCmdEnv::updateProgress()
{
if ( ! m_bAborted )
{
long nProgress = ((m_nCurrentProgress*5) % 100) + 5;
if ( m_pDialogHelper )
m_pDialogHelper->updateProgress( nProgress );
}
long nProgress = ((m_nCurrentProgress*5) % 100) + 5;
if ( m_pDialogHelper )
m_pDialogHelper->updateProgress( nProgress );
}
......@@ -730,7 +721,7 @@ void ExtensionCmdQueue::Thread::execute()
// addExtension is called, which then blocks the main thread, then we deadlock.
bool bStartProgress = true;
while ( !currentCmdEnv->isAborted() && --nSize >= 0 )
while ( --nSize >= 0 )
{
{
osl::MutexGuard aGuard( m_mutex );
......
......@@ -92,7 +92,6 @@ private:
sal_Int32 _iMax;
sal_Int32 _iProgress;
BitmapMode _eBitmapMode;
bool _bPaintBitmap;
bool _bPaintProgress;
bool _bVisible;
bool _bShowLogo;
......@@ -163,7 +162,6 @@ SplashScreen::SplashScreen()
, _iMax(100)
, _iProgress(0)
, _eBitmapMode(BM_DEFAULTMODE)
, _bPaintBitmap(true)
, _bPaintProgress(false)
, _bVisible(true)
, _bShowLogo(true)
......@@ -646,8 +644,7 @@ void SplashScreenWindow::Paint(vcl::RenderContext& rRenderContext, const Rectang
// non native drawing
// draw bitmap
if (pSpl->_bPaintBitmap)
_vdev->DrawBitmapEx(Point(), pSpl->_aIntroBmp);
_vdev->DrawBitmapEx(Point(), pSpl->_aIntroBmp);
if (pSpl->_bPaintProgress) {
// draw progress...
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment