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 ...@@ -41,7 +41,7 @@ namespace dbaui
sal_Int32 nMatch = 0; sal_Int32 nMatch = 0;
for (sal_Int32 i = nMatch; i < _sToCheck.getLength(); ++i) 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); _rsCorrected += _sToCheck.copy(nMatch, i - nMatch);
bCorrected = true; bCorrected = true;
......
...@@ -32,7 +32,6 @@ OSplitterView::OSplitterView(vcl::Window* _pParent) : Window(_pParent,WB_DIALOGC ...@@ -32,7 +32,6 @@ OSplitterView::OSplitterView(vcl::Window* _pParent) : Window(_pParent,WB_DIALOGC
,m_pSplitter( nullptr ) ,m_pSplitter( nullptr )
,m_pLeft(nullptr) ,m_pLeft(nullptr)
,m_pRight(nullptr) ,m_pRight(nullptr)
,m_bVertical(false)
{ {
ImplInitSettings(); ImplInitSettings();
} }
...@@ -53,12 +52,6 @@ void OSplitterView::dispose() ...@@ -53,12 +52,6 @@ void OSplitterView::dispose()
IMPL_LINK_NOARG_TYPED( OSplitterView, SplitHdl, Splitter*, void ) IMPL_LINK_NOARG_TYPED( OSplitterView, SplitHdl, Splitter*, void )
{ {
OSL_ENSURE(m_pSplitter, "Splitter is NULL!"); 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(); Resize();
...@@ -123,31 +116,6 @@ void OSplitterView::Resize() ...@@ -123,31 +116,6 @@ void OSplitterView::Resize()
{ {
aSplitPos = m_pSplitter->GetPosPixel(); aSplitPos = m_pSplitter->GetPosPixel();
aSplitSize = m_pSplitter->GetOutputSizePixel(); 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(); aSplitPos.X() = aPlaygroundPos.X();
aSplitSize.Width() = aPlaygroundSize.Width(); aSplitSize.Width() = aPlaygroundSize.Width();
...@@ -168,16 +136,11 @@ void OSplitterView::Resize() ...@@ -168,16 +136,11 @@ void OSplitterView::Resize()
m_pSplitter->SetPosSizePixel( aSplitPos, Size( aPlaygroundSize.Width(), aSplitSize.Height() ) ); m_pSplitter->SetPosSizePixel( aSplitPos, Size( aPlaygroundSize.Width(), aSplitSize.Height() ) );
m_pSplitter->SetDragRectPixel( Rectangle(aPlaygroundPos,aPlaygroundSize) ); m_pSplitter->SetDragRectPixel( Rectangle(aPlaygroundPos,aPlaygroundSize) );
} }
}
if ( m_pRight ) if ( m_pRight )
{ {
if ( m_bVertical )
m_pRight->setPosSizePixel( aSplitPos.X() + aSplitSize.Width(), aPlaygroundPos.Y(), m_pRight->setPosSizePixel( aSplitPos.X() + aSplitSize.Width(), aPlaygroundPos.Y(),
aPlaygroundSize.Width() - aSplitSize.Width() - aSplitPos.X(), aPlaygroundSize.Height()); 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());
} }
} }
......
...@@ -59,7 +59,6 @@ DBTreeListBox::DBTreeListBox( vcl::Window* pParent, WinBits nWinStyle ) ...@@ -59,7 +59,6 @@ DBTreeListBox::DBTreeListBox( vcl::Window* pParent, WinBits nWinStyle )
,m_pDragedEntry(nullptr) ,m_pDragedEntry(nullptr)
,m_pActionListener(nullptr) ,m_pActionListener(nullptr)
,m_pContextMenuProvider( nullptr ) ,m_pContextMenuProvider( nullptr )
,m_bHandleEnterKey(false)
{ {
init(); init();
} }
...@@ -339,7 +338,7 @@ void DBTreeListBox::KeyInput( const KeyEvent& rKEvt ) ...@@ -339,7 +338,7 @@ void DBTreeListBox::KeyInput( const KeyEvent& rKEvt )
if ( KEY_RETURN == nCode ) if ( KEY_RETURN == nCode )
{ {
bHandled = m_bHandleEnterKey; bHandled = false;
m_aEnterKeyHdl.Call(this); m_aEnterKeyHdl.Call(this);
// this is a HACK. If the data source browser is opened in the "beamer", while the main frame // 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"); ...@@ -44,7 +44,6 @@ const OString aGroupIdent("dBase III");
ODbaseIndexDialog::ODbaseIndexDialog(vcl::Window * pParent, const OUString& aDataSrcName) ODbaseIndexDialog::ODbaseIndexDialog(vcl::Window * pParent, const OUString& aDataSrcName)
: ModalDialog(pParent, "DBaseIndexDialog", "dbaccess/ui/dbaseindexdialog.ui") : ModalDialog(pParent, "DBaseIndexDialog", "dbaccess/ui/dbaseindexdialog.ui")
, m_aDSN(aDataSrcName) , m_aDSN(aDataSrcName)
, m_bCaseSensitiv(true)
{ {
get(m_pPB_OK, "ok"); get(m_pPB_OK, "ok");
get(m_pCB_Tables, "table"); get(m_pCB_Tables, "table");
...@@ -102,18 +101,10 @@ bool ODbaseIndexDialog::GetTable(const OUString& _rName, TableInfoList::iterator ...@@ -102,18 +101,10 @@ bool ODbaseIndexDialog::GetTable(const OUString& _rName, TableInfoList::iterator
_rPosition != m_aTableInfoList.end(); _rPosition != m_aTableInfoList.end();
++_rPosition ++_rPosition
) )
{
if (m_bCaseSensitiv)
{ {
if (_rPosition->aTableName == _rName) if (_rPosition->aTableName == _rName)
return true; return true;
} }
else
{
if (_rPosition->aTableName.equalsIgnoreAsciiCase(_rName))
return true;
}
}
return false; return false;
} }
...@@ -138,7 +129,7 @@ OTableIndex ODbaseIndexDialog::implRemoveIndex(const OUString& _rName, TableInde ...@@ -138,7 +129,7 @@ OTableIndex ODbaseIndexDialog::implRemoveIndex(const OUString& _rName, TableInde
++aSearch, ++nPos ++aSearch, ++nPos
) )
{ {
if ( m_bCaseSensitiv ? aSearch->GetIndexFileName() == _rName : aSearch->GetIndexFileName().equalsIgnoreAsciiCase(_rName) ) if ( aSearch->GetIndexFileName() == _rName )
{ {
aReturn = *aSearch; aReturn = *aSearch;
......
...@@ -93,13 +93,12 @@ protected: ...@@ -93,13 +93,12 @@ protected:
OUString m_aDSN; OUString m_aDSN;
TableInfoList m_aTableInfoList; TableInfoList m_aTableInfoList;
TableIndexList m_aFreeIndexList; TableIndexList m_aFreeIndexList;
bool m_bCaseSensitiv;
void Init(); void Init();
void SetCtrls(); void SetCtrls();
bool GetTable(const OUString& rName, TableInfoList::iterator& _rPosition); 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); 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); } OTableIndex RemoveFreeIndex( const OUString& _rName, bool _bMustExist ) { return implRemoveIndex(_rName, m_aFreeIndexList, *m_pLB_FreeIndexes, _bMustExist); }
......
...@@ -27,12 +27,10 @@ namespace dbaui ...@@ -27,12 +27,10 @@ namespace dbaui
class OSQLNameChecker class OSQLNameChecker
{ {
OUString m_sAllowedChars; OUString m_sAllowedChars;
bool m_bOnlyUpperCase;
bool m_bCheck; // true when we should check for invalid chars bool m_bCheck; // true when we should check for invalid chars
public: public:
OSQLNameChecker(const OUString& _rAllowedChars) OSQLNameChecker(const OUString& _rAllowedChars)
:m_sAllowedChars(_rAllowedChars) :m_sAllowedChars(_rAllowedChars)
,m_bOnlyUpperCase(false)
,m_bCheck(true) ,m_bCheck(true)
{ {
} }
......
...@@ -40,9 +40,6 @@ namespace dbaui ...@@ -40,9 +40,6 @@ namespace dbaui
private: private:
sal_uInt16 m_nCurUndoActId; sal_uInt16 m_nCurUndoActId;
protected:
bool m_bClipboardFilled;
public: public:
OTableRowView(vcl::Window* pParent); OTableRowView(vcl::Window* pParent);
......
...@@ -30,7 +30,6 @@ namespace dbaui ...@@ -30,7 +30,6 @@ namespace dbaui
VclPtr<Splitter> m_pSplitter; VclPtr<Splitter> m_pSplitter;
VclPtr<vcl::Window> m_pLeft; VclPtr<vcl::Window> m_pLeft;
VclPtr<vcl::Window> m_pRight; VclPtr<vcl::Window> m_pRight;
bool m_bVertical;
void ImplInitSettings(); void ImplInitSettings();
DECL_LINK_TYPED( SplitHdl, Splitter*, void ); DECL_LINK_TYPED( SplitHdl, Splitter*, void );
......
...@@ -68,8 +68,6 @@ namespace dbaui ...@@ -68,8 +68,6 @@ namespace dbaui
Link<LinkParamNone*,void> m_aDeleteHandler; // called when someone press DELETE Key Link<LinkParamNone*,void> m_aDeleteHandler; // called when someone press DELETE Key
Link<DBTreeListBox*,void> m_aEnterKeyHdl; Link<DBTreeListBox*,void> m_aEnterKeyHdl;
bool m_bHandleEnterKey;
private: private:
void init(); void init();
DECL_LINK_TYPED( OnTimeOut, Timer*, void ); DECL_LINK_TYPED( OnTimeOut, Timer*, void );
......
...@@ -41,7 +41,6 @@ OTableRowView::OTableRowView(vcl::Window* pParent) ...@@ -41,7 +41,6 @@ OTableRowView::OTableRowView(vcl::Window* pParent)
,m_nDataPos(-1) ,m_nDataPos(-1)
,m_nCurrentPos(-1) ,m_nCurrentPos(-1)
,m_nCurUndoActId(0) ,m_nCurUndoActId(0)
,m_bClipboardFilled(false)
{ {
} }
...@@ -111,7 +110,7 @@ void OTableRowView::Command(const CommandEvent& rEvt) ...@@ -111,7 +110,7 @@ void OTableRowView::Command(const CommandEvent& rEvt)
long nSelectRowCount = GetSelectRowCount(); long nSelectRowCount = GetSelectRowCount();
aContextMenu->EnableItem( SID_CUT, nSelectRowCount != 0); aContextMenu->EnableItem( SID_CUT, nSelectRowCount != 0);
aContextMenu->EnableItem( SID_COPY, nSelectRowCount != 0); aContextMenu->EnableItem( SID_COPY, nSelectRowCount != 0);
aContextMenu->EnableItem( SID_PASTE, m_bClipboardFilled ); aContextMenu->EnableItem( SID_PASTE, false );
aContextMenu->EnableItem( SID_DELETE, false ); aContextMenu->EnableItem( SID_DELETE, false );
switch (aContextMenu->Execute(this, rEvt.GetMousePosPixel())) switch (aContextMenu->Execute(this, rEvt.GetMousePosPixel()))
{ {
......
...@@ -123,7 +123,6 @@ class ProgressCmdEnv ...@@ -123,7 +123,6 @@ class ProgressCmdEnv
DialogHelper* m_pDialogHelper; DialogHelper* m_pDialogHelper;
OUString m_sTitle; OUString m_sTitle;
bool m_bAborted;
bool m_bWarnUser; bool m_bWarnUser;
sal_Int32 m_nCurrentProgress; sal_Int32 m_nCurrentProgress;
...@@ -147,7 +146,6 @@ public: ...@@ -147,7 +146,6 @@ public:
: m_xContext( rContext ) : m_xContext( rContext )
, m_pDialogHelper( pDialogHelper ) , m_pDialogHelper( pDialogHelper )
, m_sTitle( rTitle ) , m_sTitle( rTitle )
, m_bAborted( false )
, m_bWarnUser( false ) , m_bWarnUser( false )
, m_nCurrentProgress(0) , m_nCurrentProgress(0)
{} {}
...@@ -158,7 +156,6 @@ public: ...@@ -158,7 +156,6 @@ public:
void stopProgress(); void stopProgress();
void progressSection( const OUString &rText, void progressSection( const OUString &rText,
const uno::Reference< task::XAbortChannel > &xAbortChannel = nullptr ); const uno::Reference< task::XAbortChannel > &xAbortChannel = nullptr );
inline bool isAborted() const { return m_bAborted; }
inline void setWarnUser( bool bNewVal ) { m_bWarnUser = bNewVal; } inline void setWarnUser( bool bNewVal ) { m_bWarnUser = bNewVal; }
// XCommandEnvironment // XCommandEnvironment
...@@ -295,26 +292,20 @@ void ProgressCmdEnv::progressSection( const OUString &rText, ...@@ -295,26 +292,20 @@ void ProgressCmdEnv::progressSection( const OUString &rText,
const uno::Reference< task::XAbortChannel > &xAbortChannel ) const uno::Reference< task::XAbortChannel > &xAbortChannel )
{ {
m_xAbortChannel = xAbortChannel; m_xAbortChannel = xAbortChannel;
if (! m_bAborted)
{
m_nCurrentProgress = 0; m_nCurrentProgress = 0;
if ( m_pDialogHelper ) if ( m_pDialogHelper )
{ {
m_pDialogHelper->updateProgress( rText, xAbortChannel ); m_pDialogHelper->updateProgress( rText, xAbortChannel );
m_pDialogHelper->updateProgress( 5 ); m_pDialogHelper->updateProgress( 5 );
} }
}
} }
void ProgressCmdEnv::updateProgress() void ProgressCmdEnv::updateProgress()
{ {
if ( ! m_bAborted )
{
long nProgress = ((m_nCurrentProgress*5) % 100) + 5; long nProgress = ((m_nCurrentProgress*5) % 100) + 5;
if ( m_pDialogHelper ) if ( m_pDialogHelper )
m_pDialogHelper->updateProgress( nProgress ); m_pDialogHelper->updateProgress( nProgress );
}
} }
...@@ -730,7 +721,7 @@ void ExtensionCmdQueue::Thread::execute() ...@@ -730,7 +721,7 @@ void ExtensionCmdQueue::Thread::execute()
// addExtension is called, which then blocks the main thread, then we deadlock. // addExtension is called, which then blocks the main thread, then we deadlock.
bool bStartProgress = true; bool bStartProgress = true;
while ( !currentCmdEnv->isAborted() && --nSize >= 0 ) while ( --nSize >= 0 )
{ {
{ {
osl::MutexGuard aGuard( m_mutex ); osl::MutexGuard aGuard( m_mutex );
......
...@@ -92,7 +92,6 @@ private: ...@@ -92,7 +92,6 @@ private:
sal_Int32 _iMax; sal_Int32 _iMax;
sal_Int32 _iProgress; sal_Int32 _iProgress;
BitmapMode _eBitmapMode; BitmapMode _eBitmapMode;
bool _bPaintBitmap;
bool _bPaintProgress; bool _bPaintProgress;
bool _bVisible; bool _bVisible;
bool _bShowLogo; bool _bShowLogo;
...@@ -163,7 +162,6 @@ SplashScreen::SplashScreen() ...@@ -163,7 +162,6 @@ SplashScreen::SplashScreen()
, _iMax(100) , _iMax(100)
, _iProgress(0) , _iProgress(0)
, _eBitmapMode(BM_DEFAULTMODE) , _eBitmapMode(BM_DEFAULTMODE)
, _bPaintBitmap(true)
, _bPaintProgress(false) , _bPaintProgress(false)
, _bVisible(true) , _bVisible(true)
, _bShowLogo(true) , _bShowLogo(true)
...@@ -646,7 +644,6 @@ void SplashScreenWindow::Paint(vcl::RenderContext& rRenderContext, const Rectang ...@@ -646,7 +644,6 @@ void SplashScreenWindow::Paint(vcl::RenderContext& rRenderContext, const Rectang
// non native drawing // non native drawing
// draw bitmap // draw bitmap
if (pSpl->_bPaintBitmap)
_vdev->DrawBitmapEx(Point(), pSpl->_aIntroBmp); _vdev->DrawBitmapEx(Point(), pSpl->_aIntroBmp);
if (pSpl->_bPaintProgress) { if (pSpl->_bPaintProgress) {
......
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