[Libreoffice-commits] core.git: 2 commits - sc/source sw/source

Stephan Bergmann sbergman at redhat.com
Thu Apr 16 07:23:02 PDT 2015


 sc/source/ui/inc/prevwsh.hxx   |    4 ++--
 sc/source/ui/inc/tabview.hxx   |    4 +---
 sc/source/ui/inc/tabvwsh.hxx   |    2 +-
 sc/source/ui/view/prevwsh.cxx  |    5 +++--
 sc/source/ui/view/tabview5.cxx |    4 ++--
 sc/source/ui/view/tabvwsh4.cxx |    4 ++--
 sw/source/filter/ww8/types.hxx |    6 +-----
 7 files changed, 12 insertions(+), 17 deletions(-)

New commits:
commit cf9d714f74871e15c0019e289d45f2fc77be378c
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Thu Apr 16 16:18:27 2015 +0200

    Use C++11 std::vector<T>::data()
    
    ...all uses of bytes::data() look like they're fine with std::vector<T>::data()
    not necessarily returning nullptr when empty
    
    Change-Id: I48c3877cfb9fb1a4a129bd1e072410a8bebc87b1

diff --git a/sw/source/filter/ww8/types.hxx b/sw/source/filter/ww8/types.hxx
index a57b99b..c832e13 100644
--- a/sw/source/filter/ww8/types.hxx
+++ b/sw/source/filter/ww8/types.hxx
@@ -24,11 +24,7 @@
 
 namespace ww
 {
-    class bytes : public std::vector<sal_uInt8>
-    {
-        public:
-            const sal_uInt8* data() const { return empty() ? 0 : &front(); }
-    };
+    typedef std::vector<sal_uInt8> bytes;
 
     enum WordVersion {eWW1 = 1, eWW2 = 2, eWW6 = 6, eWW7 = 7, eWW8 = 8};
     inline bool IsSevenMinus(WordVersion eVer) { return eVer <= eWW7; }
commit c1c309d37c5129ef291becd5821d9aff3991a828
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Thu Apr 16 16:06:43 2015 +0200

    Replace "sc design mode" sal_uInt8 with TriState
    
    ...used values were 0, 1, and SC_FORCEMODE_NONE = 0xff
    
    Change-Id: Id6303b77a11d22c3d19cb22c3b5838cc7cec624f

diff --git a/sc/source/ui/inc/prevwsh.hxx b/sc/source/ui/inc/prevwsh.hxx
index d8bec53..b17ff47 100644
--- a/sc/source/ui/inc/prevwsh.hxx
+++ b/sc/source/ui/inc/prevwsh.hxx
@@ -47,7 +47,7 @@ class ScPreviewShell: public SfxViewShell
     vcl::Window*         pCorner;
 
     ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > aSourceData;  // ViewData
-    sal_uInt8           nSourceDesignMode;      // form design mode from TabView
+    TriState        nSourceDesignMode;      // form design mode from TabView
     SvxZoomType     eZoom;
     long            nMaxVertPos;
 
@@ -102,7 +102,7 @@ public:
 
     ::com::sun::star::uno::Sequence < ::com::sun::star::beans::PropertyValue >
                     GetSourceData() const       { return aSourceData; }
-    sal_uInt8           GetSourceDesignMode() const { return nSourceDesignMode; }
+    TriState        GetSourceDesignMode() const { return nSourceDesignMode; }
 
     virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) SAL_OVERRIDE;
 
diff --git a/sc/source/ui/inc/tabview.hxx b/sc/source/ui/inc/tabview.hxx
index 8d6010a..ddb45e2 100644
--- a/sc/source/ui/inc/tabview.hxx
+++ b/sc/source/ui/inc/tabview.hxx
@@ -60,8 +60,6 @@ namespace chart2 { namespace data {
     struct HighlightedRange;
 }}}}}
 
-#define SC_FORCEMODE_NONE   0xff
-
 //      Help - Window
 
 class ScCornerButton : public vcl::Window
@@ -221,7 +219,7 @@ protected:
     bool            IsDrawTextEdit() const;
     void            DrawEnableAnim(bool bSet);
 
-    void            MakeDrawView( sal_uInt8 nForceDesignMode = SC_FORCEMODE_NONE );
+    void            MakeDrawView( TriState nForceDesignMode = TRISTATE_INDET );
 
     void            HideNoteMarker();
 
diff --git a/sc/source/ui/inc/tabvwsh.hxx b/sc/source/ui/inc/tabvwsh.hxx
index 81e8004..06476e3 100644
--- a/sc/source/ui/inc/tabvwsh.hxx
+++ b/sc/source/ui/inc/tabvwsh.hxx
@@ -182,7 +182,7 @@ private:
     OUString   maScope;
 
 private:
-    void    Construct( sal_uInt8 nForceDesignMode = SC_FORCEMODE_NONE );
+    void    Construct( TriState nForceDesignMode = TRISTATE_INDET );
 
     SfxShell*       GetMySubShell() const;
 
diff --git a/sc/source/ui/view/prevwsh.cxx b/sc/source/ui/view/prevwsh.cxx
index 9760de2..49500b7 100644
--- a/sc/source/ui/view/prevwsh.cxx
+++ b/sc/source/ui/view/prevwsh.cxx
@@ -152,7 +152,7 @@ ScPreviewShell::ScPreviewShell( SfxViewFrame* pViewFrame,
     SfxViewShell( pViewFrame, SfxViewShellFlags::CAN_PRINT | SfxViewShellFlags::HAS_PRINTOPTIONS ),
     pDocShell( static_cast<ScDocShell*>(pViewFrame->GetObjectShell()) ),
     mpFrameWindow(NULL),
-    nSourceDesignMode( SC_FORCEMODE_NONE ),
+    nSourceDesignMode( TRISTATE_INDET ),
     nMaxVertPos(0),
     pAccessibilityBroadcaster( NULL )
 {
@@ -174,7 +174,8 @@ ScPreviewShell::ScPreviewShell( SfxViewFrame* pViewFrame,
         //  (only if draw view exists)
         SdrView* pDrawView = pTabViewShell->GetSdrView();
         if ( pDrawView )
-            nSourceDesignMode = pDrawView->IsDesignMode();
+            nSourceDesignMode
+                = pDrawView->IsDesignMode() ? TRISTATE_TRUE : TRISTATE_FALSE;
     }
 
     new ScPreviewObj(this);
diff --git a/sc/source/ui/view/tabview5.cxx b/sc/source/ui/view/tabview5.cxx
index 21694cb..033fae3 100644
--- a/sc/source/ui/view/tabview5.cxx
+++ b/sc/source/ui/view/tabview5.cxx
@@ -196,7 +196,7 @@ ScTabView::~ScTabView()
     delete pTabControl;
 }
 
-void ScTabView::MakeDrawView( sal_uInt8 nForceDesignMode )
+void ScTabView::MakeDrawView( TriState nForceDesignMode )
 {
     if (!pDrawView)
     {
@@ -226,7 +226,7 @@ void ScTabView::MakeDrawView( sal_uInt8 nForceDesignMode )
 
         //  used when switching back from page preview: restore saved design mode state
         //  (otherwise, keep the default from the draw view ctor)
-        if ( nForceDesignMode != SC_FORCEMODE_NONE )
+        if ( nForceDesignMode != TRISTATE_INDET )
             pDrawView->SetDesignMode( nForceDesignMode );
 
         //  an der FormShell anmelden
diff --git a/sc/source/ui/view/tabvwsh4.cxx b/sc/source/ui/view/tabvwsh4.cxx
index 360e23b..429314f 100644
--- a/sc/source/ui/view/tabvwsh4.cxx
+++ b/sc/source/ui/view/tabvwsh4.cxx
@@ -1447,7 +1447,7 @@ bool ScTabViewShell::KeyInput( const KeyEvent &rKeyEvent )
     return TabKeyInput( rKeyEvent );
 }
 
-void ScTabViewShell::Construct( sal_uInt8 nForceDesignMode )
+void ScTabViewShell::Construct( TriState nForceDesignMode )
 {
     SfxApplication* pSfxApp  = SfxGetpApp();
     ScDocShell* pDocSh = GetViewData().GetDocShell();
@@ -1703,7 +1703,7 @@ ScTabViewShell::ScTabViewShell( SfxViewFrame* pViewFrame,
     //  has to be shown by the sfx. ReadUserData is deferred until the first Activate call.
     //  old DesignMode state from form layer must be restored, too
 
-    sal_uInt8 nForceDesignMode = SC_FORCEMODE_NONE;
+    TriState nForceDesignMode = TRISTATE_INDET;
     if ( pOldSh && pOldSh->ISA( ScPreviewShell ) )
     {
         ScPreviewShell* pPreviewShell = static_cast<ScPreviewShell*>(pOldSh);


More information about the Libreoffice-commits mailing list