diff options
author | Jelle van der Waa <jelle@vdwaa.nl> | 2013-08-17 23:43:14 +0200 |
---|---|---|
committer | Petr Mladek <pmladek@suse.cz> | 2013-08-27 16:11:09 +0000 |
commit | 2ec606730bc95b58390a609df0a88958869a4066 (patch) | |
tree | 9c530b3f6b200305ba224dda2d02c9bf5aca2233 /dbaccess/source/ui/querydesign | |
parent | 434f3c8e7fac0644cfe1d7a15f97f0c267bac048 (diff) |
fdo#62475 removed pointless comments
Conflicts:
dbaccess/source/filter/xml/xmlfilter.cxx
dbaccess/source/ui/dlg/ConnectionPage.cxx
dbaccess/source/ui/dlg/detailpages.cxx
dbaccess/source/ui/dlg/odbcconfig.cxx
dbaccess/source/ui/querydesign/querycontroller.cxx
Change-Id: I3a05649efa3a43dd8d8fb069fc1bce14ca0a6338
Reviewed-on: https://gerrit.libreoffice.org/5484
Reviewed-by: Petr Mladek <pmladek@suse.cz>
Tested-by: Petr Mladek <pmladek@suse.cz>
Diffstat (limited to 'dbaccess/source/ui/querydesign')
43 files changed, 309 insertions, 955 deletions
diff --git a/dbaccess/source/ui/querydesign/ConnectionLine.cxx b/dbaccess/source/ui/querydesign/ConnectionLine.cxx index 05ca77a0b64d..f134f5bb46fe 100644 --- a/dbaccess/source/ui/querydesign/ConnectionLine.cxx +++ b/dbaccess/source/ui/querydesign/ConnectionLine.cxx @@ -27,7 +27,6 @@ #include <osl/diagnose.h> #include <vcl/lineinfo.hxx> - using namespace dbaui; const long DESCRIPT_LINE_WIDTH = 15; const long HIT_SENSITIVE_RADIUS = 5; @@ -42,7 +41,6 @@ namespace { return Rectangle( _rBase - _aVector, _rBase + _aVector ); } - // ----------------------------------------------------------------------------- /** GetTextPos calculate the rectangle for the connection to be drawn @param _pWin the table window where to draw it @param _aConnPos the connection point @@ -73,7 +71,6 @@ namespace return aReturn; } - // ----------------------------------------------------------------------------- /** calcPointsYValue calculate the points Y value in relation to the listbox entry @param _pWin the corresponding window @param _pEntry the source or dest entry @@ -109,14 +106,10 @@ namespace _rNewDescrPos.Y() = _rNewConPos.Y(); } - // ----------------------------------------------------------------------------- } -//======================================================================== // class OConnectionLine -//======================================================================== DBG_NAME(OConnectionLine) -//------------------------------------------------------------------------ OConnectionLine::OConnectionLine( OTableConnection* _pConn, OConnectionLineDataRef _pLineData ) : m_pTabConn( _pConn ) ,m_pData( _pLineData ) @@ -124,7 +117,6 @@ OConnectionLine::OConnectionLine( OTableConnection* _pConn, OConnectionLineDataR DBG_CTOR(OConnectionLine,NULL); } -//------------------------------------------------------------------------ OConnectionLine::OConnectionLine( const OConnectionLine& _rLine ) { DBG_CTOR(OConnectionLine,NULL); @@ -132,13 +124,11 @@ OConnectionLine::OConnectionLine( const OConnectionLine& _rLine ) *this = _rLine; } -//------------------------------------------------------------------------ OConnectionLine::~OConnectionLine() { DBG_DTOR(OConnectionLine,NULL); } -//------------------------------------------------------------------------ OConnectionLine& OConnectionLine::operator=( const OConnectionLine& rLine ) { if( &rLine != this ) @@ -157,10 +147,8 @@ OConnectionLine& OConnectionLine::operator=( const OConnectionLine& rLine ) return *this; } -//------------------------------------------------------------------------ Rectangle OConnectionLine::GetBoundingRect() { - ////////////////////////////////////////////////////////////////////// // determine surrounding rectangle Rectangle aBoundingRect( Point(0,0), Point(0,0) ); if( !IsValid() ) @@ -193,7 +181,6 @@ Rectangle OConnectionLine::GetBoundingRect() const OTableWindow* pSourceWin = m_pTabConn->GetSourceWin(); const OTableWindow* pDestWin = m_pTabConn->GetDestWin(); - ////////////////////////////////////////////////////////////////////// // line proceeds in in z-Form if( pSourceWin == pDestWin || std::abs(m_aSourceConnPos.X() - m_aDestConnPos.X()) > std::abs(m_aSourceDescrLinePos.X() - m_aDestDescrLinePos.X()) ) { @@ -205,24 +192,23 @@ Rectangle OConnectionLine::GetBoundingRect() return aBoundingRect; } -// ----------------------------------------------------------------------------- + void calcPointX1(const OTableWindow* _pWin,Point& _rNewConPos,Point& _rNewDescrPos) { _rNewConPos.X() = _pWin->GetPosPixel().X() + _pWin->GetSizePixel().Width(); _rNewDescrPos.X() = _rNewConPos.X(); _rNewConPos.X() += DESCRIPT_LINE_WIDTH; } -// ----------------------------------------------------------------------------- + void calcPointX2(const OTableWindow* _pWin,Point& _rNewConPos,Point& _rNewDescrPos) { _rNewConPos.X() = _pWin->GetPosPixel().X(); _rNewDescrPos.X() = _rNewConPos.X(); _rNewConPos.X() -= DESCRIPT_LINE_WIDTH; } -//------------------------------------------------------------------------ + sal_Bool OConnectionLine::RecalcLine() { - ////////////////////////////////////////////////////////////////////// // Windows and entries must be set const OTableWindow* pSourceWin = m_pTabConn->GetSourceWin(); const OTableWindow* pDestWin = m_pTabConn->GetDestWin(); @@ -233,7 +219,6 @@ sal_Bool OConnectionLine::RecalcLine() SvTreeListEntry* pSourceEntry = pSourceWin->GetListBox()->GetEntryFromText( GetData()->GetSourceFieldName() ); SvTreeListEntry* pDestEntry = pDestWin->GetListBox()->GetEntryFromText( GetData()->GetDestFieldName() ); - ////////////////////////////////////////////////////////////////////// // determine X-coordinates Point aSourceCenter( 0, 0 ); Point aDestCenter( 0, 0 ); @@ -263,29 +248,23 @@ sal_Bool OConnectionLine::RecalcLine() calcPointX1(pFirstWin,*pFirstConPos,*pFirstDescrPos); calcPointX2(pSecondWin,*pSecondConPos,*pSecondDescrPos); - ////////////////////////////////////////////////////////////////////// // determine aSourceConnPosY calcPointsYValue(pSourceWin,pSourceEntry,m_aSourceConnPos,m_aSourceDescrLinePos); - ////////////////////////////////////////////////////////////////////// // determine aDestConnPosY calcPointsYValue(pDestWin,pDestEntry,m_aDestConnPos,m_aDestDescrLinePos); return sal_True; } -// ----------------------------------------------------------------------------- -//------------------------------------------------------------------------ void OConnectionLine::Draw( OutputDevice* pOutDev ) { const sal_uInt16 nRectSize = 3; - ////////////////////////////////////////////////////////////////////// // calculate new dimension if( !RecalcLine() ) return; - ////////////////////////////////////////////////////////////////////// // draw lines if (m_pTabConn->IsSelected()) pOutDev->SetLineColor(Application::GetSettings().GetStyleSettings().GetHighlightColor()); @@ -302,7 +281,6 @@ void OConnectionLine::Draw( OutputDevice* pOutDev ) aPoly.Insert(3,m_aDestDescrLinePos); pOutDev->DrawPolyLine(aPoly,aLineInfo); - ////////////////////////////////////////////////////////////////////// // draw the connection rectangles pOutDev->SetFillColor(Application::GetSettings().GetStyleSettings().GetWindowColor()); @@ -310,12 +288,12 @@ void OConnectionLine::Draw( OutputDevice* pOutDev ) pOutDev->DrawRect( calcRect(m_aSourceDescrLinePos,aVector) ); pOutDev->DrawRect( calcRect( m_aDestDescrLinePos,aVector) ); } -// ----------------------------------------------------------------------------- + sal_Bool OConnectionLine::IsValid() const { return m_pData.is(); } -//------------------------------------------------------------------------ + double dist_Euklid(const Point &p1, const Point& p2,const Point& pM, Point& q) { Point v(p2 - p1); @@ -328,10 +306,9 @@ double dist_Euklid(const Point &p1, const Point& p2,const Point& pM, Point& q) q.Y() = long(p1.Y() + a * v.Y()); return l; } -//------------------------------------------------------------------------ + bool OConnectionLine::CheckHit( const Point& rMousePos ) const { - ////////////////////////////////////////////////////////////////////// /* course of action with HitTest: the distance is calculated according to Euklid. @@ -347,17 +324,17 @@ bool OConnectionLine::CheckHit( const Point& rMousePos ) const return false; } -// ----------------------------------------------------------------------------- + Rectangle OConnectionLine::GetSourceTextPos() const { return GetTextPos(m_pTabConn->GetSourceWin(),m_aSourceConnPos,m_aSourceDescrLinePos); } -// ----------------------------------------------------------------------------- + Rectangle OConnectionLine::GetDestTextPos() const { return GetTextPos(m_pTabConn->GetDestWin(),m_aDestConnPos,m_aDestDescrLinePos); } -// ----------------------------------------------------------------------------- + Point OConnectionLine::getMidPoint() const { Point aDest = m_aDestConnPos - m_aSourceConnPos; @@ -366,7 +343,5 @@ Point OConnectionLine::getMidPoint() const return m_aSourceConnPos + aDest; } -// ----------------------------------------------------------------------------- - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/querydesign/ConnectionLineAccess.cxx b/dbaccess/source/ui/querydesign/ConnectionLineAccess.cxx index 9394263a19c2..95165a31f3e0 100644 --- a/dbaccess/source/ui/querydesign/ConnectionLineAccess.cxx +++ b/dbaccess/source/ui/querydesign/ConnectionLineAccess.cxx @@ -42,47 +42,38 @@ namespace dbaui ,m_pLine(_pLine) { } - // ----------------------------------------------------------------------------- void SAL_CALL OConnectionLineAccess::disposing() { m_pLine = NULL; VCLXAccessibleComponent::disposing(); } - // ----------------------------------------------------------------------------- Any SAL_CALL OConnectionLineAccess::queryInterface( const Type& aType ) throw (RuntimeException) { Any aRet(VCLXAccessibleComponent::queryInterface( aType )); return aRet.hasValue() ? aRet : OConnectionLineAccess_BASE::queryInterface( aType ); } - // ----------------------------------------------------------------------------- Sequence< Type > SAL_CALL OConnectionLineAccess::getTypes( ) throw (RuntimeException) { return ::comphelper::concatSequences(VCLXAccessibleComponent::getTypes(),OConnectionLineAccess_BASE::getTypes()); } - // ----------------------------------------------------------------------------- OUString SAL_CALL OConnectionLineAccess::getImplementationName() throw(RuntimeException) { return getImplementationName_Static(); } - // ----------------------------------------------------------------------------- // XServiceInfo - static methods - // ----------------------------------------------------------------------------- OUString OConnectionLineAccess::getImplementationName_Static(void) throw( RuntimeException ) { return OUString("org.openoffice.comp.dbu.ConnectionLineAccessibility"); } - // ----------------------------------------------------------------------------- // XAccessibleContext sal_Int32 SAL_CALL OConnectionLineAccess::getAccessibleChildCount( ) throw (RuntimeException) { return 0; } - // ----------------------------------------------------------------------------- Reference< XAccessible > SAL_CALL OConnectionLineAccess::getAccessibleChild( sal_Int32 /*i*/ ) throw (RuntimeException) { return Reference< XAccessible >(); } - // ----------------------------------------------------------------------------- sal_Int32 SAL_CALL OConnectionLineAccess::getAccessibleIndexInParent( ) throw (RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); @@ -100,24 +91,20 @@ namespace dbaui } return nIndex; } - // ----------------------------------------------------------------------------- sal_Int16 SAL_CALL OConnectionLineAccess::getAccessibleRole( ) throw (RuntimeException) { return AccessibleRole::UNKNOWN; // ? or may be an AccessibleRole::WINDOW } - // ----------------------------------------------------------------------------- OUString SAL_CALL OConnectionLineAccess::getAccessibleDescription( ) throw (RuntimeException) { static OUString sDescription("Relation"); return sDescription; } - // ----------------------------------------------------------------------------- Reference< XAccessibleRelationSet > SAL_CALL OConnectionLineAccess::getAccessibleRelationSet( ) throw (RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); return this; } - // ----------------------------------------------------------------------------- // XAccessibleComponent sal_Bool SAL_CALL OConnectionLineAccess::contains( const awt::Point& _aPoint ) throw (RuntimeException) { @@ -125,63 +112,52 @@ namespace dbaui Point aPoint(_aPoint.X,_aPoint.Y); return m_pLine ? m_pLine->CheckHit(aPoint) : sal_False; } - // ----------------------------------------------------------------------------- Reference< XAccessible > SAL_CALL OConnectionLineAccess::getAccessibleAtPoint( const awt::Point& /*_aPoint*/ ) throw (RuntimeException) { return Reference< XAccessible >(); } - // ----------------------------------------------------------------------------- awt::Rectangle SAL_CALL OConnectionLineAccess::getBounds( ) throw (RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); Rectangle aRect(m_pLine ? m_pLine->GetBoundingRect() : Rectangle()); return awt::Rectangle(aRect.getX(),aRect.getY(),aRect.getWidth(),aRect.getHeight()); } - // ----------------------------------------------------------------------------- awt::Point SAL_CALL OConnectionLineAccess::getLocation( ) throw (RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); Point aPoint(m_pLine ? m_pLine->GetBoundingRect().TopLeft() : Point()); return awt::Point(aPoint.X(),aPoint.Y()); } - // ----------------------------------------------------------------------------- awt::Point SAL_CALL OConnectionLineAccess::getLocationOnScreen( ) throw (RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); Point aPoint(m_pLine ? m_pLine->GetParent()->ScreenToOutputPixel(m_pLine->GetBoundingRect().TopLeft()) : Point()); return awt::Point(aPoint.X(),aPoint.Y()); } - // ----------------------------------------------------------------------------- awt::Size SAL_CALL OConnectionLineAccess::getSize( ) throw (RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); Size aSize(m_pLine ? m_pLine->GetBoundingRect().GetSize() : Size()); return awt::Size(aSize.Width(),aSize.Height()); } - // ----------------------------------------------------------------------------- sal_Bool SAL_CALL OConnectionLineAccess::isShowing( ) throw (RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); return m_pLine ? m_pLine->GetParent()->GetWindowRegionPixel().IsInside(m_pLine->GetBoundingRect()) : sal_False; } - // ----------------------------------------------------------------------------- sal_Bool SAL_CALL OConnectionLineAccess::isVisible( ) throw (RuntimeException) { return sal_True; } - // ----------------------------------------------------------------------------- sal_Bool SAL_CALL OConnectionLineAccess::isFocusTraversable( ) throw (RuntimeException) { return sal_True; } - // ----------------------------------------------------------------------------- // XAccessibleRelationSet - // ----------------------------------------------------------------------------- sal_Int32 SAL_CALL OConnectionLineAccess::getRelationCount( ) throw (RuntimeException) { return 1; } - // ----------------------------------------------------------------------------- AccessibleRelation SAL_CALL OConnectionLineAccess::getRelation( sal_Int32 nIndex ) throw (IndexOutOfBoundsException, RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); @@ -197,44 +173,35 @@ namespace dbaui return AccessibleRelation(AccessibleRelationType::CONTROLLED_BY,aSeq); } - // ----------------------------------------------------------------------------- sal_Bool SAL_CALL OConnectionLineAccess::containsRelation( sal_Int16 aRelationType ) throw (RuntimeException) { return AccessibleRelationType::CONTROLLED_BY == aRelationType; } - // ----------------------------------------------------------------------------- AccessibleRelation SAL_CALL OConnectionLineAccess::getRelationByType( sal_Int16 aRelationType ) throw (RuntimeException) { if( AccessibleRelationType::CONTROLLED_BY == aRelationType ) return getRelation(0); return AccessibleRelation(); } - // ----------------------------------------------------------------------------- Reference< XAccessible > OTableConnection::CreateAccessible() { return new OConnectionLineAccess(this); } - // ----------------------------------------------------------------------------- OTableConnection::~OTableConnection() { DBG_DTOR(OTableConnection,NULL); - ////////////////////////////////////////////////////////////////////// // clear vector clearLineData(); } - // ----------------------------------------------------------------------------- sal_Bool OConnectionLineAccess::isEditable() const { return m_pLine ? !m_pLine->GetParent()->getDesignView()->getController().isReadOnly() : sal_False; } - // ----------------------------------------------------------------------------- Reference< XAccessibleContext > SAL_CALL OConnectionLineAccess::getAccessibleContext( ) throw (::com::sun::star::uno::RuntimeException) { return this; } - // ----------------------------------------------------------------------------- } -// ----------------------------------------------------------------------------- /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/querydesign/ConnectionLineData.cxx b/dbaccess/source/ui/querydesign/ConnectionLineData.cxx index cf093e6c5f8d..a81a965d21c7 100644 --- a/dbaccess/source/ui/querydesign/ConnectionLineData.cxx +++ b/dbaccess/source/ui/querydesign/ConnectionLineData.cxx @@ -20,19 +20,14 @@ #include "ConnectionLineData.hxx" #include <tools/debug.hxx> - using namespace dbaui; DBG_NAME(OConnectionLineData) -//================================================================== //class OConnectionLineData -//================================================================== -//------------------------------------------------------------------------ OConnectionLineData::OConnectionLineData() { DBG_CTOR(OConnectionLineData,NULL); } -//------------------------------------------------------------------------ OConnectionLineData::OConnectionLineData( const OUString& rSourceFieldName, const OUString& rDestFieldName ) :m_aSourceFieldName( rSourceFieldName ) ,m_aDestFieldName( rDestFieldName ) @@ -40,7 +35,6 @@ OConnectionLineData::OConnectionLineData( const OUString& rSourceFieldName, cons DBG_CTOR(OConnectionLineData,NULL); } -//------------------------------------------------------------------------ OConnectionLineData::OConnectionLineData( const OConnectionLineData& rConnLineData ) : ::salhelper::SimpleReferenceObject() { @@ -48,20 +42,17 @@ OConnectionLineData::OConnectionLineData( const OConnectionLineData& rConnLineDa *this = rConnLineData; } -//------------------------------------------------------------------------ OConnectionLineData::~OConnectionLineData() { DBG_DTOR(OConnectionLineData,NULL); } -//------------------------------------------------------------------------ void OConnectionLineData::CopyFrom(const OConnectionLineData& rSource) { *this = rSource; // Here I rely on the (non-virtual) operator=, which only copies my members } -//------------------------------------------------------------------------ OConnectionLineData& OConnectionLineData::operator=( const OConnectionLineData& rConnLineData ) { if (&rConnLineData == this) @@ -73,21 +64,20 @@ OConnectionLineData& OConnectionLineData::operator=( const OConnectionLineData& return *this; } -//------------------------------------------------------------------------ bool OConnectionLineData::Reset() { m_aDestFieldName = m_aSourceFieldName = OUString(); return true; } -// ----------------------------------------------------------------------------- + namespace dbaui { -//------------------------------------------------------------------------- bool operator==(const OConnectionLineData& lhs, const OConnectionLineData& rhs) { return (lhs.m_aSourceFieldName == rhs.m_aSourceFieldName) && (lhs.m_aDestFieldName == rhs.m_aDestFieldName); } + } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/querydesign/JAccess.cxx b/dbaccess/source/ui/querydesign/JAccess.cxx index 24352c73db97..52a7dcbf2781 100644 --- a/dbaccess/source/ui/querydesign/JAccess.cxx +++ b/dbaccess/source/ui/querydesign/JAccess.cxx @@ -37,23 +37,19 @@ namespace dbaui ,m_pTableView(_pTableView) { } - // ----------------------------------------------------------------------------- OUString SAL_CALL OJoinDesignViewAccess::getImplementationName() throw(RuntimeException) { return getImplementationName_Static(); } - // ----------------------------------------------------------------------------- OUString OJoinDesignViewAccess::getImplementationName_Static(void) throw( RuntimeException ) { return OUString("org.openoffice.comp.dbu.JoinViewAccessibility"); } - // ----------------------------------------------------------------------------- void OJoinDesignViewAccess::clearTableView() { ::osl::MutexGuard aGuard( m_aMutex ); m_pTableView = NULL; } - // ----------------------------------------------------------------------------- // XAccessibleContext sal_Int32 SAL_CALL OJoinDesignViewAccess::getAccessibleChildCount( ) throw (RuntimeException) { @@ -65,7 +61,6 @@ namespace dbaui nChildCount = m_pTableView->GetTabWinCount() + m_pTableView->getTableConnections()->size(); return nChildCount; } - // ----------------------------------------------------------------------------- Reference< XAccessible > SAL_CALL OJoinDesignViewAccess::getAccessibleChild( sal_Int32 i ) throw (IndexOutOfBoundsException,RuntimeException) { Reference< XAccessible > aRet; @@ -88,32 +83,22 @@ namespace dbaui throw IndexOutOfBoundsException(); return aRet; } - // ----------------------------------------------------------------------------- sal_Bool OJoinDesignViewAccess::isEditable() const { return m_pTableView && !m_pTableView->getDesignView()->getController().isReadOnly(); } - // ----------------------------------------------------------------------------- sal_Int16 SAL_CALL OJoinDesignViewAccess::getAccessibleRole( ) throw (RuntimeException) { return AccessibleRole::VIEW_PORT; } - // ----------------------------------------------------------------------------- Reference< XAccessibleContext > SAL_CALL OJoinDesignViewAccess::getAccessibleContext( ) throw (::com::sun::star::uno::RuntimeException) { return this; } - // ----------------------------------------------------------------------------- - // ----------------------------------------------------------------------------- // XInterface - // ----------------------------------------------------------------------------- IMPLEMENT_FORWARD_XINTERFACE2( OJoinDesignViewAccess, VCLXAccessibleComponent, OJoinDesignViewAccess_BASE ) - // ----------------------------------------------------------------------------- // XTypeProvider - // ----------------------------------------------------------------------------- IMPLEMENT_FORWARD_XTYPEPROVIDER2( OJoinDesignViewAccess, VCLXAccessibleComponent, OJoinDesignViewAccess_BASE ) } -// ----------------------------------------------------------------------------- - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/querydesign/JoinController.cxx b/dbaccess/source/ui/querydesign/JoinController.cxx index 20e976d70197..9c376095276b 100644 --- a/dbaccess/source/ui/querydesign/JoinController.cxx +++ b/dbaccess/source/ui/querydesign/JoinController.cxx @@ -73,14 +73,10 @@ using namespace ::com::sun::star::ui::dialogs; using namespace ::dbtools; using namespace ::comphelper; -// ............................................................................. namespace dbaui { -// ............................................................................. -// ============================================================================= -// = AddTableDialogContext -// ============================================================================= +// AddTableDialogContext class AddTableDialogContext : public IAddTableDialogContext { OJoinController& m_rController; @@ -106,37 +102,31 @@ private: OJoinTableView* getTableView() const; }; -// ----------------------------------------------------------------------------- Reference< XConnection > AddTableDialogContext::getConnection() const { return m_rController.getConnection(); } -// ----------------------------------------------------------------------------- bool AddTableDialogContext::allowViews() const { return m_rController.allowViews(); } -// ----------------------------------------------------------------------------- bool AddTableDialogContext::allowQueries() const { return m_rController.allowQueries(); } -// ----------------------------------------------------------------------------- bool AddTableDialogContext::allowAddition() const { return const_cast< OJoinController& >( m_rController ).getJoinView()->getTableView()->IsAddAllowed(); } -// ----------------------------------------------------------------------------- void AddTableDialogContext::addTableWindow( const String& _rQualifiedTableName, const String& _rAliasName ) { getTableView()->AddTabWin( _rQualifiedTableName, _rAliasName, sal_True ); } -// ----------------------------------------------------------------------------- void AddTableDialogContext::onWindowClosing( const Window* _pWindow ) { if ( !m_rController.getView() ) @@ -149,7 +139,6 @@ void AddTableDialogContext::onWindowClosing( const Window* _pWindow ) m_rController.getView()->GrabFocus(); } -// ----------------------------------------------------------------------------- OJoinTableView* AddTableDialogContext::getTableView() const { if ( m_rController.getJoinView() ) @@ -157,37 +146,31 @@ OJoinTableView* AddTableDialogContext::getTableView() const return NULL; } -// ============================================================================= -// = OJoinController -// ============================================================================= +// OJoinController DBG_NAME(OJoinController) -// ----------------------------------------------------------------------------- OJoinController::OJoinController(const Reference< XComponentContext >& _rM) :OJoinController_BASE(_rM) ,m_pAddTableDialog(NULL) { DBG_CTOR(OJoinController,NULL); } -// ----------------------------------------------------------------------------- + OJoinController::~OJoinController() { DBG_DTOR(OJoinController,NULL); } -// ----------------------------------------------------------------------------- void SAL_CALL OJoinController::disposing( const EventObject& _rSource ) throw(RuntimeException) { OJoinController_BASE::disposing( _rSource ); } -// ----------------------------------------------------------------------------- OJoinDesignView* OJoinController::getJoinView() { return static_cast< OJoinDesignView* >( getView() ); } -// ----------------------------------------------------------------------------- void OJoinController::disposing() { { @@ -202,7 +185,7 @@ void OJoinController::disposing() m_vTableConnectionData.clear(); m_vTableData.clear(); } -// ----------------------------------------------------------------------------- + void OJoinController::reconnect( sal_Bool _bUI ) { OJoinController_BASE::reconnect( _bUI ); @@ -210,13 +193,12 @@ void OJoinController::reconnect( sal_Bool _bUI ) m_pAddTableDialog->Update(); } -// ----------------------------------------------------------------------------- void OJoinController::impl_onModifyChanged() { OJoinController_BASE::impl_onModifyChanged(); InvalidateFeature( SID_RELATION_ADD_RELATION ); } -// ----------------------------------------------------------------------------- + void OJoinController::SaveTabWinPosSize(OTableWindow* pTabWin, long nOffsetX, long nOffsetY) { // the data for the window @@ -231,7 +213,7 @@ void OJoinController::SaveTabWinPosSize(OTableWindow* pTabWin, long nOffsetX, lo pData->SetSize(pTabWin->GetSizePixel()); } -// ----------------------------------------------------------------------------- + FeatureState OJoinController::GetState(sal_uInt16 _nId) const { FeatureState aReturn; @@ -257,7 +239,6 @@ FeatureState OJoinController::GetState(sal_uInt16 _nId) const return aReturn; } -// ----------------------------------------------------------------------------- AddTableDialogContext& OJoinController::impl_getDialogContext() const { if ( !m_pDialogContext.get() ) @@ -268,7 +249,6 @@ AddTableDialogContext& OJoinController::impl_getDialogContext() const return *m_pDialogContext; } -// ----------------------------------------------------------------------------- void OJoinController::Execute(sal_uInt16 _nId, const Sequence< PropertyValue >& aArgs) { switch(_nId) @@ -317,7 +297,7 @@ void OJoinController::Execute(sal_uInt16 _nId, const Sequence< PropertyValue >& } InvalidateFeature(_nId); } -// ----------------------------------------------------------------------------- + void OJoinController::SaveTabWinsPosSize( OJoinTableView::OTableWindowMap* pTabWinList, long nOffsetX, long nOffsetY ) { // Deletion and recreation of the old implementation with the current model is not correct anymore: @@ -332,12 +312,12 @@ void OJoinController::SaveTabWinsPosSize( OJoinTableView::OTableWindowMap* pTabW for(;aIter != aEnd;++aIter) SaveTabWinPosSize(aIter->second, nOffsetX, nOffsetY); } -// ----------------------------------------------------------------------------- + void OJoinController::removeConnectionData(const TTableConnectionData::value_type& _pData) { m_vTableConnectionData.erase( ::std::remove(m_vTableConnectionData.begin(),m_vTableConnectionData.end(),_pData),m_vTableConnectionData.end()); } -// ----------------------------------------------------------------------------- + void OJoinController::describeSupportedFeatures() { OJoinController_BASE::describeSupportedFeatures(); @@ -347,7 +327,7 @@ void OJoinController::describeSupportedFeatures() implDescribeSupportedFeature( ".uno:AddTable", ID_BROWSER_ADDTABLE,CommandGroup::EDIT ); implDescribeSupportedFeature( ".uno:EditDoc", ID_BROWSER_EDITDOC, CommandGroup::EDIT ); } -// ----------------------------------------------------------------------------- + sal_Bool SAL_CALL OJoinController::suspend(sal_Bool _bSuspend) throw( RuntimeException ) { if ( getBroadcastHelper().bInDispose || getBroadcastHelper().bDisposed ) @@ -366,7 +346,7 @@ sal_Bool SAL_CALL OJoinController::suspend(sal_Bool _bSuspend) throw( RuntimeExc } return bCheck; } -// ----------------------------------------------------------------------------- + void OJoinController::loadTableWindows( const ::comphelper::NamedValueCollection& i_rViewSettings ) { m_vTableData.clear(); @@ -389,7 +369,6 @@ void OJoinController::loadTableWindows( const ::comphelper::NamedValueCollection } } -// ----------------------------------------------------------------------------- void OJoinController::loadTableWindow( const ::comphelper::NamedValueCollection& i_rTableWindowSettings ) { sal_Int32 nX = -1, nY = -1, nHeight = -1, nWidth = -1; @@ -419,7 +398,7 @@ void OJoinController::loadTableWindow( const ::comphelper::NamedValueCollection& m_aMinimumTableViewSize.Y() = (nY+nHeight); } } -// ----------------------------------------------------------------------------- + void OJoinController::saveTableWindows( ::comphelper::NamedValueCollection& o_rViewSettings ) const { if ( !m_vTableData.empty() ) @@ -447,7 +426,7 @@ void OJoinController::saveTableWindows( ::comphelper::NamedValueCollection& o_rV o_rViewSettings.put( "Tables", aAllTablesData.getPropertyValues() ); } } -// ----------------------------------------------------------------------------- + TTableWindowData::value_type OJoinController::createTableWindowData(const OUString& _sComposedName,const OUString& _sTableName,const OUString& _sWindowName) { OJoinDesignView* pView = getJoinView(); @@ -457,8 +436,7 @@ TTableWindowData::value_type OJoinController::createTableWindowData(const OUStri return TTableWindowData::value_type(); } -// ............................................................................. + } // namespace dbaui -// ............................................................................. /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/querydesign/JoinDesignView.cxx b/dbaccess/source/ui/querydesign/JoinDesignView.cxx index b5d0c440cd30..31dd26d43b54 100644 --- a/dbaccess/source/ui/querydesign/JoinDesignView.cxx +++ b/dbaccess/source/ui/querydesign/JoinDesignView.cxx @@ -49,10 +49,7 @@ using namespace ::com::sun::star::util; namespace dbaui { -// ============================================================================= -// = OJoinDesignView -// ============================================================================= -// ----------------------------------------------------------------------------- +// OJoinDesignView OJoinDesignView::OJoinDesignView(Window* _pParent, OJoinController& _rController,const Reference< XComponentContext >& _rxContext) :ODataView( _pParent, _rController, _rxContext ) ,m_pTableView(NULL) @@ -60,7 +57,7 @@ OJoinDesignView::OJoinDesignView(Window* _pParent, OJoinController& _rController { m_pScrollWindow = new OScrollWindowHelper(this); } -// ----------------------------------------------------------------------------- + OJoinDesignView::~OJoinDesignView() { SAL_WNODEPRECATED_DECLARATIONS_PUSH @@ -72,7 +69,7 @@ OJoinDesignView::~OJoinDesignView() SAL_WNODEPRECATED_DECLARATIONS_POP m_pTableView = NULL; } -// ------------------------------------------------------------------------- + void OJoinDesignView::Construct() { m_pScrollWindow->setTableView(m_pTableView); @@ -83,11 +80,11 @@ void OJoinDesignView::Construct() ODataView::Construct(); } -// ----------------------------------------------------------------------------- + void OJoinDesignView::initialize() { } -// ------------------------------------------------------------------------- + void OJoinDesignView::resizeDocumentView(Rectangle& _rPlayground) { m_pScrollWindow->SetPosSizePixel( _rPlayground.TopLeft(), _rPlayground.GetSize() ); @@ -96,16 +93,16 @@ void OJoinDesignView::resizeDocumentView(Rectangle& _rPlayground) _rPlayground.SetPos( _rPlayground.BottomRight() ); _rPlayground.SetSize( Size( 0, 0 ) ); } -// ----------------------------------------------------------------------------- + void OJoinDesignView::setReadOnly(sal_Bool /*_bReadOnly*/) { } -// ----------------------------------------------------------------------------- + void OJoinDesignView::SaveTabWinUIConfig(OTableWindow* pWin) { getController().SaveTabWinPosSize(pWin, m_pScrollWindow->GetHScrollBar()->GetThumbPos(), m_pScrollWindow->GetVScrollBar()->GetThumbPos()); } -// ----------------------------------------------------------------------------- + void OJoinDesignView::KeyInput( const KeyEvent& rEvt ) { if ( m_pTableView && m_pTableView->IsVisible() ) @@ -113,7 +110,6 @@ void OJoinDesignView::KeyInput( const KeyEvent& rEvt ) else ODataView::KeyInput(rEvt); } -// ----------------------------------------------------------------------------- } // namespace dbaui diff --git a/dbaccess/source/ui/querydesign/JoinExchange.cxx b/dbaccess/source/ui/querydesign/JoinExchange.cxx index eec14375a6b0..6cc155618771 100644 --- a/dbaccess/source/ui/querydesign/JoinExchange.cxx +++ b/dbaccess/source/ui/querydesign/JoinExchange.cxx @@ -29,11 +29,8 @@ namespace dbaui using namespace ::com::sun::star::datatransfer; String OJoinExchObj::m_sJoinFormat; - //================================================================== // class OJoinExchObj - //================================================================== DBG_NAME(OJoinExchObj) - //------------------------------------------------------------------------ OJoinExchObj::OJoinExchObj(const OJoinExchangeData& jxdSource,sal_Bool _bFirstEntry) :m_bFirstEntry(_bFirstEntry) ,m_jxdSourceDescription(jxdSource) @@ -43,20 +40,17 @@ namespace dbaui // add available types to list } - //------------------------------------------------------------------------ OJoinExchObj::~OJoinExchObj() { DBG_DTOR(OJoinExchObj,NULL); } - //------------------------------------------------------------------------ void OJoinExchObj::StartDrag( Window* _pWindow, sal_Int8 _nDragSourceActions, IDragTransferableListener* _pListener ) { m_pDragListener = _pListener; TransferableHelper::StartDrag(_pWindow, _nDragSourceActions); } - //------------------------------------------------------------------------ void OJoinExchObj::DragFinished( sal_Int8 /*nDropAction*/ ) { if (m_pDragListener) @@ -64,7 +58,6 @@ namespace dbaui m_pDragListener = NULL; } - //------------------------------------------------------------------------ sal_Bool OJoinExchObj::isFormatAvailable( const DataFlavorExVector& _rFormats ,SotFormatStringId _nSlotID) { DataFlavorExVector::const_iterator aCheckEnd = _rFormats.end(); @@ -79,7 +72,6 @@ namespace dbaui return sal_False; } - //------------------------------------------------------------------------ OJoinExchangeData OJoinExchObj::GetSourceDescription(const Reference< XTransferable >& _rxObject) { OJoinExchangeData aReturn; @@ -93,7 +85,6 @@ namespace dbaui return aReturn; } - //------------------------------------------------------------------------ Sequence< sal_Int8 > OJoinExchObj::getUnoTunnelImplementationId() { static ::cppu::OImplementationId * pId = 0; @@ -109,7 +100,6 @@ namespace dbaui return pId->getImplementationId(); } - //------------------------------------------------------------------------ sal_Int64 SAL_CALL OJoinExchObj::getSomething( const Sequence< sal_Int8 >& _rIdentifier ) throw(RuntimeException) { if (_rIdentifier.getLength() == 16 && 0 == memcmp(getUnoTunnelImplementationId().getConstArray(), _rIdentifier.getConstArray(), 16 ) ) @@ -118,7 +108,6 @@ namespace dbaui return 0; } - //------------------------------------------------------------------------ void OJoinExchObj::AddSupportedFormats() { AddFormat( SOT_FORMATSTR_ID_SBA_JOIN ); @@ -126,7 +115,6 @@ namespace dbaui AddFormat( SOT_FORMATSTR_ID_SBA_TABID ); } - //------------------------------------------------------------------------ sal_Bool OJoinExchObj::GetData( const ::com::sun::star::datatransfer::DataFlavor& rFlavor ) { sal_uInt32 nFormat = SotExchange::GetFormat(rFlavor); @@ -139,7 +127,6 @@ namespace dbaui return sal_False; } - //------------------------------------------------------------------------ Any SAL_CALL OJoinExchObj::queryInterface( const Type& _rType ) throw(RuntimeException) { Any aReturn = TransferableHelper::queryInterface(_rType); @@ -148,19 +135,16 @@ namespace dbaui return aReturn; } - //------------------------------------------------------------------------ void SAL_CALL OJoinExchObj::acquire( ) throw() { TransferableHelper::acquire( ); } - //------------------------------------------------------------------------ void SAL_CALL OJoinExchObj::release( ) throw() { TransferableHelper::release( ); } - } // namespace dbaui /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/querydesign/JoinTableView.cxx b/dbaccess/source/ui/querydesign/JoinTableView.cxx index ebe877782c34..c20d09153f58 100644 --- a/dbaccess/source/ui/querydesign/JoinTableView.cxx +++ b/dbaccess/source/ui/querydesign/JoinTableView.cxx @@ -55,7 +55,6 @@ using namespace ::com::sun::star::container; using namespace ::com::sun::star::lang; #define LINE_SIZE 50 -//////////////////////////////////////////////////////////////// // Constants for the window layout #define TABWIN_SPACING_X 17 #define TABWIN_SPACING_Y 17 @@ -72,7 +71,6 @@ OScrollWindowHelper::OScrollWindowHelper( Window* pParent) : Window( pParent) { DBG_CTOR(OScrollWindowHelper,NULL); - ////////////////////////////////////////////////////////////////////// // ScrollBars GetHScrollBar()->SetRange( Range(0, 1000) ); @@ -89,7 +87,6 @@ OScrollWindowHelper::OScrollWindowHelper( Window* pParent) : Window( pParent) SetAccessibleRole(AccessibleRole::SCROLL_PANE); } -// ----------------------------------------------------------------------------- OScrollWindowHelper::~OScrollWindowHelper() { DBG_DTOR(OScrollWindowHelper,NULL); @@ -100,23 +97,21 @@ OScrollWindowHelper::~OScrollWindowHelper() m_pTableView = NULL; } -// ----------------------------------------------------------------------------- void OScrollWindowHelper::setTableView(OJoinTableView* _pTableView) { m_pTableView = _pTableView; - ////////////////////////////////////////////////////////////////////// // ScrollBars GetHScrollBar()->SetScrollHdl( LINK(m_pTableView, OJoinTableView, ScrollHdl) ); GetVScrollBar()->SetScrollHdl( LINK(m_pTableView, OJoinTableView, ScrollHdl) ); } -// ----------------------------------------------------------------------------- + void OScrollWindowHelper::resetRange(const Point& _aSize) { Point aPos = PixelToLogic(_aSize); GetHScrollBar()->SetRange( Range(0, aPos.X() + TABWIN_SPACING_X) ); GetVScrollBar()->SetRange( Range(0, aPos.Y() + TABWIN_SPACING_Y) ); } -//------------------------------------------------------------------------------ + void OScrollWindowHelper::Resize() { Window::Resize(); @@ -157,14 +152,10 @@ void OScrollWindowHelper::Resize() m_pTableView->SetPosSizePixel(Point( 0, 0 ),Size( aTotalOutputSize.Width()-nVScrollWidth, aTotalOutputSize.Height()-nHScrollHeight )); } -// ----------------------------------------------------------------------------- -// ----------------------------------------------------------------------------- -//================================================================== + // class OJoinTableView -//================================================================== DBG_NAME(OJoinTableView); -//------------------------------------------------------------------------------ OJoinTableView::OJoinTableView( Window* pParent, OJoinDesignView* pView ) :Window( pParent,WB_BORDER ) ,DropTargetHelper(this) @@ -186,7 +177,6 @@ OJoinTableView::OJoinTableView( Window* pParent, OJoinDesignView* pView ) m_aDragScrollTimer.SetTimeoutHdl(LINK(this, OJoinTableView, OnDragScrollTimer)); } -//------------------------------------------------------------------------------ OJoinTableView::~OJoinTableView() { DBG_DTOR(OJoinTableView,NULL); @@ -195,20 +185,18 @@ OJoinTableView::~OJoinTableView() m_pAccessible->clearTableView(); m_pAccessible = NULL; } - ////////////////////////////////////////////////////////////////////// // delete lists clearLayoutInformation(); } -//------------------------------------------------------------------------------ + IMPL_LINK( OJoinTableView, ScrollHdl, ScrollBar*, pScrollBar ) { - ////////////////////////////////////////////////////////////////////// // move all windows ScrollPane( pScrollBar->GetDelta(), (pScrollBar == GetHScrollBar()), sal_False ); return 0; } -//------------------------------------------------------------------------------ + void OJoinTableView::Resize() { DBG_CHKTHIS(OJoinTableView,NULL); @@ -241,14 +229,13 @@ void OJoinTableView::Resize() pCurrent->SetPosPixel(aPos); } } -//------------------------------------------------------------------------------ + sal_uLong OJoinTableView::GetTabWinCount() { DBG_CHKTHIS(OJoinTableView,NULL); return m_aTableMap.size(); } -//------------------------------------------------------------------------------ bool OJoinTableView::RemoveConnection( OTableConnection* _pConn,sal_Bool _bDelete ) { DBG_CHKTHIS(OJoinTableView,NULL); @@ -275,7 +262,6 @@ bool OJoinTableView::RemoveConnection( OTableConnection* _pConn,sal_Bool _bDelet return true; } -//------------------------------------------------------------------------ OTableWindow* OJoinTableView::GetTabWindow( const String& rName ) { DBG_CHKTHIS(OJoinTableView,NULL); @@ -283,7 +269,7 @@ OTableWindow* OJoinTableView::GetTabWindow( const String& rName ) return aIter == m_aTableMap.end() ? NULL : aIter->second; } -// ----------------------------------------------------------------------------- + TTableWindowData::value_type OJoinTableView::createTableWindowData(const OUString& _rComposedName ,const OUString& _sTableName ,const OUString& _rWinName) @@ -317,14 +303,14 @@ TTableWindowData::value_type OJoinTableView::createTableWindowData(const OUStrin } return pData; } -// ----------------------------------------------------------------------------- + OTableWindowData* OJoinTableView::CreateImpl(const OUString& _rComposedName ,const OUString& _sTableName ,const OUString& _rWinName) { return new OTableWindowData( NULL,_rComposedName,_sTableName, _rWinName ); } -//------------------------------------------------------------------------------ + void OJoinTableView::AddTabWin(const OUString& _rComposedName, const OUString& rWinName, sal_Bool /*bNewTable*/) { DBG_CHKTHIS(OJoinTableView,NULL); @@ -332,7 +318,6 @@ void OJoinTableView::AddTabWin(const OUString& _rComposedName, const OUString& r TTableWindowData::value_type pNewTabWinData(createTableWindowData( _rComposedName, rWinName,rWinName )); - ////////////////////////////////////////////////////////////////// // insert new window in window list OTableWindow* pNewTabWin = createWindow( pNewTabWinData ); if ( pNewTabWin->Init() ) @@ -360,11 +345,9 @@ void OJoinTableView::AddTabWin(const OUString& _rComposedName, const OUString& r } } -//------------------------------------------------------------------------------ void OJoinTableView::RemoveTabWin( OTableWindow* pTabWin ) { DBG_CHKTHIS(OJoinTableView,NULL); - ////////////////////////////////////////////////////////////////////// // first delete all connections of this window to others bool bRemove = true; TTableWindowData::value_type pData = pTabWin->GetData(); @@ -385,7 +368,6 @@ void OJoinTableView::RemoveTabWin( OTableWindow* pTabWin ) ++aIter; } - ////////////////////////////////////////////////////////////////////// // then delete the window itself if ( bRemove ) { @@ -419,12 +401,11 @@ void OJoinTableView::RemoveTabWin( OTableWindow* pTabWin ) if ( (sal_Int32)m_vTableConnection.size() < (nCount-1) ) // if some connections could be removed modified(); } + namespace { - // ----------------------------------------------------------------------------- sal_Bool isScrollAllowed( OJoinTableView* _pView,long nDelta, sal_Bool bHoriz) { - ////////////////////////////////////////////////////////////////////// // adjust ScrollBar-Positions ScrollBar* pBar = _pView->GetVScrollBar(); if( bHoriz ) @@ -447,7 +428,6 @@ namespace return sal_True; } - // ----------------------------------------------------------------------------- sal_Bool getMovementImpl(OJoinTableView* _pView,const Point& _rPoint,const Size& _rSize,long& _nScrollX,long& _nScrollY) { _nScrollY = _nScrollX = 0; @@ -504,17 +484,16 @@ namespace } } - return bVisbile; } } // end of ano namespace -// ----------------------------------------------------------------------------- + sal_Bool OJoinTableView::isMovementAllowed(const Point& _rPoint,const Size& _rSize) { long nX,nY; return getMovementImpl(this,_rPoint,_rSize,nX,nY); } -//------------------------------------------------------------------------------ + void OJoinTableView::EnsureVisible(const OTableWindow* _pWin) { // data about the tab win @@ -522,7 +501,7 @@ void OJoinTableView::EnsureVisible(const OTableWindow* _pWin) EnsureVisible( pData->GetPosition() , pData->GetSize()); Invalidate(INVALIDATE_NOCHILDREN); } -//------------------------------------------------------------------------------ + void OJoinTableView::EnsureVisible(const Point& _rPoint,const Size& _rSize) { long nScrollX,nScrollY; @@ -538,11 +517,9 @@ void OJoinTableView::EnsureVisible(const Point& _rPoint,const Size& _rSize) } } -//------------------------------------------------------------------------------ void OJoinTableView::SetDefaultTabWinPosSize( OTableWindow* pTabWin ) { DBG_CHKTHIS(OJoinTableView,NULL); - ////////////////////////////////////////////////////////////////// // determine position: // the window is divided into lines with height TABWIN_SPACING_Y+TABWIN_HEIGTH_STD. // Then for each line is checked, if there is space for another window. @@ -553,18 +530,15 @@ void OJoinTableView::SetDefaultTabWinPosSize( OTableWindow* pTabWin ) sal_Bool bEnd = sal_False; while( !bEnd ) { - ////////////////////////////////////////////////////////////////// // Set new position to start of line aNewPos.X() = TABWIN_SPACING_X; aNewPos.Y() = (nRow+1) * TABWIN_SPACING_Y; - ////////////////////////////////////////////////////////////////// // determine rectangle for the corresponding line Rectangle aRowRect( Point(0,0), aOutSize ); aRowRect.Top() = nRow * ( TABWIN_SPACING_Y + TABWIN_HEIGHT_STD ); aRowRect.Bottom() = (nRow+1) * ( TABWIN_SPACING_Y + TABWIN_HEIGHT_STD ); - ////////////////////////////////////////////////////////////////// // check occupied areas of this line OTableWindow* pOtherTabWin; OTableWindowMapIterator aIter = m_aTableMap.begin(); @@ -579,14 +553,12 @@ void OJoinTableView::SetDefaultTabWinPosSize( OTableWindow* pTabWin ) ( (aOtherTabWinRect.Bottom()>aRowRect.Top()) && (aOtherTabWinRect.Bottom()<aRowRect.Bottom()) ) ) { - ////////////////////////////////////////////////////////////////// // TabWin is in the line if( aOtherTabWinRect.Right()>aNewPos.X() ) aNewPos.X() = aOtherTabWinRect.Right() + TABWIN_SPACING_X; } } - ////////////////////////////////////////////////////////////////// // Is there space left in this line? if( (aNewPos.X()+TABWIN_WIDTH_STD)<aRowRect.Right() ) { @@ -609,7 +581,6 @@ void OJoinTableView::SetDefaultTabWinPosSize( OTableWindow* pTabWin ) } } - ////////////////////////////////////////////////////////////////// // determine size Size aNewSize( CalcZoom(TABWIN_WIDTH_STD), CalcZoom(TABWIN_HEIGHT_STD) ); @@ -626,7 +597,6 @@ void OJoinTableView::SetDefaultTabWinPosSize( OTableWindow* pTabWin ) pTabWin->SetPosSizePixel( aNewPos, aNewSize ); } -//------------------------------------------------------------------------------ void OJoinTableView::DataChanged(const DataChangedEvent& rDCEvt) { DBG_CHKTHIS(OJoinTableView,NULL); @@ -639,7 +609,6 @@ void OJoinTableView::DataChanged(const DataChangedEvent& rDCEvt) } } -//------------------------------------------------------------------------------ void OJoinTableView::InitColors() { DBG_CHKTHIS(OJoinTableView,NULL); @@ -648,7 +617,6 @@ void OJoinTableView::InitColors() SetBackground(Wallpaper(Color(aSystemStyle.GetDialogColor()))); } -//------------------------------------------------------------------------------ void OJoinTableView::BeginChildMove( OTableWindow* pTabWin, const Point& rMousePos ) { DBG_CHKTHIS(OJoinTableView,NULL); @@ -672,7 +640,6 @@ void OJoinTableView::NotifyTitleClicked( OTableWindow* pTabWin, const Point rMou BeginChildMove(pTabWin, rMousePos); } -//------------------------------------------------------------------------------ void OJoinTableView::BeginChildSizing( OTableWindow* pTabWin, const Pointer& rPointer ) { DBG_CHKTHIS(OJoinTableView,NULL); @@ -685,13 +652,11 @@ void OJoinTableView::BeginChildSizing( OTableWindow* pTabWin, const Pointer& rPo StartTracking(); } -//------------------------------------------------------------------------------ sal_Bool OJoinTableView::ScrollPane( long nDelta, sal_Bool bHoriz, sal_Bool bPaintScrollBars ) { DBG_CHKTHIS(OJoinTableView,NULL); sal_Bool bRet = sal_True; - ////////////////////////////////////////////////////////////////////// // adjust ScrollBar-Positions if( bPaintScrollBars ) { @@ -731,20 +696,17 @@ sal_Bool OJoinTableView::ScrollPane( long nDelta, sal_Bool bHoriz, sal_Bool bPai } } - ////////////////////////////////////////////////////////////////////// // If ScrollOffset hitting borders, no redrawing. if( (GetHScrollBar()->GetThumbPos()==m_aScrollOffset.X()) && (GetVScrollBar()->GetThumbPos()==m_aScrollOffset.Y()) ) return sal_False; - ////////////////////////////////////////////////////////////////////// // set ScrollOffset anew if (bHoriz) m_aScrollOffset.X() = GetHScrollBar()->GetThumbPos(); else m_aScrollOffset.Y() = GetVScrollBar()->GetThumbPos(); - ////////////////////////////////////////////////////////////////////// // move all windows OTableWindow* pTabWin; Point aPos; @@ -768,7 +730,6 @@ sal_Bool OJoinTableView::ScrollPane( long nDelta, sal_Bool bHoriz, sal_Bool bPai return bRet; } -//------------------------------------------------------------------------------ void OJoinTableView::Tracking( const TrackingEvent& rTEvt ) { DBG_CHKTHIS(OJoinTableView,NULL); @@ -781,9 +742,7 @@ void OJoinTableView::Tracking( const TrackingEvent& rTEvt ) if (m_aDragScrollTimer.IsActive()) m_aDragScrollTimer.Stop(); - ////////////////////////////////////////////////////////////////////// // adjust position of child after moving - ////////////////////////////////////////////////////////////////////// // windows are not allowed to leave display range Point aDragWinPos = rTEvt.GetMouseEvent().GetPosPixel() - m_aDragOffset; Size aDragWinSize = m_pDragWin->GetSizePixel(); @@ -801,8 +760,6 @@ void OJoinTableView::Tracking( const TrackingEvent& rTEvt ) aDragWinPos.Y() = 0; // TODO : don't position window anew, if it is leaving range, but just expand the range - - ////////////////////////////////////////////////////////////////////// // position window EndTracking(); m_pDragWin->SetZOrder(NULL, WINDOW_ZORDER_FIRST); @@ -865,13 +822,11 @@ void OJoinTableView::Tracking( const TrackingEvent& rTEvt ) } } -//------------------------------------------------------------------------------ void OJoinTableView::ConnDoubleClicked( OTableConnection* /*pConnection*/ ) { DBG_CHKTHIS(OJoinTableView,NULL); } -//------------------------------------------------------------------------------ void OJoinTableView::MouseButtonDown( const MouseEvent& rEvt ) { DBG_CHKTHIS(OJoinTableView,NULL); @@ -879,12 +834,10 @@ void OJoinTableView::MouseButtonDown( const MouseEvent& rEvt ) Window::MouseButtonDown(rEvt); } -//------------------------------------------------------------------------------ void OJoinTableView::MouseButtonUp( const MouseEvent& rEvt ) { DBG_CHKTHIS(OJoinTableView,NULL); Window::MouseButtonUp(rEvt); - ////////////////////////////////////////////////////////////////////// // Has a connection been selected? if( !m_vTableConnection.empty() ) { @@ -908,7 +861,6 @@ void OJoinTableView::MouseButtonUp( const MouseEvent& rEvt ) } } -//------------------------------------------------------------------------------ void OJoinTableView::KeyInput( const KeyEvent& rEvt ) { DBG_CHKTHIS(OJoinTableView,NULL); @@ -925,7 +877,6 @@ void OJoinTableView::KeyInput( const KeyEvent& rEvt ) Window::KeyInput( rEvt ); } -//------------------------------------------------------------------------------ void OJoinTableView::DeselectConn(OTableConnection* pConn) { DBG_CHKTHIS(OJoinTableView,NULL); @@ -945,7 +896,6 @@ void OJoinTableView::DeselectConn(OTableConnection* pConn) m_pSelectedConn = NULL; } -//------------------------------------------------------------------------------ void OJoinTableView::SelectConn(OTableConnection* pConn) { DBG_CHKTHIS(OJoinTableView,NULL); @@ -1000,28 +950,24 @@ void OJoinTableView::SelectConn(OTableConnection* pConn) } } } -//------------------------------------------------------------------------------ + void OJoinTableView::Paint( const Rectangle& rRect ) { DBG_CHKTHIS(OJoinTableView,NULL); DrawConnections( rRect ); } -//------------------------------------------------------------------------------ void OJoinTableView::InvalidateConnections() { DBG_CHKTHIS(OJoinTableView,NULL); - ////////////////////////////////////////////////////////////////////// // draw Joins ::std::for_each(m_vTableConnection.begin(),m_vTableConnection.end(), ::std::mem_fun(& OTableConnection::InvalidateConnection)); } -//------------------------------------------------------------------------------ void OJoinTableView::DrawConnections( const Rectangle& rRect ) { DBG_CHKTHIS(OJoinTableView,NULL); - ////////////////////////////////////////////////////////////////////// // draw Joins ::std::for_each(m_vTableConnection.begin(),m_vTableConnection.end(),boost::bind( &OTableConnection::Draw, _1, boost::cref( rRect ))); // finally redraw the selected one above all others @@ -1029,28 +975,26 @@ void OJoinTableView::DrawConnections( const Rectangle& rRect ) GetSelectedConn()->Draw( rRect ); } - -//------------------------------------------------------------------------------ ::std::vector<OTableConnection*>::const_iterator OJoinTableView::getTableConnections(const OTableWindow* _pFromWin) const { return ::std::find_if( m_vTableConnection.begin(), m_vTableConnection.end(), ::std::bind2nd(::std::mem_fun(&OTableConnection::isTableConnection),_pFromWin)); } -// ----------------------------------------------------------------------------- + sal_Int32 OJoinTableView::getConnectionCount(const OTableWindow* _pFromWin) const { return ::std::count_if( m_vTableConnection.begin(), m_vTableConnection.end(), ::std::bind2nd(::std::mem_fun(&OTableConnection::isTableConnection),_pFromWin)); } -//------------------------------------------------------------------------------ + sal_Bool OJoinTableView::ExistsAConn(const OTableWindow* pFrom) const { DBG_CHKTHIS(OJoinTableView,NULL); return getTableConnections(pFrom) != m_vTableConnection.end(); } -//------------------------------------------------------------------------ + void OJoinTableView::ClearAll() { DBG_CHKTHIS(OJoinTableView,NULL); @@ -1074,7 +1018,6 @@ void OJoinTableView::ClearAll() Invalidate(); } -//------------------------------------------------------------------------ sal_Bool OJoinTableView::ScrollWhileDragging() { DBG_CHKTHIS(OJoinTableView,NULL); @@ -1152,19 +1095,18 @@ sal_Bool OJoinTableView::ScrollWhileDragging() return bScrolling; } -//------------------------------------------------------------------------ IMPL_LINK_NOARG(OJoinTableView, OnDragScrollTimer) { ScrollWhileDragging(); return 0L; } -// ----------------------------------------------------------------------------- + void OJoinTableView::invalidateAndModify(SfxUndoAction *_pAction) { Invalidate(INVALIDATE_NOCHILDREN); m_pView->getController().addUndoActionAndInvalidate(_pAction); } -//------------------------------------------------------------------------ + void OJoinTableView::TabWinMoved(OTableWindow* ptWhich, const Point& ptOldPosition) { DBG_CHKTHIS(OJoinTableView,NULL); @@ -1174,7 +1116,6 @@ void OJoinTableView::TabWinMoved(OTableWindow* ptWhich, const Point& ptOldPositi invalidateAndModify(new OJoinMoveTabWinUndoAct(this, ptOldPosition, ptWhich)); } -//------------------------------------------------------------------------ void OJoinTableView::TabWinSized(OTableWindow* ptWhich, const Point& ptOldPosition, const Size& szOldSize) { DBG_CHKTHIS(OJoinTableView,NULL); @@ -1184,7 +1125,6 @@ void OJoinTableView::TabWinSized(OTableWindow* ptWhich, const Point& ptOldPositi invalidateAndModify(new OJoinSizeTabWinUndoAct(this, ptOldPosition, szOldSize, ptWhich)); } -//------------------------------------------------------------------------------ sal_Bool OJoinTableView::IsAddAllowed() { DBG_CHKTHIS(OJoinTableView,NULL); @@ -1212,7 +1152,7 @@ sal_Bool OJoinTableView::IsAddAllowed() return sal_True; } -// ----------------------------------------------------------------------------- + void OJoinTableView::executePopup(const Point& _aPos,OTableConnection* _pSelConnection) { PopupMenu aContextMenu( ModuleRes( RID_MENU_JOINVIEW_CONNECTION ) ); @@ -1226,7 +1166,7 @@ void OJoinTableView::executePopup(const Point& _aPos,OTableConnection* _pSelConn break; } } -//------------------------------------------------------------------------------ + void OJoinTableView::Command(const CommandEvent& rEvt) { DBG_CHKTHIS(OJoinTableView,NULL); @@ -1277,7 +1217,6 @@ void OJoinTableView::Command(const CommandEvent& rEvt) Window::Command(rEvt); } -//------------------------------------------------------------------------------ OTableConnection* OJoinTableView::GetTabConn(const OTableWindow* pLhs,const OTableWindow* pRhs,bool _bSupressCrossOrNaturalJoin,const OTableConnection* _rpFirstAfter) const { OTableConnection* pConn = NULL; @@ -1330,7 +1269,6 @@ OTableConnection* OJoinTableView::GetTabConn(const OTableWindow* pLhs,const OTab return pConn; } -//------------------------------------------------------------------------------ long OJoinTableView::PreNotify(NotifyEvent& rNEvt) { sal_Bool bHandled = sal_False; @@ -1525,7 +1463,6 @@ long OJoinTableView::PreNotify(NotifyEvent& rNEvt) return 1L; } -//------------------------------------------------------------------------------ void OJoinTableView::GrabTabWinFocus() { if (m_pLastFocusTabWin && m_pLastFocusTabWin->IsVisible()) @@ -1544,7 +1481,7 @@ void OJoinTableView::GrabTabWinFocus() pFirstWin->GrabFocus(); } } -// ----------------------------------------------------------------------------- + void OJoinTableView::StateChanged( StateChangedType nType ) { Window::StateChanged( nType ); @@ -1569,7 +1506,7 @@ void OJoinTableView::StateChanged( StateChangedType nType ) Resize(); } } -//------------------------------------------------------------------------------ + void OJoinTableView::HideTabWins() { DBG_CHKTHIS(OJoinTableView,NULL); @@ -1591,30 +1528,29 @@ void OJoinTableView::HideTabWins() SetUpdateMode(sal_True); } -// ----------------------------------------------------------------------------- + sal_Int8 OJoinTableView::AcceptDrop( const AcceptDropEvent& /*_rEvt*/ ) { return DND_ACTION_NONE; } -// ----------------------------------------------------------------------------- + sal_Int8 OJoinTableView::ExecuteDrop( const ExecuteDropEvent& /*_rEvt*/ ) { return DND_ACTION_NONE; } -// ----------------------------------------------------------------------------- + void OJoinTableView::dragFinished( ) { } -//------------------------------------------------------------------------------ + void OJoinTableView::StartDrag( sal_Int8 /*nAction*/, const Point& /*rPosPixel*/ ) { } -// ----------------------------------------------------------------------------- + void OJoinTableView::clearLayoutInformation() { m_pLastFocusTabWin = NULL; m_pSelectedConn = NULL; - ////////////////////////////////////////////////////////////////////// // delete lists OTableWindowMapIterator aIter = m_aTableMap.begin(); OTableWindowMapIterator aEnd = m_aTableMap.end(); @@ -1637,30 +1573,30 @@ void OJoinTableView::clearLayoutInformation() m_vTableConnection.clear(); } -// ----------------------------------------------------------------------------- + void OJoinTableView::lookForUiActivities() { } -// ----------------------------------------------------------------------------- + void OJoinTableView::LoseFocus() { DeselectConn(GetSelectedConn()); Window::LoseFocus(); } -// ----------------------------------------------------------------------------- + void OJoinTableView::GetFocus() { Window::GetFocus(); if ( !m_aTableMap.empty() && !GetSelectedConn() ) GrabTabWinFocus(); } -// ----------------------------------------------------------------------------- + Reference< XAccessible > OJoinTableView::CreateAccessible() { m_pAccessible = new OJoinDesignViewAccess(this); return m_pAccessible; } -// ----------------------------------------------------------------------------- + void OJoinTableView::modified() { OJoinController& rController = m_pView->getController(); @@ -1668,7 +1604,7 @@ void OJoinTableView::modified() rController.InvalidateFeature(ID_BROWSER_ADDTABLE); rController.InvalidateFeature(SID_RELATION_ADD_RELATION); } -// ----------------------------------------------------------------------------- + void OJoinTableView::addConnection(OTableConnection* _pConnection,sal_Bool _bAddData) { if ( _bAddData ) @@ -1689,18 +1625,18 @@ void OJoinTableView::addConnection(OTableConnection* _pConnection,sal_Bool _bAdd Any(), makeAny(_pConnection->GetAccessible())); } -// ----------------------------------------------------------------------------- + bool OJoinTableView::allowQueries() const { return true; } -// ----------------------------------------------------------------------------- + void OJoinTableView::onNoColumns_throw() { OSL_FAIL( "OTableWindow::onNoColumns_throw: cannot really handle this!" ); throw SQLException(); } -//------------------------------------------------------------------------------ + bool OJoinTableView::supressCrossNaturalJoin(const TTableConnectionData::value_type& ) const { return false; diff --git a/dbaccess/source/ui/querydesign/QTableConnection.cxx b/dbaccess/source/ui/querydesign/QTableConnection.cxx index 849cd9c30482..48ce949d29c2 100644 --- a/dbaccess/source/ui/querydesign/QTableConnection.cxx +++ b/dbaccess/source/ui/querydesign/QTableConnection.cxx @@ -22,12 +22,9 @@ #include "QueryTableView.hxx" #include "ConnectionLine.hxx" using namespace dbaui; -//======================================================================== // class OQueryTableConnection -//======================================================================== DBG_NAME(OQueryTableConnection) -//------------------------------------------------------------------------ OQueryTableConnection::OQueryTableConnection(OQueryTableView* pContainer, const TTableConnectionData::value_type& pTabConnData) :OTableConnection(pContainer, pTabConnData) ,m_bVisited(sal_False) @@ -35,20 +32,18 @@ OQueryTableConnection::OQueryTableConnection(OQueryTableView* pContainer, const DBG_CTOR(OQueryTableConnection,NULL); } -//------------------------------------------------------------------------ OQueryTableConnection::OQueryTableConnection(const OQueryTableConnection& rConn) :OTableConnection( rConn ) { DBG_CTOR(OQueryTableConnection,NULL); // no own members, so base class functionality is sufficient } -//------------------------------------------------------------------------ + OQueryTableConnection::~OQueryTableConnection() { DBG_DTOR(OQueryTableConnection,NULL); } -//------------------------------------------------------------------------ OQueryTableConnection& OQueryTableConnection::operator=(const OQueryTableConnection& rConn) { if (&rConn == this) @@ -59,7 +54,6 @@ OQueryTableConnection& OQueryTableConnection::operator=(const OQueryTableConnect return *this; } -//------------------------------------------------------------------------ sal_Bool OQueryTableConnection::operator==(const OQueryTableConnection& rCompare) { OSL_ENSURE(GetData() && rCompare.GetData(), "OQueryTableConnection::operator== : one of the two participants has no data!"); @@ -82,6 +76,5 @@ sal_Bool OQueryTableConnection::operator==(const OQueryTableConnection& rCompare ) ); } -// ----------------------------------------------------------------------------- /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/querydesign/QTableConnection.hxx b/dbaccess/source/ui/querydesign/QTableConnection.hxx index 728bd4dc0a79..352f309486b2 100644 --- a/dbaccess/source/ui/querydesign/QTableConnection.hxx +++ b/dbaccess/source/ui/querydesign/QTableConnection.hxx @@ -25,7 +25,6 @@ namespace dbaui { - //================================================================== class OQueryTableView; class OQueryTableConnection : public OTableConnection { diff --git a/dbaccess/source/ui/querydesign/QTableConnectionData.cxx b/dbaccess/source/ui/querydesign/QTableConnectionData.cxx index 314fda96ba0a..429e32a11352 100644 --- a/dbaccess/source/ui/querydesign/QTableConnectionData.cxx +++ b/dbaccess/source/ui/querydesign/QTableConnectionData.cxx @@ -23,11 +23,8 @@ using namespace dbaui; -//======================================================================== // class OQueryTableConnectionData -//======================================================================== DBG_NAME(OQueryTableConnectionData) -//------------------------------------------------------------------------ OQueryTableConnectionData::OQueryTableConnectionData() :OTableConnectionData() ,m_eJoinType (INNER_JOIN) @@ -36,7 +33,6 @@ OQueryTableConnectionData::OQueryTableConnectionData() DBG_CTOR(OQueryTableConnectionData,NULL); } -//------------------------------------------------------------------------ OQueryTableConnectionData::OQueryTableConnectionData( const OQueryTableConnectionData& rConnData ) :OTableConnectionData( rConnData ) { @@ -50,7 +46,6 @@ OQueryTableConnectionData::OQueryTableConnectionData( const OQueryTableConnectio m_bNatural = rConnData.m_bNatural; } -//------------------------------------------------------------------------ OQueryTableConnectionData::OQueryTableConnectionData(const TTableWindowData::value_type& _pReferencingTable ,const TTableWindowData::value_type& _pReferencedTable ,const OUString& rConnName) @@ -65,13 +60,11 @@ OQueryTableConnectionData::OQueryTableConnectionData(const TTableWindowData::val DBG_CTOR(OQueryTableConnectionData,NULL); } -//------------------------------------------------------------------------ OQueryTableConnectionData::~OQueryTableConnectionData() { DBG_DTOR(OQueryTableConnectionData,NULL); } -//------------------------------------------------------------------------ OConnectionLineDataRef OQueryTableConnectionData::CreateLineDataObj() { DBG_CHKTHIS(OQueryTableConnectionData,NULL); @@ -79,14 +72,12 @@ OConnectionLineDataRef OQueryTableConnectionData::CreateLineDataObj() return new OConnectionLineData(); } -//------------------------------------------------------------------------ OConnectionLineDataRef OQueryTableConnectionData::CreateLineDataObj( const OConnectionLineData& rConnLineData ) { DBG_CHKTHIS(OQueryTableConnectionData,NULL); return new OConnectionLineData( rConnLineData ); } -//------------------------------------------------------------------------ void OQueryTableConnectionData::CopyFrom(const OTableConnectionData& rSource) { DBG_CHKTHIS(OQueryTableConnectionData,NULL); @@ -94,7 +85,6 @@ void OQueryTableConnectionData::CopyFrom(const OTableConnectionData& rSource) *this = (const OQueryTableConnectionData&)rSource; } -//------------------------------------------------------------------------ OQueryTableConnectionData& OQueryTableConnectionData::operator=(const OQueryTableConnectionData& rConnData) { DBG_CHKTHIS(OQueryTableConnectionData,NULL); @@ -114,14 +104,12 @@ OQueryTableConnectionData& OQueryTableConnectionData::operator=(const OQueryTabl return *this; } -//------------------------------------------------------------------------------ OUString OQueryTableConnectionData::GetAliasName(EConnectionSide nWhich) const { DBG_CHKTHIS(OQueryTableConnectionData,NULL); return nWhich == JTCS_FROM ? m_pReferencingTable->GetWinName() : m_pReferencedTable->GetWinName(); } -//------------------------------------------------------------------------------ void OQueryTableConnectionData::InitFromDrag(const OTableFieldDescRef& rDragLeft, const OTableFieldDescRef& rDragRight) { DBG_CHKTHIS(OQueryTableConnectionData,NULL); @@ -142,16 +130,15 @@ void OQueryTableConnectionData::InitFromDrag(const OTableFieldDescRef& rDragLeft AppendConnLine((OUString)rDragLeft->GetField(),(OUString)rDragRight->GetField()); } -// ----------------------------------------------------------------------------- + OTableConnectionData* OQueryTableConnectionData::NewInstance() const { return new OQueryTableConnectionData(); } -// ----------------------------------------------------------------------------- + sal_Bool OQueryTableConnectionData::Update() { return sal_True; } -// ----------------------------------------------------------------------------- /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/querydesign/QTableWindow.cxx b/dbaccess/source/ui/querydesign/QTableWindow.cxx index 928245ab9c73..43e96642b95f 100644 --- a/dbaccess/source/ui/querydesign/QTableWindow.cxx +++ b/dbaccess/source/ui/querydesign/QTableWindow.cxx @@ -48,11 +48,8 @@ using namespace ::com::sun::star::uno; using namespace ::com::sun::star::container; using namespace ::com::sun::star::beans; using namespace dbaui; -//======================================================================== // class OQueryTableWindow -//======================================================================== DBG_NAME(OQueryTableWindow) -//------------------------------------------------------------------------------ OQueryTableWindow::OQueryTableWindow( Window* pParent, const TTableWindowData::value_type& pTabWinData, sal_Unicode* pszInitialAlias) :OTableWindow( pParent, pTabWinData ) ,m_nAliasNum(0) @@ -71,13 +68,11 @@ OQueryTableWindow::OQueryTableWindow( Window* pParent, const TTableWindowData::v SetHelpId(HID_CTL_QRYDGNTAB); } -//------------------------------------------------------------------------------ OQueryTableWindow::~OQueryTableWindow() { DBG_DTOR(OQueryTableWindow,NULL); } -//------------------------------------------------------------------------------ sal_Bool OQueryTableWindow::Init() { sal_Bool bSuccess = OTableWindow::Init(); @@ -106,7 +101,6 @@ sal_Bool OQueryTableWindow::Init() sAliasName += OUString::number(m_nAliasNum); } - sAliasName = comphelper::string::remove(sAliasName, '"'); SetAliasName(sAliasName); // SetAliasName passes it as WinName, hence it uses the base class @@ -135,7 +129,7 @@ sal_Bool OQueryTableWindow::Init() getTableView()->getDesignView()->getController().InvalidateFeature(ID_BROWSER_QUERY_EXECUTE); return bSuccess; } -// ----------------------------------------------------------------------------- + void* OQueryTableWindow::createUserData(const Reference< XPropertySet>& _xColumn,bool _bPrimaryKey) { OTableFieldInfo* pInfo = new OTableFieldInfo(); @@ -144,13 +138,13 @@ void* OQueryTableWindow::createUserData(const Reference< XPropertySet>& _xColumn pInfo->SetDataType(::comphelper::getINT32(_xColumn->getPropertyValue(PROPERTY_TYPE))); return pInfo; } -// ----------------------------------------------------------------------------- + void OQueryTableWindow::deleteUserData(void*& _pUserData) { delete static_cast<OTableFieldInfo*>(_pUserData); _pUserData = NULL; } -//------------------------------------------------------------------------------ + void OQueryTableWindow::OnEntryDoubleClicked(SvTreeListEntry* pEntry) { OSL_ENSURE(pEntry != NULL, "OQueryTableWindow::OnEntryDoubleClicked : pEntry must not be NULL !"); @@ -173,7 +167,6 @@ void OQueryTableWindow::OnEntryDoubleClicked(SvTreeListEntry* pEntry) static_cast<OQueryTableView*>(getTableView())->InsertField(aInfo); } -//------------------------------------------------------------------------------ sal_Bool OQueryTableWindow::ExistsField(const OUString& strFieldName, OTableFieldDescRef& rInfo) { OSL_ENSURE(m_pListBox != NULL, "OQueryTableWindow::ExistsField : doesn't have ::com::sun::star::form::ListBox !"); @@ -215,17 +208,14 @@ sal_Bool OQueryTableWindow::ExistsField(const OUString& strFieldName, OTableFiel return bExists; } -//------------------------------------------------------------------------------ sal_Bool OQueryTableWindow::ExistsAVisitedConn() const { return static_cast<const OQueryTableView*>(getTableView())->ExistsAVisitedConn(this); } -//------------------------------------------------------------------------------ void OQueryTableWindow::KeyInput( const KeyEvent& rEvt ) { OTableWindow::KeyInput( rEvt ); } -// ----------------------------------------------------------------------------- /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/querydesign/QTableWindow.hxx b/dbaccess/source/ui/querydesign/QTableWindow.hxx index 7718355195eb..d97069f08701 100644 --- a/dbaccess/source/ui/querydesign/QTableWindow.hxx +++ b/dbaccess/source/ui/querydesign/QTableWindow.hxx @@ -26,7 +26,6 @@ namespace dbaui { - //================================================================== class OQueryTableWindow : public OTableWindow { sal_Int32 m_nAliasNum; @@ -81,5 +80,4 @@ namespace dbaui } #endif // DBAUI_QUERY_TABLEWINDOW_HXX - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/querydesign/QTableWindowData.cxx b/dbaccess/source/ui/querydesign/QTableWindowData.cxx index 582e8ae916f4..238ea80b616f 100644 --- a/dbaccess/source/ui/querydesign/QTableWindowData.cxx +++ b/dbaccess/source/ui/querydesign/QTableWindowData.cxx @@ -20,30 +20,21 @@ #include "QTableWindowData.hxx" #include <tools/debug.hxx> - using namespace dbaui; using namespace ::com::sun::star::io; using namespace ::com::sun::star::uno; DBG_NAME(OQueryTableWindowData) -//================================================================== // class OQueryTableWindowData -//================================================================== -//------------------------------------------------------------------------------ OQueryTableWindowData::OQueryTableWindowData(const OUString& _rComposedName, const OUString& rTableName, const OUString& rTableAlias ) :OTableWindowData(NULL,_rComposedName, rTableName, rTableAlias) { DBG_CTOR(OQueryTableWindowData,NULL); } -//------------------------------------------------------------------------------ OQueryTableWindowData::~OQueryTableWindowData() { DBG_DTOR(OQueryTableWindowData,NULL); } -// ----------------------------------------------------------------------------- - - - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/querydesign/QueryAddTabConnUndoAction.hxx b/dbaccess/source/ui/querydesign/QueryAddTabConnUndoAction.hxx index 59986c15b085..9977e7ff2d77 100644 --- a/dbaccess/source/ui/querydesign/QueryAddTabConnUndoAction.hxx +++ b/dbaccess/source/ui/querydesign/QueryAddTabConnUndoAction.hxx @@ -23,7 +23,6 @@ namespace dbaui { - // ================================================================================================ // OQueryAddTabConnUndoAction - Undo-Klasse fuer Einfuegen einer Connection class OQueryTableView; @@ -36,7 +35,6 @@ namespace dbaui virtual void Redo(); }; - // ================================================================================================ // OQueryDelTabConnUndoAction - Undo-Klasse fuer Einfuegen einer Connection class OQueryDelTabConnUndoAction : public OQueryTabConnUndoAction @@ -50,5 +48,4 @@ namespace dbaui } #endif // DBAUI_QUERYADDTABCONNUNDOACTION_HXX - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/querydesign/QueryDesignFieldUndoAct.hxx b/dbaccess/source/ui/querydesign/QueryDesignFieldUndoAct.hxx index 3179e6259222..129e5454bd37 100644 --- a/dbaccess/source/ui/querydesign/QueryDesignFieldUndoAct.hxx +++ b/dbaccess/source/ui/querydesign/QueryDesignFieldUndoAct.hxx @@ -23,13 +23,10 @@ #include "dbu_qry.hrc" #include "SelectionBrowseBox.hxx" - namespace dbaui { - // ================================================================================================ // OQueryDesignFieldUndoAct - Basisclass for undo's in the fieldlist of a query design - class OQueryDesignFieldUndoAct : public OCommentUndoAction { protected: @@ -51,7 +48,6 @@ namespace dbaui } }; - // ================================================================================================ // OTabFieldCellModifiedUndoAct - undo class to change a line of the column description class OTabFieldCellModifiedUndoAct : public OQueryDesignFieldUndoAct @@ -72,7 +68,6 @@ namespace dbaui virtual void Redo() { Undo(); } }; - // ================================================================================================ // OTabFieldSizedUndoAct - undo class to change the column width class OTabFieldSizedUndoAct : public OQueryDesignFieldUndoAct @@ -89,7 +84,6 @@ namespace dbaui virtual void Redo() { Undo(); } }; - // ================================================================================================ // OTabFieldUndoAct - base class for undos in the fieldlist of a query design, which are used to change complete field descriptions class OTabFieldUndoAct : public OQueryDesignFieldUndoAct @@ -103,7 +97,6 @@ namespace dbaui void SetTabFieldDescr(OTableFieldDescRef pDescription) { pDescr = pDescription; } }; - // ================================================================================================ // OTabFieldDelUndoAct - undo class to delete a field class OTabFieldDelUndoAct : public OTabFieldUndoAct @@ -116,7 +109,6 @@ namespace dbaui OTabFieldDelUndoAct(OSelectionBrowseBox* pSelBrwBox) : OTabFieldUndoAct(pSelBrwBox, STR_QUERY_UNDO_TABFIELDDELETE) { } }; - // ================================================================================================ // OTabFieldDelUndoAct - Undo-Klasse fuer Anlegen eines Feldes // OTabFieldDelUndoAct - undo class to create a field @@ -130,7 +122,6 @@ namespace dbaui OTabFieldCreateUndoAct(OSelectionBrowseBox* pSelBrwBox) : OTabFieldUndoAct(pSelBrwBox, STR_QUERY_UNDO_TABFIELDCREATE) { } }; - // ================================================================================================ // OTabFieldMovedUndoAct - Undo class when a field was moved inside the selection class OTabFieldMovedUndoAct : public OTabFieldUndoAct @@ -148,6 +139,4 @@ namespace dbaui } #endif // DBAUI_QUERYDESIGNFIELDUNDOACT_HXX - - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/querydesign/QueryDesignUndoAction.hxx b/dbaccess/source/ui/querydesign/QueryDesignUndoAction.hxx index e114f6e0ba6a..911c7c2cee09 100644 --- a/dbaccess/source/ui/querydesign/QueryDesignUndoAction.hxx +++ b/dbaccess/source/ui/querydesign/QueryDesignUndoAction.hxx @@ -23,7 +23,6 @@ namespace dbaui { - // ================================================================================================ // OQueryDesignUndoAction - undo base class for actions in graphical query design (without field list) class OJoinTableView; class OQueryDesignUndoAction : public OCommentUndoAction diff --git a/dbaccess/source/ui/querydesign/QueryDesignView.cxx b/dbaccess/source/ui/querydesign/QueryDesignView.cxx index 99f24d3d7201..b62564a244e5 100644 --- a/dbaccess/source/ui/querydesign/QueryDesignView.cxx +++ b/dbaccess/source/ui/querydesign/QueryDesignView.cxx @@ -100,7 +100,6 @@ namespace sal_Bool bHaving, bool _bAddOrOnOneLine); - //------------------------------------------------------------------------------ OUString quoteTableAlias(sal_Bool _bQuote, const OUString& _sAliasName, const OUString& _sQuote) { OUString sRet; @@ -112,7 +111,6 @@ namespace } return sRet; } - //------------------------------------------------------------------------------ OUString getTableRange(const OQueryDesignView* _pView,const ::connectivity::OSQLParseNode* _pTableRef) { Reference< XConnection> xConnection = static_cast<OQueryController&>(_pView->getController()).getConnection(); @@ -125,7 +123,6 @@ namespace } return sTableRange; } - //------------------------------------------------------------------------------ void insertConnection(const OQueryDesignView* _pView,const EJoinType& _eJoinType,OTableFieldDescRef _aDragLeft,OTableFieldDescRef _aDragRight,bool _bNatural = false) { OQueryTableView* pTableView = static_cast<OQueryTableView*>(_pView->getTableView()); @@ -187,7 +184,6 @@ namespace pConn->InvalidateConnection(); } } - //------------------------------------------------------------------------------ OUString ParseCondition( OQueryController& rController ,const ::connectivity::OSQLParseNode* pCondition ,const OUString _sDecimal @@ -209,7 +205,6 @@ namespace } return aCondition; } - //------------------------------------------------------------------------------ SqlParseError FillOuterJoins(OQueryDesignView* _pView, const ::connectivity::OSQLParseNode* pTableRefList) { @@ -239,11 +234,9 @@ namespace return eErrorCode; } - // ----------------------------------------------------------------------------- /** FillDragInfo fills the field description out of the table */ - //------------------------------------------------------------------------------ SqlParseError FillDragInfo( const OQueryDesignView* _pView, const ::connectivity::OSQLParseNode* pColumnRef, OTableFieldDescRef& _rDragInfo) @@ -288,7 +281,6 @@ namespace return eErrorCode; } - //------------------------------------------------------------------------------ OUString BuildJoinCriteria( const Reference< XConnection>& _xConnection, const OConnectionLineDataVec* pLineDataList, const OQueryTableConnectionData* pData) @@ -324,7 +316,6 @@ namespace return aCondition.makeStringAndClear(); } - //------------------------------------------------------------------------------ /** JoinCycle looks for a join cycle and append it to the string @param _xConnection the connection @param _pEntryConn the table connection which holds the data @@ -353,7 +344,6 @@ namespace _pEntryConn->SetVisited(sal_True); } } - //------------------------------------------------------------------------------ OUString BuildTable( const Reference< XConnection>& _xConnection, const OQueryTableWindow* pEntryTab, bool _bForce = false @@ -388,7 +378,6 @@ namespace } return aDBName; } - //------------------------------------------------------------------------------ OUString BuildJoin( const Reference< XConnection>& _xConnection, const OUString& rLh, const OUString& rRh, @@ -428,7 +417,6 @@ namespace return aErg; } - //------------------------------------------------------------------------------ OUString BuildJoin( const Reference< XConnection>& _xConnection, const OQueryTableWindow* pLh, const OQueryTableWindow* pRh, @@ -438,7 +426,6 @@ namespace bool bForce = pData->GetJoinType() == CROSS_JOIN || pData->isNatural(); return BuildJoin(_xConnection,BuildTable(_xConnection,pLh,bForce),BuildTable(_xConnection,pRh,bForce),pData); } - //------------------------------------------------------------------------------ OUString BuildJoin( const Reference< XConnection>& _xConnection, const OUString &rLh, const OQueryTableWindow* pRh, @@ -447,7 +434,6 @@ namespace { return BuildJoin(_xConnection,rLh,BuildTable(_xConnection,pRh),pData); } - //------------------------------------------------------------------------------ OUString BuildJoin( const Reference< XConnection>& _xConnection, const OQueryTableWindow* pLh, const OUString &rRh, @@ -475,9 +461,7 @@ namespace } return BuildJoin(_xConnection, rRh, BuildTable(_xConnection,pLh), &data); } - //------------------------------------------------------------------------------ typedef ::std::map< OUString,sal_Bool,::comphelper::UStringMixLess> tableNames_t; - //------------------------------------------------------------------------------ void addConnectionTableNames( const Reference< XConnection>& _xConnection, const OQueryTableConnection* const pEntryConn, tableNames_t &_rTableNames ) @@ -493,7 +477,6 @@ namespace if(_rTableNames.find(sTabName) == _rTableNames.end()) _rTableNames[sTabName] = sal_True; } - //------------------------------------------------------------------------------ void GetNextJoin( const Reference< XConnection>& _xConnection, OQueryTableConnection* pEntryConn, OQueryTableWindow* pEntryTabTo, @@ -559,7 +542,6 @@ namespace } } } - //------------------------------------------------------------------------------ SqlParseError InsertJoinConnection( const OQueryDesignView* _pView, const ::connectivity::OSQLParseNode *pNode, const EJoinType& _eJoinType, @@ -616,13 +598,11 @@ namespace eErrorCode = eIllegalJoin; return eErrorCode; } - //------------------------------------------------------------------------------ sal_Bool GetInnerJoinCriteria( const OQueryDesignView* _pView, const ::connectivity::OSQLParseNode *pCondition) { return InsertJoinConnection(_pView,pCondition, INNER_JOIN,NULL,NULL) != eOk; } - //------------------------------------------------------------------------------ OUString GenerateSelectList( const OQueryDesignView* _pView, OTableFields& _rFieldList, sal_Bool bAlias) @@ -732,7 +712,6 @@ namespace } return aFieldListStr.makeStringAndClear(); } - //------------------------------------------------------------------------------ sal_Bool GenerateCriterias( OQueryDesignView* _pView, OUStringBuffer& rRetStr, OUStringBuffer& rHavingStr, @@ -785,7 +764,6 @@ namespace } aWork = OUString(); - aWork += quoteTableAlias(bMulti,pEntryField->GetAlias(),aQuote); if ( (pEntryField->GetFunctionType() & (FKT_OTHER|FKT_NUMERIC)) || (aFieldName.toChar() == '*') ) @@ -909,7 +887,6 @@ namespace } return sal_True; } - //------------------------------------------------------------------------------ SqlParseError GenerateOrder( OQueryDesignView* _pView, OTableFields& _rFieldList, sal_Bool bMulti, @@ -1010,7 +987,6 @@ namespace return eErrorCode; } - //------------------------------------------------------------------------------ void GenerateInnerJoinCriterias(const Reference< XConnection>& _xConnection, OUString& _rJoinCrit, const ::std::vector<OTableConnection*>* _pConnList) @@ -1029,7 +1005,6 @@ namespace } } } - //------------------------------------------------------------------------------ void searchAndAppendName(const Reference< XConnection>& _xConnection, const OQueryTableWindow* _pTableWindow, tableNames_t& _rTableNames, @@ -1045,7 +1020,6 @@ namespace _rsTableListStr += OUString(','); } } - //------------------------------------------------------------------------------ OUString GenerateFromClause( const Reference< XConnection>& _xConnection, const OQueryTableView::OTableWindowMap* pTabList, const ::std::vector<OTableConnection*>* pConnList @@ -1162,7 +1136,6 @@ namespace aTableListStr = aTableListStr.replaceAt(aTableListStr.getLength()-1,1, OUString() ); return aTableListStr; } - //------------------------------------------------------------------------------ OUString GenerateGroupBy(const OQueryDesignView* _pView,OTableFields& _rFieldList, sal_Bool bMulti ) { OQueryController& rController = static_cast<OQueryController&>(_pView->getController()); @@ -1236,14 +1209,12 @@ namespace } return aGroupByStr; } - // ----------------------------------------------------------------------------- SqlParseError GetORCriteria(OQueryDesignView* _pView, OSelectionBrowseBox* _pSelectionBrw, const ::connectivity::OSQLParseNode * pCondition, sal_uInt16& nLevel , sal_Bool bHaving = sal_False, bool bAddOrOnOneLine = false); - // ----------------------------------------------------------------------------- SqlParseError GetSelectionCriteria( OQueryDesignView* _pView, OSelectionBrowseBox* _pSelectionBrw, const ::connectivity::OSQLParseNode* pNode, @@ -1287,21 +1258,18 @@ namespace } return eErrorCode; } - //------------------------------------------------------------------------------ SqlParseError GetANDCriteria( OQueryDesignView* _pView, OSelectionBrowseBox* _pSelectionBrw, const ::connectivity::OSQLParseNode * pCondition, sal_uInt16& nLevel, sal_Bool bHaving, bool bAddOrOnOneLine); - //------------------------------------------------------------------------------ SqlParseError ComparisonPredicate(OQueryDesignView* _pView, OSelectionBrowseBox* _pSelectionBrw, const ::connectivity::OSQLParseNode * pCondition, const sal_uInt16 nLevel, sal_Bool bHaving, bool bAddOrOnOneLine); - //------------------------------------------------------------------------------ SqlParseError GetORCriteria(OQueryDesignView* _pView, OSelectionBrowseBox* _pSelectionBrw, const ::connectivity::OSQLParseNode * pCondition, @@ -1340,7 +1308,6 @@ namespace return eErrorCode; } - //-------------------------------------------------------------------------------------------------- bool CheckOrCriteria(const ::connectivity::OSQLParseNode* _pCondition,::connectivity::OSQLParseNode* _pFirstColumnRef) { bool bRet = true; @@ -1362,7 +1329,6 @@ namespace } return bRet; } - //-------------------------------------------------------------------------------------------------- SqlParseError GetANDCriteria( OQueryDesignView* _pView, OSelectionBrowseBox* _pSelectionBrw, const ::connectivity::OSQLParseNode * pCondition, @@ -1526,7 +1492,6 @@ namespace // Pass on the error code return eErrorCode; } - //------------------------------------------------------------------------------ SqlParseError AddFunctionCondition(OQueryDesignView* _pView, OSelectionBrowseBox* _pSelectionBrw, const ::connectivity::OSQLParseNode * pCondition, @@ -1569,7 +1534,6 @@ namespace if ( aCondition.indexOf('=',0) == 0 ) // ignore the equal sign aCondition = aCondition.copy(1); - if ( SQL_ISRULE(pFunction, general_set_fct ) ) { sal_Int32 nFunctionType = FKT_AGGREGATE; @@ -1620,7 +1584,6 @@ namespace return eErrorCode; } - //------------------------------------------------------------------------------ SqlParseError ComparisonPredicate(OQueryDesignView* _pView, OSelectionBrowseBox* _pSelectionBrw, const ::connectivity::OSQLParseNode * pCondition, @@ -1733,7 +1696,6 @@ namespace } // else ??? - if( eOk == ( eErrorCode = FillDragInfo(_pView,pCondition->getChild(nPos),aDragLeft))) { if(bHaving) @@ -1783,7 +1745,6 @@ namespace return eErrorCode; } - //------------------------------------------------------------------------------ namespace { OQueryTableWindow* lcl_findColumnInTables( const OUString& _rColumName, const OJoinTableView::OTableWindowMap& _rTabList, OTableFieldDescRef& _rInfo ) @@ -1800,7 +1761,6 @@ namespace } } - //------------------------------------------------------------------------------ void InsertColumnRef(const OQueryDesignView* _pView, const ::connectivity::OSQLParseNode * pColumnRef, OUString& aColumnName, @@ -1844,7 +1804,6 @@ namespace _raInfo->SetFunctionType(FKT_OTHER); } } - //----------------------------------------------------------------------------- sal_Bool checkJoinConditions( const OQueryDesignView* _pView, const ::connectivity::OSQLParseNode* _pNode ) { @@ -1864,7 +1823,6 @@ namespace bRet = sal_False; return bRet; } - //----------------------------------------------------------------------------- sal_Bool InsertJoin(const OQueryDesignView* _pView, const ::connectivity::OSQLParseNode *pNode) { @@ -1947,10 +1905,8 @@ namespace insertConnection(_pView,eJoinType,aDragLeft,aDragRight,bNatural); } - return sal_True; } - //------------------------------------------------------------------------------ void insertUnUsedFields(OQueryDesignView* _pView,OSelectionBrowseBox* _pSelectionBrw) { // now we have to insert the fields which aren't in the statement @@ -1963,7 +1919,6 @@ namespace OTableFields().swap( rUnUsedFields ); } - //------------------------------------------------------------------------------ SqlParseError InitFromParseNodeImpl(OQueryDesignView* _pView,OSelectionBrowseBox* _pSelectionBrw) { SqlParseError eErrorCode = eOk; @@ -1974,7 +1929,6 @@ namespace _pSelectionBrw->SetReadOnly(rController.isReadOnly()); _pSelectionBrw->Fill(); - ::connectivity::OSQLParseTreeIterator& aIterator = rController.getParseIterator(); const ::connectivity::OSQLParseNode* pParseTree = aIterator.getParseTree(); @@ -2141,12 +2095,10 @@ namespace _pSelectionBrw->Invalidate(); return eErrorCode; } - //------------------------------------------------------------------------------ /** fillSelectSubList @return <TRUE/> when columns could be inserted otherwise <FALSE/> */ - //------------------------------------------------------------------------------ SqlParseError fillSelectSubList( OQueryDesignView* _pView, OJoinTableView::OTableWindowMap* _pTabList) { @@ -2167,7 +2119,6 @@ namespace } return eErrorCode; } - //------------------------------------------------------------------------------ SqlParseError InstallFields(OQueryDesignView* _pView, const ::connectivity::OSQLParseNode* pNode, OJoinTableView::OTableWindowMap* pTabList ) @@ -2346,7 +2297,6 @@ namespace return eErrorCode; } - //------------------------------------------------------------------------------ SqlParseError GetOrderCriteria( OQueryDesignView* _pView, OSelectionBrowseBox* _pSelectionBrw, const ::connectivity::OSQLParseNode* pParseRoot ) @@ -2423,7 +2373,6 @@ namespace } return eErrorCode; } - //------------------------------------------------------------------------------ SqlParseError GetHavingCriteria( OQueryDesignView* _pView, OSelectionBrowseBox* _pSelectionBrw, const ::connectivity::OSQLParseNode* pSelectRoot, @@ -2434,7 +2383,6 @@ namespace eErrorCode = GetORCriteria(_pView,_pSelectionBrw,pSelectRoot->getChild(3)->getChild(3)->getChild(1),rLevel, sal_True); return eErrorCode; } - //------------------------------------------------------------------------------ SqlParseError GetGroupCriteria( OQueryDesignView* _pView, OSelectionBrowseBox* _pSelectionBrw, const ::connectivity::OSQLParseNode* pSelectRoot ) @@ -2490,7 +2438,6 @@ namespace return eErrorCode; } - //------------------------------------------------------------------------------ String getParseErrorMessage( SqlParseError _eErrorCode ) { sal_uInt16 nResId; @@ -2540,9 +2487,8 @@ namespace return String( ModuleRes( nResId ) ); } - //------------------------------------------------------------------------------ - //------------------------------------------------------------------------------ } + // end of anonymouse namespace DBG_NAME(OQueryDesignView) @@ -2575,7 +2521,7 @@ OQueryDesignView::OQueryDesignView( OQueryContainerWindow* _pParent, m_aSplitter.Show(); } -// ----------------------------------------------------------------------------- + OQueryDesignView::~OQueryDesignView() { if ( m_pTableView ) @@ -2587,7 +2533,7 @@ OQueryDesignView::~OQueryDesignView() DBG_DTOR(OQueryDesignView,NULL); } -//------------------------------------------------------------------------------ + IMPL_LINK( OQueryDesignView, SplitHdl, void*, /*p*/ ) { if (!getController().isReadOnly()) @@ -2601,14 +2547,14 @@ IMPL_LINK( OQueryDesignView, SplitHdl, void*, /*p*/ ) } return 0L; } -// ------------------------------------------------------------------------- + void OQueryDesignView::Construct() { m_pTableView = new OQueryTableView(m_pScrollWindow,this); ::dbaui::notifySystemWindow(this,m_pTableView,::comphelper::mem_fun(&TaskPaneList::AddWindow)); OQueryView::Construct(); } -// ----------------------------------------------------------------------------- + void OQueryDesignView::initialize() { if(static_cast<OQueryController&>(getController()).getSplitPos() != -1) @@ -2619,7 +2565,7 @@ void OQueryDesignView::initialize() m_pSelectionBox->initialize(); reset(); } -// ------------------------------------------------------------------------- + void OQueryDesignView::resizeDocumentView(Rectangle& _rPlayground) { Point aPlaygroundPos( _rPlayground.TopLeft() ); @@ -2690,28 +2636,28 @@ void OQueryDesignView::resizeDocumentView(Rectangle& _rPlayground) _rPlayground.SetPos( _rPlayground.BottomRight() ); _rPlayground.SetSize( Size( 0, 0 ) ); } -// ----------------------------------------------------------------------------- + void OQueryDesignView::setReadOnly(sal_Bool _bReadOnly) { m_pSelectionBox->SetReadOnly(_bReadOnly); } -// ----------------------------------------------------------------------------- + void OQueryDesignView::clear() { m_pSelectionBox->ClearAll(); // clear the whole selection m_pTableView->ClearAll(); } -// ----------------------------------------------------------------------------- + void OQueryDesignView::setStatement(const OUString& /*_rsStatement*/) { } -// ----------------------------------------------------------------------------- + void OQueryDesignView::copy() { if( m_eChildFocus == SELECTION) m_pSelectionBox->copy(); } -// ----------------------------------------------------------------------------- + sal_Bool OQueryDesignView::isCutAllowed() { sal_Bool bAllowed = sal_False; @@ -2719,7 +2665,7 @@ sal_Bool OQueryDesignView::isCutAllowed() bAllowed = m_pSelectionBox->isCutAllowed(); return bAllowed; } -// ----------------------------------------------------------------------------- + sal_Bool OQueryDesignView::isPasteAllowed() { sal_Bool bAllowed = sal_False; @@ -2727,7 +2673,7 @@ sal_Bool OQueryDesignView::isPasteAllowed() bAllowed = m_pSelectionBox->isPasteAllowed(); return bAllowed; } -// ----------------------------------------------------------------------------- + sal_Bool OQueryDesignView::isCopyAllowed() { sal_Bool bAllowed = sal_False; @@ -2735,17 +2681,17 @@ sal_Bool OQueryDesignView::isCopyAllowed() bAllowed = m_pSelectionBox->isCopyAllowed(); return bAllowed; } -// ----------------------------------------------------------------------------- + void OQueryDesignView::stopTimer() { m_pSelectionBox->stopTimer(); } -// ----------------------------------------------------------------------------- + void OQueryDesignView::startTimer() { m_pSelectionBox->startTimer(); } -// ----------------------------------------------------------------------------- + void OQueryDesignView::cut() { if( m_eChildFocus == SELECTION) @@ -2754,7 +2700,7 @@ void OQueryDesignView::cut() static_cast<OQueryController&>(getController()).setModified(sal_True); } } -// ----------------------------------------------------------------------------- + void OQueryDesignView::paste() { if( m_eChildFocus == SELECTION) @@ -2763,29 +2709,29 @@ void OQueryDesignView::paste() static_cast<OQueryController&>(getController()).setModified(sal_True); } } -// ----------------------------------------------------------------------------- + void OQueryDesignView::TableDeleted(const OUString& rAliasName) { // message that the table was removed from the window DeleteFields(rAliasName); static_cast<OQueryController&>(getController()).InvalidateFeature(ID_BROWSER_ADDTABLE); // inform the view again } -//------------------------------------------------------------------------------ + void OQueryDesignView::DeleteFields( const OUString& rAliasName ) { m_pSelectionBox->DeleteFields( rAliasName ); } -// ----------------------------------------------------------------------------- + bool OQueryDesignView::HasFieldByAliasName(const OUString& rFieldName, OTableFieldDescRef& rInfo) const { return m_pSelectionBox->HasFieldByAliasName( rFieldName, rInfo); } -// ----------------------------------------------------------------------------- + SqlParseError OQueryDesignView::InsertField( const OTableFieldDescRef& rInfo, sal_Bool bVis, sal_Bool bActivate) { return m_pSelectionBox->InsertField( rInfo, BROWSER_INVALIDID,bVis, bActivate ).is() ? eOk : eTooManyColumns; } -// ----------------------------------------------------------------------------- + sal_Int32 OQueryDesignView::getColWidth(sal_uInt16 _nColPos) const { static sal_Int32 s_nDefaultWidth = GetTextWidth(String(RTL_CONSTASCII_USTRINGPARAM("0"))) * 15; @@ -2794,7 +2740,7 @@ sal_Int32 OQueryDesignView::getColWidth(sal_uInt16 _nColPos) const nWidth = s_nDefaultWidth; return nWidth; } -//------------------------------------------------------------------------------ + void OQueryDesignView::fillValidFields(const OUString& sAliasName, ComboBox* pFieldList) { OSL_ENSURE(pFieldList != NULL, "OQueryDesignView::FillValidFields : What the hell do you think I can do with a NULL-ptr ? This will crash !"); @@ -2834,7 +2780,7 @@ void OQueryDesignView::fillValidFields(const OUString& sAliasName, ComboBox* pFi } } } -// ----------------------------------------------------------------------------- + long OQueryDesignView::PreNotify(NotifyEvent& rNEvt) { switch (rNEvt.GetType()) @@ -2856,10 +2802,7 @@ long OQueryDesignView::PreNotify(NotifyEvent& rNEvt) return OQueryView::PreNotify(rNEvt); } -//------------------------------------------------------------------------------ - -// ----------------------------------------------------------------------------- // check if the statement is correct when not returning false sal_Bool OQueryDesignView::checkStatement() { @@ -2868,7 +2811,7 @@ sal_Bool OQueryDesignView::checkStatement() bRet = m_pSelectionBox->Save(); // an error occurred so we return no return bRet; } -//------------------------------------------------------------------------------- + OUString OQueryDesignView::getStatement() { OQueryController& rController = static_cast<OQueryController&>(getController()); @@ -2922,6 +2865,7 @@ OUString OQueryDesignView::getStatement() // a table is deleted, also the belonging fields will be deleted -> therefore it CANNOT occur that fields // exist but no tables exist (and aFieldListStr has its length, I secure this above) OUStringBuffer aHavingStr,aCriteriaListStr; + // ----------------- Kriterien aufbauen ---------------------- if (!GenerateCriterias(this,aCriteriaListStr,aHavingStr,rFieldList, nTabcount > 1)) return OUString(); @@ -2953,7 +2897,6 @@ OUString OQueryDesignView::getStatement() aSqlCmd.append(OUString(" WHERE ")); aSqlCmd.append(aCriteriaListStr.makeStringAndClear()); } - // ----------------- construct GroupBy and attachen ------------ Reference<XDatabaseMetaData> xMeta; if ( xConnection.is() ) xMeta = xConnection->getMetaData(); @@ -2962,7 +2905,7 @@ OUString OQueryDesignView::getStatement() bUseAlias = bUseAlias || !xMeta->supportsGroupByUnrelated(); aSqlCmd.append(GenerateGroupBy(this,rFieldList,bUseAlias)); - // ----------------- attache having ------------ + // ----------------- construct GroupBy and attachen ------------ if(!aHavingStr.isEmpty()) { aSqlCmd.append(OUString(" HAVING ")); @@ -3015,8 +2958,7 @@ OUString OQueryDesignView::getStatement() } return sSQL; } -// ----------------------------------------------------------------------------- -// ----------------------------------------------------------------------------- + void OQueryDesignView::setSlotEnabled(sal_Int32 _nSlotId,sal_Bool _bEnable) { sal_uInt16 nRow; @@ -3039,7 +2981,7 @@ void OQueryDesignView::setSlotEnabled(sal_Int32 _nSlotId,sal_Bool _bEnable) m_pSelectionBox->SetRowVisible(nRow,_bEnable); m_pSelectionBox->Invalidate(); } -// ----------------------------------------------------------------------------- + sal_Bool OQueryDesignView::isSlotEnabled(sal_Int32 _nSlotId) { sal_uInt16 nRow; @@ -3061,7 +3003,7 @@ sal_Bool OQueryDesignView::isSlotEnabled(sal_Int32 _nSlotId) } return m_pSelectionBox->IsRowVisible(nRow); } -// ----------------------------------------------------------------------------- + void OQueryDesignView::SaveUIConfig() { OQueryController& rCtrl = static_cast<OQueryController&>(getController()); @@ -3070,7 +3012,7 @@ void OQueryDesignView::SaveUIConfig() if ( m_aSplitter.GetSplitPosPixel() != 0 ) rCtrl.setSplitPos( m_aSplitter.GetSplitPosPixel() ); } -// ----------------------------------------------------------------------------- + OSQLParseNode* OQueryDesignView::getPredicateTreeFromEntry(OTableFieldDescRef pEntry, const OUString& _sCriteria, OUString& _rsErrorMessage, @@ -3163,7 +3105,7 @@ OSQLParseNode* OQueryDesignView::getPredicateTreeFromEntry(OTableFieldDescRef pE _rxColumn); return pParseNode; } -// ----------------------------------------------------------------------------- + void OQueryDesignView::GetFocus() { OQueryView::GetFocus(); @@ -3175,19 +3117,18 @@ void OQueryDesignView::GetFocus() m_pSelectionBox->GrabFocus(); } } -// ----------------------------------------------------------------------------- + void OQueryDesignView::reset() { m_pTableView->ClearAll(); m_pTableView->ReSync(); } -// ----------------------------------------------------------------------------- + void OQueryDesignView::setNoneVisbleRow(sal_Int32 _nRows) { m_pSelectionBox->SetNoneVisbleRow(_nRows); } -// ----------------------------------------------------------------------------- void OQueryDesignView::initByFieldDescriptions( const Sequence< PropertyValue >& i_rFieldDescriptions ) { OQueryController& rController = static_cast< OQueryController& >( getController() ); @@ -3210,7 +3151,6 @@ void OQueryDesignView::initByFieldDescriptions( const Sequence< PropertyValue >& m_pSelectionBox->Invalidate(); } -// ----------------------------------------------------------------------------- bool OQueryDesignView::initByParseIterator( ::dbtools::SQLExceptionInfo* _pErrorInfo ) { SqlParseError eErrorCode = eNativeMode; @@ -3297,7 +3237,6 @@ namespace { } } -//------------------------------------------------------------------------------ // Try to guess the type of an expression in simple cases. // Originally meant to be called only on a function call (hence the misnomer), // but now tries to do the best it can also in other cases. @@ -3624,6 +3563,5 @@ void OQueryDesignView::fillFunctionInfo( const ::connectivity::OSQLParseNode* p aInfo->SetField(sFunctionTerm); aInfo->SetTabWindow(NULL); } -// ----------------------------------------------------------------------------- /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/querydesign/QueryMoveTabWinUndoAct.cxx b/dbaccess/source/ui/querydesign/QueryMoveTabWinUndoAct.cxx index e1063449794e..7b0eaed7aff9 100644 --- a/dbaccess/source/ui/querydesign/QueryMoveTabWinUndoAct.cxx +++ b/dbaccess/source/ui/querydesign/QueryMoveTabWinUndoAct.cxx @@ -17,12 +17,10 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ - #include "QueryMoveTabWinUndoAct.hxx" #include "JoinTableView.hxx" #include "QTableWindow.hxx" using namespace dbaui; -//------------------------------------------------------------------------------ void OJoinMoveTabWinUndoAct::TogglePosition() { Point ptFrameScrollPos(m_pOwner->GetHScrollBar()->GetThumbPos(), m_pOwner->GetVScrollBar()->GetThumbPos()); @@ -38,5 +36,4 @@ void OJoinMoveTabWinUndoAct::TogglePosition() m_ptNextPosition = ptNext; } - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/querydesign/QueryMoveTabWinUndoAct.hxx b/dbaccess/source/ui/querydesign/QueryMoveTabWinUndoAct.hxx index 4a9e609f65d0..15bbc2ae27bc 100644 --- a/dbaccess/source/ui/querydesign/QueryMoveTabWinUndoAct.hxx +++ b/dbaccess/source/ui/querydesign/QueryMoveTabWinUndoAct.hxx @@ -26,7 +26,6 @@ namespace dbaui { - // ================================================================================================ // OQueryMoveTabWinUndoAct - Undo-Klasse fuer Verschieben eines TabWins class OTableWindow; class OJoinMoveTabWinUndoAct : public OQueryDesignUndoAction @@ -44,7 +43,6 @@ namespace dbaui virtual void Redo() { TogglePosition(); } }; - // ------------------------------------------------------------------------------------------------ inline OJoinMoveTabWinUndoAct::OJoinMoveTabWinUndoAct(OJoinTableView* pOwner, const Point& ptOriginalPosition, OTableWindow* pTabWin) :OQueryDesignUndoAction(pOwner, STR_QUERY_UNDO_MOVETABWIN) ,m_ptNextPosition(ptOriginalPosition) @@ -54,5 +52,4 @@ namespace dbaui } #endif // DBAUI_OQUERYMOVETABWINUNDOACT_HXX - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/querydesign/QuerySizeTabWinUndoAct.hxx b/dbaccess/source/ui/querydesign/QuerySizeTabWinUndoAct.hxx index e21ebf02716a..c6ada503e71a 100644 --- a/dbaccess/source/ui/querydesign/QuerySizeTabWinUndoAct.hxx +++ b/dbaccess/source/ui/querydesign/QuerySizeTabWinUndoAct.hxx @@ -25,7 +25,6 @@ namespace dbaui { - // ================================================================================================ // OQuerySizeTabWinUndoAct - undo class to change size of TabWins class OTableWindow; class OJoinSizeTabWinUndoAct : public OQueryDesignUndoAction @@ -47,7 +46,6 @@ namespace dbaui virtual void Redo() { ToggleSizePosition(); } }; - //------------------------------------------------------------------------------ inline OJoinSizeTabWinUndoAct::OJoinSizeTabWinUndoAct(OJoinTableView* pOwner, const Point& ptOriginalPos, const Size& szOriginalSize, OTableWindow* pTabWin) :OQueryDesignUndoAction(pOwner, STR_QUERY_UNDO_SIZETABWIN) ,m_ptNextPosition(ptOriginalPos) @@ -56,7 +54,6 @@ namespace dbaui { } - //------------------------------------------------------------------------------ inline void OJoinSizeTabWinUndoAct::ToggleSizePosition() { Point ptNext = m_pTabWin->GetPosPixel(); @@ -73,5 +70,4 @@ namespace dbaui #endif //DBAUI_QUERYSIZETABWINUNDOACT_HXX - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/querydesign/QueryTabConnUndoAction.cxx b/dbaccess/source/ui/querydesign/QueryTabConnUndoAction.cxx index d09f60dd4400..0ad9239d1899 100644 --- a/dbaccess/source/ui/querydesign/QueryTabConnUndoAction.cxx +++ b/dbaccess/source/ui/querydesign/QueryTabConnUndoAction.cxx @@ -28,7 +28,6 @@ using namespace dbaui; DBG_NAME(OQueryTabConnUndoAction) -// ------------------------------------------------------------------------------------------------ OQueryTabConnUndoAction::~OQueryTabConnUndoAction() { DBG_DTOR(OQueryTabConnUndoAction,NULL); @@ -39,7 +38,6 @@ OQueryTabConnUndoAction::~OQueryTabConnUndoAction() } } -// ------------------------------------------------------------------------------------------------ OQueryTabConnUndoAction::OQueryTabConnUndoAction(OQueryTableView* pOwner, sal_uInt16 nCommentID) :OQueryDesignUndoAction(pOwner, nCommentID) ,m_pConnection(NULL) @@ -47,82 +45,81 @@ OQueryTabConnUndoAction::OQueryTabConnUndoAction(OQueryTableView* pOwner, sal_uI { DBG_CTOR(OQueryTabConnUndoAction,NULL); } -// ----------------------------------------------------------------------------- + OQueryAddTabConnUndoAction::OQueryAddTabConnUndoAction(OQueryTableView* pOwner) : OQueryTabConnUndoAction(pOwner, STR_QUERY_UNDO_INSERTCONNECTION) { } -// ----------------------------------------------------------------------------- + void OQueryAddTabConnUndoAction::Undo() { static_cast<OQueryTableView*>(m_pOwner)->DropConnection(m_pConnection); SetOwnership(sal_True); } -// ----------------------------------------------------------------------------- + void OQueryAddTabConnUndoAction::Redo() { static_cast<OQueryTableView*>(m_pOwner)->GetConnection(m_pConnection); SetOwnership(sal_False); } -// ----------------------------------------------------------------------------- + OQueryDelTabConnUndoAction::OQueryDelTabConnUndoAction(OQueryTableView* pOwner) : OQueryTabConnUndoAction(pOwner, STR_QUERY_UNDO_REMOVECONNECTION) { } -// ----------------------------------------------------------------------------- + void OQueryDelTabConnUndoAction::Undo() { static_cast<OQueryTableView*>(m_pOwner)->GetConnection(m_pConnection); SetOwnership(sal_False); } -// ----------------------------------------------------------------------------- + void OQueryDelTabConnUndoAction::Redo() { static_cast<OQueryTableView*>(m_pOwner)->DropConnection(m_pConnection); SetOwnership(sal_True); } -// ----------------------------------------------------------------------------- + OQueryTabWinShowUndoAct::OQueryTabWinShowUndoAct(OQueryTableView* pOwner) : OQueryTabWinUndoAct(pOwner, STR_QUERY_UNDO_TABWINSHOW) { } -// ----------------------------------------------------------------------------- + OQueryTabWinShowUndoAct::~OQueryTabWinShowUndoAct() { } -// ----------------------------------------------------------------------------- + void OQueryTabWinShowUndoAct::Undo() { static_cast<OQueryTableView*>(m_pOwner)->HideTabWin(m_pTabWin, this); SetOwnership(sal_True); } -// ----------------------------------------------------------------------------- + void OQueryTabWinShowUndoAct::Redo() { static_cast<OQueryTableView*>(m_pOwner)->ShowTabWin(m_pTabWin, this,sal_True); SetOwnership(sal_False); } -// ----------------------------------------------------------------------------- + OQueryTabWinDelUndoAct::OQueryTabWinDelUndoAct(OQueryTableView* pOwner) : OQueryTabWinUndoAct(pOwner, STR_QUERY_UNDO_TABWINDELETE) { } -// ----------------------------------------------------------------------------- + OQueryTabWinDelUndoAct::~OQueryTabWinDelUndoAct() { } -// ----------------------------------------------------------------------------- + void OQueryTabWinDelUndoAct::Undo() { static_cast<OQueryTableView*>(m_pOwner)->ShowTabWin( m_pTabWin, this,sal_True ); SetOwnership(sal_False); } -// ----------------------------------------------------------------------------- + void OQueryTabWinDelUndoAct::Redo() { static_cast<OQueryTableView*>(m_pOwner)->HideTabWin( m_pTabWin, this ); SetOwnership(sal_True); } -// ----------------------------------------------------------------------------- /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/querydesign/QueryTabWinShowUndoAct.hxx b/dbaccess/source/ui/querydesign/QueryTabWinShowUndoAct.hxx index 8bf401416e7f..57a6777e96b8 100644 --- a/dbaccess/source/ui/querydesign/QueryTabWinShowUndoAct.hxx +++ b/dbaccess/source/ui/querydesign/QueryTabWinShowUndoAct.hxx @@ -24,7 +24,6 @@ namespace dbaui { - // ================================================================================================ // OQueryTabWinShowUndoAct - undo class to show a TabWins class OQueryTabWinShowUndoAct : public OQueryTabWinUndoAct @@ -37,7 +36,6 @@ namespace dbaui virtual void Redo(); }; - // ================================================================================================ // OQueryTabWinDelUndoAct - undo class to delete a TabWins class OQueryTabWinDelUndoAct : public OQueryTabWinUndoAct @@ -52,6 +50,4 @@ namespace dbaui } #endif // DBAUI_QUERYTABWINSHOWUNDOACT_HXX - - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/querydesign/QueryTabWinUndoAct.cxx b/dbaccess/source/ui/querydesign/QueryTabWinUndoAct.cxx index 2e3e995b7132..85b895c32fa8 100644 --- a/dbaccess/source/ui/querydesign/QueryTabWinUndoAct.cxx +++ b/dbaccess/source/ui/querydesign/QueryTabWinUndoAct.cxx @@ -26,7 +26,6 @@ #include "QueryDesignFieldUndoAct.hxx" #include "QueryTableView.hxx" - using namespace dbaui; DBG_NAME(OQueryDesignFieldUndoAct) OQueryDesignFieldUndoAct::OQueryDesignFieldUndoAct(OSelectionBrowseBox* pSelBrwBox, sal_uInt16 nCommentID) @@ -36,23 +35,21 @@ OQueryDesignFieldUndoAct::OQueryDesignFieldUndoAct(OSelectionBrowseBox* pSelBrwB { DBG_CTOR(OQueryDesignFieldUndoAct,NULL); } -// ----------------------------------------------------------------------------- + OQueryDesignFieldUndoAct::~OQueryDesignFieldUndoAct() { DBG_DTOR(OQueryDesignFieldUndoAct,NULL); pOwner = NULL; } -// ----------------------------------------------------------------------------- DBG_NAME(OQueryTabWinUndoAct ) -// ------------------------------------------------------------------------------------------------ OQueryTabWinUndoAct::OQueryTabWinUndoAct(OQueryTableView* pOwner, sal_uInt16 nCommentID) :OQueryDesignUndoAction(pOwner, nCommentID) ,m_pTabWin(NULL) { DBG_CTOR(OQueryTabWinUndoAct ,NULL); } -//============================================================================== + OQueryTabWinUndoAct::~OQueryTabWinUndoAct() { DBG_DTOR(OQueryTabWinUndoAct ,NULL); @@ -77,7 +74,7 @@ OQueryTabWinUndoAct::~OQueryTabWinUndoAct() m_vTableConnection.clear(); } } -//------------------------------------------------------------------------------ + void OTabFieldCellModifiedUndoAct::Undo() { pOwner->EnterUndoMode(); @@ -93,7 +90,6 @@ void OTabFieldCellModifiedUndoAct::Undo() pOwner->LeaveUndoMode(); } -//------------------------------------------------------------------------------ void OTabFieldSizedUndoAct::Undo() { pOwner->EnterUndoMode(); @@ -107,7 +103,7 @@ void OTabFieldSizedUndoAct::Undo() } pOwner->LeaveUndoMode(); } -// ----------------------------------------------------------------------------- + void OTabFieldMovedUndoAct::Undo() { pOwner->EnterUndoMode(); @@ -122,6 +118,5 @@ void OTabFieldMovedUndoAct::Undo() } pOwner->LeaveUndoMode(); } -// ----------------------------------------------------------------------------- /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/querydesign/QueryTabWinUndoAct.hxx b/dbaccess/source/ui/querydesign/QueryTabWinUndoAct.hxx index af839edaebb9..7ea2f86064d3 100644 --- a/dbaccess/source/ui/querydesign/QueryTabWinUndoAct.hxx +++ b/dbaccess/source/ui/querydesign/QueryTabWinUndoAct.hxx @@ -25,7 +25,6 @@ namespace dbaui { - // ================================================================================================ // OQueryTabWinUndoAct - undo base class for all which is concerned with insert/remove TabWins class OQueryTableWindow; @@ -45,7 +44,6 @@ namespace dbaui void SetOwnership(sal_Bool bTakeIt) { m_bOwnerOfObjects = bTakeIt; } - virtual void Undo() = 0; virtual void Redo() = 0; @@ -65,10 +63,7 @@ namespace dbaui } }; - } #endif // DBAUI_QUERYTABWINUNDOACT_HXX - - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/querydesign/QueryTableView.cxx b/dbaccess/source/ui/querydesign/QueryTableView.cxx index 2a57381338f8..ecb8c10236ae 100644 --- a/dbaccess/source/ui/querydesign/QueryTableView.cxx +++ b/dbaccess/source/ui/querydesign/QueryTableView.cxx @@ -17,7 +17,6 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ - #include "QueryTableView.hxx" #include "TableFieldInfo.hxx" #include "TableFieldDescription.hxx" @@ -59,10 +58,8 @@ using namespace ::com::sun::star::beans; using namespace ::com::sun::star::container; using namespace ::com::sun::star::accessibility; -//------------------------------------------------------------------------------ namespace { - // ----------------------------------------------------------------------------- sal_Bool isColumnInKeyType(const Reference<XIndexAccess>& _rxKeys,const OUString& _rColumnName,sal_Int32 _nKeyType) { sal_Bool bReturn = sal_False; @@ -96,14 +93,12 @@ namespace } return bReturn; } - // ----------------------------------------------------------------------------- /** appends a new TabAdd Undo action at controller @param _pView the view which we use @param _pUndoAction the undo action which should be added @param _pConnection the connection for which the undo action should be appended @param _bOwner is the undo action the owner */ - // ----------------------------------------------------------------------------- void addUndoAction( OQueryTableView* _pView, OQueryTabConnUndoAction* _pUndoAction, OQueryTableConnection* _pConnection, @@ -113,7 +108,6 @@ namespace _pUndoAction->SetConnection(_pConnection); _pView->getDesignView()->getController().addUndoActionAndInvalidate(_pUndoAction); } - // ----------------------------------------------------------------------------- /** openJoinDialog opens the join dialog with this connection data @param _pView the view which we use @param _pConnectionData the connection data @@ -134,7 +128,6 @@ namespace return bOk; } - // ----------------------------------------------------------------------------- /** connectionModified adds an undo action for the modified connection and forces an redraw @param _pView the view which we use @param _pConnection the connection which was modified @@ -159,7 +152,6 @@ namespace _pView->Invalidate(INVALIDATE_NOCHILDREN); } - // ----------------------------------------------------------------------------- void addConnections(OQueryTableView* _pView, const OQueryTableWindow& _rSource, const OQueryTableWindow& _rDest, @@ -228,11 +220,9 @@ namespace } } } -//================================================================== + // class OQueryTableView -//================================================================== DBG_NAME(OQueryTableView) -//------------------------------------------------------------------------ OQueryTableView::OQueryTableView( Window* pParent,OQueryDesignView* pView) : OJoinTableView( pParent,pView) { @@ -240,13 +230,11 @@ OQueryTableView::OQueryTableView( Window* pParent,OQueryDesignView* pView) SetHelpId(HID_CTL_QRYDGNTAB); } -//------------------------------------------------------------------------ OQueryTableView::~OQueryTableView() { DBG_DTOR(OQueryTableView,NULL); } -//------------------------------------------------------------------------ sal_Int32 OQueryTableView::CountTableAlias(const String& rName, sal_Int32& rMax) { DBG_CHKTHIS(OQueryTableView,NULL); @@ -263,7 +251,7 @@ sal_Int32 OQueryTableView::CountTableAlias(const String& rName, sal_Int32& rMax) return nRet; } -//------------------------------------------------------------------------ + void OQueryTableView::ReSync() { DBG_CHKTHIS(OQueryTableView,NULL); @@ -271,7 +259,6 @@ void OQueryTableView::ReSync() OSL_ENSURE((getTableConnections()->size()==0) && (GetTabWinMap()->size()==0), "before calling OQueryTableView::ReSync() please call ClearAll !"); - // I need a collection of all window names that cannot be created so that I do not initialize connections for them. ::std::vector<String> arrInvalidTables; @@ -332,7 +319,6 @@ void OQueryTableView::ReSync() } } -//------------------------------------------------------------------------ void OQueryTableView::ClearAll() { DBG_CHKTHIS(OQueryTableView,NULL); @@ -342,13 +328,11 @@ void OQueryTableView::ClearAll() m_pView->getController().setModified(sal_True); } -// ----------------------------------------------------------------------------- OTableWindow* OQueryTableView::createWindow(const TTableWindowData::value_type& _pData) { return new OQueryTableWindow(this,_pData); } -//------------------------------------------------------------------------------ void OQueryTableView::NotifyTabConnection(const OQueryTableConnection& rNewConn, sal_Bool _bCreateUndoAction) { DBG_CHKTHIS(OQueryTableView,NULL); @@ -388,14 +372,14 @@ void OQueryTableView::NotifyTabConnection(const OQueryTableConnection& rNewConn, connectionModified(this,pNewConn,_bCreateUndoAction); } } -// ----------------------------------------------------------------------------- + OTableWindowData* OQueryTableView::CreateImpl(const OUString& _rComposedName ,const OUString& _sTableName ,const OUString& _rWinName) { return new OQueryTableWindowData( _rComposedName, _sTableName,_rWinName ); } -//------------------------------------------------------------------------------ + void OQueryTableView::AddTabWin(const OUString& _rTableName, const OUString& _rAliasName, sal_Bool bNewTable) { DBG_CHKTHIS(OQueryTableView,NULL); @@ -429,7 +413,7 @@ void OQueryTableView::AddTabWin(const OUString& _rTableName, const OUString& _rA OSL_FAIL("qualifiedNameComponents"); } } -// ----------------------------------------------------------------------------- + // find the table which has a foreign key with this referencedTable name Reference<XPropertySet> getKeyReferencedTo(const Reference<XIndexAccess>& _rxKeys,const OUString& _rReferencedTable) { @@ -459,7 +443,7 @@ Reference<XPropertySet> getKeyReferencedTo(const Reference<XIndexAccess>& _rxKey } return Reference<XPropertySet>(); } -//------------------------------------------------------------------------------ + void OQueryTableView::AddTabWin(const OUString& _rComposedName, const OUString& _rTableName, const OUString& strAlias, sal_Bool bNewTable) { DBG_CHKTHIS(OQueryTableView,NULL); @@ -521,7 +505,6 @@ void OQueryTableView::AddTabWin(const OUString& _rComposedName, const OUString& try { - ////////////////////////////////////////////////////////////////////// // find relations between the table an the tables already inserted Reference< XIndexAccess> xKeyIndex = pNewTabWin->GetData()->getKeys(); if ( !xKeyIndex.is() ) @@ -611,8 +594,7 @@ void OQueryTableView::AddTabWin(const OUString& _rComposedName, const OUString& m_lnkTabWinsChangeHandler.Call(&aHint); } } -// ----------------------------------------------------------------------------- -// ----------------------------------------------------------------------------- + void OQueryTableView::AddConnection(const OJoinExchangeData& jxdSource, const OJoinExchangeData& jxdDest) { DBG_CHKTHIS(OQueryTableView,NULL); @@ -672,7 +654,7 @@ void OQueryTableView::AddConnection(const OJoinExchangeData& jxdSource, const OJ connectionModified(this,pConn,sal_False); } } -// ----------------------------------------------------------------------------- + void OQueryTableView::ConnDoubleClicked(OTableConnection* pConnection) { DBG_CHKTHIS(OQueryTableView,NULL); @@ -682,7 +664,7 @@ void OQueryTableView::ConnDoubleClicked(OTableConnection* pConnection) SelectConn( pConnection ); } } -// ----------------------------------------------------------------------------- + void OQueryTableView::createNewConnection() { TTableConnectionData::value_type pData(new OQueryTableConnectionData()); @@ -711,7 +693,7 @@ void OQueryTableView::createNewConnection() SelectConn( pConn ); } } -//------------------------------------------------------------------------------ + bool OQueryTableView::RemoveConnection( OTableConnection* _pConnection,sal_Bool /*_bDelete*/ ) { DBG_CHKTHIS(OQueryTableView,NULL); @@ -727,14 +709,12 @@ bool OQueryTableView::RemoveConnection( OTableConnection* _pConnection,sal_Bool return bRet; } -//------------------------------------------------------------------------------ void OQueryTableView::KeyInput( const KeyEvent& rEvt ) { DBG_CHKTHIS(OQueryTableView,NULL); OJoinTableView::KeyInput( rEvt ); } -//------------------------------------------------------------------------------ OQueryTableWindow* OQueryTableView::FindTable(const String& rAliasName) { DBG_CHKTHIS(OQueryTableView,NULL); @@ -746,7 +726,6 @@ OQueryTableWindow* OQueryTableView::FindTable(const String& rAliasName) return NULL; } -//------------------------------------------------------------------------------ sal_Bool OQueryTableView::FindTableFromField(const String& rFieldName, OTableFieldDescRef& rInfo, sal_uInt16& rCnt) { DBG_CHKTHIS(OQueryTableView,NULL); @@ -762,7 +741,6 @@ sal_Bool OQueryTableView::FindTableFromField(const String& rFieldName, OTableFie return rCnt == 1; } -//------------------------------------------------------------------------------ bool OQueryTableView::ContainsTabWin(const OTableWindow& rTabWin) { OTableWindowMap* pTabWins = GetTabWinMap(); @@ -782,7 +760,6 @@ bool OQueryTableView::ContainsTabWin(const OTableWindow& rTabWin) return false; } -//------------------------------------------------------------------------------ void OQueryTableView::RemoveTabWin(OTableWindow* pTabWin) { DBG_CHKTHIS(OQueryTableView,NULL); @@ -824,7 +801,6 @@ void OQueryTableView::RemoveTabWin(OTableWindow* pTabWin) } } -//------------------------------------------------------------------------ void OQueryTableView::EnsureVisible(const OTableWindow* pWin) { DBG_CHKTHIS(OQueryTableView,NULL); @@ -833,7 +809,6 @@ void OQueryTableView::EnsureVisible(const OTableWindow* pWin) OJoinTableView::EnsureVisible(pWin); } -//------------------------------------------------------------------------ void OQueryTableView::GetConnection(OQueryTableConnection* pConn) { DBG_CHKTHIS(OQueryTableView,NULL); @@ -842,7 +817,6 @@ void OQueryTableView::GetConnection(OQueryTableConnection* pConn) addConnection( pConn ); } -//------------------------------------------------------------------------ void OQueryTableView::DropConnection(OQueryTableConnection* pConn) { DBG_CHKTHIS(OQueryTableView,NULL); @@ -851,7 +825,6 @@ void OQueryTableView::DropConnection(OQueryTableConnection* pConn) RemoveConnection( pConn ,sal_False); } -//------------------------------------------------------------------------ void OQueryTableView::HideTabWin( OQueryTableWindow* pTabWin, OQueryTabWinUndoAct* pUndoAction ) { DBG_CHKTHIS(OQueryTableView,NULL); @@ -925,7 +898,6 @@ void OQueryTableView::HideTabWin( OQueryTableWindow* pTabWin, OQueryTabWinUndoAc } } -//------------------------------------------------------------------------ sal_Bool OQueryTableView::ShowTabWin( OQueryTableWindow* pTabWin, OQueryTabWinUndoAct* pUndoAction,sal_Bool _bAppend ) { DBG_CHKTHIS(OQueryTableView,NULL); @@ -999,14 +971,14 @@ sal_Bool OQueryTableView::ShowTabWin( OQueryTableWindow* pTabWin, OQueryTabWinUn return bSuccess; } -//------------------------------------------------------------------------ + void OQueryTableView::InsertField(const OTableFieldDescRef& rInfo) { DBG_CHKTHIS(OQueryTableView,NULL); OSL_ENSURE(getDesignView() != NULL, "OQueryTableView::InsertField : has no Parent !"); static_cast<OQueryDesignView*>(getDesignView())->InsertField(rInfo); } -//------------------------------------------------------------------------------ + sal_Bool OQueryTableView::ExistsAVisitedConn(const OQueryTableWindow* pFrom) const { DBG_CHKTHIS(OQueryTableView,NULL); @@ -1026,18 +998,17 @@ sal_Bool OQueryTableView::ExistsAVisitedConn(const OQueryTableWindow* pFrom) con return sal_False; } -// ----------------------------------------------------------------------------- + void OQueryTableView::onNoColumns_throw() { String sError( ModuleRes( STR_STATEMENT_WITHOUT_RESULT_SET ) ); ::dbtools::throwSQLException( sError, ::dbtools::SQL_GENERAL_ERROR, NULL ); } -//------------------------------------------------------------------------------ + bool OQueryTableView::supressCrossNaturalJoin(const TTableConnectionData::value_type& _pData) const { OQueryTableConnectionData* pQueryData = static_cast<OQueryTableConnectionData*>(_pData.get()); return pQueryData && (pQueryData->GetJoinType() == CROSS_JOIN); } -// ----------------------------------------------------------------------------- /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/querydesign/QueryTextView.cxx b/dbaccess/source/ui/querydesign/QueryTextView.cxx index 4a0b2ae0df59..4bf48814ec49 100644 --- a/dbaccess/source/ui/querydesign/QueryTextView.cxx +++ b/dbaccess/source/ui/querydesign/QueryTextView.cxx @@ -36,10 +36,8 @@ using namespace dbaui; using namespace ::com::sun::star::uno; using namespace ::com::sun::star::lang; using namespace ::com::sun::star::frame; -// ----------------------------------------------------------------------------- // end of temp classes -// ------------------------------------------------------------------------- DBG_NAME(OQueryTextView) OQueryTextView::OQueryTextView(OQueryContainerWindow* _pParent) :Window(_pParent) @@ -52,42 +50,42 @@ OQueryTextView::OQueryTextView(OQueryContainerWindow* _pParent) m_pEdit->SetPosPixel( Point( 0, 0 ) ); m_pEdit->Show(); } -// ----------------------------------------------------------------------------- + OQueryTextView::~OQueryTextView() { DBG_DTOR(OQueryTextView,NULL); ::std::auto_ptr<Window> aTemp(m_pEdit); m_pEdit = NULL; } -// ----------------------------------------------------------------------------- + void OQueryTextView::GetFocus() { if ( m_pEdit ) m_pEdit->GrabFocus(); } -// ------------------------------------------------------------------------- + void OQueryTextView::Resize() { Window::Resize(); m_pEdit->SetSizePixel( GetOutputSizePixel() ); } -// ----------------------------------------------------------------------------- + // check if the statement is correct when not returning false sal_Bool OQueryTextView::checkStatement() { return sal_True; } -// ----------------------------------------------------------------------------- + OUString OQueryTextView::getStatement() { return m_pEdit->GetText(); } -// ----------------------------------------------------------------------------- + void OQueryTextView::setReadOnly(sal_Bool _bReadOnly) { m_pEdit->SetReadOnly(_bReadOnly); } -// ----------------------------------------------------------------------------- + void OQueryTextView::clear() { OSqlEditUndoAct* pUndoAct = new OSqlEditUndoAct( m_pEdit ); @@ -97,46 +95,45 @@ void OQueryTextView::clear() m_pEdit->SetText(String()); } -// ----------------------------------------------------------------------------- + void OQueryTextView::setStatement(const OUString& _rsStatement) { m_pEdit->SetText(_rsStatement); } -// ----------------------------------------------------------------------------- + void OQueryTextView::copy() { if(!m_pEdit->IsInAccelAct() ) m_pEdit->Copy(); } -// ----------------------------------------------------------------------------- + sal_Bool OQueryTextView::isCutAllowed() { return !m_pEdit->GetSelected().isEmpty(); } -// ----------------------------------------------------------------------------- + sal_Bool OQueryTextView::isPasteAllowed() { return sal_True; } -// ----------------------------------------------------------------------------- + sal_Bool OQueryTextView::isCopyAllowed() { return sal_True; } -// ----------------------------------------------------------------------------- + void OQueryTextView::cut() { if(!m_pEdit->IsInAccelAct() ) m_pEdit->Cut(); getContainerWindow()->getDesignView()->getController().setModified(sal_True); } -// ----------------------------------------------------------------------------- + void OQueryTextView::paste() { if(!m_pEdit->IsInAccelAct() ) m_pEdit->Paste(); getContainerWindow()->getDesignView()->getController().setModified(sal_True); } -// ----------------------------------------------------------------------------- /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/querydesign/QueryViewSwitch.cxx b/dbaccess/source/ui/querydesign/QueryViewSwitch.cxx index 2f940cf326f6..bf470cdbbad5 100644 --- a/dbaccess/source/ui/querydesign/QueryViewSwitch.cxx +++ b/dbaccess/source/ui/querydesign/QueryViewSwitch.cxx @@ -40,7 +40,7 @@ OQueryViewSwitch::OQueryViewSwitch(OQueryContainerWindow* _pParent, OQueryContro m_pTextView = new OQueryTextView(_pParent); m_pDesignView = new OQueryDesignView( _pParent, _rController, _rxContext ); } -// ----------------------------------------------------------------------------- + OQueryViewSwitch::~OQueryViewSwitch() { DBG_DTOR(OQueryViewSwitch,NULL); @@ -57,19 +57,19 @@ OQueryViewSwitch::~OQueryViewSwitch() m_pDesignView = NULL; } } -// ------------------------------------------------------------------------- + void OQueryViewSwitch::Construct() { m_pDesignView->Construct( ); } -// ----------------------------------------------------------------------------- + void OQueryViewSwitch::initialize() { // initially be in SQL mode m_pTextView->Show(); m_pDesignView->initialize(); } -// ------------------------------------------------------------------------- + void OQueryViewSwitch::resizeDocumentView(Rectangle& _rPlayground) { m_pTextView->SetPosSizePixel( _rPlayground.TopLeft(), _rPlayground.GetSize() ); @@ -79,21 +79,21 @@ void OQueryViewSwitch::resizeDocumentView(Rectangle& _rPlayground) _rPlayground.SetPos( _rPlayground.BottomRight() ); _rPlayground.SetSize( Size( 0, 0 ) ); } -// ----------------------------------------------------------------------------- + sal_Bool OQueryViewSwitch::checkStatement() { if(m_pTextView->IsVisible()) return m_pTextView->checkStatement(); return m_pDesignView->checkStatement(); } -// ----------------------------------------------------------------------------- + OUString OQueryViewSwitch::getStatement() { if(m_pTextView->IsVisible()) return m_pTextView->getStatement(); return m_pDesignView->getStatement(); } -// ----------------------------------------------------------------------------- + void OQueryViewSwitch::setReadOnly(sal_Bool _bReadOnly) { if(m_pTextView->IsVisible()) @@ -101,7 +101,7 @@ void OQueryViewSwitch::setReadOnly(sal_Bool _bReadOnly) else m_pDesignView->setReadOnly(_bReadOnly); } -// ----------------------------------------------------------------------------- + void OQueryViewSwitch::clear() { if(m_pTextView->IsVisible()) @@ -109,7 +109,7 @@ void OQueryViewSwitch::clear() else m_pDesignView->clear(); } -// ----------------------------------------------------------------------------- + void OQueryViewSwitch::GrabFocus() { if ( m_pTextView && m_pTextView->IsVisible() ) @@ -117,7 +117,7 @@ void OQueryViewSwitch::GrabFocus() else if ( m_pDesignView && m_pDesignView->IsVisible() ) m_pDesignView->GrabFocus(); } -// ----------------------------------------------------------------------------- + void OQueryViewSwitch::setStatement(const OUString& _rsStatement) { if(m_pTextView->IsVisible()) @@ -125,7 +125,7 @@ void OQueryViewSwitch::setStatement(const OUString& _rsStatement) else m_pDesignView->setStatement(_rsStatement); } -// ----------------------------------------------------------------------------- + void OQueryViewSwitch::copy() { if(m_pTextView->IsVisible()) @@ -133,28 +133,28 @@ void OQueryViewSwitch::copy() else m_pDesignView->copy(); } -// ----------------------------------------------------------------------------- + sal_Bool OQueryViewSwitch::isCutAllowed() { if(m_pTextView->IsVisible()) return m_pTextView->isCutAllowed(); return m_pDesignView->isCutAllowed(); } -// ----------------------------------------------------------------------------- + sal_Bool OQueryViewSwitch::isCopyAllowed() { if(m_pTextView->IsVisible()) return m_pTextView->isCopyAllowed(); return m_pDesignView->isCopyAllowed(); } -// ----------------------------------------------------------------------------- + sal_Bool OQueryViewSwitch::isPasteAllowed() { if(m_pTextView->IsVisible()) return m_pTextView->isPasteAllowed(); return m_pDesignView->isPasteAllowed(); } -// ----------------------------------------------------------------------------- + void OQueryViewSwitch::cut() { if(m_pTextView->IsVisible()) @@ -162,7 +162,7 @@ void OQueryViewSwitch::cut() else m_pDesignView->cut(); } -// ----------------------------------------------------------------------------- + void OQueryViewSwitch::paste() { if(m_pTextView->IsVisible()) @@ -170,14 +170,13 @@ void OQueryViewSwitch::paste() else m_pDesignView->paste(); } -// ----------------------------------------------------------------------------- + OQueryContainerWindow* OQueryViewSwitch::getContainer() const { Window* pDesignParent = getDesignView() ? getDesignView()->GetParent() : NULL; return static_cast< OQueryContainerWindow* >( pDesignParent ); } -// ----------------------------------------------------------------------------- void OQueryViewSwitch::impl_forceSQLView() { OAddTableDlg* pAddTabDialog( getAddTableDialog() ); @@ -196,7 +195,6 @@ void OQueryViewSwitch::impl_forceSQLView() m_pTextView->setStatement(static_cast<OQueryController&>(m_pDesignView->getController()).getStatement()); } -// ----------------------------------------------------------------------------- void OQueryViewSwitch::forceInitialView() { OQueryController& rQueryController( static_cast< OQueryController& >( m_pDesignView->getController() ) ); @@ -223,7 +221,6 @@ void OQueryViewSwitch::forceInitialView() impl_postViewSwitch( bGraphicalDesign, true ); } -// ----------------------------------------------------------------------------- bool OQueryViewSwitch::switchView( ::dbtools::SQLExceptionInfo* _pErrorInfo ) { sal_Bool bRet = sal_True; @@ -253,7 +250,6 @@ bool OQueryViewSwitch::switchView( ::dbtools::SQLExceptionInfo* _pErrorInfo ) return impl_postViewSwitch( bGraphicalDesign, bRet ); } -// ----------------------------------------------------------------------------- bool OQueryViewSwitch::impl_postViewSwitch( const bool i_bGraphicalDesign, const bool i_bSuccess ) { if ( i_bSuccess ) @@ -278,42 +274,41 @@ bool OQueryViewSwitch::impl_postViewSwitch( const bool i_bGraphicalDesign, const return i_bSuccess; } -// ----------------------------------------------------------------------------- OAddTableDlg* OQueryViewSwitch::getAddTableDialog() { if ( !m_pDesignView ) return NULL; return m_pDesignView->getController().getAddTableDialog(); } -// ----------------------------------------------------------------------------- + sal_Bool OQueryViewSwitch::isSlotEnabled(sal_Int32 _nSlotId) { return m_pDesignView->isSlotEnabled(_nSlotId); } -// ----------------------------------------------------------------------------- + void OQueryViewSwitch::setSlotEnabled(sal_Int32 _nSlotId,sal_Bool _bEnable) { m_pDesignView->setSlotEnabled(_nSlotId,_bEnable); } -// ----------------------------------------------------------------------------- + void OQueryViewSwitch::SaveUIConfig() { if(m_pDesignView->IsVisible()) m_pDesignView->SaveUIConfig(); } -// ----------------------------------------------------------------------------- + void OQueryViewSwitch::SetPosSizePixel( Point _rPt,Size _rSize) { m_pDesignView->SetPosSizePixel( _rPt,_rSize); m_pDesignView->Resize(); m_pTextView->SetPosSizePixel( _rPt,_rSize); } -// ----------------------------------------------------------------------------- + Reference< XComponentContext > OQueryViewSwitch::getORB() const { return m_pDesignView->getORB(); } -// ----------------------------------------------------------------------------- + bool OQueryViewSwitch::reset( ::dbtools::SQLExceptionInfo* _pErrorInfo ) { m_pDesignView->reset(); @@ -325,12 +320,11 @@ bool OQueryViewSwitch::reset( ::dbtools::SQLExceptionInfo* _pErrorInfo ) return true; } -// ----------------------------------------------------------------------------- + void OQueryViewSwitch::setNoneVisbleRow(sal_Int32 _nRows) { if(m_pDesignView) m_pDesignView->setNoneVisbleRow(_nRows); } -// ----------------------------------------------------------------------------- /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx b/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx index ec85ed39a8a0..652a4c3437d9 100644 --- a/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx +++ b/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx @@ -61,7 +61,6 @@ using namespace ::com::sun::star::accessibility; #define HANDLE_COLUMN_WITDH 70 #define SORT_COLUMN_NONE 0xFFFFFFFF -// ----------------------------------------------------------------------------- namespace { sal_Bool isFieldNameAsterix(const OUString& _sFieldName ) @@ -79,7 +78,6 @@ namespace } return bAsterix; } - // ----------------------------------------------------------------------------- sal_Bool lcl_SupportsCoreSQLGrammar(const Reference< XConnection>& _xConnection) { sal_Bool bSupportsCoreGrammar = sal_False; @@ -99,7 +97,6 @@ namespace } DBG_NAME(OSelectionBrowseBox) -//------------------------------------------------------------------------------ OSelectionBrowseBox::OSelectionBrowseBox( Window* pParent ) :EditBrowseBox( pParent,EBBF_NOROWPICTURE, WB_3DLOOK, BROWSER_COLUMNSELECTION | BROWSER_KEEPSELECTION | BROWSER_HIDESELECT | BROWSER_HIDECURSOR | BROWSER_HLINESFULL | BROWSER_VLINESFULL ) @@ -134,7 +131,6 @@ OSelectionBrowseBox::OSelectionBrowseBox( Window* pParent ) m_pOrderCell->SetHelpId(HID_QRYDGN_ROW_ORDER); m_pFunctionCell->SetHelpId(HID_QRYDGN_ROW_FUNCTION); - ////////////////////////////////////////////////////////////////////// // switch off triState of ::com::sun::star::form::CheckBox m_pVisibleCell->GetBox().EnableTriState( sal_False ); @@ -158,7 +154,6 @@ OSelectionBrowseBox::OSelectionBrowseBox( Window* pParent ) m_timerInvalidate.Start(); } -//------------------------------------------------------------------------------ OSelectionBrowseBox::~OSelectionBrowseBox() { DBG_DTOR(OSelectionBrowseBox,NULL); @@ -170,7 +165,7 @@ OSelectionBrowseBox::~OSelectionBrowseBox() delete m_pOrderCell; delete m_pFunctionCell; } -// ----------------------------------------------------------------------------- + void OSelectionBrowseBox::initialize() { Reference< XConnection> xConnection = static_cast<OQueryController&>(getDesignView()->getController()).getConnection(); @@ -232,20 +227,21 @@ void OSelectionBrowseBox::initialize() Init(); } -//============================================================================== + OQueryDesignView* OSelectionBrowseBox::getDesignView() { DBG_CHKTHIS(OSelectionBrowseBox,NULL); OSL_ENSURE(static_cast<const OQueryDesignView*>(GetParent()),"Parent isn't an OQueryDesignView!"); return static_cast<OQueryDesignView*>(GetParent()); } -// ----------------------------------------------------------------------------- + OQueryDesignView* OSelectionBrowseBox::getDesignView() const { DBG_CHKTHIS(OSelectionBrowseBox,NULL); OSL_ENSURE(static_cast<const OQueryDesignView*>(GetParent()),"Parent isn't an OQueryDesignView!"); return static_cast<OQueryDesignView*>(GetParent()); } + namespace { class OSelectionBrwBoxHeader : public ::svt::EditBrowserHeader @@ -284,12 +280,11 @@ namespace } } -// ----------------------------------------------------------------------------- BrowserHeader* OSelectionBrowseBox::imp_CreateHeaderBar(BrowseBox* /*pParent*/) { return new OSelectionBrwBoxHeader(this); } -// ----------------------------------------------------------------------------- + void OSelectionBrowseBox::ColumnMoved( sal_uInt16 nColId,sal_Bool _bCreateUndo ) { EditBrowseBox::ColumnMoved( nColId ); @@ -325,7 +320,7 @@ void OSelectionBrowseBox::ColumnMoved( sal_uInt16 nColId,sal_Bool _bCreateUndo ) else OSL_FAIL("Invalid column id!"); } -//------------------------------------------------------------------------------ + void OSelectionBrowseBox::Init() { DBG_CHKTHIS(OSelectionBrowseBox,NULL); @@ -380,7 +375,6 @@ void OSelectionBrowseBox::Init() } } -//------------------------------------------------------------------------------ void OSelectionBrowseBox::PreFill() { DBG_CHKTHIS(OSelectionBrowseBox,NULL); @@ -389,7 +383,6 @@ void OSelectionBrowseBox::PreFill() if (GetCurRow() != 0) GoToRow(0); - static_cast< OQueryController& >( getDesignView()->getController() ).clearFields(); DeactivateCell(); @@ -398,7 +391,7 @@ void OSelectionBrowseBox::PreFill() InsertHandleColumn( HANDLE_COLUMN_WITDH ); SetUpdateMode(sal_True); } -//------------------------------------------------------------------------------ + void OSelectionBrowseBox::ClearAll() { DBG_CHKTHIS(OSelectionBrowseBox,NULL); @@ -416,7 +409,7 @@ void OSelectionBrowseBox::ClearAll() m_nLastSortColumn = SORT_COLUMN_NONE; SetUpdateMode(sal_True); } -//------------------------------------------------------------------------------ + void OSelectionBrowseBox::SetReadOnly(sal_Bool bRO) { if (bRO) @@ -433,7 +426,6 @@ void OSelectionBrowseBox::SetReadOnly(sal_Bool bRO) } } -//------------------------------------------------------------------------------ CellController* OSelectionBrowseBox::GetController(long nRow, sal_uInt16 nColId) { DBG_CHKTHIS(OSelectionBrowseBox,NULL); @@ -466,7 +458,6 @@ CellController* OSelectionBrowseBox::GetController(long nRow, sal_uInt16 nColId) } } -//------------------------------------------------------------------------------ void OSelectionBrowseBox::InitController(CellControllerRef& /*rController*/, long nRow, sal_uInt16 nColId) { DBG_CHKTHIS(OSelectionBrowseBox,NULL); @@ -561,14 +552,14 @@ void OSelectionBrowseBox::InitController(CellControllerRef& /*rController*/, lon } Controller()->ClearModified(); } -// ----------------------------------------------------------------------------- + void OSelectionBrowseBox::notifyTableFieldChanged(const String& _sOldAlias,const String& _sAlias,sal_Bool& _bListAction,sal_uInt16 _nColumnId) { appendUndoAction(_sOldAlias,_sAlias,BROW_TABLE_ROW,_bListAction); if ( m_bVisibleRow[BROW_TABLE_ROW] ) RowModified(GetBrowseRow(BROW_TABLE_ROW), _nColumnId); } -// ----------------------------------------------------------------------------- + void OSelectionBrowseBox::notifyFunctionFieldChanged(const String& _sOldFunctionName,const String& _sFunctionName,sal_Bool& _bListAction,sal_uInt16 _nColumnId) { appendUndoAction(_sOldFunctionName,_sFunctionName,BROW_FUNCTION_ROW,_bListAction); @@ -576,7 +567,7 @@ void OSelectionBrowseBox::notifyFunctionFieldChanged(const String& _sOldFunction SetRowVisible(BROW_FUNCTION_ROW, sal_True); RowModified(GetBrowseRow(BROW_FUNCTION_ROW), _nColumnId); } -// ----------------------------------------------------------------------------- + void OSelectionBrowseBox::clearEntryFunctionField(const String& _sFieldName,OTableFieldDescRef& _pEntry,sal_Bool& _bListAction,sal_uInt16 _nColumnId) { if ( isFieldNameAsterix( _sFieldName ) && (!_pEntry->isNoneFunction() || _pEntry->IsGroupBy()) ) @@ -594,7 +585,7 @@ void OSelectionBrowseBox::clearEntryFunctionField(const String& _sFieldName,OTab } } } -// ----------------------------------------------------------------------------- + sal_Bool OSelectionBrowseBox::fillColumnRef(const OSQLParseNode* _pColumnRef, const Reference< XConnection >& _rxConnection, OTableFieldDescRef& _pEntry, sal_Bool& _bListAction ) { OSL_ENSURE(_pColumnRef,"No valid parsenode!"); @@ -602,7 +593,7 @@ sal_Bool OSelectionBrowseBox::fillColumnRef(const OSQLParseNode* _pColumnRef, co OSQLParseTreeIterator::getColumnRange(_pColumnRef,_rxConnection,sColumnName,sTableRange); return fillColumnRef(sColumnName,sTableRange,_rxConnection->getMetaData(),_pEntry,_bListAction); } -// ----------------------------------------------------------------------------- + sal_Bool OSelectionBrowseBox::fillColumnRef(const OUString& _sColumnName,const OUString& _sTableRange,const Reference<XDatabaseMetaData>& _xMetaData,OTableFieldDescRef& _pEntry,sal_Bool& _bListAction) { sal_Bool bError = sal_False; @@ -647,7 +638,7 @@ sal_Bool OSelectionBrowseBox::fillColumnRef(const OUString& _sColumnName,const O return bError; } -// ----------------------------------------------------------------------------- + sal_Bool OSelectionBrowseBox::saveField(String& _sFieldName ,OTableFieldDescRef& _pEntry, sal_Bool& _bListAction) { sal_Bool bError = sal_False; @@ -904,7 +895,7 @@ sal_Bool OSelectionBrowseBox::saveField(String& _sFieldName ,OTableFieldDescRef& return bError; } -//------------------------------------------------------------------------------ + sal_Bool OSelectionBrowseBox::SaveModified() { DBG_CHKTHIS(OSelectionBrowseBox,NULL); @@ -1229,7 +1220,6 @@ sal_Bool OSelectionBrowseBox::SaveModified() return pEntry != NULL && !bError; } -//------------------------------------------------------------------------------ sal_Bool OSelectionBrowseBox::SeekRow(long nRow) { DBG_CHKTHIS(OSelectionBrowseBox,NULL); @@ -1242,7 +1232,6 @@ sal_Bool OSelectionBrowseBox::SeekRow(long nRow) return bRet; } -//------------------------------------------------------------------------------ void OSelectionBrowseBox::PaintCell(OutputDevice& rDev, const Rectangle& rRect, sal_uInt16 nColumnId) const { DBG_CHKTHIS(OSelectionBrowseBox,NULL); @@ -1265,7 +1254,6 @@ void OSelectionBrowseBox::PaintCell(OutputDevice& rDev, const Rectangle& rRect, rDev.SetClipRegion( ); } -//------------------------------------------------------------------------------ void OSelectionBrowseBox::PaintStatusCell(OutputDevice& rDev, const Rectangle& rRect) const { DBG_CHKTHIS(OSelectionBrowseBox,NULL); @@ -1280,7 +1268,6 @@ void OSelectionBrowseBox::PaintStatusCell(OutputDevice& rDev, const Rectangle& r rDev.DrawText(aRect, aLabel.GetToken(nToken),TEXT_DRAW_VCENTER); } -//------------------------------------------------------------------------------ void OSelectionBrowseBox::RemoveColumn(sal_uInt16 _nColumnId) { DBG_CHKTHIS(OSelectionBrowseBox,NULL); @@ -1315,7 +1302,6 @@ void OSelectionBrowseBox::RemoveColumn(sal_uInt16 _nColumnId) invalidateUndoRedo(); } -//------------------------------------------------------------------------------ void OSelectionBrowseBox::RemoveField(sal_uInt16 nColumnId ) { DBG_CHKTHIS(OSelectionBrowseBox,NULL); @@ -1341,7 +1327,6 @@ void OSelectionBrowseBox::RemoveField(sal_uInt16 nColumnId ) invalidateUndoRedo(); } -//------------------------------------------------------------------------------ void OSelectionBrowseBox::adjustSelectionMode( sal_Bool _bClickedOntoHeader, sal_Bool _bClickedOntoHandleCol ) { // if a Header has been selected it should be shown otherwise not @@ -1370,7 +1355,6 @@ void OSelectionBrowseBox::adjustSelectionMode( sal_Bool _bClickedOntoHeader, sal } } -//------------------------------------------------------------------------------ void OSelectionBrowseBox::MouseButtonDown(const BrowserMouseEvent& rEvt) { DBG_CHKTHIS(OSelectionBrowseBox,NULL); @@ -1383,7 +1367,6 @@ void OSelectionBrowseBox::MouseButtonDown(const BrowserMouseEvent& rEvt) EditBrowseBox::MouseButtonDown(rEvt); } -//------------------------------------------------------------------------------ void OSelectionBrowseBox::MouseButtonUp(const BrowserMouseEvent& rEvt) { DBG_CHKTHIS(OSelectionBrowseBox,NULL); @@ -1391,7 +1374,6 @@ void OSelectionBrowseBox::MouseButtonUp(const BrowserMouseEvent& rEvt) static_cast<OQueryController&>(getDesignView()->getController()).InvalidateFeature( ID_BROWSER_QUERY_EXECUTE ); } -//------------------------------------------------------------------------------ void OSelectionBrowseBox::KeyInput( const KeyEvent& rEvt ) { DBG_CHKTHIS(OSelectionBrowseBox,NULL); @@ -1408,8 +1390,6 @@ void OSelectionBrowseBox::KeyInput( const KeyEvent& rEvt ) EditBrowseBox::KeyInput(rEvt); } - -//------------------------------------------------------------------------------ sal_Int8 OSelectionBrowseBox::AcceptDrop( const BrowserAcceptDropEvent& rEvt ) { DBG_CHKTHIS(OSelectionBrowseBox,NULL); @@ -1432,7 +1412,6 @@ sal_Int8 OSelectionBrowseBox::AcceptDrop( const BrowserAcceptDropEvent& rEvt ) return nDropAction; } -//------------------------------------------------------------------------------ sal_Int8 OSelectionBrowseBox::ExecuteDrop( const BrowserExecuteDropEvent& _rEvt ) { DBG_CHKTHIS(OSelectionBrowseBox,NULL); @@ -1452,7 +1431,6 @@ sal_Int8 OSelectionBrowseBox::ExecuteDrop( const BrowserExecuteDropEvent& _rEvt return DND_ACTION_LINK; } -//------------------------------------------------------------------------------ OTableFieldDescRef OSelectionBrowseBox::AppendNewCol( sal_uInt16 nCnt) { DBG_CHKTHIS(OSelectionBrowseBox,NULL); @@ -1471,7 +1449,6 @@ OTableFieldDescRef OSelectionBrowseBox::AppendNewCol( sal_uInt16 nCnt) return getFields()[nCount]; } -//------------------------------------------------------------------------------ void OSelectionBrowseBox::DeleteFields(const String& rAliasName) { DBG_CHKTHIS(OSelectionBrowseBox,NULL); @@ -1501,7 +1478,6 @@ void OSelectionBrowseBox::DeleteFields(const String& rAliasName) } } -//------------------------------------------------------------------------------ void OSelectionBrowseBox::SetColWidth(sal_uInt16 nColId, long nNewWidth) { DBG_CHKTHIS(OSelectionBrowseBox,NULL); @@ -1521,15 +1497,12 @@ void OSelectionBrowseBox::SetColWidth(sal_uInt16 nColId, long nNewWidth) ActivateCell(GetCurRow(), GetCurColumnId()); } -//------------------------------------------------------------------------------ Rectangle OSelectionBrowseBox::GetInvalidRect( sal_uInt16 nColId ) { DBG_CHKTHIS(OSelectionBrowseBox,NULL); - ////////////////////////////////////////////////////////////////////// // The rectangle is the full output area of the window Rectangle aInvalidRect( Point(0,0), GetOutputSizePixel() ); - ////////////////////////////////////////////////////////////////////// // now update the left side Rectangle aFieldRect(GetCellRect( 0, nColId )); // used instead of GetFieldRectPixel aInvalidRect.Left() = aFieldRect.Left(); @@ -1537,7 +1510,6 @@ Rectangle OSelectionBrowseBox::GetInvalidRect( sal_uInt16 nColId ) return aInvalidRect; } -//------------------------------------------------------------------------------ void OSelectionBrowseBox::InsertColumn(OTableFieldDescRef pEntry, sal_uInt16& _nColumnPosition) { DBG_CHKTHIS(OSelectionBrowseBox,NULL); @@ -1601,7 +1573,6 @@ void OSelectionBrowseBox::InsertColumn(OTableFieldDescRef pEntry, sal_uInt16& _n invalidateUndoRedo(); } -//------------------------------------------------------------------------------ OTableFieldDescRef OSelectionBrowseBox::InsertField(const OJoinExchangeData& jxdSource, sal_uInt16 _nColumnPosition, sal_Bool bVis, sal_Bool bActivate) { DBG_CHKTHIS(OSelectionBrowseBox,NULL); @@ -1627,7 +1598,6 @@ OTableFieldDescRef OSelectionBrowseBox::InsertField(const OJoinExchangeData& jxd return InsertField(aInfo, _nColumnPosition, bVis, bActivate); } -//------------------------------------------------------------------------------ OTableFieldDescRef OSelectionBrowseBox::InsertField(const OTableFieldDescRef& _rInfo, sal_uInt16 _nColumnPosition, sal_Bool bVis, sal_Bool bActivate) { DBG_CHKTHIS(OSelectionBrowseBox,NULL); @@ -1656,7 +1626,6 @@ OTableFieldDescRef OSelectionBrowseBox::InsertField(const OTableFieldDescRef& _r return pEntry; } -//------------------------------------------------------------------------------ sal_uInt16 OSelectionBrowseBox::FieldsCount() { DBG_CHKTHIS(OSelectionBrowseBox,NULL); @@ -1673,7 +1642,6 @@ sal_uInt16 OSelectionBrowseBox::FieldsCount() return nCount; } -//------------------------------------------------------------------------------ OTableFieldDescRef OSelectionBrowseBox::FindFirstFreeCol(sal_uInt16& _rColumnPosition ) { DBG_CHKTHIS(OSelectionBrowseBox,NULL); @@ -1694,7 +1662,6 @@ OTableFieldDescRef OSelectionBrowseBox::FindFirstFreeCol(sal_uInt16& _rColumnPos return NULL; } -//------------------------------------------------------------------------------ void OSelectionBrowseBox::CheckFreeColumns(sal_uInt16& _rColumnPosition) { DBG_CHKTHIS(OSelectionBrowseBox,NULL); @@ -1705,7 +1672,7 @@ void OSelectionBrowseBox::CheckFreeColumns(sal_uInt16& _rColumnPosition) OSL_VERIFY(FindFirstFreeCol(_rColumnPosition).is()); } } -//------------------------------------------------------------------------------ + void OSelectionBrowseBox::AddGroupBy( const OTableFieldDescRef& rInfo , sal_uInt32 /*_nCurrentPos*/) { Reference< XConnection> xConnection = static_cast<OQueryController&>(getDesignView()->getController()).getConnection(); @@ -1761,7 +1728,7 @@ void OSelectionBrowseBox::AddGroupBy( const OTableFieldDescRef& rInfo , sal_uInt pTmp->SetGroupBy(sal_False); } } -//------------------------------------------------------------------------------ + void OSelectionBrowseBox::DuplicateConditionLevel( const sal_uInt16 nLevel) { DBG_CHKTHIS(OSelectionBrowseBox,NULL); @@ -1787,7 +1754,7 @@ void OSelectionBrowseBox::DuplicateConditionLevel( const sal_uInt16 nLevel) } } } -//------------------------------------------------------------------------------ + void OSelectionBrowseBox::AddCondition( const OTableFieldDescRef& rInfo, const String& rValue, const sal_uInt16 nLevel,bool _bAddOrOnOneLine ) { Reference< XConnection> xConnection = static_cast<OQueryController&>(getDesignView()->getController()).getConnection(); @@ -1880,7 +1847,6 @@ void OSelectionBrowseBox::AddCondition( const OTableFieldDescRef& rInfo, const S } } -//------------------------------------------------------------------------------ void OSelectionBrowseBox::AddOrder( const OTableFieldDescRef& rInfo, const EOrderDir eDir, sal_uInt32 _nCurrentPos) { if (_nCurrentPos == 0) @@ -1936,14 +1902,12 @@ void OSelectionBrowseBox::AddOrder( const OTableFieldDescRef& rInfo, const EOrde } } -//------------------------------------------------------------------------------ void OSelectionBrowseBox::ArrangeControls(sal_uInt16& nX, sal_uInt16 nY) { DBG_CHKTHIS(OSelectionBrowseBox,NULL); EditBrowseBox::ArrangeControls(nX, nY); } -//------------------------------------------------------------------------------ sal_Bool OSelectionBrowseBox::Save() { DBG_CHKTHIS(OSelectionBrowseBox,NULL); @@ -1953,7 +1917,6 @@ sal_Bool OSelectionBrowseBox::Save() return bRet; } -//------------------------------------------------------------------------------ void OSelectionBrowseBox::CellModified() { DBG_CHKTHIS(OSelectionBrowseBox,NULL); @@ -1981,7 +1944,6 @@ void OSelectionBrowseBox::CellModified() static_cast<OQueryController&>(getDesignView()->getController()).setModified( sal_True ); } -//------------------------------------------------------------------------------ void OSelectionBrowseBox::Fill() { DBG_CHKTHIS(OSelectionBrowseBox,NULL); @@ -1992,7 +1954,6 @@ void OSelectionBrowseBox::Fill() AppendNewCol(DEFAULT_QUERY_COLS - nColCount); } -//------------------------------------------------------------------------------ Size OSelectionBrowseBox::CalcOptimalSize( const Size& _rAvailable ) { Size aReturn( _rAvailable.Width(), GetTitleHeight() ); @@ -2003,7 +1964,6 @@ Size OSelectionBrowseBox::CalcOptimalSize( const Size& _rAvailable ) return aReturn; } -//------------------------------------------------------------------------------ void OSelectionBrowseBox::Command(const CommandEvent& rEvt) { DBG_CHKTHIS(OSelectionBrowseBox,NULL); @@ -2102,14 +2062,12 @@ void OSelectionBrowseBox::Command(const CommandEvent& rEvt) } } -//------------------------------------------------------------------------------ sal_Bool OSelectionBrowseBox::IsRowVisible(sal_uInt16 _nWhich) const { OSL_ENSURE(_nWhich<(m_bVisibleRow.size()), "OSelectionBrowseBox::IsRowVisible : invalid parameter !"); return m_bVisibleRow[_nWhich]; } -//------------------------------------------------------------------------------ void OSelectionBrowseBox::SetRowVisible(sal_uInt16 _nWhich, sal_Bool _bVis) { DBG_CHKTHIS(OSelectionBrowseBox,NULL); @@ -2138,7 +2096,6 @@ void OSelectionBrowseBox::SetRowVisible(sal_uInt16 _nWhich, sal_Bool _bVis) ActivateCell(); } -//------------------------------------------------------------------------------ long OSelectionBrowseBox::GetBrowseRow(long nRowId) const { sal_uInt16 nCount(0); @@ -2149,7 +2106,7 @@ long OSelectionBrowseBox::GetBrowseRow(long nRowId) const } return nCount; } -//------------------------------------------------------------------------------ + long OSelectionBrowseBox::GetRealRow(long nRowId) const { DBG_CHKTHIS(OSelectionBrowseBox,NULL); @@ -2166,6 +2123,7 @@ long OSelectionBrowseBox::GetRealRow(long nRowId) const OSL_ENSURE(nErg <= long(m_bVisibleRow.size()),"nErg kann nicht groesser als BROW_ROW_CNT sein!"); return i; } + static const long nVisibleRowMask[] = { 0x0001, @@ -2181,7 +2139,6 @@ static const long nVisibleRowMask[] = 0x0400, 0x0800 }; -//------------------------------------------------------------------------------ sal_Int32 OSelectionBrowseBox::GetNoneVisibleRows() const { sal_Int32 nErg(0); @@ -2194,7 +2151,7 @@ sal_Int32 OSelectionBrowseBox::GetNoneVisibleRows() const } return nErg; } -//------------------------------------------------------------------------------ + void OSelectionBrowseBox::SetNoneVisbleRow(long nRows) { // only the first 11 row are interesting @@ -2202,7 +2159,7 @@ void OSelectionBrowseBox::SetNoneVisbleRow(long nRows) for(sal_Int32 i=0;i< nSize;i++) m_bVisibleRow[i] = !(nRows & nVisibleRowMask[i]); } -//------------------------------------------------------------------------------ + OUString OSelectionBrowseBox::GetCellText(long nRow, sal_uInt16 nColId) const { DBG_CHKTHIS(OSelectionBrowseBox,NULL); @@ -2253,7 +2210,7 @@ OUString OSelectionBrowseBox::GetCellText(long nRow, sal_uInt16 nColId) const } return aText; } -//------------------------------------------------------------------------------ + sal_Bool OSelectionBrowseBox::GetFunctionName(sal_uInt32 _nFunctionTokenId,String& rFkt) { DBG_CHKTHIS(OSelectionBrowseBox,NULL); @@ -2324,7 +2281,7 @@ sal_Bool OSelectionBrowseBox::GetFunctionName(sal_uInt32 _nFunctionTokenId,Strin return bErg; } -//------------------------------------------------------------------------------ + String OSelectionBrowseBox::GetCellContents(sal_Int32 nCellIndex, sal_uInt16 nColId) { DBG_CHKTHIS(OSelectionBrowseBox,NULL); @@ -2351,7 +2308,6 @@ String OSelectionBrowseBox::GetCellContents(sal_Int32 nCellIndex, sal_uInt16 nCo } } -//------------------------------------------------------------------------------ void OSelectionBrowseBox::SetCellContents(sal_Int32 nRow, sal_uInt16 nColId, const String& strNewText) { DBG_CHKTHIS(OSelectionBrowseBox,NULL); @@ -2363,7 +2319,6 @@ void OSelectionBrowseBox::SetCellContents(sal_Int32 nRow, sal_uInt16 nColId, con OTableFieldDescRef pEntry = getEntry(nPos - 1); OSL_ENSURE(pEntry != NULL, "OSelectionBrowseBox::SetCellContents : invalid column id, prepare for GPF ... "); - switch (nRow) { case BROW_VIS_ROW: @@ -2394,7 +2349,6 @@ void OSelectionBrowseBox::SetCellContents(sal_Int32 nRow, sal_uInt16 nColId, con if ( pEntry->IsGroupBy() && !sGroupFunctionName.EqualsIgnoreCaseAscii(strNewText) ) pEntry->SetGroupBy(sal_False); - if ( sGroupFunctionName.EqualsIgnoreCaseAscii(strNewText) ) pEntry->SetGroupBy(sal_True); else if ( strNewText.Len() ) @@ -2420,7 +2374,7 @@ void OSelectionBrowseBox::SetCellContents(sal_Int32 nRow, sal_uInt16 nColId, con static_cast<OQueryController&>(getDesignView()->getController()).setModified( sal_True ); } -//------------------------------------------------------------------------------ + sal_uInt32 OSelectionBrowseBox::GetTotalCellWidth(long nRow, sal_uInt16 nColId) const { DBG_CHKTHIS(OSelectionBrowseBox,NULL); @@ -2432,7 +2386,6 @@ sal_uInt32 OSelectionBrowseBox::GetTotalCellWidth(long nRow, sal_uInt16 nColId) return GetDataWindow().GetTextWidth(GetCellText(nRowId, nColId)); } -//------------------------------------------------------------------------------ void OSelectionBrowseBox::ColumnResized(sal_uInt16 nColId) { if (static_cast<OQueryController&>(getDesignView()->getController()).isReadOnly()) @@ -2463,7 +2416,6 @@ void OSelectionBrowseBox::ColumnResized(sal_uInt16 nColId) } } -//------------------------------------------------------------------------------ sal_uInt32 OSelectionBrowseBox::GetTotalCellWidth(long nRowId, sal_uInt16 nColId) { DBG_CHKTHIS(OSelectionBrowseBox,NULL); @@ -2478,7 +2430,6 @@ sal_uInt32 OSelectionBrowseBox::GetTotalCellWidth(long nRowId, sal_uInt16 nColId return GetDataWindow().LogicToPixel(Size(GetDataWindow().GetTextWidth(strText),0)).Width(); } -//------------------------------------------------------------------------------ sal_uInt16 OSelectionBrowseBox::GetDefaultColumnWidth(const String& /*rName*/) const { DBG_CHKTHIS(OSelectionBrowseBox,NULL); @@ -2486,7 +2437,7 @@ sal_uInt16 OSelectionBrowseBox::GetDefaultColumnWidth(const String& /*rName*/) c // like to have a new Default-value return static_cast<sal_uInt16>(DEFAULT_SIZE); } -//------------------------------------------------------------------------------ + sal_Bool OSelectionBrowseBox::isCutAllowed() { sal_Bool bCutAllowed = sal_False; @@ -2507,7 +2458,7 @@ sal_Bool OSelectionBrowseBox::isCutAllowed() } return bCutAllowed; } -// ----------------------------------------------------------------------------- + void OSelectionBrowseBox::cut() { long nRow = GetRealRow(GetCurRow()); @@ -2526,7 +2477,7 @@ void OSelectionBrowseBox::cut() invalidateUndoRedo(); } -// ----------------------------------------------------------------------------- + void OSelectionBrowseBox::paste() { long nRow = GetRealRow(GetCurRow()); @@ -2543,7 +2494,7 @@ void OSelectionBrowseBox::paste() RowModified(GetBrowseRow(nRow), GetCurColumnId()); invalidateUndoRedo(); } -// ----------------------------------------------------------------------------- + sal_Bool OSelectionBrowseBox::isPasteAllowed() { sal_Bool bPasteAllowed = sal_True; @@ -2559,12 +2510,12 @@ sal_Bool OSelectionBrowseBox::isPasteAllowed() } return bPasteAllowed; } -// ----------------------------------------------------------------------------- + sal_Bool OSelectionBrowseBox::isCopyAllowed() { return isCutAllowed(); } -// ----------------------------------------------------------------------------- + void OSelectionBrowseBox::copy() { long nRow = GetRealRow(GetCurRow()); @@ -2577,7 +2528,7 @@ void OSelectionBrowseBox::copy() m_pTextCell->Copy(); } } -// ----------------------------------------------------------------------------- + void OSelectionBrowseBox::appendUndoAction(const String& _rOldValue,const String& _rNewValue,sal_Int32 _nRow,sal_Bool& _bListAction) { if ( !m_bInUndoMode && !_rNewValue.Equals(_rOldValue) ) @@ -2590,7 +2541,7 @@ void OSelectionBrowseBox::appendUndoAction(const String& _rOldValue,const String appendUndoAction(_rOldValue,_rNewValue,_nRow); } } -// ----------------------------------------------------------------------------- + void OSelectionBrowseBox::appendUndoAction(const String& _rOldValue,const String& _rNewValue,sal_Int32 _nRow) { if ( !m_bInUndoMode && !_rNewValue.Equals(_rOldValue) ) @@ -2603,7 +2554,7 @@ void OSelectionBrowseBox::appendUndoAction(const String& _rOldValue,const String getDesignView()->getController().addUndoActionAndInvalidate(pUndoAct); } } -// ----------------------------------------------------------------------------- + IMPL_LINK_NOARG(OSelectionBrowseBox, OnInvalidateTimer) { static_cast<OQueryController&>(getDesignView()->getController()).InvalidateFeature(SID_CUT); @@ -2613,34 +2564,34 @@ IMPL_LINK_NOARG(OSelectionBrowseBox, OnInvalidateTimer) m_timerInvalidate.Start(); return 0L; } -// ----------------------------------------------------------------------------- + void OSelectionBrowseBox::stopTimer() { m_bStopTimer = sal_True; if (m_timerInvalidate.IsActive()) m_timerInvalidate.Stop(); } -// ----------------------------------------------------------------------------- + void OSelectionBrowseBox::startTimer() { m_bStopTimer = sal_False; if (!m_timerInvalidate.IsActive()) m_timerInvalidate.Start(); } -// ----------------------------------------------------------------------------- + OTableFields& OSelectionBrowseBox::getFields() const { OQueryController& rController = static_cast<OQueryController&>(getDesignView()->getController()); return rController.getTableFieldDesc(); } -// ----------------------------------------------------------------------------- + void OSelectionBrowseBox::enableControl(const OTableFieldDescRef& _rEntry,Window* _pControl) { sal_Bool bEnable = !_rEntry->isCondition(); _pControl->Enable(bEnable); _pControl->EnableInput(bEnable); } -// ----------------------------------------------------------------------------- + void OSelectionBrowseBox::setTextCellContext(const OTableFieldDescRef& _rEntry,const String& _sText,const OString& _sHelpId) { m_pTextCell->SetText(_sText); @@ -2655,7 +2606,7 @@ void OSelectionBrowseBox::setTextCellContext(const OTableFieldDescRef& _rEntry,c m_pTextCell->SetHelpText(String()); m_pTextCell->SetHelpId(_sHelpId); } -// ----------------------------------------------------------------------------- + void OSelectionBrowseBox::invalidateUndoRedo() { OQueryController& rController = static_cast<OQueryController&>(getDesignView()->getController()); @@ -2663,7 +2614,7 @@ void OSelectionBrowseBox::invalidateUndoRedo() rController.InvalidateFeature( ID_BROWSER_REDO ); rController.InvalidateFeature( ID_BROWSER_QUERY_EXECUTE ); } -// ----------------------------------------------------------------------------- + OTableFieldDescRef OSelectionBrowseBox::getEntry(OTableFields::size_type _nPos) { // we have to check if we need a new entry at this position @@ -2681,21 +2632,21 @@ OTableFieldDescRef OSelectionBrowseBox::getEntry(OTableFields::size_type _nPos) } return pEntry; } -// ----------------------------------------------------------------------------- + void OSelectionBrowseBox::GetFocus() { if(!IsEditing() && !m_bWasEditing) ActivateCell(); EditBrowseBox::GetFocus(); } -// ----------------------------------------------------------------------------- + void OSelectionBrowseBox::DeactivateCell(sal_Bool _bUpdate) { m_bWasEditing = sal_True; EditBrowseBox::DeactivateCell(_bUpdate); m_bWasEditing = sal_False; } -// ----------------------------------------------------------------------------- + OUString OSelectionBrowseBox::GetRowDescription( sal_Int32 _nRow ) const { String aLabel(ModuleRes(STR_QUERY_HANDLETEXT)); @@ -2706,7 +2657,7 @@ OUString OSelectionBrowseBox::GetRowDescription( sal_Int32 _nRow ) const xub_StrLen(BROW_CRIT2_ROW) : xub_StrLen(GetRealRow(_nRow)); return OUString(aLabel.GetToken(nToken)); } -// ----------------------------------------------------------------------------- + OUString OSelectionBrowseBox::GetAccessibleObjectName( ::svt::AccessibleBrowseBoxObjType _eObjType,sal_Int32 _nPosition) const { OUString sRetText; @@ -2720,7 +2671,7 @@ OUString OSelectionBrowseBox::GetAccessibleObjectName( ::svt::AccessibleBrowseBo } return sRetText; } -// ----------------------------------------------------------------------------- + sal_Bool OSelectionBrowseBox::fillEntryTable(OTableFieldDescRef& _pEntry,const OUString& _sTableName) { sal_Bool bRet = sal_False; @@ -2741,7 +2692,7 @@ sal_Bool OSelectionBrowseBox::fillEntryTable(OTableFieldDescRef& _pEntry,const O } return bRet; } -// ----------------------------------------------------------------------------- + void OSelectionBrowseBox::setFunctionCell(OTableFieldDescRef& _pEntry) { Reference< XConnection> xConnection = static_cast<OQueryController&>(getDesignView()->getController()).getConnection(); @@ -2793,7 +2744,7 @@ void OSelectionBrowseBox::setFunctionCell(OTableFieldDescRef& _pEntry) } } } -// ----------------------------------------------------------------------------- + Reference< XAccessible > OSelectionBrowseBox::CreateAccessibleCell( sal_Int32 _nRow, sal_uInt16 _nColumnPos ) { OTableFieldDescRef pEntry = NULL; @@ -2805,7 +2756,7 @@ Reference< XAccessible > OSelectionBrowseBox::CreateAccessibleCell( sal_Int32 _n return EditBrowseBox::CreateAccessibleCell( _nRow, _nColumnPos ); } -// ----------------------------------------------------------------------------- + bool OSelectionBrowseBox::HasFieldByAliasName(const OUString& rFieldName, OTableFieldDescRef& rInfo) const { OTableFields& aFields = getFields(); @@ -2822,6 +2773,5 @@ bool OSelectionBrowseBox::HasFieldByAliasName(const OUString& rFieldName, OTable } return aIter != aEnd; } -// ----------------------------------------------------------------------------- /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/querydesign/SelectionBrowseBox.hxx b/dbaccess/source/ui/querydesign/SelectionBrowseBox.hxx index 65867fc3363b..bce9fce6f13a 100644 --- a/dbaccess/source/ui/querydesign/SelectionBrowseBox.hxx +++ b/dbaccess/source/ui/querydesign/SelectionBrowseBox.hxx @@ -48,7 +48,6 @@ namespace dbaui #define BROW_CRIT6_ROW 11 #define BROW_ROW_CNT 12 - //================================================================== class OQueryDesignView; class OSelectionBrowseBox : public ::svt::EditBrowseBox { @@ -181,7 +180,6 @@ namespace dbaui @return The XAccessible interface of the specified cell. */ virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > CreateAccessibleCell( sal_Int32 nRow, sal_uInt16 nColumnId ); - protected: virtual sal_Bool SeekRow( long nRow ); @@ -283,7 +281,6 @@ namespace dbaui OTableFieldDescRef& _pEntry, sal_Bool& _bListAction); - /** append an undo action for the table field @param _sOldAlias The old table alias. @@ -330,6 +327,4 @@ namespace dbaui } #endif // DBAUI_QUERYDESIGN_OSELECTIONBROWSEBOX_HXX - - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/querydesign/TableConnection.cxx b/dbaccess/source/ui/querydesign/TableConnection.cxx index 8f2427a7f2b1..8a60793f2962 100644 --- a/dbaccess/source/ui/querydesign/TableConnection.cxx +++ b/dbaccess/source/ui/querydesign/TableConnection.cxx @@ -25,19 +25,15 @@ #include "ConnectionLineAccess.hxx" #include <algorithm> - using namespace dbaui; using namespace comphelper; using namespace ::com::sun::star::uno; using namespace ::com::sun::star::accessibility; -//======================================================================== // class OTableConnection -//======================================================================== namespace dbaui { DBG_NAME(OTableConnection) - //------------------------------------------------------------------------ OTableConnection::OTableConnection( OJoinTableView* _pContainer,const TTableConnectionData::value_type& _pTabConnData ) :Window(_pContainer) ,m_pData( _pTabConnData ) @@ -49,7 +45,6 @@ namespace dbaui Show(); } - //------------------------------------------------------------------------ OTableConnection::OTableConnection( const OTableConnection& _rConn ) : Window(_rConn.m_pParent) ,m_pData(_rConn.GetData()->NewInstance()) { @@ -57,10 +52,8 @@ namespace dbaui *this = _rConn; } - //------------------------------------------------------------------------ void OTableConnection::Init() { - ////////////////////////////////////////////////////////////////////// // initialise linelist with defaults OConnectionLineDataVec* pLineData = GetData()->GetConnLineDataList(); OConnectionLineDataVec::const_iterator aIter = pLineData->begin(); @@ -70,12 +63,10 @@ namespace dbaui m_vConnLine.push_back( new OConnectionLine(this, *aIter) ); } - //------------------------------------------------------------------------ OConnectionLine* OTableConnection::CreateConnLine( const OConnectionLine& rConnLine ) { return new OConnectionLine( rConnLine ); } - // ----------------------------------------------------------------------------- void OTableConnection::clearLineData() { ::std::vector<OConnectionLine*>::iterator aLineEnd = m_vConnLine.end(); @@ -83,17 +74,14 @@ namespace dbaui delete *aLineIter; m_vConnLine.clear(); } - //------------------------------------------------------------------------ void OTableConnection::UpdateLineList() { - ////////////////////////////////////////////////////////////////////// // delete linelist clearLineData(); Init(); } - //------------------------------------------------------------------------ OTableConnection& OTableConnection::operator=( const OTableConnection& rConn ) { if( &rConn == this ) @@ -113,7 +101,6 @@ namespace dbaui m_vConnLine.push_back( CreateConnLine( **aIter )); } - // as the data are not mine, I also do not delete the old m_pData->CopyFrom(*rConn.GetData()); // CopyFrom is virtual, therefore it is not a problem if m_pData is a derived type of OTableConnectionData @@ -124,15 +111,12 @@ namespace dbaui return *this; } - - //------------------------------------------------------------------------ bool OTableConnection::RecalcLines() { // call RecalcLines on each line ::std::for_each(m_vConnLine.begin(),m_vConnLine.end(),::std::mem_fun(&OConnectionLine::RecalcLine)); return true; } - //------------------------------------------------------------------------ OTableWindow* OTableConnection::GetSourceWin() const { TTableWindowData::value_type pRef = GetData()->getReferencingTable(); @@ -143,7 +127,6 @@ namespace dbaui } return pRet; } - //------------------------------------------------------------------------ OTableWindow* OTableConnection::GetDestWin() const { TTableWindowData::value_type pRef = GetData()->getReferencedTable(); @@ -155,24 +138,20 @@ namespace dbaui return pRet; } - //------------------------------------------------------------------------ void OTableConnection::Select() { m_bSelected = sal_True; m_pParent->Invalidate( GetBoundingRect(), INVALIDATE_NOCHILDREN); } - //------------------------------------------------------------------------ void OTableConnection::Deselect() { m_bSelected = sal_False; InvalidateConnection(); } - //------------------------------------------------------------------------ sal_Bool OTableConnection::CheckHit( const Point& rMousePos ) const { - ////////////////////////////////////////////////////////////////////// // check if the point hit our line ::std::vector<OConnectionLine*>::const_iterator aIter = ::std::find_if(m_vConnLine.begin(), m_vConnLine.end(), @@ -180,7 +159,6 @@ namespace dbaui return aIter != m_vConnLine.end(); } - //------------------------------------------------------------------------ bool OTableConnection::InvalidateConnection() { Rectangle rcBounding = GetBoundingRect(); @@ -195,10 +173,8 @@ namespace dbaui return true; } - //------------------------------------------------------------------------ Rectangle OTableConnection::GetBoundingRect() const { - ////////////////////////////////////////////////////////////////////// // determine all lines of the surrounding rectangle Rectangle aBoundingRect( Point(0,0), Point(0,0) ); Rectangle aTempRect; @@ -207,7 +183,6 @@ namespace dbaui { aTempRect = (*aIter)->GetBoundingRect(); - ////////////////////////////////////////////////////////////////////// // is the BoundingRect of this line valid? if( (aTempRect.GetWidth()!=1) && (aTempRect.GetHeight()!=1) ) { @@ -221,16 +196,11 @@ namespace dbaui return aBoundingRect; } - //------------------------------------------------------------------------ void OTableConnection::Draw( const Rectangle& /*rRect*/ ) { - ////////////////////////////////////////////////////////////////////// // Draw line ::std::for_each(m_vConnLine.begin(),m_vConnLine.end(),TConnectionLineDrawFunctor(m_pParent)); } - // ----------------------------------------------------------------------------- } - - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/querydesign/TableConnectionData.cxx b/dbaccess/source/ui/querydesign/TableConnectionData.cxx index 2f68e74d1dc3..2d7b3be86c26 100644 --- a/dbaccess/source/ui/querydesign/TableConnectionData.cxx +++ b/dbaccess/source/ui/querydesign/TableConnectionData.cxx @@ -24,17 +24,14 @@ using namespace dbaui; using namespace comphelper; -//================================================================== // class OTableConnectionData -//================================================================== DBG_NAME(OTableConnectionData) -//------------------------------------------------------------------------ OTableConnectionData::OTableConnectionData() { DBG_CTOR(OTableConnectionData,NULL); Init(); } -// ----------------------------------------------------------------------------- + OTableConnectionData::OTableConnectionData(const TTableWindowData::value_type& _pReferencingTable ,const TTableWindowData::value_type& _pReferencedTable ,const String& rConnName ) @@ -45,29 +42,27 @@ OTableConnectionData::OTableConnectionData(const TTableWindowData::value_type& _ DBG_CTOR(OTableConnectionData,NULL); Init(); } -//------------------------------------------------------------------------ + void OTableConnectionData::Init() { - ////////////////////////////////////////////////////////////////////// // initialise linedatalist with defaults OSL_ENSURE(m_vConnLineData.empty(), "OTableConnectionData::Init() : nur mit leere Linienliste aufzurufen !"); ResetConnLines(); // this creates the defaults } -//------------------------------------------------------------------------ + OTableConnectionData::OTableConnectionData( const OTableConnectionData& rConnData ) { DBG_CTOR(OTableConnectionData,NULL); *this = rConnData; } -//------------------------------------------------------------------------ + void OTableConnectionData::CopyFrom(const OTableConnectionData& rSource) { *this = rSource; // here I revert to the (non-virtual) operator =, which only copies my members } -//------------------------------------------------------------------------ OTableConnectionData::~OTableConnectionData() { DBG_DTOR(OTableConnectionData,NULL); @@ -75,7 +70,6 @@ OTableConnectionData::~OTableConnectionData() OConnectionLineDataVec().swap(m_vConnLineData); } -//------------------------------------------------------------------------ OTableConnectionData& OTableConnectionData::operator=( const OTableConnectionData& rConnData ) { if (&rConnData == this) @@ -99,7 +93,6 @@ OTableConnectionData& OTableConnectionData::operator=( const OTableConnectionDat return *this; } -//------------------------------------------------------------------------ sal_Bool OTableConnectionData::SetConnLine( sal_uInt16 nIndex, const String& rSourceFieldName, const String& rDestFieldName ) { if (sal_uInt16(m_vConnLineData.size()) < nIndex) @@ -119,7 +112,6 @@ sal_Bool OTableConnectionData::SetConnLine( sal_uInt16 nIndex, const String& rSo return sal_True; } -//------------------------------------------------------------------------ sal_Bool OTableConnectionData::AppendConnLine( const OUString& rSourceFieldName, const OUString& rDestFieldName ) { OConnectionLineDataVec::iterator aIter = m_vConnLineData.begin(); @@ -140,29 +132,26 @@ sal_Bool OTableConnectionData::AppendConnLine( const OUString& rSourceFieldName, return sal_True; } -//------------------------------------------------------------------------ void OTableConnectionData::ResetConnLines() { OConnectionLineDataVec().swap(m_vConnLineData); } -//------------------------------------------------------------------------ OConnectionLineDataRef OTableConnectionData::CreateLineDataObj() { return new OConnectionLineData(); } -//------------------------------------------------------------------------ OConnectionLineDataRef OTableConnectionData::CreateLineDataObj( const OConnectionLineData& rConnLineData ) { return new OConnectionLineData( rConnLineData ); } -// ----------------------------------------------------------------------------- + OTableConnectionData* OTableConnectionData::NewInstance() const { return new OTableConnectionData(); } -// ----------------------------------------------------------------------------- + OConnectionLineDataVec::size_type OTableConnectionData::normalizeLines() { // remove empty lines @@ -183,9 +172,5 @@ OConnectionLineDataVec::size_type OTableConnectionData::normalizeLines() } return nRet; } -// ----------------------------------------------------------------------------- - - - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/querydesign/TableFieldDescription.cxx b/dbaccess/source/ui/querydesign/TableFieldDescription.cxx index a36b9f777731..e70b23b2d93c 100644 --- a/dbaccess/source/ui/querydesign/TableFieldDescription.cxx +++ b/dbaccess/source/ui/querydesign/TableFieldDescription.cxx @@ -17,7 +17,6 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ - #include "TableFieldDescription.hxx" #include <tools/debug.hxx> #include <com/sun/star/sdbc/DataType.hpp> @@ -32,7 +31,6 @@ using namespace comphelper; using namespace dbaui; DBG_NAME(OTableFieldDesc) -//============================================================================== OTableFieldDesc::OTableFieldDesc() :m_pTabWindow(0) ,m_eDataType(1000) @@ -47,7 +45,7 @@ OTableFieldDesc::OTableFieldDesc() { DBG_CTOR(OTableFieldDesc,NULL); } -//------------------------------------------------------------------------------ + OTableFieldDesc::OTableFieldDesc(const OTableFieldDesc& rRS) : ::salhelper::SimpleReferenceObject() @@ -56,7 +54,6 @@ OTableFieldDesc::OTableFieldDesc(const OTableFieldDesc& rRS) *this = rRS; } -//------------------------------------------------------------------------------ OTableFieldDesc::OTableFieldDesc(const OUString& rT, const OUString& rF ) :m_pTabWindow(0) ,m_eFunctionType( FKT_NONE ) @@ -69,12 +66,11 @@ OTableFieldDesc::OTableFieldDesc(const OUString& rT, const OUString& rF ) SetField( rF ); SetTable( rT ); } -//------------------------------------------------------------------------------ OTableFieldDesc::~OTableFieldDesc() { DBG_DTOR(OTableFieldDesc,NULL); } -//------------------------------------------------------------------------------ + OTableFieldDesc& OTableFieldDesc::operator=( const OTableFieldDesc& rRS ) { if (&rRS == this) @@ -99,7 +95,7 @@ OTableFieldDesc& OTableFieldDesc::operator=( const OTableFieldDesc& rRS ) return *this; } -//------------------------------------------------------------------------------ + sal_Bool OTableFieldDesc::operator==( const OTableFieldDesc& rDesc ) { DBG_CHKTHIS(OTableFieldDesc,NULL); @@ -116,7 +112,6 @@ sal_Bool OTableFieldDesc::operator==( const OTableFieldDesc& rDesc ) } -//------------------------------------------------------------------------------ void OTableFieldDesc::SetCriteria( sal_uInt16 nIdx, const OUString& rCrit) { DBG_CHKTHIS(OTableFieldDesc,NULL); @@ -130,7 +125,6 @@ void OTableFieldDesc::SetCriteria( sal_uInt16 nIdx, const OUString& rCrit) } } -//------------------------------------------------------------------------------ OUString OTableFieldDesc::GetCriteria( sal_uInt16 nIdx ) const { DBG_CHKTHIS(OTableFieldDesc,NULL); @@ -141,7 +135,6 @@ OUString OTableFieldDesc::GetCriteria( sal_uInt16 nIdx ) const return aRetStr; } -// ----------------------------------------------------------------------------- namespace { struct SelectPropertyValueAsString : public ::std::unary_function< PropertyValue, OUString > @@ -155,7 +148,6 @@ namespace }; } -// ----------------------------------------------------------------------------- void OTableFieldDesc::Load( const ::com::sun::star::beans::PropertyValue& i_rSettings, const bool i_bIncludingCriteria ) { DBG_CHKTHIS(OTableFieldDesc,NULL); @@ -187,7 +179,7 @@ void OTableFieldDesc::Load( const ::com::sun::star::beans::PropertyValue& i_rSet ); } } -//------------------------------------------------------------------------------ + void OTableFieldDesc::Save( ::comphelper::NamedValueCollection& o_rSettings, const bool i_bIncludingCriteria ) { DBG_CHKTHIS(OTableFieldDesc,NULL); @@ -224,8 +216,5 @@ void OTableFieldDesc::Save( ::comphelper::NamedValueCollection& o_rSettings, con } } } -// ----------------------------------------------------------------------------- - - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/querydesign/TableFieldInfo.cxx b/dbaccess/source/ui/querydesign/TableFieldInfo.cxx index 69125694e348..9c608cfd4c7a 100644 --- a/dbaccess/source/ui/querydesign/TableFieldInfo.cxx +++ b/dbaccess/source/ui/querydesign/TableFieldInfo.cxx @@ -17,14 +17,11 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ - #include "TableFieldInfo.hxx" #include <tools/debug.hxx> using namespace dbaui; -//================================================================== // class OTableFieldInfo -//================================================================== DBG_NAME(OTableFieldInfo) OTableFieldInfo::OTableFieldInfo() : @@ -34,13 +31,9 @@ OTableFieldInfo::OTableFieldInfo() : m_eFieldType = TAB_NORMAL_FIELD; } -//------------------------------------------------------------------------------ OTableFieldInfo::~OTableFieldInfo() { DBG_DTOR(OTableFieldInfo,NULL); } - - - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/querydesign/TableWindow.cxx b/dbaccess/source/ui/querydesign/TableWindow.cxx index 88e1cfcb69b9..c32d8319e385 100644 --- a/dbaccess/source/ui/querydesign/TableWindow.cxx +++ b/dbaccess/source/ui/querydesign/TableWindow.cxx @@ -60,11 +60,8 @@ using namespace ::com::sun::star::accessibility; #define TABWIN_WIDTH_MIN 90 #define TABWIN_HEIGHT_MIN 80 -//======================================================================== // class OTableWindow -//======================================================================== DBG_NAME(OTableWindow) -//------------------------------------------------------------------------------ OTableWindow::OTableWindow( Window* pParent, const TTableWindowData::value_type& pTabWinData ) : ::comphelper::OContainerListener(m_aMutex) ,Window( pParent, WB_3DLOOK|WB_MOVEABLE ) @@ -97,7 +94,6 @@ OTableWindow::OTableWindow( Window* pParent, const TTableWindowData::value_type& EnableClipSiblings(); } -//------------------------------------------------------------------------------ OTableWindow::~OTableWindow() { DBG_DTOR(OTableWindow,NULL); @@ -113,25 +109,25 @@ OTableWindow::~OTableWindow() m_pAccessible = NULL; } -// ----------------------------------------------------------------------------- + const OJoinTableView* OTableWindow::getTableView() const { OSL_ENSURE(static_cast<OJoinTableView*>(GetParent()),"No OJoinTableView!"); return static_cast<OJoinTableView*>(GetParent()); } -// ----------------------------------------------------------------------------- + OJoinTableView* OTableWindow::getTableView() { OSL_ENSURE(static_cast<OJoinTableView*>(GetParent()),"No OJoinTableView!"); return static_cast<OJoinTableView*>(GetParent()); } -// ----------------------------------------------------------------------------- + OJoinDesignView* OTableWindow::getDesignView() { OSL_ENSURE(static_cast<OJoinDesignView*>(GetParent()->GetParent()->GetParent()),"No OJoinDesignView!"); return static_cast<OJoinDesignView*>(GetParent()->GetParent()->GetParent()); } -//------------------------------------------------------------------------------ + void OTableWindow::SetPosPixel( const Point& rNewPos ) { Point aNewPosData = rNewPos + getTableView()->GetScrollOffset(); @@ -139,7 +135,6 @@ void OTableWindow::SetPosPixel( const Point& rNewPos ) Window::SetPosPixel( rNewPos ); } -//------------------------------------------------------------------------------ void OTableWindow::SetSizePixel( const Size& rNewSize ) { Size aOutSize(rNewSize); @@ -151,19 +146,18 @@ void OTableWindow::SetSizePixel( const Size& rNewSize ) GetData()->SetSize( aOutSize ); Window::SetSizePixel( aOutSize ); } -//------------------------------------------------------------------------------ + void OTableWindow::SetPosSizePixel( const Point& rNewPos, const Size& rNewSize ) { SetPosPixel( rNewPos ); SetSizePixel( rNewSize ); } -//------------------------------------------------------------------------------ + OTableWindowListBox* OTableWindow::CreateListBox() { return new OTableWindowListBox(this); } -//------------------------------------------------------------------------------ sal_Bool OTableWindow::FillListBox() { m_pListBox->Clear(); @@ -225,18 +219,18 @@ sal_Bool OTableWindow::FillListBox() return sal_True; } -// ----------------------------------------------------------------------------- + void* OTableWindow::createUserData(const Reference< XPropertySet>& /*_xColumn*/,bool /*_bPrimaryKey*/) { return NULL; } -// ----------------------------------------------------------------------------- + void OTableWindow::deleteUserData(void*& _pUserData) { OSL_ENSURE(!_pUserData,"INVALID call. Need to delete the userclass!"); _pUserData = NULL; } -//------------------------------------------------------------------------------ + void OTableWindow::clearListBox() { if ( m_pListBox ) @@ -254,7 +248,6 @@ void OTableWindow::clearListBox() } } -//------------------------------------------------------------------------------ void OTableWindow::impl_updateImage() { ImageProvider aImageProvider( getDesignView()->getController().getConnection() ); @@ -272,7 +265,6 @@ void OTableWindow::impl_updateImage() m_aTypeImage.Show(); } -//------------------------------------------------------------------------------ sal_Bool OTableWindow::Init() { // create list box if necessary @@ -299,7 +291,7 @@ sal_Bool OTableWindow::Init() return bSuccess; } -//------------------------------------------------------------------------------ + void OTableWindow::DataChanged(const DataChangedEvent& rDCEvt) { if (rDCEvt.GetType() == DATACHANGED_SETTINGS) @@ -311,7 +303,7 @@ void OTableWindow::DataChanged(const DataChangedEvent& rDCEvt) SetTextColor(aSystemStyle.GetButtonTextColor()); } } -//------------------------------------------------------------------------------ + void OTableWindow::Paint( const Rectangle& rRect ) { Rectangle aRect( Point(0,0), GetOutputSizePixel() ); @@ -319,7 +311,6 @@ void OTableWindow::Paint( const Rectangle& rRect ) Draw3DBorder( aRect ); } -//------------------------------------------------------------------------------ void OTableWindow::Draw3DBorder(const Rectangle& rRect) { // Use the System Style-Settings for my colours @@ -341,7 +332,7 @@ void OTableWindow::Draw3DBorder(const Rectangle& rRect) DrawLine( rRect.BottomLeft()+Point(1,-2), rRect.TopLeft() + aEHvector ); DrawLine( rRect.TopLeft() + aEHvector, rRect.TopRight()+Point(-2,1) ); } -// ----------------------------------------------------------------------------- + Rectangle OTableWindow::getSizingRect(const Point& _rPos,const Size& _rOutputSize) const { Rectangle aSizingRect = Rectangle( GetPosPixel(), GetSizePixel() ); @@ -363,7 +354,6 @@ Rectangle OTableWindow::getSizingRect(const Point& _rPos,const Size& _rOutputSiz aSizingRect.Bottom() = _rPos.Y(); } - if( nSizingFlags & SIZING_RIGHT ) { if( _rPos.X() > _rOutputSize.Width() ) @@ -381,11 +371,10 @@ Rectangle OTableWindow::getSizingRect(const Point& _rPos,const Size& _rOutputSiz } return aSizingRect; } -// ----------------------------------------------------------------------------- + void OTableWindow::setSizingFlag(const Point& _rPos) { Size aOutSize = GetOutputSizePixel(); - ////////////////////////////////////////////////////////////////////// // Set the flags when the mouse cursor is in the sizing area m_nSizingFlags = SIZING_NONE; @@ -401,7 +390,7 @@ void OTableWindow::setSizingFlag(const Point& _rPos) if( _rPos.Y() > aOutSize.Height()-TABWIN_SIZING_AREA ) m_nSizingFlags |= SIZING_BOTTOM; } -//------------------------------------------------------------------------------ + void OTableWindow::MouseMove( const MouseEvent& rEvt ) { Window::MouseMove(rEvt); @@ -414,8 +403,6 @@ void OTableWindow::MouseMove( const MouseEvent& rEvt ) setSizingFlag(aPos); Pointer aPointer; - - ////////////////////////////////////////////////////////////////////// // Set the mouse cursor when it is in the sizing area switch( m_nSizingFlags ) { @@ -443,10 +430,8 @@ void OTableWindow::MouseMove( const MouseEvent& rEvt ) SetPointer( aPointer ); } -//------------------------------------------------------------------------------ void OTableWindow::MouseButtonDown( const MouseEvent& rEvt ) { - ////////////////////////////////////////////////////////////////////// // When resizing, the parent must be informed that // the window size of its child has changed if( m_nSizingFlags ) @@ -455,19 +440,14 @@ void OTableWindow::MouseButtonDown( const MouseEvent& rEvt ) Window::MouseButtonDown( rEvt ); } - - -//------------------------------------------------------------------------------ void OTableWindow::Resize() { - ////////////////////////////////////////////////////////////////////// // The window must not disappear so we enforce a minimum size Size aOutSize = GetOutputSizePixel(); aOutSize = Size(CalcZoom(aOutSize.Width()),CalcZoom(aOutSize.Height())); long nTitleHeight = CalcZoom( GetTextHeight() )+ CalcZoom( 4 ); - ////////////////////////////////////////////////////////////////////// // Set the title and ListBox long n5Pos = CalcZoom(5); long nPositionX = n5Pos; @@ -494,7 +474,6 @@ void OTableWindow::Resize() Window::Invalidate(); } -//------------------------------------------------------------------------------ void OTableWindow::SetBoldTitle( sal_Bool bBold ) { Font aFont = m_aTitle.GetFont(); @@ -503,7 +482,6 @@ void OTableWindow::SetBoldTitle( sal_Bool bBold ) m_aTitle.Invalidate(); } -//------------------------------------------------------------------------------ void OTableWindow::GetFocus() { Window::GetFocus(); @@ -511,7 +489,7 @@ void OTableWindow::GetFocus() if(m_pListBox) m_pListBox->GrabFocus(); } -// ----------------------------------------------------------------------------- + void OTableWindow::setActive(sal_Bool _bActive) { SetBoldTitle( _bActive ); @@ -520,16 +498,14 @@ void OTableWindow::setActive(sal_Bool _bActive) m_pListBox->SelectAll(sal_False); } -//------------------------------------------------------------------------------ void OTableWindow::Remove() { - ////////////////////////////////////////////////////////////////// // Delete the window OJoinTableView* pTabWinCont = getTableView(); pTabWinCont->RemoveTabWin( this ); pTabWinCont->Invalidate(); } -//------------------------------------------------------------------------------ + sal_Bool OTableWindow::HandleKeyInput( const KeyEvent& rEvt ) { const KeyCode& rCode = rEvt.GetKeyCode(); @@ -547,12 +523,11 @@ sal_Bool OTableWindow::HandleKeyInput( const KeyEvent& rEvt ) return bHandle; } -//------------------------------------------------------------------------------ sal_Bool OTableWindow::ExistsAConn() const { return getTableView()->ExistsAConn(this); } -//------------------------------------------------------------------------------ + void OTableWindow::EnumValidFields(::std::vector< OUString>& arrstrFields) { arrstrFields.clear(); @@ -568,7 +543,7 @@ void OTableWindow::EnumValidFields(::std::vector< OUString>& arrstrFields) } } } -// ----------------------------------------------------------------------------- + void OTableWindow::StateChanged( StateChangedType nType ) { Window::StateChanged( nType ); @@ -588,14 +563,14 @@ void OTableWindow::StateChanged( StateChangedType nType ) Invalidate(); } } -// ----------------------------------------------------------------------------- + Reference< XAccessible > OTableWindow::CreateAccessible() { OTableWindowAccess* pAccessible = new OTableWindowAccess(this); m_pAccessible = pAccessible; return pAccessible; } -// ----------------------------------------------------------------------------- + void OTableWindow::Command(const CommandEvent& rEvt) { switch (rEvt.GetCommand()) @@ -631,7 +606,7 @@ void OTableWindow::Command(const CommandEvent& rEvt) Window::Command(rEvt); } } -// ----------------------------------------------------------------------------- + long OTableWindow::PreNotify(NotifyEvent& rNEvt) { sal_Bool bHandled = sal_False; @@ -764,26 +739,25 @@ long OTableWindow::PreNotify(NotifyEvent& rNEvt) return Window::PreNotify(rNEvt); return 1L; } -// ----------------------------------------------------------------------------- + String OTableWindow::getTitle() const { return m_aTitle.GetText(); } -// ----------------------------------------------------------------------------- + void OTableWindow::_elementInserted( const container::ContainerEvent& /*_rEvent*/ ) throw(::com::sun::star::uno::RuntimeException) { FillListBox(); } -// ----------------------------------------------------------------------------- + void OTableWindow::_elementRemoved( const container::ContainerEvent& /*_rEvent*/ ) throw(::com::sun::star::uno::RuntimeException) { FillListBox(); } -// ----------------------------------------------------------------------------- + void OTableWindow::_elementReplaced( const container::ContainerEvent& /*_rEvent*/ ) throw(::com::sun::star::uno::RuntimeException) { FillListBox(); } -// ----------------------------------------------------------------------------- /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/querydesign/TableWindowAccess.cxx b/dbaccess/source/ui/querydesign/TableWindowAccess.cxx index 92fa870682c7..c2c497973f8a 100644 --- a/dbaccess/source/ui/querydesign/TableWindowAccess.cxx +++ b/dbaccess/source/ui/querydesign/TableWindowAccess.cxx @@ -31,7 +31,6 @@ #include <comphelper/sequence.hxx> #include "dbu_qry.hrc" - namespace dbaui { using namespace ::com::sun::star::accessibility; @@ -45,13 +44,11 @@ namespace dbaui ,m_pTable(_pTable) { } - // ----------------------------------------------------------------------------- void SAL_CALL OTableWindowAccess::disposing() { m_pTable = NULL; VCLXAccessibleComponent::disposing(); } - // ----------------------------------------------------------------------------- void OTableWindowAccess::ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent ) { if ( rVclWindowEvent.GetId() == VCLEVENT_OBJECT_DYING ) @@ -62,28 +59,23 @@ namespace dbaui VCLXAccessibleComponent::ProcessWindowEvent( rVclWindowEvent ); } - // ----------------------------------------------------------------------------- Any SAL_CALL OTableWindowAccess::queryInterface( const Type& aType ) throw (RuntimeException) { Any aRet(VCLXAccessibleComponent::queryInterface( aType )); return aRet.hasValue() ? aRet : OTableWindowAccess_BASE::queryInterface( aType ); } - // ----------------------------------------------------------------------------- Sequence< Type > SAL_CALL OTableWindowAccess::getTypes( ) throw (RuntimeException) { return ::comphelper::concatSequences(VCLXAccessibleComponent::getTypes(),OTableWindowAccess_BASE::getTypes()); } - // ----------------------------------------------------------------------------- OUString SAL_CALL OTableWindowAccess::getImplementationName() throw(RuntimeException) { return getImplementationName_Static(); } - // ----------------------------------------------------------------------------- Sequence< OUString > SAL_CALL OTableWindowAccess::getSupportedServiceNames() throw(RuntimeException) { return getSupportedServiceNames_Static(); } - // ----------------------------------------------------------------------------- // XServiceInfo - static methods Sequence< OUString > OTableWindowAccess::getSupportedServiceNames_Static(void) throw( RuntimeException ) { @@ -92,12 +84,10 @@ namespace dbaui aSupported[1] = OUString("com.sun.star.accessibility.AccessibleContext"); return aSupported; } - // ----------------------------------------------------------------------------- OUString OTableWindowAccess::getImplementationName_Static(void) throw( RuntimeException ) { return OUString("org.openoffice.comp.dbu.TableWindowAccessibility"); } - // ----------------------------------------------------------------------------- // XAccessibleContext sal_Int32 SAL_CALL OTableWindowAccess::getAccessibleChildCount( ) throw (RuntimeException) { @@ -112,7 +102,6 @@ namespace dbaui } return nCount; } - // ----------------------------------------------------------------------------- Reference< XAccessible > SAL_CALL OTableWindowAccess::getAccessibleChild( sal_Int32 i ) throw (IndexOutOfBoundsException,RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); @@ -137,7 +126,6 @@ namespace dbaui } return aRet; } - // ----------------------------------------------------------------------------- sal_Int32 SAL_CALL OTableWindowAccess::getAccessibleIndexInParent( ) throw (RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); @@ -154,18 +142,15 @@ namespace dbaui } return nIndex; } - // ----------------------------------------------------------------------------- sal_Int16 SAL_CALL OTableWindowAccess::getAccessibleRole( ) throw (RuntimeException) { return AccessibleRole::PANEL; // ? or may be an AccessibleRole::WINDOW } - // ----------------------------------------------------------------------------- Reference< XAccessibleRelationSet > SAL_CALL OTableWindowAccess::getAccessibleRelationSet( ) throw (RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); return this; } - // ----------------------------------------------------------------------------- // XAccessibleComponent Reference< XAccessible > SAL_CALL OTableWindowAccess::getAccessibleAtPoint( const awt::Point& _aPoint ) throw (RuntimeException) { @@ -182,7 +167,6 @@ namespace dbaui } return aRet; } - // ----------------------------------------------------------------------------- Reference< XAccessible > OTableWindowAccess::getParentChild(sal_Int32 _nIndex) { Reference< XAccessible > xReturn; @@ -197,14 +181,12 @@ namespace dbaui } return xReturn; } - // ----------------------------------------------------------------------------- sal_Int32 SAL_CALL OTableWindowAccess::getRelationCount( ) throw (RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); return m_pTable ? m_pTable->getTableView()->getConnectionCount(m_pTable) : sal_Int32(0); } - // ----------------------------------------------------------------------------- AccessibleRelation SAL_CALL OTableWindowAccess::getRelation( sal_Int32 nIndex ) throw (IndexOutOfBoundsException, RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); @@ -222,14 +204,12 @@ namespace dbaui } return aRet; } - // ----------------------------------------------------------------------------- sal_Bool SAL_CALL OTableWindowAccess::containsRelation( sal_Int16 aRelationType ) throw (RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); return AccessibleRelationType::CONTROLLER_FOR == aRelationType && m_pTable && m_pTable->getTableView()->ExistsAConn(m_pTable); } - // ----------------------------------------------------------------------------- AccessibleRelation SAL_CALL OTableWindowAccess::getRelationByType( sal_Int16 aRelationType ) throw (RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); @@ -255,17 +235,14 @@ namespace dbaui } return AccessibleRelation(); } - // ----------------------------------------------------------------------------- sal_Bool OTableWindowAccess::isEditable() const { return m_pTable && !m_pTable->getTableView()->getDesignView()->getController().isReadOnly(); } - // ----------------------------------------------------------------------------- OUString SAL_CALL OTableWindowAccess::getTitledBorderText( ) throw (RuntimeException) { return getAccessibleName( ); } - // ----------------------------------------------------------------------------- OUString SAL_CALL OTableWindowAccess::getAccessibleName( ) throw (RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); @@ -274,14 +251,11 @@ namespace dbaui sAccessibleName = m_pTable->getTitle(); return sAccessibleName; } - // ----------------------------------------------------------------------------- Reference< XAccessibleContext > SAL_CALL OTableWindowAccess::getAccessibleContext( ) throw (::com::sun::star::uno::RuntimeException) { return this; } - // ----------------------------------------------------------------------------- } -// ----------------------------------------------------------------------------- /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/querydesign/TableWindowData.cxx b/dbaccess/source/ui/querydesign/TableWindowData.cxx index 90155ca00110..df5168f5a045 100644 --- a/dbaccess/source/ui/querydesign/TableWindowData.cxx +++ b/dbaccess/source/ui/querydesign/TableWindowData.cxx @@ -35,11 +35,8 @@ using namespace ::com::sun::star::sdbcx; using namespace ::com::sun::star::beans; using namespace ::com::sun::star::container; -//================================================================== // class OTableWindowData -//================================================================== DBG_NAME(OTableWindowData) -//------------------------------------------------------------------------------ OTableWindowData::OTableWindowData( const Reference< XPropertySet>& _xTable ,const OUString& _rComposedName ,const OUString& rTableName @@ -61,7 +58,6 @@ OTableWindowData::OTableWindowData( const Reference< XPropertySet>& _xTable listen(); } -//------------------------------------------------------------------------------ OTableWindowData::~OTableWindowData() { DBG_DTOR(OTableWindowData,NULL); @@ -70,18 +66,16 @@ OTableWindowData::~OTableWindowData() stopComponentListening( xComponent ); } -//------------------------------------------------------------------------------ sal_Bool OTableWindowData::HasPosition() const { return ( (m_aPosition.X() != -1) && (m_aPosition.Y() != -1) ); } -//------------------------------------------------------------------------------ sal_Bool OTableWindowData::HasSize() const { return ( (m_aSize.Width() != -1) && (m_aSize.Height() !=-1) ); } -// ----------------------------------------------------------------------------- + void OTableWindowData::_disposing( const ::com::sun::star::lang::EventObject& /*_rSource*/ ) { ::osl::MutexGuard aGuard( m_aMutex ); @@ -90,7 +84,7 @@ void OTableWindowData::_disposing( const ::com::sun::star::lang::EventObject& /* m_xKeys.clear(); m_xTable.clear(); } -// ----------------------------------------------------------------------------- + bool OTableWindowData::init(const Reference< XConnection >& _xConnection,bool _bAllowQueries) { OSL_ENSURE(!m_xTable.is(),"We are already connected to a table!"); @@ -120,7 +114,7 @@ bool OTableWindowData::init(const Reference< XConnection >& _xConnection,bool _ Reference< XIndexAccess > xColumnsAsIndex( m_xColumns,UNO_QUERY ); return xColumnsAsIndex.is() && ( xColumnsAsIndex->getCount() > 0 ); } -// ----------------------------------------------------------------------------- + void OTableWindowData::listen() { if ( m_xTable.is() ) @@ -140,6 +134,5 @@ void OTableWindowData::listen() m_xKeys = xKeySup->getKeys(); } } -// ----------------------------------------------------------------------------- /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/querydesign/TableWindowListBox.cxx b/dbaccess/source/ui/querydesign/TableWindowListBox.cxx index 9f4e3cce3064..6e718abe5015 100644 --- a/dbaccess/source/ui/querydesign/TableWindowListBox.cxx +++ b/dbaccess/source/ui/querydesign/TableWindowListBox.cxx @@ -39,11 +39,8 @@ OJoinExchangeData::OJoinExchangeData(OTableWindowListBox* pBox) const sal_uLong SCROLLING_TIMESPAN = 500; const long LISTBOX_SCROLLING_AREA = 6; -//================================================================== // class OTableWindowListBox -//================================================================== DBG_NAME(OTableWindowListBox) -//------------------------------------------------------------------------------ OTableWindowListBox::OTableWindowListBox( OTableWindow* pParent ) :SvTreeListBox( pParent, WB_HASBUTTONS | WB_BORDER) ,m_aMousePos( Point(0,0) ) @@ -61,7 +58,6 @@ OTableWindowListBox::OTableWindowListBox( OTableWindow* pParent ) SetHighlightRange( ); } -//------------------------------------------------------------------------------ void OTableWindowListBox::dragFinished( ) { // first show the error msg when existing @@ -72,7 +68,6 @@ void OTableWindowListBox::dragFinished( ) m_nUiEvent = Application::PostUserEvent(LINK(this, OTableWindowListBox, LookForUiHdl)); } -//------------------------------------------------------------------------------ OTableWindowListBox::~OTableWindowListBox() { DBG_DTOR(OTableWindowListBox,NULL); @@ -85,10 +80,8 @@ OTableWindowListBox::~OTableWindowListBox() m_pTabWin = NULL; } -//------------------------------------------------------------------------------ SvTreeListEntry* OTableWindowListBox::GetEntryFromText( const String& rEntryText ) { - ////////////////////////////////////////////////////////////////////// // iterate through the list SvTreeList* pTreeList = GetModel(); SvTreeListEntry* pEntry = pTreeList->First(); @@ -121,13 +114,11 @@ SvTreeListEntry* OTableWindowListBox::GetEntryFromText( const String& rEntryText return NULL; } -//------------------------------------------------------------------------------ void OTableWindowListBox::NotifyScrolled() { m_bReallyScrolled = sal_True; } -//------------------------------------------------------------------------------ void OTableWindowListBox::NotifyEndScroll() { if (m_bReallyScrolled) @@ -139,7 +130,6 @@ void OTableWindowListBox::NotifyEndScroll() m_bReallyScrolled = sal_False; } -//------------------------------------------------------------------------------ long OTableWindowListBox::PreNotify(NotifyEvent& rNEvt) { sal_Bool bHandled = sal_False; @@ -172,7 +162,6 @@ long OTableWindowListBox::PreNotify(NotifyEvent& rNEvt) return 1L; } -//------------------------------------------------------------------------------ IMPL_LINK( OTableWindowListBox, ScrollUpHdl, SvTreeListBox*, /*pBox*/ ) { SvTreeListEntry* pEntry = GetEntry( m_aMousePos ); @@ -189,7 +178,6 @@ IMPL_LINK( OTableWindowListBox, ScrollUpHdl, SvTreeListBox*, /*pBox*/ ) return 0; } -//------------------------------------------------------------------------------ IMPL_LINK( OTableWindowListBox, ScrollDownHdl, SvTreeListBox*, /*pBox*/ ) { SvTreeListEntry* pEntry = GetEntry( m_aMousePos ); @@ -206,7 +194,6 @@ IMPL_LINK( OTableWindowListBox, ScrollDownHdl, SvTreeListBox*, /*pBox*/ ) return 0; } -//------------------------------------------------------------------------------ void OTableWindowListBox::StartDrag( sal_Int8 /*nAction*/, const Point& /*rPosPixel*/ ) { OJoinTableView* pCont = m_pTabWin->getTableView(); @@ -224,7 +211,6 @@ void OTableWindowListBox::StartDrag( sal_Int8 /*nAction*/, const Point& /*rPosPi } } -//------------------------------------------------------------------------------ sal_Int8 OTableWindowListBox::AcceptDrop( const AcceptDropEvent& _rEvt ) { sal_Int8 nDND_Action = DND_ACTION_NONE; @@ -287,16 +273,14 @@ sal_Int8 OTableWindowListBox::AcceptDrop( const AcceptDropEvent& _rEvt ) } return nDND_Action; } -// ----------------------------------------------------------------------------- -//------------------------------------------------------------------------------ IMPL_LINK( OTableWindowListBox, LookForUiHdl, void *, /*EMPTY_ARG*/) { m_nUiEvent = 0; m_pTabWin->getTableView()->lookForUiActivities(); return 0L; } -//------------------------------------------------------------------------------ + IMPL_LINK( OTableWindowListBox, DropHdl, void *, /*EMPTY_ARG*/) { // create the connection @@ -315,7 +299,7 @@ IMPL_LINK( OTableWindowListBox, DropHdl, void *, /*EMPTY_ARG*/) } return 0L; } -//------------------------------------------------------------------------------ + sal_Int8 OTableWindowListBox::ExecuteDrop( const ExecuteDropEvent& _rEvt ) { TransferableDataHelper aDropped(_rEvt.maDropEvent.Transferable); @@ -333,7 +317,6 @@ sal_Int8 OTableWindowListBox::ExecuteDrop( const ExecuteDropEvent& _rEvt ) return DND_ACTION_NONE; } -//------------------------------------------------------------------------------ void OTableWindowListBox::LoseFocus() { if(m_pTabWin) @@ -341,7 +324,6 @@ void OTableWindowListBox::LoseFocus() SvTreeListBox::LoseFocus(); } -//------------------------------------------------------------------------------ void OTableWindowListBox::GetFocus() { if(m_pTabWin) @@ -361,7 +343,6 @@ void OTableWindowListBox::GetFocus() SvTreeListBox::GetFocus(); } -//------------------------------------------------------------------------------ IMPL_LINK( OTableWindowListBox, OnDoubleClick, SvTreeListBox *, /*pBox*/ ) { // tell my parent @@ -372,7 +353,7 @@ IMPL_LINK( OTableWindowListBox, OnDoubleClick, SvTreeListBox *, /*pBox*/ ) return 0; } -// ----------------------------------------------------------------------------- + void OTableWindowListBox::Command(const CommandEvent& rEvt) { switch (rEvt.GetCommand()) @@ -386,6 +367,5 @@ void OTableWindowListBox::Command(const CommandEvent& rEvt) SvTreeListBox::Command(rEvt); } } -// ----------------------------------------------------------------------------- /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/querydesign/TableWindowTitle.cxx b/dbaccess/source/ui/querydesign/TableWindowTitle.cxx index 6acc2851a60e..da3caaa4604e 100644 --- a/dbaccess/source/ui/querydesign/TableWindowTitle.cxx +++ b/dbaccess/source/ui/querydesign/TableWindowTitle.cxx @@ -37,11 +37,8 @@ using namespace dbaui; using namespace ::com::sun::star::beans; using namespace ::com::sun::star::uno; -//================================================================== // class OTableWindowTitle -//================================================================== DBG_NAME(OTableWindowTitle) -//------------------------------------------------------------------------------ OTableWindowTitle::OTableWindowTitle( OTableWindow* pParent ) : FixedText( pParent, WB_3DLOOK|WB_LEFT|WB_NOLABEL|WB_VCENTER ) ,m_pTabWin( pParent ) @@ -57,26 +54,23 @@ OTableWindowTitle::OTableWindowTitle( OTableWindow* pParent ) : SetFont( aFont ); } -//------------------------------------------------------------------------------ OTableWindowTitle::~OTableWindowTitle() { DBG_DTOR(OTableWindowTitle,NULL); m_pTabWin = NULL; } -//------------------------------------------------------------------------------ void OTableWindowTitle::GetFocus() { if(m_pTabWin) m_pTabWin->GetFocus(); } -//------------------------------------------------------------------------------ void OTableWindowTitle::LoseFocus() { m_pTabWin->LoseFocus(); } -//------------------------------------------------------------------------------ + void OTableWindowTitle::RequestHelp( const HelpEvent& rHEvt ) { if(m_pTabWin) @@ -101,7 +95,6 @@ void OTableWindowTitle::RequestHelp( const HelpEvent& rHEvt ) } } -//------------------------------------------------------------------------------ void OTableWindowTitle::Command( const CommandEvent& rEvt ) { switch( rEvt.GetCommand() ) @@ -117,14 +110,12 @@ void OTableWindowTitle::Command( const CommandEvent& rEvt ) } } -//------------------------------------------------------------------------------ void OTableWindowTitle::KeyInput( const KeyEvent& rEvt ) { if ( m_pTabWin ) m_pTabWin->KeyInput( rEvt ); } -//------------------------------------------------------------------------------ void OTableWindowTitle::MouseButtonDown( const MouseEvent& rEvt ) { if( rEvt.IsLeft() ) @@ -165,8 +156,6 @@ void OTableWindowTitle::MouseButtonDown( const MouseEvent& rEvt ) Control::MouseButtonDown( rEvt ); } - -//------------------------------------------------------------------------------ void OTableWindowTitle::DataChanged(const DataChangedEvent& rDCEvt) { if (rDCEvt.GetType() == DATACHANGED_SETTINGS) @@ -177,7 +166,7 @@ void OTableWindowTitle::DataChanged(const DataChangedEvent& rDCEvt) SetTextColor(aSystemStyle.GetButtonTextColor()); } } -// ----------------------------------------------------------------------------- + void OTableWindowTitle::StateChanged( StateChangedType nType ) { Window::StateChanged( nType ); diff --git a/dbaccess/source/ui/querydesign/querycontainerwindow.cxx b/dbaccess/source/ui/querydesign/querycontainerwindow.cxx index a99e407dabaf..8cc0b6e8470a 100644 --- a/dbaccess/source/ui/querydesign/querycontainerwindow.cxx +++ b/dbaccess/source/ui/querydesign/querycontainerwindow.cxx @@ -17,7 +17,6 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ - #include "querycontainerwindow.hxx" #include "QueryDesignView.hxx" #include <tools/debug.hxx> @@ -32,19 +31,15 @@ #include <com/sun/star/frame/Frame.hpp> #include <com/sun/star/util/XCloseable.hpp> -//......................................................................... namespace dbaui { -//......................................................................... using namespace ::com::sun::star::uno; using namespace ::com::sun::star::lang; using namespace ::com::sun::star::frame; using namespace ::com::sun::star::beans; - //===================================================================== - //= OQueryContainerWindow - //===================================================================== + // OQueryContainerWindow DBG_NAME(OQueryContainerWindow) OQueryContainerWindow::OQueryContainerWindow(Window* pParent, OQueryController& _rController,const Reference< XComponentContext >& _rxContext) :ODataView( pParent, _rController, _rxContext ) @@ -59,7 +54,6 @@ namespace dbaui m_pSplitter->SetSplitHdl( LINK( this, OQueryContainerWindow, SplitHdl ) ); m_pSplitter->SetBackground( Wallpaper( Application::GetSettings().GetStyleSettings().GetDialogColor() ) ); } - // ----------------------------------------------------------------------------- OQueryContainerWindow::~OQueryContainerWindow() { DBG_DTOR(OQueryContainerWindow,NULL); @@ -82,19 +76,16 @@ namespace dbaui m_pSplitter = NULL; } - // ----------------------------------------------------------------------------- bool OQueryContainerWindow::switchView( ::dbtools::SQLExceptionInfo* _pErrorInfo ) { return m_pViewSwitch->switchView( _pErrorInfo ); } - // ----------------------------------------------------------------------------- void OQueryContainerWindow::forceInitialView() { return m_pViewSwitch->forceInitialView(); } - // ----------------------------------------------------------------------------- void OQueryContainerWindow::resizeAll( const Rectangle& _rPlayground ) { Rectangle aPlayground( _rPlayground ); @@ -127,7 +118,6 @@ namespace dbaui ODataView::resizeAll( aPlayground ); } - // ----------------------------------------------------------------------------- void OQueryContainerWindow::resizeDocumentView( Rectangle& _rPlayground ) { m_pViewSwitch->SetPosSizePixel( _rPlayground.TopLeft(), Size( _rPlayground.GetWidth(), _rPlayground.GetHeight() ) ); @@ -135,14 +125,12 @@ namespace dbaui ODataView::resizeDocumentView( _rPlayground ); } - // ----------------------------------------------------------------------------- void OQueryContainerWindow::GetFocus() { ODataView::GetFocus(); if(m_pViewSwitch) m_pViewSwitch->GrabFocus(); } - // ----------------------------------------------------------------------------- IMPL_LINK( OQueryContainerWindow, SplitHdl, void*, /*p*/ ) { m_pSplitter->SetPosPixel( Point( m_pSplitter->GetPosPixel().X(),m_pSplitter->GetSplitPosPixel() ) ); @@ -151,13 +139,11 @@ namespace dbaui return 0L; } - // ----------------------------------------------------------------------------- void OQueryContainerWindow::Construct() { m_pViewSwitch->Construct(); } - // ----------------------------------------------------------------------------- void OQueryContainerWindow::disposingPreview() { if ( m_pBeamer ) @@ -170,7 +156,6 @@ namespace dbaui Resize(); } } - // ----------------------------------------------------------------------------- long OQueryContainerWindow::PreNotify( NotifyEvent& rNEvt ) { sal_Bool bHandled = sal_False; @@ -187,7 +172,6 @@ namespace dbaui } return bHandled ? 1L : ODataView::PreNotify(rNEvt); } - // ----------------------------------------------------------------------------- void OQueryContainerWindow::showPreview(const Reference<XFrame>& _xFrame) { if(!m_pBeamer) @@ -239,12 +223,7 @@ namespace dbaui Resize(); } } - // ----------------------------------------------------------------------------- - -//......................................................................... } // namespace dbaui -//......................................................................... - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/querydesign/querycontroller.cxx b/dbaccess/source/ui/querydesign/querycontroller.cxx index c4d0b3cbf1e6..ca88cc47ca43 100644 --- a/dbaccess/source/ui/querydesign/querycontroller.cxx +++ b/dbaccess/source/ui/querydesign/querycontroller.cxx @@ -90,6 +90,7 @@ extern "C" void SAL_CALL createRegistryInfo_OQueryControl() { static ::dbaui::OMultiInstanceAutoRegistration< ::dbaui::OQueryController > aAutoRegistration; } + namespace dbaui { using namespace ::com::sun::star::uno; @@ -100,12 +101,10 @@ namespace dbaui class OViewController : public OQueryController { - //------------------------------------------------------------------------------ virtual OUString SAL_CALL getImplementationName() throw( RuntimeException ) { return getImplementationName_Static(); } - //------------------------------------------------------------------------- virtual Sequence< OUString> SAL_CALL getSupportedServiceNames() throw(RuntimeException) { return getSupportedServiceNames_Static(); @@ -130,6 +129,7 @@ namespace dbaui } }; } + extern "C" void SAL_CALL createRegistryInfo_OViewControl() { static ::dbaui::OMultiInstanceAutoRegistration< ::dbaui::OViewController > aAutoRegistration; @@ -141,7 +141,6 @@ namespace dbaui #if OSL_DEBUG_LEVEL > 1 namespace { - // ----------------------------------------------------------------------------- void insertParseTree(SvTreeListBox* _pBox,::connectivity::OSQLParseNode* _pNode,SvTreeListEntry* _pParent = NULL) { OUString rString; @@ -151,7 +150,6 @@ namespace dbaui rString = "RULE_ID: " + OUString::number( (sal_Int32)_pNode->getRuleID() ) + "(" + OSQLParser::RuleIDToStr(_pNode->getRuleID()) + ")"; - _pParent = _pBox->InsertEntry(rString,_pParent); // determine how much subtrees this node has @@ -223,7 +221,6 @@ namespace dbaui namespace { - // ----------------------------------------------------------------------------- String lcl_getObjectResourceString( sal_uInt16 _nResId, sal_Int32 _nCommandType ) { String sMessageText = String( ModuleRes( _nResId ) ); @@ -301,36 +298,34 @@ namespace } } -//------------------------------------------------------------------------------ OUString SAL_CALL OQueryController::getImplementationName() throw( RuntimeException ) { return getImplementationName_Static(); } -//------------------------------------------------------------------------------ OUString OQueryController::getImplementationName_Static() throw( RuntimeException ) { return OUString("org.openoffice.comp.dbu.OQueryDesign"); } -//------------------------------------------------------------------------------ + Sequence< OUString> OQueryController::getSupportedServiceNames_Static(void) throw( RuntimeException ) { Sequence< OUString> aSupported(1); aSupported.getArray()[0] = "com.sun.star.sdb.QueryDesign"; return aSupported; } -//------------------------------------------------------------------------- + Sequence< OUString> SAL_CALL OQueryController::getSupportedServiceNames() throw(RuntimeException) { return getSupportedServiceNames_Static(); } -// ------------------------------------------------------------------------- + Reference< XInterface > SAL_CALL OQueryController::Create(const Reference<XMultiServiceFactory >& _rxFactory) { return *(new OQueryController(comphelper::getComponentContext(_rxFactory))); } + DBG_NAME(OQueryController); -// ----------------------------------------------------------------------------- OQueryController::OQueryController(const Reference< XComponentContext >& _rM) :OJoinController(_rM) ,OQueryController_PBase( getBroadcastHelper() ) @@ -357,7 +352,6 @@ OQueryController::OQueryController(const Reference< XComponentContext >& _rM) &m_bEscapeProcessing, ::getCppuType( &m_bEscapeProcessing ) ); } -// ----------------------------------------------------------------------------- OQueryController::~OQueryController() { DBG_DTOR(OQueryController,NULL); @@ -373,26 +367,22 @@ OQueryController::~OQueryController() IMPLEMENT_FORWARD_XINTERFACE2( OQueryController, OJoinController, OQueryController_PBase ) IMPLEMENT_FORWARD_XTYPEPROVIDER2( OQueryController, OJoinController, OQueryController_PBase ) -//------------------------------------------------------------------------- Reference< XPropertySetInfo > SAL_CALL OQueryController::getPropertySetInfo() throw(RuntimeException) { Reference< XPropertySetInfo > xInfo( createPropertySetInfo( getInfoHelper() ) ); return xInfo; } -//------------------------------------------------------------------------- sal_Bool SAL_CALL OQueryController::convertFastPropertyValue( Any& o_rConvertedValue, Any& o_rOldValue, sal_Int32 i_nHandle, const Any& i_rValue ) throw (IllegalArgumentException) { return OPropertyContainer::convertFastPropertyValue( o_rConvertedValue, o_rOldValue, i_nHandle, i_rValue ); } -//------------------------------------------------------------------------- void SAL_CALL OQueryController::setFastPropertyValue_NoBroadcast( sal_Int32 i_nHandle, const Any& i_rValue ) throw ( Exception ) { OPropertyContainer::setFastPropertyValue_NoBroadcast( i_nHandle, i_rValue ); } -//------------------------------------------------------------------------- void SAL_CALL OQueryController::getFastPropertyValue( Any& o_rValue, sal_Int32 i_nHandle ) const { switch ( i_nHandle ) @@ -424,13 +414,11 @@ void SAL_CALL OQueryController::getFastPropertyValue( Any& o_rValue, sal_Int32 i } } -//------------------------------------------------------------------------- ::cppu::IPropertyArrayHelper& OQueryController::getInfoHelper() { return *const_cast< OQueryController* >( this )->getArrayHelper(); } -//-------------------------------------------------------------------- ::cppu::IPropertyArrayHelper* OQueryController::createArrayHelper( ) const { Sequence< Property > aProps; @@ -455,7 +443,6 @@ void SAL_CALL OQueryController::getFastPropertyValue( Any& o_rValue, sal_Int32 i return new ::cppu::OPropertyArrayHelper(aProps); } -// ----------------------------------------------------------------------------- void OQueryController::deleteIterator() { if(m_pSqlIterator) @@ -466,7 +453,7 @@ void OQueryController::deleteIterator() m_pSqlIterator = NULL; } } -// ----------------------------------------------------------------------------- + void OQueryController::disposing() { OQueryController_PBase::disposing(); @@ -482,12 +469,12 @@ void OQueryController::disposing() OJoinController::disposing(); OQueryController_PBase::disposing(); } -// ----------------------------------------------------------------------------- + void OQueryController::clearFields() { OTableFields().swap(m_vTableFieldDesc); } -// ----------------------------------------------------------------------------- + FeatureState OQueryController::GetState(sal_uInt16 _nId) const { FeatureState aReturn; @@ -580,7 +567,7 @@ FeatureState OQueryController::GetState(sal_uInt16 _nId) const } return aReturn; } -// ----------------------------------------------------------------------------- + void OQueryController::Execute(sal_uInt16 _nId, const Sequence< PropertyValue >& aArgs) { switch(_nId) @@ -829,7 +816,6 @@ void OQueryController::Execute(sal_uInt16 _nId, const Sequence< PropertyValue >& InvalidateFeature(_nId); } -// ----------------------------------------------------------------------------- void OQueryController::impl_showAutoSQLViewError( const ::com::sun::star::uno::Any& _rErrorDetails ) { SQLContext aErrorContext; @@ -840,7 +826,6 @@ void OQueryController::impl_showAutoSQLViewError( const ::com::sun::star::uno::A showError( aErrorContext ); } -// ----------------------------------------------------------------------------- bool OQueryController::impl_setViewMode( ::dbtools::SQLExceptionInfo* _pErrorInfo ) { OSL_PRECOND( getContainer(), "OQueryController::impl_setViewMode: illegal call!" ); @@ -870,7 +855,6 @@ bool OQueryController::impl_setViewMode( ::dbtools::SQLExceptionInfo* _pErrorInf return bSuccess; } -// ----------------------------------------------------------------------------- void OQueryController::impl_initialize() { OJoinController::impl_initialize(); @@ -952,7 +936,6 @@ void OQueryController::impl_initialize() m_bGraphicalDesign = false; } - // ......................................................................... // . initial design bool bForceInitialDesign = false; Sequence< PropertyValue > aCurrentQueryDesignProps; @@ -1088,13 +1071,11 @@ void OQueryController::impl_initialize() } } -// ----------------------------------------------------------------------------- void OQueryController::onLoadedMenu(const Reference< ::com::sun::star::frame::XLayoutManager >& /*_xLayoutManager*/) { ensureToolbars( *this, m_bGraphicalDesign ); } -// ----------------------------------------------------------------------------- OUString OQueryController::getPrivateTitle( ) const { OUString sName = m_sName; @@ -1111,7 +1092,7 @@ OUString OQueryController::getPrivateTitle( ) const } return sName; } -// ----------------------------------------------------------------------------- + void OQueryController::setQueryComposer() { if(isConnected()) @@ -1136,7 +1117,7 @@ void OQueryController::setQueryComposer() } } } -// ----------------------------------------------------------------------------- + sal_Bool OQueryController::Construct(Window* pParent) { // TODO: we have to check if we should create the text- or the design- view @@ -1146,12 +1127,11 @@ sal_Bool OQueryController::Construct(Window* pParent) return OJoinController::Construct(pParent); } -// ----------------------------------------------------------------------------- OJoinDesignView* OQueryController::getJoinView() { return getContainer()->getDesignView(); } -// ----------------------------------------------------------------------------- + void OQueryController::describeSupportedFeatures() { OJoinController::describeSupportedFeatures(); @@ -1174,7 +1154,7 @@ void OQueryController::describeSupportedFeatures() implDescribeSupportedFeature( ".uno:DBMakeDisjunct", ID_EDIT_QUERY_DESIGN ); #endif } -// ----------------------------------------------------------------------------- + void OQueryController::impl_onModifyChanged() { OJoinController::impl_onModifyChanged(); @@ -1182,7 +1162,7 @@ void OQueryController::impl_onModifyChanged() InvalidateFeature(ID_BROWSER_SAVEASDOC); InvalidateFeature(ID_BROWSER_QUERY_EXECUTE); } -// ----------------------------------------------------------------------------- + void SAL_CALL OQueryController::disposing( const EventObject& Source ) throw(RuntimeException) { SolarMutexGuard aGuard; @@ -1202,7 +1182,7 @@ void SAL_CALL OQueryController::disposing( const EventObject& Source ) throw(Run OJoinController::disposing(Source); } -// ----------------------------------------------------------------------------- + void OQueryController::reconnect(sal_Bool _bUI) { deleteIterator(); @@ -1226,7 +1206,6 @@ void OQueryController::reconnect(sal_Bool _bUI) } } -// ----------------------------------------------------------------------------- void OQueryController::saveViewSettings( ::comphelper::NamedValueCollection& o_rViewSettings, const bool i_includingCriteria ) const { saveTableWindows( o_rViewSettings ); @@ -1252,7 +1231,7 @@ void OQueryController::saveViewSettings( ::comphelper::NamedValueCollection& o_r o_rViewSettings.put( "SplitterPosition", m_nSplitPos ); o_rViewSettings.put( "VisibleRows", m_nVisibleRows ); } -// ----------------------------------------------------------------------------- + void OQueryController::loadViewSettings( const ::comphelper::NamedValueCollection& o_rViewSettings ) { loadTableWindows( o_rViewSettings ); @@ -1261,7 +1240,7 @@ void OQueryController::loadViewSettings( const ::comphelper::NamedValueCollectio m_nVisibleRows = o_rViewSettings.getOrDefault( "VisibleRows", m_nVisibleRows ); m_aFieldInformation = o_rViewSettings.getOrDefault( "Fields", m_aFieldInformation ); } -// ----------------------------------------------------------------------------- + void OQueryController::execute_QueryPropDlg() { QueryPropertiesDialog aQueryPropDlg( @@ -1275,7 +1254,7 @@ void OQueryController::execute_QueryPropDlg() InvalidateFeature( SID_QUERY_LIMIT, 0, sal_True ); } } -// ----------------------------------------------------------------------------- + sal_Int32 OQueryController::getColWidth(sal_uInt16 _nColPos) const { if ( _nColPos < m_aFieldInformation.getLength() ) @@ -1286,7 +1265,7 @@ sal_Int32 OQueryController::getColWidth(sal_uInt16 _nColPos) const } return 0; } -// ----------------------------------------------------------------------------- + Reference<XNameAccess> OQueryController::getObjectContainer() const { Reference< XNameAccess > xElements; @@ -1313,7 +1292,6 @@ Reference<XNameAccess> OQueryController::getObjectContainer() const return xElements; } -// ----------------------------------------------------------------------------- void OQueryController::executeQuery() { // we don't need to check the connection here because we already check the composer @@ -1399,7 +1377,7 @@ void OQueryController::executeQuery() } } } -// ----------------------------------------------------------------------------- + sal_Bool OQueryController::askForNewName(const Reference<XNameAccess>& _xElements,sal_Bool _bSaveAs) { OSL_ENSURE( !editingCommand(), "OQueryController::askForNewName: not to be called when designing an independent statement!" ); @@ -1447,7 +1425,7 @@ sal_Bool OQueryController::askForNewName(const Reference<XNameAccess>& _xElement } return bRet; } -// ----------------------------------------------------------------------------- + bool OQueryController::doSaveAsDoc(sal_Bool _bSaveAs) { OSL_ENSURE(isEditable(),"Slot ID_BROWSER_SAVEDOC should not be enabled!"); @@ -1629,7 +1607,6 @@ bool OQueryController::doSaveAsDoc(sal_Bool _bSaveAs) return bSuccess; } -//----------------------------------------------------------------------------- namespace { struct CommentStrip @@ -1639,6 +1616,7 @@ struct CommentStrip CommentStrip( const OUString& rComment, bool bLastOnLine ) : maComment( rComment), mbLastOnLine( bLastOnLine) {} }; + } /** Obtain all comments in a query. @@ -1713,7 +1691,6 @@ static ::std::vector< CommentStrip > getComment( const OUString& rQuery ) } return aRet; } -//------------------------------------------------------------------------------ /** Concat/insert comments that were previously obtained with getComment(). @@ -1772,7 +1749,7 @@ static OUString concatComment( const OUString& rQuery, const ::std::vector< Comm } return aBuf.makeStringAndClear(); } -// ----------------------------------------------------------------------------- + OUString OQueryController::translateStatement( bool _bFireStatementChange ) { // now set the properties @@ -1817,7 +1794,7 @@ OUString OQueryController::translateStatement( bool _bFireStatementChange ) return sTranslatedStmt; } -// ----------------------------------------------------------------------------- + short OQueryController::saveModified() { SolarMutexGuard aSolarGuard; @@ -1845,7 +1822,7 @@ short OQueryController::saveModified() } return nRet; } -// ----------------------------------------------------------------------------- + void OQueryController::impl_reset( const bool i_bForceCurrentControllerSettings ) { bool bValid = false; @@ -1969,7 +1946,6 @@ void OQueryController::impl_reset( const bool i_bForceCurrentControllerSettings getContainer()->setNoneVisbleRow(m_nVisibleRows); } -// ----------------------------------------------------------------------------- void OQueryController::reset() { impl_reset(); @@ -1977,7 +1953,6 @@ void OQueryController::reset() ClearUndoManager(); } -// ----------------------------------------------------------------------------- void OQueryController::setStatement_fireEvent( const OUString& _rNewStatement, bool _bFireStatementChange ) { Any aOldValue = makeAny( m_sStatement ); @@ -1989,7 +1964,6 @@ void OQueryController::setStatement_fireEvent( const OUString& _rNewStatement, b fire( &nHandle, &aNewValue, &aOldValue, 1, sal_False ); } -// ----------------------------------------------------------------------------- void OQueryController::setEscapeProcessing_fireEvent( const sal_Bool _bEscapeProcessing ) { if ( _bEscapeProcessing == m_bEscapeProcessing ) @@ -2003,20 +1977,17 @@ void OQueryController::setEscapeProcessing_fireEvent( const sal_Bool _bEscapePro fire( &nHandle, &aNewValue, &aOldValue, 1, sal_False ); } -// ----------------------------------------------------------------------------- IMPL_LINK( OQueryController, OnExecuteAddTable, void*, /*pNotInterestedIn*/ ) { Execute( ID_BROWSER_ADDTABLE,Sequence<PropertyValue>() ); return 0L; } -// ----------------------------------------------------------------------------- bool OQueryController::allowViews() const { return true; } -// ----------------------------------------------------------------------------- bool OQueryController::allowQueries() const { OSL_ENSURE( getSdbMetaData().isConnected(), "OQueryController::allowQueries: illegal call!" ); @@ -2029,7 +2000,6 @@ bool OQueryController::allowQueries() const return !bCreatingView; } -// ----------------------------------------------------------------------------- Any SAL_CALL OQueryController::getViewData() throw( RuntimeException ) { ::osl::MutexGuard aGuard( getMutex() ); @@ -2041,14 +2011,12 @@ Any SAL_CALL OQueryController::getViewData() throw( RuntimeException ) return makeAny( aViewSettings.getPropertyValues() ); } -// ----------------------------------------------------------------------------- + void SAL_CALL OQueryController::restoreViewData(const Any& /*Data*/) throw( RuntimeException ) { // TODO } -// ----------------------------------------------------------------------------- } // namespace dbaui -// ----------------------------------------------------------------------------- /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/querydesign/querydlg.cxx b/dbaccess/source/ui/querydesign/querydlg.cxx index e382fda8f23f..3229a55daa63 100644 --- a/dbaccess/source/ui/querydesign/querydlg.cxx +++ b/dbaccess/source/ui/querydesign/querydlg.cxx @@ -47,6 +47,7 @@ public: OJoinControl(Window* _pParent,const ResId& _rResId); }; + OJoinControl::OJoinControl(Window* _pParent,const ResId& _rResId) : Window(_pParent,_rResId) ,aFL_Join( this, ResId( FL_JOIN,*_rResId.GetResMgr() ) ) @@ -56,9 +57,9 @@ OJoinControl::OJoinControl(Window* _pParent,const ResId& _rResId) { FreeResource(); } -// ----------------------------------------------------------------------------- + } // dbaui -// ----------------------------------------------------------------------------- + DBG_NAME(DlgQryJoin) DlgQryJoin::DlgQryJoin( OQueryTableView * pParent, const TTableConnectionData::value_type& _pData, @@ -81,7 +82,6 @@ DlgQryJoin::DlgQryJoin( OQueryTableView * pParent, DBG_CTOR(DlgQryJoin,NULL); aML_HelpText.SetControlBackground( GetSettings().GetStyleSettings().GetFaceColor() ); - ////////////////////////////////////////////////////////////////////// // Connection kopieren m_pConnData.reset(_pData->NewInstance()); m_pConnData->CopyFrom(*_pData); @@ -160,14 +160,13 @@ DlgQryJoin::DlgQryJoin( OQueryTableView * pParent, FreeResource(); } -//------------------------------------------------------------------------ DlgQryJoin::~DlgQryJoin() { DBG_DTOR(DlgQryJoin,NULL); delete m_pJoinControl; delete m_pTableControl; } -// ----------------------------------------------------------------------------- + IMPL_LINK( DlgQryJoin, LBChangeHdl, ListBox*, /*pListBox*/ ) { DBG_CHKTHIS(DlgQryJoin,NULL); @@ -256,7 +255,6 @@ IMPL_LINK( DlgQryJoin, LBChangeHdl, ListBox*, /*pListBox*/ ) aML_HelpText.SetText( sHelpText ); return 1; } -// ----------------------------------------------------------------------------- IMPL_LINK( DlgQryJoin, OKClickHdl, Button*, /*pButton*/ ) { @@ -268,7 +266,6 @@ IMPL_LINK( DlgQryJoin, OKClickHdl, Button*, /*pButton*/ ) EndDialog(RET_OK); return 1; } -// ----------------------------------------------------------------------------- IMPL_LINK( DlgQryJoin, NaturalToggleHdl, CheckBox*, /*pButton*/ ) { @@ -301,24 +298,24 @@ IMPL_LINK( DlgQryJoin, NaturalToggleHdl, CheckBox*, /*pButton*/ ) return 1; } -// ----------------------------------------------------------------------------- + TTableConnectionData::value_type DlgQryJoin::getConnectionData() const { return m_pConnData; } -// ----------------------------------------------------------------------------- + void DlgQryJoin::setValid(sal_Bool _bValid) { aPB_OK.Enable(_bValid || eJoinType == CROSS_JOIN ); } -// ----------------------------------------------------------------------------- + void DlgQryJoin::notifyConnectionChange( ) { setJoinType( static_cast<OQueryTableConnectionData*>(m_pConnData.get())->GetJoinType() ); m_pJoinControl->m_aCBNatural.Check(static_cast<OQueryTableConnectionData*>(m_pConnData.get())->isNatural()); NaturalToggleHdl(&m_pJoinControl->m_aCBNatural); } -// ----------------------------------------------------------------------------- + void DlgQryJoin::setJoinType(EJoinType _eNewJoinType) { eJoinType = _eNewJoinType; @@ -357,8 +354,5 @@ void DlgQryJoin::setJoinType(EJoinType _eNewJoinType) LBChangeHdl(&m_pJoinControl->aLB_JoinType); } -// ----------------------------------------------------------------------------- - - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/querydesign/queryview.cxx b/dbaccess/source/ui/querydesign/queryview.cxx index e49c7b000c9f..e2946c73940c 100644 --- a/dbaccess/source/ui/querydesign/queryview.cxx +++ b/dbaccess/source/ui/querydesign/queryview.cxx @@ -21,27 +21,21 @@ #include "dbu_qry.hrc" #include "querycontroller.hxx" - using namespace dbaui; using namespace ::com::sun::star::uno; using namespace ::com::sun::star::lang; DBG_NAME(OQueryView) -// ------------------------------------------------------------------------- OQueryView::OQueryView(Window* _pParent, OQueryController& _rController,const Reference< XComponentContext >& _rxContext) :OJoinDesignView( _pParent, _rController, _rxContext ) { DBG_CTOR(OQueryView,NULL); } -// ----------------------------------------------------------------------------- + OQueryView::~OQueryView() { DBG_DTOR(OQueryView,NULL); } -// ----------------------------------------------------------------------------- - - - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |