[Libreoffice-commits] .: 4 commits - officecfg/registry rsc/inc sw/source vcl/inc vcl/source

Cédric Bosdonnat cbosdo at kemper.freedesktop.org
Tue Sep 13 08:30:45 PDT 2011


 officecfg/registry/schema/org/openoffice/Office/Writer.xcs    |   10 -
 officecfg/registry/schema/org/openoffice/Office/WriterWeb.xcs |    8 
 rsc/inc/vclrsc.hxx                                            |    1 
 sw/source/core/layout/paintfrm.cxx                            |   56 +++---
 sw/source/ui/docvw/HeaderFooterWin.cxx                        |   92 +++++-----
 vcl/inc/vcl/symbol.hxx                                        |    1 
 vcl/source/window/decoview.cxx                                |   11 +
 7 files changed, 104 insertions(+), 75 deletions(-)

New commits:
commit f59a7f11665b6ffed1e0b536bd968005a16452e0
Author: Cédric Bosdonnat <cedric.bosdonnat.ooo at free.fr>
Date:   Tue Sep 13 16:08:01 2011 +0200

    Page Break: show the meta-characters by default

diff --git a/officecfg/registry/schema/org/openoffice/Office/Writer.xcs b/officecfg/registry/schema/org/openoffice/Office/Writer.xcs
index c125a92..10ff191 100644
--- a/officecfg/registry/schema/org/openoffice/Office/Writer.xcs
+++ b/officecfg/registry/schema/org/openoffice/Office/Writer.xcs
@@ -1131,7 +1131,7 @@
 						<desc>Determines whether certain settings are applied (display of tab stops, spaces, breaks)</desc>
 						<label>Meta characters</label>
 					</info>
-					<value>false</value>
+					<value>true</value>
 				</prop>
 				<prop oor:name="ParagraphEnd" oor:type="xs:boolean">
 					<!-- OldPath: Writer/Contents/Nonprinting_characters -->
@@ -1142,7 +1142,7 @@
 						<desc>Specifies if paragraph ends are shown on the screen.</desc>
 						<label>Paragraph end</label>
 					</info>
-					<value>false</value>
+					<value>true</value>
 				</prop>
 				<prop oor:name="OptionalHyphen" oor:type="xs:boolean">
 					<!-- OldPath: Writer/Contents/Nonprinting_characters -->
@@ -1164,7 +1164,7 @@
 						<desc>Specifies if spaces are shown on the screen.</desc>
 						<label>Spaces</label>
 					</info>
-					<value>false</value>
+					<value>true</value>
 				</prop>
 				<prop oor:name="ProtectedSpace" oor:type="xs:boolean">
 					<!-- OldPath: Writer/Contents/Nonprinting_characters -->
@@ -1186,7 +1186,7 @@
 						<desc>Specifies if breaks are shown on the screen.</desc>
 						<label>Tabs</label>
 					</info>
-					<value>false</value>
+					<value>true</value>
 				</prop>
 				<prop oor:name="Break" oor:type="xs:boolean">
 					<!-- OldPath: Writer/Contents/Nonprinting_characters -->
@@ -1197,7 +1197,7 @@
 						<desc>Specifies if paragraph ends are shown on the screen.</desc>
 						<label>Breaks</label>
 					</info>
-					<value>false</value>
+					<value>true</value>
 				</prop>
 				<prop oor:name="HiddenText" oor:type="xs:boolean">
 					<!-- OldPath: Writer/Contents/Nonprinting_characters -->
diff --git a/officecfg/registry/schema/org/openoffice/Office/WriterWeb.xcs b/officecfg/registry/schema/org/openoffice/Office/WriterWeb.xcs
index b42c61c..c5f7b1d 100644
--- a/officecfg/registry/schema/org/openoffice/Office/WriterWeb.xcs
+++ b/officecfg/registry/schema/org/openoffice/Office/WriterWeb.xcs
@@ -116,7 +116,7 @@
 						<desc>Determines whether certain settings are applied or not (display of tab stops, spaces, breaks).</desc>
 						<label>Meta characters</label>
 					</info>
-					<value>false</value>
+					<value>true</value>
 				</prop>
 				<prop oor:name="ParagraphEnd" oor:type="xs:boolean">
 					<!-- OldPath: HTML_Editor/Content/Nonprinting_characters -->
@@ -127,7 +127,7 @@
 						<desc>Specifies if paragraph ends are shown on the screen.</desc>
 						<label>Paragraph end</label>
 					</info>
-					<value>false</value>
+					<value>true</value>
 				</prop>
 				<prop oor:name="OptionalHyphen" oor:type="xs:boolean">
 					<!-- OldPath: HTML_Editor/Content/Nonprinting_characters -->
@@ -149,7 +149,7 @@
 						<desc>Specifies if spaces are shown on the screen.</desc>
 						<label>Spaces</label>
 					</info>
-					<value>false</value>
+					<value>true</value>
 				</prop>
 				<prop oor:name="ProtectedSpace" oor:type="xs:boolean">
 					<!-- OldPath: HTML_Editor/Content/Nonprinting_characters -->
@@ -171,7 +171,7 @@
 						<desc>Specifies if breaks are shown on the screen.</desc>
 						<label>Breaks</label>
 					</info>
-					<value>false</value>
+					<value>true</value>
 				</prop>
 			</group>
 			<group oor:name="Highlighting">
commit 59e708a6f2b114b2afb59efc476780dcb987fa8d
Author: Cédric Bosdonnat <cedric.bosdonnat.ooo at free.fr>
Date:   Tue Sep 13 16:07:35 2011 +0200

    Page Break: show/hide them with the line breaks

diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx
index 544d02b..54d2e5d 100755
--- a/sw/source/core/layout/paintfrm.cxx
+++ b/sw/source/core/layout/paintfrm.cxx
@@ -3357,7 +3357,7 @@ void SwPageFrm::PaintBreak( ) const
                 //    * Non-printing characters are shown, as this is more consistent
                 //      with other formatting marks
                 if ( !pGlobalShell->IsShowHeaderFooterSeparator() &&
-                      pGlobalShell->GetViewOptions()->IsShowHiddenChar( ) )
+                      pGlobalShell->GetViewOptions( )->IsLineBreak( ) )
                 {
                     SwRect aRect( pCnt->Prt() );
                     aRect.Pos() += pCnt->Frm().Pos();
commit e88eb733eda4fe3284d366a4cc0d20d3b1c80e85
Author: Cédric Bosdonnat <cedric.bosdonnat.ooo at free.fr>
Date:   Tue Sep 13 15:29:57 2011 +0200

    Header/Footer: handle high contrast mode in Paint method

diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx
index eee5966..544d02b 100755
--- a/sw/source/core/layout/paintfrm.cxx
+++ b/sw/source/core/layout/paintfrm.cxx
@@ -3279,39 +3279,50 @@ drawinglayer::primitive2d::Primitive2DSequence lcl_CreateHeaderFooterSeparatorPr
         const SwPageFrm* pPageFrm, double nLineY )
 {
     // Adjust the Y-coordinate of the line to the header/footer box
-    drawinglayer::primitive2d::Primitive2DSequence aSeq( 2 );
+    drawinglayer::primitive2d::Primitive2DSequence aSeq( 1 );
 
     basegfx::B2DPoint aLeft ( pPageFrm->Frm().Left(), nLineY );
     basegfx::B2DPoint aRight( pPageFrm->Frm().Right(), nLineY );
 
     basegfx::BColor aLineColor = SwViewOption::GetHeaderFooterMarkColor().getBColor();
 
-    // Get a color for the contrast
-    basegfx::BColor aHslLine = basegfx::tools::rgb2hsl( aLineColor );
-    double nLuminance = aHslLine.getZ() * 2.5;
-    if ( nLuminance == 0 )
-        nLuminance = 0.5;
-    else if ( nLuminance >= 1.0 )
-        nLuminance = aHslLine.getZ() * 0.4;
-    aHslLine.setZ( nLuminance );
-    const basegfx::BColor aOtherColor = basegfx::tools::hsl2rgb( aHslLine );
-
-    // Compute the plain line
+    std::vector< double > aStrokePattern;
     basegfx::B2DPolygon aLinePolygon;
     aLinePolygon.append( aLeft );
     aLinePolygon.append( aRight );
 
-    drawinglayer::primitive2d::PolygonHairlinePrimitive2D * pPlainLine =
-        new drawinglayer::primitive2d::PolygonHairlinePrimitive2D(
-                aLinePolygon, aOtherColor );
+    const StyleSettings& rSettings = Application::GetSettings().GetStyleSettings();
+    if ( rSettings.GetHighContrastMode( ) )
+    {
+        // Only a solid line in high contrast mode
+        aLineColor = rSettings.GetDialogTextColor().getBColor();
+    }
+    else
+    {
+        // Get a color for the contrast
+        basegfx::BColor aHslLine = basegfx::tools::rgb2hsl( aLineColor );
+        double nLuminance = aHslLine.getZ() * 2.5;
+        if ( nLuminance == 0 )
+            nLuminance = 0.5;
+        else if ( nLuminance >= 1.0 )
+            nLuminance = aHslLine.getZ() * 0.4;
+        aHslLine.setZ( nLuminance );
+        const basegfx::BColor aOtherColor = basegfx::tools::hsl2rgb( aHslLine );
+
+        // Compute the plain line
+        drawinglayer::primitive2d::PolygonHairlinePrimitive2D * pPlainLine =
+            new drawinglayer::primitive2d::PolygonHairlinePrimitive2D(
+                    aLinePolygon, aOtherColor );
+
+        aSeq[0] = drawinglayer::primitive2d::Primitive2DReference( pPlainLine );
 
-    aSeq[0] = drawinglayer::primitive2d::Primitive2DReference( pPlainLine );
 
+        // Dashed line in twips
+        aStrokePattern.push_back( 40 );
+        aStrokePattern.push_back( 40 );
 
-    // Dashed line in twips
-    std::vector< double > aStrokePattern;
-    aStrokePattern.push_back( 40 );
-    aStrokePattern.push_back( 40 );
+        aSeq.realloc( 2 );
+    }
 
     // Compute the dashed line primitive
     drawinglayer::primitive2d::PolyPolygonStrokePrimitive2D * pLine =
@@ -3320,7 +3331,8 @@ drawinglayer::primitive2d::Primitive2DSequence lcl_CreateHeaderFooterSeparatorPr
                 drawinglayer::attribute::LineAttribute( aLineColor ),
                 drawinglayer::attribute::StrokeAttribute( aStrokePattern ) );
 
-    aSeq[1] = drawinglayer::primitive2d::Primitive2DReference( pLine );
+    aSeq[ aSeq.getLength( ) - 1 ] = drawinglayer::primitive2d::Primitive2DReference( pLine );
+
     return aSeq;
 }
 
diff --git a/sw/source/ui/docvw/HeaderFooterWin.cxx b/sw/source/ui/docvw/HeaderFooterWin.cxx
index edc09d8..1f7bbae 100644
--- a/sw/source/ui/docvw/HeaderFooterWin.cxx
+++ b/sw/source/ui/docvw/HeaderFooterWin.cxx
@@ -79,25 +79,37 @@ namespace
 
     void lcl_DrawBackground( OutputDevice* pOut, const Rectangle& rRect, bool bHeader )
     {
-        // Colors
         basegfx::BColor aLineColor = SwViewOption::GetHeaderFooterMarkColor().getBColor();
-        basegfx::BColor aFillColor = lcl_GetFillColor( aLineColor );
-        basegfx::BColor aLighterColor = lcl_GetLighterGradientColor( aFillColor );
-
-        // Draw the background gradient
-        Gradient aGradient;
-        if ( bHeader )
-            aGradient = Gradient( GRADIENT_LINEAR,
-                   Color( aLighterColor ), Color( aFillColor ) );
-        else
-            aGradient = Gradient( GRADIENT_LINEAR,
-                   Color( aFillColor ), Color( aLighterColor ) );
 
-        pOut->DrawGradient( rRect, aGradient );
+        const StyleSettings& rSettings = Application::GetSettings().GetStyleSettings();
+        if ( rSettings.GetHighContrastMode() )
+        {
+            aLineColor = rSettings.GetDialogTextColor().getBColor();
 
-        pOut->SetFillColor( Color ( aFillColor ) );
-        pOut->SetLineColor( Color ( aFillColor ) );
+            pOut->SetFillColor( rSettings.GetDialogColor( ) );
+            pOut->SetLineColor( rSettings.GetDialogTextColor( ) );
 
+            pOut->DrawRect( rRect );
+        }
+        else
+        {
+            // Colors
+            basegfx::BColor aFillColor = lcl_GetFillColor( aLineColor );
+            basegfx::BColor aLighterColor = lcl_GetLighterGradientColor( aFillColor );
+            // Draw the background gradient
+            Gradient aGradient;
+            if ( bHeader )
+                aGradient = Gradient( GRADIENT_LINEAR,
+                       Color( aLighterColor ), Color( aFillColor ) );
+            else
+                aGradient = Gradient( GRADIENT_LINEAR,
+                       Color( aFillColor ), Color( aLighterColor ) );
+
+            pOut->DrawGradient( rRect, aGradient );
+
+            pOut->SetFillColor( Color ( aFillColor ) );
+            pOut->SetLineColor( Color ( aFillColor ) );
+        }
 
         // Draw the lines around the rect
         pOut->SetLineColor( Color( aLineColor ) );
@@ -203,7 +215,10 @@ void SwHeaderFooterWin::Paint( const Rectangle& )
     GetTextBoundRect( aTextRect, String( m_sLabel ) );
     Point aTextPos = aTextRect.TopLeft() + Point( TEXT_PADDING, 0 );
 
+    const StyleSettings& rSettings = Application::GetSettings().GetStyleSettings();
     basegfx::BColor aLineColor = SwViewOption::GetHeaderFooterMarkColor().getBColor();
+    if ( rSettings.GetHighContrastMode( ) )
+        aLineColor = rSettings.GetDialogTextColor().getBColor();
     SetTextColor( Color( aLineColor ) );
     DrawText( aTextPos, String( m_sLabel ) );
 
commit 883991e8470075be1ade56595a90040d1ad64f6c
Author: Cédric Bosdonnat <cedric.bosdonnat.ooo at free.fr>
Date:   Tue Sep 13 14:42:17 2011 +0200

    Header/Footer: use a plus symbol instead of the add icon
    
    This will help drawing the high contrast mode and makes the plus more
    visible even given the background color.

diff --git a/rsc/inc/vclrsc.hxx b/rsc/inc/vclrsc.hxx
index 2189340..0fe026e 100644
--- a/rsc/inc/vclrsc.hxx
+++ b/rsc/inc/vclrsc.hxx
@@ -168,6 +168,7 @@ typedef sal_uInt16 SymbolType;
 #define SYMBOL_DOCK             ((SymbolType)32)
 #define SYMBOL_HIDE             ((SymbolType)33)
 #define SYMBOL_HELP             ((SymbolType)34)
+#define SYMBOL_PLUS             ((SymbolType)35)
 
 #define SYMBOL_NOSYMBOL         (SYMBOL_DONTKNOW)
 
diff --git a/sw/source/ui/docvw/HeaderFooterWin.cxx b/sw/source/ui/docvw/HeaderFooterWin.cxx
index 6f59189..edc09d8 100644
--- a/sw/source/ui/docvw/HeaderFooterWin.cxx
+++ b/sw/source/ui/docvw/HeaderFooterWin.cxx
@@ -214,36 +214,25 @@ void SwHeaderFooterWin::Paint( const Rectangle& )
         Size aPicSize( BUTTON_WIDTH, aRect.getHeight() );
         Rectangle aSymbolRect( aPicPos, aPicSize );
 
+        // 25% distance to the left and right button border
+        const long nBorderDistanceLeftAndRight = ((aSymbolRect.GetWidth()*250)+500)/1000;
+        aSymbolRect.Left()+=nBorderDistanceLeftAndRight;
+        aSymbolRect.Right()-=nBorderDistanceLeftAndRight;
+        // 30% distance to the top button border
+        const long nBorderDistanceTop = ((aSymbolRect.GetHeight()*300)+500)/1000;
+        aSymbolRect.Top()+=nBorderDistanceTop;
+        // 25% distance to the bottom button border
+        const long nBorderDistanceBottom = ((aSymbolRect.GetHeight()*250)+500)/1000;
+        aSymbolRect.Bottom()-=nBorderDistanceBottom;
+
+        SymbolType nSymbol = SYMBOL_SPIN_DOWN;
         if ( IsEmptyHeaderFooter( ) )
-        {
-            SvtResId id( BMP_LIST_ADD );
-            Image aPlusImg( id );
-            Size aSize = aPlusImg.GetSizePixel();
-            Point aPt = aSymbolRect.TopLeft();
-            long nXOffset = ( aSymbolRect.GetWidth() - aSize.Width() ) / 2;
-            long nYOffset = ( aSymbolRect.GetHeight() - aSize.Height() ) / 2;
-            aPt += Point( nXOffset, nYOffset );
-            DrawImage(aPt, aPlusImg);
-        }
-        else
-        {
-            // 25% distance to the left and right button border
-            const long nBorderDistanceLeftAndRight = ((aSymbolRect.GetWidth()*250)+500)/1000;
-            aSymbolRect.Left()+=nBorderDistanceLeftAndRight;
-            aSymbolRect.Right()-=nBorderDistanceLeftAndRight;
-            // 30% distance to the top button border
-            const long nBorderDistanceTop = ((aSymbolRect.GetHeight()*300)+500)/1000;
-            aSymbolRect.Top()+=nBorderDistanceTop;
-            // 25% distance to the bottom button border
-            const long nBorderDistanceBottom = ((aSymbolRect.GetHeight()*250)+500)/1000;
-            aSymbolRect.Bottom()-=nBorderDistanceBottom;
-
-            DecorationView aDecoView( this );
-            aDecoView.DrawSymbol( aSymbolRect, SYMBOL_SPIN_DOWN,
-                                  ( Application::GetSettings().GetStyleSettings().GetHighContrastMode()
-                                    ? Color( COL_WHITE )
-                                    : Color( COL_BLACK ) ) );
-        }
+            nSymbol = SYMBOL_PLUS;
+        DecorationView aDecoView( this );
+        aDecoView.DrawSymbol( aSymbolRect, nSymbol,
+                              ( Application::GetSettings().GetStyleSettings().GetHighContrastMode()
+                                ? Color( COL_WHITE )
+                                : Color( COL_BLACK ) ) );
     }
 }
 
diff --git a/vcl/inc/vcl/symbol.hxx b/vcl/inc/vcl/symbol.hxx
index c03bf9a..f15a399 100644
--- a/vcl/inc/vcl/symbol.hxx
+++ b/vcl/inc/vcl/symbol.hxx
@@ -72,6 +72,7 @@ typedef sal_uInt16 SymbolType;
 #define SYMBOL_DOCK             ((SymbolType)32)
 #define SYMBOL_HIDE             ((SymbolType)33)
 #define SYMBOL_HELP             ((SymbolType)34)
+#define SYMBOL_PLUS             ((SymbolType)35)
 #define SYMBOL_MENU             SYMBOL_SPIN_DOWN
 
 #define SYMBOL_NOSYMBOL         (SYMBOL_DONTKNOW)
diff --git a/vcl/source/window/decoview.cxx b/vcl/source/window/decoview.cxx
index 125c927..ba41187 100644
--- a/vcl/source/window/decoview.cxx
+++ b/vcl/source/window/decoview.cxx
@@ -566,6 +566,17 @@ static void ImplDrawSymbol( OutputDevice* pDev, const Rectangle& rRect,
             pDev->DrawRect( aRect );
             }
             break;
+
+        case SYMBOL_PLUS:
+            {
+            nLeft = nCenterX-n2;
+            nRight = nCenterX+n2;
+            nTop = nCenterY-n2;
+            nBottom = nCenterY+n2;
+            pDev->DrawRect( Rectangle( nLeft, nCenterY - 1, nRight, nCenterY + 1 ) );
+            pDev->DrawRect( Rectangle( nCenterX - 1, nTop, nCenterX + 1, nBottom ) );
+            }
+            break;
     }
 }
 


More information about the Libreoffice-commits mailing list