[Libreoffice-commits] core.git: Branch 'aoo/trunk' - 2 commits - offapi/com svtools/inc svtools/source

Jürgen Schmidt jsc at apache.org
Thu Dec 19 22:08:08 PST 2013


 offapi/com/sun/star/presentation/XSlideShowController.idl |   10 +++++++-
 svtools/inc/svtools/table/tablemodel.hxx                  |    4 +++
 svtools/source/table/gridtablerenderer.cxx                |   16 +++++++++----
 svtools/source/table/tablecontrol_impl.cxx                |    4 +++
 svtools/source/uno/svtxgridcontrol.cxx                    |   14 +++++++++++
 svtools/source/uno/svtxgridcontrol.hxx                    |    3 ++
 svtools/source/uno/unocontroltablemodel.cxx               |   17 ++++++++++++++
 svtools/source/uno/unocontroltablemodel.hxx               |    2 +
 8 files changed, 64 insertions(+), 6 deletions(-)

New commits:
commit 91e3fca93d3a0b51e8f1ea87df902d928a7005ca
Author: Jürgen Schmidt <jsc at apache.org>
Date:   Fri Dec 20 05:48:42 2013 +0000

    #121943# apply patch for PenWidth attribute
    
    Patch By: hanya
    Review By: jsc

diff --git a/offapi/com/sun/star/presentation/XSlideShowController.idl b/offapi/com/sun/star/presentation/XSlideShowController.idl
index 9c05cb7..21addd0 100644
--- a/offapi/com/sun/star/presentation/XSlideShowController.idl
+++ b/offapi/com/sun/star/presentation/XSlideShowController.idl
@@ -48,7 +48,7 @@
 /** interface to control a running slideshow.
 
     @see XPresentation2
-    @since OOo 3.0
+    @since OpenOffice 3.0
 */
 interface XSlideShowController
 {
@@ -288,6 +288,14 @@ interface XSlideShowController
 
     //-------------------------------------------------------------------------
 
+    /** This attribute changes the width of the pen.
+
+        @since OpenOffice 4.1
+    */
+    [attribute] double PenWidth;
+
+    //-------------------------------------------------------------------------
+
     /** returns the actuall <type>XSlideShow</type> instance that runs the
         slideshow.
         <br>Normaly all navigation should be done using this controller and
commit 0164d67071d06aa42213c4a66765b5d032ca84d3
Author: Jürgen Schmidt <jsc at apache.org>
Date:   Fri Dec 20 05:47:11 2013 +0000

    #120065# apply patch for Enabled property in grid model
    
    Patch By: hanya
    Review By: jsc

diff --git a/svtools/inc/svtools/table/tablemodel.hxx b/svtools/inc/svtools/table/tablemodel.hxx
index fb501a3..da3d568 100644
--- a/svtools/inc/svtools/table/tablemodel.hxx
+++ b/svtools/inc/svtools/table/tablemodel.hxx
@@ -529,6 +529,10 @@ namespace svt { namespace table
         */
         virtual ITableDataSort* getSortAdapter() = 0;
 
+        /** returns enabled state.
+        */
+        virtual bool isEnabled() const = 0;
+
         /// destroys the table model instance
         virtual ~ITableModel() { }
     };
diff --git a/svtools/source/table/gridtablerenderer.cxx b/svtools/source/table/gridtablerenderer.cxx
index d74c251..cd2b822 100644
--- a/svtools/source/table/gridtablerenderer.cxx
+++ b/svtools/source/table/gridtablerenderer.cxx
@@ -277,7 +277,9 @@ namespace svt { namespace table
         _rDevice.SetTextColor( textColor );
 
         Rectangle const aTextRect( lcl_getTextRenderingArea( lcl_getContentArea( *m_pImpl, _rArea ) ) );
-        sal_uLong const nDrawTextFlags = lcl_getAlignmentTextDrawFlags( *m_pImpl, _nCol ) | TEXT_DRAW_CLIP;
+        sal_uLong nDrawTextFlags = lcl_getAlignmentTextDrawFlags( *m_pImpl, _nCol ) | TEXT_DRAW_CLIP;
+        if ( !m_pImpl->rModel.isEnabled() )
+            nDrawTextFlags |= TEXT_DRAW_DISABLE;
         _rDevice.DrawText( aTextRect, sHeaderText, nDrawTextFlags );
 
         ::boost::optional< ::Color > const aLineColor( m_pImpl->rModel.getLineColor() );
@@ -413,7 +415,9 @@ namespace svt { namespace table
             _rDevice.SetTextColor( textColor );
 
             Rectangle const aTextRect( lcl_getTextRenderingArea( lcl_getContentArea( *m_pImpl, _rArea ) ) );
-            sal_uLong const nDrawTextFlags = lcl_getAlignmentTextDrawFlags( *m_pImpl, 0 ) | TEXT_DRAW_CLIP;
+            sal_uLong nDrawTextFlags = lcl_getAlignmentTextDrawFlags( *m_pImpl, 0 ) | TEXT_DRAW_CLIP;
+            if ( !m_pImpl->rModel.isEnabled() )
+                nDrawTextFlags |= TEXT_DRAW_DISABLE;
                 // TODO: is using the horizontal alignment of the 0'th column a good idea here? This is pretty ... arbitray ..
             _rDevice.DrawText( aTextRect, rowTitle, nDrawTextFlags );
         }
@@ -517,8 +521,8 @@ namespace svt { namespace table
         }
         else
             imageSize.Height() = i_context.aContentArea.GetHeight() - 1;
-
-        i_context.rDevice.DrawImage( imagePos, imageSize, i_image, 0 );
+        sal_uInt16 const nStyle = m_pImpl->rModel.isEnabled() ? 0 : IMAGE_DRAW_DISABLE;
+        i_context.rDevice.DrawImage( imagePos, imageSize, i_image, nStyle );
     }
 
     //------------------------------------------------------------------------------------------------------------------
@@ -563,7 +567,9 @@ namespace svt { namespace table
         }
 
         Rectangle const textRect( lcl_getTextRenderingArea( i_context.aContentArea ) );
-        sal_uLong const nDrawTextFlags = lcl_getAlignmentTextDrawFlags( *m_pImpl, i_context.nColumn ) | TEXT_DRAW_CLIP;
+        sal_uLong nDrawTextFlags = lcl_getAlignmentTextDrawFlags( *m_pImpl, i_context.nColumn ) | TEXT_DRAW_CLIP;
+        if ( !m_pImpl->rModel.isEnabled() )
+            nDrawTextFlags |= TEXT_DRAW_DISABLE;
         i_context.rDevice.DrawText( textRect, i_text, nDrawTextFlags );
     }
 
diff --git a/svtools/source/table/tablecontrol_impl.cxx b/svtools/source/table/tablecontrol_impl.cxx
index d096400..d73b8aa 100644
--- a/svtools/source/table/tablecontrol_impl.cxx
+++ b/svtools/source/table/tablecontrol_impl.cxx
@@ -219,6 +219,10 @@ namespace svt { namespace table
         {
             return NULL;
         }
+        virtual bool isEnabled() const
+        {
+            return true;
+        }
         virtual void getCellContent( ColPos const i_col, RowPos const i_row, ::com::sun::star::uno::Any& o_cellContent )
         {
             (void)i_row;
diff --git a/svtools/source/uno/svtxgridcontrol.cxx b/svtools/source/uno/svtxgridcontrol.cxx
index f74c6e8..07594e0 100644
--- a/svtools/source/uno/svtxgridcontrol.cxx
+++ b/svtools/source/uno/svtxgridcontrol.cxx
@@ -855,6 +855,20 @@ void SVTXGridControl::ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent
 }
 
 //----------------------------------------------------------------------------------------------------------------------
+void SVTXGridControl::setEnable( sal_Bool bEnable ) throw(::com::sun::star::uno::RuntimeException)
+{
+    ::vos::OGuard aGuard( GetMutex() );
+    m_pTableModel->setEnabled( bEnable );
+    Window * pWindow = GetWindow();
+    if ( pWindow )
+    {
+        pWindow->Enable( bEnable, sal_True );
+        pWindow->EnableInput( bEnable );
+        pWindow->Invalidate();
+    }
+}
+
+//----------------------------------------------------------------------------------------------------------------------
 void SVTXGridControl::ImplCallItemListeners()
 {
     TableControl* pTable = dynamic_cast< TableControl* >( GetWindow() );
diff --git a/svtools/source/uno/svtxgridcontrol.hxx b/svtools/source/uno/svtxgridcontrol.hxx
index 76d8c64..9526d9e 100644
--- a/svtools/source/uno/svtxgridcontrol.hxx
+++ b/svtools/source/uno/svtxgridcontrol.hxx
@@ -106,6 +106,9 @@ public:
     // ::com::sun::star::lang::XComponent
     void SAL_CALL dispose(  ) throw(::com::sun::star::uno::RuntimeException);
 
+    // XWindow
+    void SAL_CALL setEnable( sal_Bool bEnable ) throw(::com::sun::star::uno::RuntimeException);
+
 protected:
     // VCLXWindow
     virtual void    SetWindow( Window* pWindow );
diff --git a/svtools/source/uno/unocontroltablemodel.cxx b/svtools/source/uno/unocontroltablemodel.cxx
index 7c4ae3a..049b467 100644
--- a/svtools/source/uno/unocontroltablemodel.cxx
+++ b/svtools/source/uno/unocontroltablemodel.cxx
@@ -102,6 +102,7 @@ namespace svt { namespace table
         ::boost::optional< ::Color >                    m_aTextLineColor;
         ::boost::optional< ::std::vector< ::Color > >   m_aRowColors;
         VerticalAlignment                               m_eVerticalAlign;
+        bool                                            bEnabled;
         ModellListeners                                 m_aListeners;
         WeakReference< XGridDataModel >                 m_aDataModel;
         WeakReference< XGridColumnModel >               m_aColumnModel;
@@ -128,6 +129,7 @@ namespace svt { namespace table
             ,m_aTextLineColor               ( )
             ,m_aRowColors                   ( )
             ,m_eVerticalAlign               ( VerticalAlignment_TOP )
+            ,bEnabled                       ( true )
         {
         }
     };
@@ -166,6 +168,7 @@ namespace svt { namespace table
         DBG_CTOR( UnoControlTableModel, UnoControlTableModel_checkInvariants );
         m_pImpl->bHasColumnHeaders = true;
         m_pImpl->bHasRowHeaders = false;
+        m_pImpl->bEnabled = true;
         m_pImpl->pRenderer.reset( new GridTableRenderer( *this ) );
         m_pImpl->pInputHandler.reset( new DefaultInputHandler );
     }
@@ -815,6 +818,20 @@ namespace svt { namespace table
     }
 
     //------------------------------------------------------------------------------------------------------------------
+    bool UnoControlTableModel::isEnabled() const
+    {
+        DBG_CHECK_ME();
+        return m_pImpl->bEnabled;
+    }
+
+    //------------------------------------------------------------------------------------------------------------------
+    void UnoControlTableModel::setEnabled( bool _bEnabled )
+    {
+        DBG_CHECK_ME();
+        m_pImpl->bEnabled = _bEnabled;
+    }
+
+    //------------------------------------------------------------------------------------------------------------------
     void UnoControlTableModel::sortByColumn( ColPos const i_column, ColumnSortDirection const i_sortDirection )
     {
         DBG_CHECK_ME();
diff --git a/svtools/source/uno/unocontroltablemodel.hxx b/svtools/source/uno/unocontroltablemodel.hxx
index 345871a..d0823b7 100644
--- a/svtools/source/uno/unocontroltablemodel.hxx
+++ b/svtools/source/uno/unocontroltablemodel.hxx
@@ -96,6 +96,7 @@ namespace svt { namespace table
         virtual ::com::sun::star::style::VerticalAlignment
                                                 getVerticalAlign() const;
         virtual ITableDataSort*                 getSortAdapter();
+        virtual bool                            isEnabled() const;
 
         // ITableDataSort overridables
         virtual void        sortByColumn( ColPos const i_column, ColumnSortDirection const i_sortDirection );
@@ -139,6 +140,7 @@ namespace svt { namespace table
         void    setRowBackgroundColors( ::com::sun::star::uno::Any const & i_APIValue );
 
         void    setVerticalAlign(::com::sun::star::style::VerticalAlignment _rAlign);
+        void    setEnabled( bool _bEnabled );
 
         // multiplexing of XGridDataListener events
         void    notifyRowsInserted( ::com::sun::star::awt::grid::GridDataEvent const & i_event ) const;


More information about the Libreoffice-commits mailing list