[Libreoffice-commits] core.git: offapi/com officecfg/registry sw/inc sw/source

Ariel Constenla-Haile arielch at apache.org
Fri Jun 7 04:06:09 PDT 2013


 offapi/com/sun/star/text/ViewSettings.idl                  |   34 +++++++------
 officecfg/registry/schema/org/openoffice/Office/Writer.xcs |    9 +++
 sw/inc/viewopt.hxx                                         |    6 +-
 sw/source/ui/config/usrpref.cxx                            |    7 +-
 sw/source/ui/uiview/viewport.cxx                           |   31 ++++++-----
 sw/source/ui/uno/unomod.cxx                                |    6 +-
 6 files changed, 60 insertions(+), 33 deletions(-)

New commits:
commit 6005dd5366a86d6b7b1535233a99e24501e053a3
Author: Ariel Constenla-Haile <arielch at apache.org>
Date:   Tue Dec 11 03:31:17 2012 +0000

    Resolves: #i25945# Allow disabling scrollbar tips by API and configuration
    
    (cherry picked from commit a2bbabbe141de1303ebf052e5c22b6e77387785e)
    
    Conflicts:
    	offapi/com/sun/star/text/ViewSettings.idl
    	officecfg/registry/schema/org/openoffice/Office/Writer.xcs
    	sw/source/ui/config/usrpref.cxx
    	sw/source/ui/uiview/viewport.cxx
    
    Change-Id: I939ec22527a0b654de5f379e781c24c0a3088739

diff --git a/offapi/com/sun/star/text/ViewSettings.idl b/offapi/com/sun/star/text/ViewSettings.idl
index 4b626a9..dd5025d 100644
--- a/offapi/com/sun/star/text/ViewSettings.idl
+++ b/offapi/com/sun/star/text/ViewSettings.idl
@@ -23,8 +23,7 @@
 #include <com/sun/star/view/DocumentZoomType.idl>
 #include <com/sun/star/lang/IllegalArgumentException.idl>
 
-
- module com {  module sun {  module star {  module text {
+module com {  module sun {  module star {  module text {
 
 /** provides access to the settings of the controller of a text document.
  */
@@ -65,20 +64,17 @@ published service ViewSettings
      */
     [property] boolean ShowHiddenText;
 
+    /** ShowHoriRuler and ShowVertRuler determine whether a ruler is visible.
+     */
+    [property] boolean ShowRulers;
 
-         /** ShowHoriRuler and ShowVertRuler determine whether a ruler is visible.
-         */
-        [property] boolean ShowRulers;
-
-
-        /** If this property is `TRUE` and the property ShowRulers is `TRUE`,
-           the horizontal ruler is displayed.
+    /** If this property is `TRUE` and the property ShowRulers is `TRUE`,
+        the horizontal ruler is displayed.
      */
     [property] boolean ShowHoriRuler;
 
-
-        /** If this property is `TRUE` and the property ShowRulers is `TRUE`,
-           the horizontal scroll bar is displayed.
+    /** If this property is `TRUE` and the property ShowRulers is `TRUE`,
+        the horizontal scroll bar is displayed.
      */
     [property] boolean ShowHoriScrollBar;
 
@@ -220,7 +216,7 @@ published service ViewSettings
      */
     [optional, property] long RasterResolutionY;
 
-    /** If this property is `TRUE`, hidden characters are displayed
+    /** If this property is <TRUE/>, hidden characters are displayed
 
         @since OOo 3.0
      */
@@ -233,6 +229,7 @@ published service ViewSettings
         @since OOo 3.0
      */
     [optional, property] boolean ShowNonprintingCharacters;
+
     /** metric unit of the horizontal ruler
 
         <p>Uses values com::sun::star::awt::FieldUnit</p>
@@ -240,6 +237,7 @@ published service ViewSettings
         @since OOo 3.1
      */
     [optional, property] long HorizontalRulerMetric;
+
     /** metric unit of the vertical ruler
 
         <p>Uses values from com::sun::star::awt::FieldUnit</p>
@@ -247,15 +245,21 @@ published service ViewSettings
         @since OOo 3.1
      */
     [optional, property] long VerticalRulerMetric;
-    //-------------------------------------------------------------------------
+
     /** If this property is `TRUE`, tips for document content are shown,
         typically in a help balloon when the mouse is over the content.
 
         @since LibreOffice 4.1
      */
     [optional, property] boolean ShowContentTips;
-};
 
+    /** If this property is `TRUE`, and the scroll bar is shown, a tool tip
+        is displayed while scrolling.
+
+        @since LibreOffice 4.2
+     */
+    [optional, property] boolean ShowScrollBarTips;
+};
 
 }; }; }; };
 
diff --git a/officecfg/registry/schema/org/openoffice/Office/Writer.xcs b/officecfg/registry/schema/org/openoffice/Office/Writer.xcs
index 78524c4..fad816c 100644
--- a/officecfg/registry/schema/org/openoffice/Office/Writer.xcs
+++ b/officecfg/registry/schema/org/openoffice/Office/Writer.xcs
@@ -1253,6 +1253,15 @@
         <info>
           <desc>Contains various window settings such as scrollbars, rules, etc.</desc>
         </info>
+        <prop oor:name="ShowScrollBarTips" oor:type="xs:boolean">
+          <!-- UIHints: Not accessible via user interface -->
+          <info>
+            <author>arielch</author>
+            <desc>Enables the user to prevent the display of help tips on the scrollbars programmatically.</desc>
+            <label>Prevent scrollbars help tips</label>
+          </info>
+          <value>true</value>
+        </prop>
         <prop oor:name="HorizontalScroll" oor:type="xs:boolean" oor:nillable="false">
           <!-- OldPath: Writer/Layout/Window -->
           <!-- OldLocation: Soffice.cfg -->
diff --git a/sw/inc/viewopt.hxx b/sw/inc/viewopt.hxx
index f13e6c5..b205f1e 100644
--- a/sw/inc/viewopt.hxx
+++ b/sw/inc/viewopt.hxx
@@ -85,7 +85,7 @@ namespace svtools{ class ColorConfig;}
 #define VIEWOPT_2_GRFKEEPZOOM       0x00040000L
 #define VIEWOPT_2_CONTENT_TIPS      0x00100000L
 #define VIEWOPT_2_RESERVED3         0x00200000L
-#define VIEWOPT_2_RESERVED4         0x00400000L
+#define VIEWOPT_2_SCROLLBAR_TIPS    0x00400000L
 #define VIEWOPT_2_PRTFORMAT         0x00800000L
 #define VIEWOPT_2_SHADOWCRSR        0x01000000L
 #define VIEWOPT_2_V_RULER_RIGHT     0x02000000L
@@ -468,6 +468,8 @@ public:
         { return nUIOptions & VIEWOPT_2_CONTENT_TIPS ? sal_True : sal_False; }
     sal_Bool    IsPrtFormat() const
         { return nUIOptions & VIEWOPT_2_PRTFORMAT ? sal_True : sal_False; }
+    sal_Bool    IsShowScrollBarTips() const
+        { return nUIOptions & VIEWOPT_2_SCROLLBAR_TIPS ? sal_True : sal_False; }
 
     SvxZoomType    GetZoomType()      const { return eZoom; }
 
@@ -485,6 +487,8 @@ public:
         { b ? (nUIOptions |= VIEWOPT_2_CONTENT_TIPS) : (nUIOptions &= ~VIEWOPT_2_CONTENT_TIPS); }
     void SetPrtFormat( sal_Bool b)
         { b ? (nUIOptions |= VIEWOPT_2_PRTFORMAT) : (nUIOptions &= ~VIEWOPT_2_PRTFORMAT); }
+    void SetShowScrollBarTips( sal_Bool b)
+        { b ? (nUIOptions |= VIEWOPT_2_SCROLLBAR_TIPS) : (nUIOptions &= ~VIEWOPT_2_SCROLLBAR_TIPS); }
 
     void            SetZoomType     (SvxZoomType eZoom_){ eZoom = eZoom_;  }
     void            SetTblDest( sal_uInt8 nNew )    { nTblDest = nNew;  }
diff --git a/sw/source/ui/config/usrpref.cxx b/sw/source/ui/config/usrpref.cxx
index 2a58f61c..acdcac3 100644
--- a/sw/source/ui/config/usrpref.cxx
+++ b/sw/source/ui/config/usrpref.cxx
@@ -235,9 +235,10 @@ Sequence<OUString> SwLayoutViewConfig::GetPropertyNames()
         "ViewLayout/Columns",                   //15
         "ViewLayout/BookMode",                  //16
         "Other/IsSquaredPageMode",              //17
-        "Other/ApplyCharUnit"                   //18
+        "Other/ApplyCharUnit",                  //18
+        "Window/ShowScrollBarTips"              //19
     };
-    const int nCount = bWeb ? 13 : 19;
+    const int nCount = bWeb ? 13 : 20;
     Sequence<OUString> aNames(nCount);
     OUString* pNames = aNames.getArray();
     for(int i = 0; i < nCount; i++)
@@ -298,6 +299,7 @@ void SwLayoutViewConfig::Commit()
             case 16: rVal <<= (sal_Bool) rParent.IsViewLayoutBookMode(); break;     // "ViewLayout/BookMode",
             case 17: rVal <<= (sal_Bool) rParent.IsSquaredPageMode(); break;        // "Other/IsSquaredPageMode",
             case 18: rVal <<= (sal_Bool) rParent.IsApplyCharUnit(); break;        // "Other/ApplyCharUnit",
+            case 19: rVal <<= (sal_Bool) rParent.IsShowScrollBarTips(); break;      // "Window/ShowScrollBarTips",
         }
     }
     PutProperties(aNames, aValues);
@@ -351,6 +353,7 @@ void SwLayoutViewConfig::Load()
                     case 16: rParent.SetViewLayoutBookMode(bSet); break;// "ViewLayout/BookMode",
                     case 17: rParent.SetDefaultPageMode(bSet,sal_True); break;// "Other/IsSquaredPageMode",
                     case 18: rParent.SetApplyCharUnit(bSet); break;// "Other/ApplyUserChar"
+                    case 19: rParent.SetShowScrollBarTips(bSet); break;// "Window/ShowScrollBarTips",
                 }
             }
         }
diff --git a/sw/source/ui/uiview/viewport.cxx b/sw/source/ui/uiview/viewport.cxx
index e9f5d1a..c62c4bf 100644
--- a/sw/source/ui/uiview/viewport.cxx
+++ b/sw/source/ui/uiview/viewport.cxx
@@ -680,20 +680,26 @@ IMPL_LINK( SwView, ScrollHdl, SwScrollbar *, pScrollbar )
         // so we dont must do it agin.
         EndScrollHdl(pScrollbar);
 
-        Point aPos( m_aVisArea.TopLeft() );
-        lcl_GetPos(this, aPos, pScrollbar, IsDocumentBorder());
+        if ( !m_bWheelScrollInProgress && Help::IsQuickHelpEnabled() &&
+             m_pWrtShell->GetViewOptions()->IsShowScrollBarTips())
+        {
 
-        sal_uInt16 nPhNum = 1;
-        sal_uInt16 nVirtNum = 1;
+            Point aPos( m_aVisArea.TopLeft() );
+            lcl_GetPos(this, aPos, pScrollbar, IsDocumentBorder());
 
-        String sDisplay;
-        if(m_pWrtShell->GetPageNumber( aPos.Y(), sal_False, nPhNum, nVirtNum, sDisplay ))
-        {
+            sal_uInt16 nPhNum = 1;
+            sal_uInt16 nVirtNum = 1;
 
-            //QuickHelp:
-            if( !m_bWheelScrollInProgress && m_pWrtShell->GetPageCnt() > 1 && Help::IsQuickHelpEnabled() )
+            String sDisplay;
+            if(m_pWrtShell->GetPageNumber( aPos.Y(), sal_False, nPhNum, nVirtNum, sDisplay ))
             {
-                if( !nPgNum || nPgNum != nPhNum )
+                // JP 21.07.00: the end scrollhandler invalidate the FN_STAT_PAGE,
+                //                 so we dont must do it agin.
+        //      if(!GetViewFrame()->GetFrame().IsInPlace())
+        //            S F X_BINDINGS().Update(FN_STAT_PAGE);
+
+                //QuickHelp:
+                if( m_pWrtShell->GetPageCnt() > 1 )
                 {
                     Rectangle aRect;
                     aRect.Left() = pScrollbar->GetParent()->OutputToScreenPixel(
@@ -713,11 +719,8 @@ IMPL_LINK( SwView, ScrollHdl, SwScrollbar *, pScrollbar )
                         sPageStr.SearchAndReplaceAll( '\t', ' ' );
                         sPageStr.SearchAndReplaceAll( 0x0a, ' ' );
                     }
-
-                    Help::ShowQuickHelp( pScrollbar, aRect, sPageStr,
-                                    QUICKHELP_RIGHT|QUICKHELP_VCENTER);
+                    nPgNum = nPhNum;
                 }
-                nPgNum = nPhNum;
             }
         }
     }
diff --git a/sw/source/ui/uno/unomod.cxx b/sw/source/ui/uno/unomod.cxx
index bb1115b..05723ab 100644
--- a/sw/source/ui/uno/unomod.cxx
+++ b/sw/source/ui/uno/unomod.cxx
@@ -88,7 +88,8 @@ enum SwViewSettingsPropertyHandles
     HANDLE_VIEWSET_RASTER_SUBDIVISION_X,
     HANDLE_VIEWSET_RASTER_SUBDIVISION_Y,
     HANDLE_VIEWSET_HORI_RULER_METRIC,
-    HANDLE_VIEWSET_VERT_RULER_METRIC
+    HANDLE_VIEWSET_VERT_RULER_METRIC,
+    HANDLE_VIEWSET_SCROLLBAR_TIPS
 };
 
 enum SwPrintSettingsPropertyHandles
@@ -144,6 +145,7 @@ static ChainablePropertySetInfo * lcl_createViewSettingsInfo()
         { RTL_CONSTASCII_STRINGPARAM ( "ShowParaBreaks"),       HANDLE_VIEWSET_PARA_BREAKS          , CPPUTYPE_BOOLEAN, PROPERTY_NONE,  0},
         { RTL_CONSTASCII_STRINGPARAM ( "ShowProtectedSpaces"),  HANDLE_VIEWSET_PROTECTED_SPACES     , CPPUTYPE_BOOLEAN, PROPERTY_NONE,  0},
         { RTL_CONSTASCII_STRINGPARAM ( "ShowRulers"),           HANDLE_VIEWSET_SHOW_RULER           , CPPUTYPE_BOOLEAN, PROPERTY_NONE,  0},
+        { RTL_CONSTASCII_STRINGPARAM ( "ShowScrollBarTips"),    HANDLE_VIEWSET_SCROLLBAR_TIPS       , CPPUTYPE_BOOLEAN, PROPERTY_NONE,  0},
         { RTL_CONSTASCII_STRINGPARAM ( "ShowSoftHyphens"),      HANDLE_VIEWSET_SOFT_HYPHENS         , CPPUTYPE_BOOLEAN, PROPERTY_NONE,  0},
         { RTL_CONSTASCII_STRINGPARAM ( "ShowSpaces"),           HANDLE_VIEWSET_SPACES               , CPPUTYPE_BOOLEAN, PROPERTY_NONE,  0},
         { RTL_CONSTASCII_STRINGPARAM ( "ShowTableBoundaries"),  HANDLE_VIEWSET_TABLE_BOUNDARIES     , CPPUTYPE_BOOLEAN, PROPERTY_NONE,  0},
@@ -635,6 +637,7 @@ void SwXViewSettings::_setSingleValue( const comphelper::PropertyInfo & rInfo, c
         case  HANDLE_VIEWSET_SHOW_CONTENT_TIPS     :   mpViewOption->SetShowContentTips(bVal); break;
         case  HANDLE_VIEWSET_IS_RASTER_VISIBLE     : mpViewOption->SetGridVisible(bVal); break;
         case  HANDLE_VIEWSET_IS_SNAP_TO_RASTER     : mpViewOption->SetSnap(bVal); break;
+        case  HANDLE_VIEWSET_SCROLLBAR_TIPS        : mpViewOption->SetShowScrollBarTips(bVal); break;
         case  HANDLE_VIEWSET_RASTER_RESOLUTION_X   :
         {
             sal_Int32 nTmp = 0;
@@ -862,6 +865,7 @@ void SwXViewSettings::_getSingleValue( const comphelper::PropertyInfo & rInfo, u
         case  HANDLE_VIEWSET_SHOW_CONTENT_TIPS     :   bBoolVal = mpConstViewOption->IsShowContentTips(); break;
         case  HANDLE_VIEWSET_IS_RASTER_VISIBLE     : bBoolVal = mpConstViewOption->IsGridVisible(); break;
         case  HANDLE_VIEWSET_IS_SNAP_TO_RASTER     : bBoolVal = mpConstViewOption->IsSnap(); break;
+        case  HANDLE_VIEWSET_SCROLLBAR_TIPS        : bBoolVal = mpConstViewOption->IsShowScrollBarTips(); break;
         case  HANDLE_VIEWSET_RASTER_RESOLUTION_X   :
             bBool = false;
             rValue <<= (sal_Int32) TWIP_TO_MM100(mpConstViewOption->GetSnapSize().Width());


More information about the Libreoffice-commits mailing list