[ooo-build-commit] Branch 'ooo-build-3-1-1' - 2 commits - patches/dev300

Thorsten Behrens thorsten at kemper.freedesktop.org
Sat Sep 19 15:02:38 PDT 2009


 patches/dev300/apply                       |    3 
 patches/dev300/sd-layoutcode.diff          |  275 +++++++++++++++++++++++++++--
 patches/dev300/svg-import-opacity-fix.diff |  153 ++++++++++++++++
 3 files changed, 419 insertions(+), 12 deletions(-)

New commits:
commit e43be3327f9ee193d09f0365607469f849846d04
Author: Thorsten Behrens <tbehrens at novell.com>
Date:   Sat Sep 19 20:55:37 2009 +0200

    Add handling of svg opacity attribute
    
    * patches/dev300/apply: added patch
    * patches/dev300/svg-import-opacity-fix.diff: handling of opacity
      was missing completely (only fill/stroke-opacity was handled as
      of now)

diff --git a/patches/dev300/apply b/patches/dev300/apply
index 2c4ea86..9dc7a94 100644
--- a/patches/dev300/apply
+++ b/patches/dev300/apply
@@ -2369,6 +2369,9 @@ svg-import-textimport.diff, thorsten
 # fixing relative size calculation
 svg-import-convlength-fix.diff, cmc
 
+# fixing handling of opacity attribute
+svg-import-opacity-fix.diff, thorsten
+
 [ NovellLikeOnlyWin32 ]
 novell-win32-msi-patchability.diff, tml
 
diff --git a/patches/dev300/svg-import-opacity-fix.diff b/patches/dev300/svg-import-opacity-fix.diff
new file mode 100644
index 0000000..9389b67
--- /dev/null
+++ b/patches/dev300/svg-import-opacity-fix.diff
@@ -0,0 +1,153 @@
+Actually handling global svg opacity now
+
+From: Thorsten Behrens <thb at openoffice.org>
+
+
+---
+
+ filter/source/svg/gfxtypes.hxx  |    2 ++
+ filter/source/svg/svgreader.cxx |   38 ++++++++++++++++++++++----------------
+ 2 files changed, 24 insertions(+), 16 deletions(-)
+
+
+diff --git filter/source/svg/gfxtypes.hxx filter/source/svg/gfxtypes.hxx
+index bdf66af..79d73d4 100644
+--- filter/source/svg/gfxtypes.hxx
++++ filter/source/svg/gfxtypes.hxx
+@@ -174,6 +174,7 @@ struct State
+         mbVisibility(true),
+         meFillType(SOLID),
+         mnFillOpacity(1.0),
++        mnOpacity(1.0),
+         meStrokeType(NONE),
+         mnStrokeOpacity(1.0),
+         meViewportFillType(NONE),
+@@ -220,6 +221,7 @@ struct State
+ 
+     PaintType                   meFillType;
+     double                      mnFillOpacity;
++    double                      mnOpacity;
+     PaintType                   meStrokeType;
+     double                      mnStrokeOpacity;
+     PaintType                   meViewportFillType;
+diff --git filter/source/svg/svgreader.cxx filter/source/svg/svgreader.cxx
+index 1e4570c..8a33745 100644
+--- filter/source/svg/svgreader.cxx
++++ filter/source/svg/svgreader.cxx
+@@ -519,12 +519,12 @@ struct AnnotatingVisitor
+                                       rtl::OUString::valueOf(
+                                           maGradientStopVector[
+                                               rState.maFillGradient.maStops[0]].maStopColor.a*
+-                                          maCurrState.mnFillOpacity*100.0)+USTR("%" ) );
++                                          maCurrState.mnFillOpacity*maCurrState.mnOpacity*100.0)+USTR("%" ) );
+                 xAttrs->AddAttribute( USTR( "draw:start" ), 
+                                       rtl::OUString::valueOf(
+                                           maGradientStopVector[
+                                               rState.maFillGradient.maStops[1]].maStopColor.a*
+-                                          maCurrState.mnFillOpacity*100.0)+USTR("%" ) );
++                                          maCurrState.mnFillOpacity*maCurrState.mnOpacity*100.0)+USTR("%" ) );
+                 xAttrs->AddAttribute( USTR( "draw:border" ), USTR("0%") );
+                 mxDocumentHandler->startElement( USTR("draw:opacity"), 
+                                                  xUnoAttrs );
+@@ -616,17 +616,17 @@ struct AnnotatingVisitor
+                         xAttrs->AddAttribute( USTR( "draw:opacity-name" ), 
+                                               getStyleName("svgopacity", rState.maFillGradient.mnId) );
+                     }
+-                    else if( maCurrState.mnFillOpacity != 1.0 )
++                    else if( maCurrState.mnFillOpacity*maCurrState.mnOpacity != 1.0 )
+                         xAttrs->AddAttribute( USTR( "draw:opacity" ), 
+-                                              rtl::OUString::valueOf(100.0*maCurrState.mnFillOpacity)+USTR("%") );
++                                              rtl::OUString::valueOf(100.0*maCurrState.mnFillOpacity*maCurrState.mnOpacity)+USTR("%") );
+                 }
+                 else
+                 {
+                     xAttrs->AddAttribute( USTR( "draw:fill" ), USTR("solid"));
+                     xAttrs->AddAttribute( USTR( "draw:fill-color" ), getOdfColor(rState.maFillColor));
+-                    if( maCurrState.mnFillOpacity != 1.0 )
++                    if( maCurrState.mnFillOpacity*maCurrState.mnOpacity != 1.0 )
+                         xAttrs->AddAttribute( USTR( "draw:opacity" ), 
+-                                              rtl::OUString::valueOf(100.0*maCurrState.mnFillOpacity)+USTR("%") );
++                                              rtl::OUString::valueOf(100.0*maCurrState.mnFillOpacity*maCurrState.mnOpacity)+USTR("%") );
+                 }
+             }
+             else
+@@ -652,9 +652,9 @@ struct AnnotatingVisitor
+                 xAttrs->AddAttribute( USTR( "draw:stroke-linejoin"), USTR("round"));
+             else if( maCurrState.meLineJoin == basegfx::B2DLINEJOIN_BEVEL )
+                 xAttrs->AddAttribute( USTR( "draw:stroke-linejoin"), USTR("bevel"));
+-            if( maCurrState.mnStrokeOpacity != 1.0 )
++            if( maCurrState.mnStrokeOpacity*maCurrState.mnOpacity != 1.0 )
+                 xAttrs->AddAttribute( USTR("svg:stroke-opacity"), 
+-                                      rtl::OUString::valueOf(100.0*maCurrState.mnStrokeOpacity)+USTR("%"));
++                                      rtl::OUString::valueOf(100.0*maCurrState.mnStrokeOpacity*maCurrState.mnOpacity)+USTR("%"));
+         }
+ 
+         mxDocumentHandler->startElement( USTR("style:graphic-properties"), 
+@@ -876,6 +876,12 @@ struct AnnotatingVisitor
+                     maCurrState.meFillRule = maParentStates.back().meFillRule;
+                 break;
+             }
++            case XML_OPACITY:
++                if( aValueUtf8 == "inherit" )
++                    maCurrState.mnOpacity = maParentStates.back().mnOpacity;
++                else
++                    maCurrState.mnOpacity = aValueUtf8.toDouble();
++                break;
+             case XML_FILL_OPACITY:
+                 if( aValueUtf8 == "inherit" )
+                     maCurrState.mnFillOpacity = maParentStates.back().mnFillOpacity;
+@@ -2540,13 +2546,13 @@ struct ShapeRenderingVisitor
+                 const BYTE	cTransStart( 255-
+                     basegfx::fround(mrGradientStopVector[
+                                         aState.maFillGradient.maStops[1]].maStopColor.a*
+-                                    aState.mnFillOpacity*255.0));
++                                    aState.mnFillOpacity*maCurrState.mnOpacity*255.0));
+                 const Color aTransStart( cTransStart, cTransStart, cTransStart );
+ 
+                 const BYTE	cTransEnd( 255-
+                     basegfx::fround(mrGradientStopVector[
+                                         aState.maFillGradient.maStops[0]].maStopColor.a*
+-                                    aState.mnFillOpacity*255.0));
++                                    aState.mnFillOpacity*maCurrState.mnOpacity*255.0));
+                 const Color aTransEnd( cTransEnd, cTransEnd, cTransEnd );
+ 
+                 // modulate gradient opacity with overall fill opacity
+@@ -2594,10 +2600,10 @@ struct ShapeRenderingVisitor
+             else
+                 mrOutDev.SetFillColor(getVclColor(aState.maFillColor));
+ 
+-            if( aState.mnFillOpacity != 1.0 )
++            if( aState.mnFillOpacity*maCurrState.mnOpacity != 1.0 )
+                 mrOutDev.DrawTransparent(::PolyPolygon(aPoly),
+                                          basegfx::fround(
+-                                             (1.0-aState.mnFillOpacity)*100.0));
++                                             (1.0-(aState.mnFillOpacity*maCurrState.mnOpacity))*100.0));
+             else
+                 mrOutDev.DrawPolyPolygon(::PolyPolygon(aPoly));
+         }
+@@ -2652,10 +2658,10 @@ struct ShapeRenderingVisitor
+ 
+             for( sal_uInt32 i=0; i<aPolys.size(); ++i )
+             {
+-                if( aState.mnStrokeOpacity != 1.0 )
++                if( aState.mnStrokeOpacity*maCurrState.mnOpacity != 1.0 )
+                     mrOutDev.DrawTransparent(::PolyPolygon(aPolys[i]),
+                                              basegfx::fround(
+-                                                 (1.0-aState.mnStrokeOpacity)*100.0));
++                                                 (1.0-(aState.mnStrokeOpacity*maCurrState.mnOpacity))*100.0));
+                 else
+                     mrOutDev.DrawPolyPolygon(::PolyPolygon(aPolys[i]));
+ 
+@@ -2675,10 +2681,10 @@ struct ShapeRenderingVisitor
+             else
+                 mrOutDev.SetLineColor(getVclColor(aState.maStrokeColor));
+ 
+-            if( aState.mnStrokeOpacity != 1.0 )
++            if( aState.mnStrokeOpacity*maCurrState.mnOpacity != 1.0 )
+                 mrOutDev.DrawTransparent(::PolyPolygon(aPoly),
+                                          basegfx::fround(
+-                                             (1.0-aState.mnStrokeOpacity)*100.0));
++                                             (1.0-(aState.mnStrokeOpacity*maCurrState.mnOpacity))*100.0));
+             else
+                 mrOutDev.DrawPolyPolygon(::PolyPolygon(aPoly));
+         }
commit 73182eed6a5f6d5988c0565ae2ead9b9f09d143e
Author: Thorsten Behrens <tbehrens at novell.com>
Date:   Sat Sep 19 10:00:37 2009 +0200

    Update from code.google.com, latest version from cocofan
    
    * patches/dev300/sd-layoutcode.diff:

diff --git a/patches/dev300/sd-layoutcode.diff b/patches/dev300/sd-layoutcode.diff
index 4919aa6..ac7b746 100644
--- a/patches/dev300/sd-layoutcode.diff
+++ b/patches/dev300/sd-layoutcode.diff
@@ -619,7 +619,7 @@ diff -Nrup sd-m16/inc/pres.hxx sd/inc/pres.hxx
  	PK_STANDARD,
 diff -Nrup sd-m16/inc/sdpage.hxx sd/inc/sdpage.hxx
 --- sd-m16/inc/sdpage.hxx	2009-07-25 19:24:39.000000000 -0700
-+++ sd/inc/sdpage.hxx	2009-07-31 00:10:16.000000000 -0700
++++ sd/inc/sdpage.hxx	2009-08-06 18:01:33.000000000 -0700
 @@ -45,6 +45,8 @@
  #include <list>
  #include <functional>
@@ -3115,6 +3115,237 @@ diff -Nrup sd-m16/source/core/layouttype.cxx sd/source/core/layouttype.cxx
 +}
 +
 +
+diff -Nrup sd-m16/source/core/layouttype.hxx sd/source/core/layouttype.hxx
+--- sd-m16/source/core/layouttype.hxx	1969-12-31 16:00:00.000000000 -0800
++++ sd/source/core/layouttype.hxx	2009-08-09 22:22:34.000000000 -0700
+@@ -0,0 +1,227 @@
++/*************************************************************************
++ *
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ * 
++ * Copyright 2008 by Sun Microsystems, Inc.
++ *
++ * OpenOffice.org - a multi-platform office productivity suite
++ *
++ * $RCSfile: layouttype.hxx,v $
++ * $Revision: 0.1 $
++ *
++ * This file is part of OpenOffice.org.
++ *
++ * OpenOffice.org is free software: you can redistribute it and/or modify
++ * it under the terms of the GNU Lesser General Public License version 3
++ * only, as published by the Free Software Foundation.
++ *
++ * OpenOffice.org is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++ * GNU Lesser General Public License version 3 for more details
++ * (a copy is included in the LICENSE file that accompanied this code).
++ *
++ * You should have received a copy of the GNU Lesser General Public License
++ * version 3 along with OpenOffice.org.  If not, see
++ * <http://www.openoffice.org/license.html>
++ * for a copy of the LGPLv3 License.
++ *
++ ************************************************************************/
++
++
++#ifndef _LAYOUTTYPE_HXX
++#define _LAYOUTTYPE_HXX
++
++#include <vector>
++#include <cppuhelper/implbase1.hxx>
++
++#include <com/sun/star/text/WritingMode.hpp>
++#include "sal/types.h"
++#include "tools/string.hxx"
++#include "tools/gen.hxx"
++#include "pres.hxx"
++#include <sax/fshelper.hxx>
++#include <com/sun/star/uno/Reference.hxx>
++#include <com/sun/star/xml/dom/XDocumentBuilder.hpp>
++
++
++
++using ::com::sun::star::uno::Reference;
++using namespace ::com::sun::star::xml;
++using namespace ::com::sun::star::text;
++using namespace ::sax_fastparser;
++
++namespace sd {
++  
++   typedef String LString;
++
++   /** RectType determines which
++    *  standard rectangle to use
++    *  to calculate bounding rects
++    *  and also determine the factors
++    *  used to calculate the custom
++    *  rects.
++    */
++    
++   enum RectType {
++	   RT_TITLE,  // a non-vertical title
++	   RT_VERTICAL_TITLE, // a vertical title
++	   RT_LAYOUT,  // a non-vertical non-title shape
++	   RT_VERTICAL_LAYOUT, // a vertical non-title shape
++	   RT_TEXT_ONLY, // for the text only layout
++	   RT_LAYOUT_SWITCH, // use if shapes need switching
++	                    // for right to left writing
++	   RT_MAX
++   };
++
++   /** ElemType defines the information for
++    *  one element (or pres. object) in
++    *  a layout.
++    */
++    
++   typedef struct {
++      PresObjKind kind;  // the type of pres. object
++	  bool isVertical;   // whether to make this obj. vertical
++	  double factorX;    // factor for calculating topleft x value
++                         //      X = Xstandard + WidthStandard*factorX
++	  double factorY;    // factor for calculating topleft y value
++                         //      Y = Ystandard + HeightStandard*factorY
++	  double factorHt;   // factor for calculating height
++                         //      Height = HeightStandard*factorHt
++	  double factorWt;   // factor for calculating width
++                         //      Width = WidthStandard*factorWt
++	  RectType recttype; // type of standard rect to use
++                         // for calculating rects.
++   } ElemType;
++	
++   /** LayoutType represents the information for one autolayout 
++    */
++   
++   class LayoutType
++   {
++   public:
++	   LayoutType();
++	   ~LayoutType();
++       
++      /** functions for writing this layout to a xml configuration file */
++       void writeLayoutToFile(FastSerializerHelper& fsh, sal_Int32 autolayout);
++       void writeElementTofile(FastSerializerHelper& fsh,
++                               const sal_uInt32 i,
++                               const char* sNumber,
++                               const ElemType* elem);
++
++      /** functions for reading this layout in from a xml configuration
++       *  file.  Passes back index to the layout list.
++       */ 
++       sal_Int32 getIntValue(const Reference<dom::XNode>& node);
++       double getDoubleValue(const Reference<dom::XNode>& node);
++       sal_Int32 readLayoutFromFile(const Reference<dom::XNode>& node);
++		
++		/** get functions for variables 
++         *  other than elements 
++         */
++	   LString getName();
++       sal_Int32 getStrId();
++	   WritingMode getWritingMode();
++	   sal_uInt32 getHBitmapId();
++	   sal_uInt32 getLBitmapId();
++       PageKind getPageKind();
++	   
++	   /** get functions for elements by index
++	    * and element list functions
++        */
++	   ElemType* getElemByIndex(const sal_uInt32& nIndex);
++	   sal_uInt32 length();
++	   PresObjKind getPresKind(const sal_uInt32& nIndex);
++	   bool isVertical(const sal_uInt32& nIndex);
++	   double factorX(const sal_uInt32& nIndex);
++	   double factorY(const sal_uInt32& nIndex);
++	   double factorHt(const sal_uInt32& nIndex);
++	   double factorWt(const sal_uInt32& nIndex);
++	   RectType recttype(const sal_uInt32& nIndex);
++	   
++	   /** set functions for variables other
++        *  than elements.
++        */
++        
++	   void setName(const LString& sName);
++       void setStrId(const sal_Int32 id);
++	   void setWritingMode(const WritingMode& wmode);
++	   void setHBitmapId(const sal_uInt32& id);
++	   void setLBitmapId(const sal_uInt32& id);
++       void setPageKind(const PageKind& kind);
++
++	   
++	   /** set functions for elements and list
++        */
++        
++	   void createDefaultElement();
++	   void setPresKind(const sal_uInt32& nIndex, PresObjKind nKind);
++	   void setVertical(const sal_uInt32& nIndex, bool bVertical);
++	   void setFactorX(const sal_uInt32& nIndex, double fx);
++	   void setFactorY(const sal_uInt32& nIndex, double fy);
++	   void setFactorHt(const sal_uInt32& nIndex, double ht);
++	   void setFactorWt(const sal_uInt32& nIndex, double wt);
++	   void setRecttype(const sal_uInt32& nIndex, RectType rect);
++       /** add a passed in element to the list */
++	   void addElemToList(ElemType& rElement);
++	   /** deletes element and also removes from list */
++	   void deleteElement(const sal_uInt32& nIndex);
++	   
++	   /** sets the bounding rectangle information
++	    *  for a custom layout.  rRect is the actual
++		*  rectangle from the pres object. rStandard
++		*  is the generic title or layout rectangle.
++		*  For all titles, use RT_TITLE
++		*  and pass in the generic title rect.
++		*  For all else, use RT_LAYOUT,
++		*  (or RT_LAYOUT_SWITCH if a switching of 
++		*  rectangles is needed for right to left
++		*  writing) and pass in a generic layout rect.
++		*/
++	   void setCustomRectInfo(const sal_uInt32& nIndex, 
++                              const RectType& rType,
++                              const Rectangle& rRect,
++			      const Rectangle& rStandard);
++                              
++        /** call this to calculation the bounding rectangles for
++         *  the elements in a layout
++         */
++       void calcAutoLayoutRectangles( const Rectangle& aTitleRect,
++                                      const Rectangle& aLayoutRect,
++				      const Size& aPageSize,
++				      const bool& bRightToLeft,
++				      Rectangle* pRectangle );
++                                      
++        /** initialize the rectInfo for builtin 
++         *  layout elements.
++         *  These functions may not be
++         *  needed after the configuration
++         *  file code is done. 
++         */
++		
++	   void initializeRectInfo(const sal_uInt32& nLayout);
++	   void initFromLayoutNumber(ElemType* elem,
++                                 const sal_uInt32& i,
++                                 const sal_uInt32& nLayout);									  
++	   
++   private: 
++	   LString name;  // String name of the layout
++           sal_Int32 nStrId;  // resource id for the string.
++	   WritingMode nWritingMode; // righttoleft or toptobottom
++	   sal_uInt32 nHBitmapId;  // resource id for the High Contrast? Bitmap
++	   sal_uInt32 nLBitmapId;  // resource id for the Low contrast? Bitmap
++           PageKind nPageKind;  // the page kind for this layout (PK_STANDARD, PK_NOTES, PK_HANDOUT)
++       
++           // list of elements which the pres. objects will be
++           // from for this layout.
++	   typedef std::vector< ElemType* > ListImpl;
++	   ListImpl elemList;
++	   
++	   
++   }; // Class LayoutType
++	
++} //namespace sd
++
++#endif	   // _LAYOUTTYPE_HXX
++
 diff -Nrup sd-m16/source/core/makefile.mk sd/source/core/makefile.mk
 --- sd-m16/source/core/makefile.mk	2009-07-25 19:25:13.000000000 -0700
 +++ sd/source/core/makefile.mk	2009-07-31 00:10:17.000000000 -0700
@@ -3129,7 +3360,7 @@ diff -Nrup sd-m16/source/core/makefile.mk sd/source/core/makefile.mk
  		   $(SLO)$/sdattr.obj \
 diff -Nrup sd-m16/source/core/sdpage.cxx sd/source/core/sdpage.cxx
 --- sd-m16/source/core/sdpage.cxx	2009-07-25 19:25:13.000000000 -0700
-+++ sd/source/core/sdpage.cxx	2009-07-31 00:10:16.000000000 -0700
++++ sd/source/core/sdpage.cxx	2009-08-06 18:01:31.000000000 -0700
 @@ -1058,261 +1058,10 @@ Rectangle SdPage::GetLayoutRect() const
  |*
  \*************************************************************************/
@@ -3651,6 +3882,14 @@ diff -Nrup sd-m16/source/core/sdpage.cxx sd/source/core/sdpage.cxx
  }
  
  /*************************************************************************
+@@ -2918,6 +2720,7 @@ bool SdPage::RestoreDefaultText( SdrObje
+ 	return bRet;
+ }
+ 
++
+ void SdPage::CalculateHandoutAreas( SdDrawDocument& rModel, AutoLayout eLayout, bool bHorizontal, std::vector< Rectangle >& rAreas )
+ {
+ 	SdPage& rHandoutMaster = *rModel.GetMasterSdPage( 0, PK_HANDOUT );
 diff -Nrup sd-m16/source/filter/ppt/pptin.cxx sd/source/filter/ppt/pptin.cxx
 --- sd-m16/source/filter/ppt/pptin.cxx	2009-07-25 19:25:17.000000000 -0700
 +++ sd/source/filter/ppt/pptin.cxx	2009-07-31 00:10:17.000000000 -0700
@@ -3889,16 +4128,19 @@ diff -Nrup sd-m16/source/ui/toolpanel/LayoutMenu.cxx sd/source/ui/toolpanel/Layo
  LayoutMenu::LayoutMenu (
      TreeNode* pParent,
      DrawDocShell& rDocumentShell,
-@@ -763,43 +670,77 @@ void LayoutMenu::Fill (void)
+@@ -763,43 +670,89 @@ void LayoutMenu::Fill (void)
      catch (RuntimeException&)
      {}
      
 -	snewfoil_value_info* pInfo = NULL;
++    // Get layoutlist 
 +    LayoutList* list = GetLayoutList();
 +	PageKind eMenu;
 +	bool aViewExists = true;
 +	LayoutType* layout;
 +
++    // determine which view (PageKind) so we can set the right
++    // menu
      if (sCenterPaneViewName.equals(framework::FrameworkHelper::msNotesViewURL))
      {
 -        pInfo = notes;
@@ -3922,6 +4164,7 @@ diff -Nrup sd-m16/source/ui/toolpanel/LayoutMenu.cxx sd/source/ui/toolpanel/Layo
 +		aViewExists = false;
  	}
  
++   
      Clear();
 -    int n = 0;
 -	for (sal_uInt16 i=1; pInfo!=NULL&&pInfo->mnBmpResId!=0; i++,pInfo++)
@@ -3950,37 +4193,45 @@ diff -Nrup sd-m16/source/ui/toolpanel/LayoutMenu.cxx sd/source/ui/toolpanel/Layo
 +    
 +	sal_uInt32 size = list->getMenuLength(eMenu);
 +	
++    // for each entry in the menu order list
 +	index = 1;
 +	if (aViewExists) {
 +	   for (sal_uInt16 i=0; i < size; i++)
 +	   {
++           // get the LayoutType for this menu entry
 +		   layout = list->getLayoutAtMenuIndex(i,eMenu);
-+		   if(layout) 
++		   if(layout) // some layouts can be NULL
 +		   {
-+		      name = layout->getName();
-+		      lnum = list->getLayoutIndex(name);
-+			  if(lnum == LL_NOT_FOUND)
++		      name = layout->getName();  // get string name
++		      lnum = list->getLayoutIndex(name); // get index in list
++			  if(lnum == LL_NOT_FOUND) // no layout at this index, so skip
 +              {
 +                 continue;
 +              }
-+              resId = layout->getStrId();
++              resId = layout->getStrId(); // get resource ID string if there
 +              if(resId != -1) // if it has an ID, pull string from resource.
 +              {
 +                  name = SdResId(resId);
 +              }
-+	          wm = layout->getWritingMode();
++	          wm = layout->getWritingMode();  
 +		      Hbitmap = layout->getHBitmapId();
-+		      Lbitmap = layout->getLBitmapId(); 
++		      Lbitmap = layout->getLBitmapId();
++              // if its vertical but not Right to Left
 +		      if((wm != WritingMode_TB_RL) || bVertical)
 +		      {
++                  // set which bitmap for the icon to use.
 +		         BitmapEx aBmp (SdResId (bHighContrast 
 +                               ? Hbitmap
 +                              : Lbitmap));
++                // need to reverse the bitmap image for right to left
 +		         if(bRightToLeft && (wm != WritingMode_TB_RL))
 +		            aBmp.Mirror(BMP_MIRROR_HORZ);
++                  // insert into the menu
 +		          InsertItem (index, aBmp, name);
++                  // set the index into the layout list to
++                  // be passed back to SdPage.
 +                  SetItemData (index, new AutoLayout(lnum));
-+                  index++;
++                  index++; // go to next menu item
 +		       
 +		      } //if wm...
 +	       } //if layout..
@@ -3989,7 +4240,7 @@ diff -Nrup sd-m16/source/ui/toolpanel/LayoutMenu.cxx sd/source/ui/toolpanel/Layo
  
      mbSelectionUpdatePending = true;
  }
-@@ -904,9 +845,7 @@ void LayoutMenu::UpdateSelection (void)
+@@ -904,9 +857,7 @@ void LayoutMenu::UpdateSelection (void)
  
          // Get layout of current page.
          AutoLayout aLayout (pCurrentPage->GetAutoLayout());


More information about the ooo-build-commit mailing list