[Libreoffice-commits] .: Branch 'distro/suse/suse-3.6.3' - 12 commits - chart2/source oox/source sc/inc sc/qa sc/source sd/source sw/inc sw/source vcl/inc vcl/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Thu Dec 13 12:13:52 PST 2012


 chart2/source/controller/dialogs/res_DataLabel.cxx           |    9 -
 chart2/source/controller/main/ChartController_Properties.cxx |    2 
 chart2/source/view/charttypes/PieChart.cxx                   |   10 -
 oox/source/vml/vmlshape.cxx                                  |    8 
 oox/source/vml/vmltextboxcontext.cxx                         |    8 
 sc/inc/dpsave.hxx                                            |    2 
 sc/qa/unit/ucalc.cxx                                         |   29 +++
 sc/source/core/data/dpobject.cxx                             |   12 +
 sc/source/core/data/dpsave.cxx                               |   37 ++++
 sc/source/ui/view/dbfunc3.cxx                                |   43 ----
 sd/source/ui/view/sdview4.cxx                                |    2 
 sw/inc/iodetect.hxx                                          |    3 
 sw/source/core/doc/notxtfrm.cxx                              |    2 
 sw/source/core/inc/cellfrm.hxx                               |    2 
 sw/source/core/inc/flyfrm.hxx                                |    2 
 sw/source/core/inc/frame.hxx                                 |    2 
 sw/source/core/inc/layfrm.hxx                                |    2 
 sw/source/core/inc/notxtfrm.hxx                              |    2 
 sw/source/core/inc/pagefrm.hxx                               |    2 
 sw/source/core/inc/rootfrm.hxx                               |    2 
 sw/source/core/inc/txtfrm.hxx                                |    2 
 sw/source/core/layout/trvlfrm.cxx                            |   96 +++++++----
 sw/source/core/layout/unusedf.cxx                            |    2 
 sw/source/core/text/frmcrsr.cxx                              |    2 
 sw/source/filter/basflt/iodetect.cxx                         |   15 -
 sw/source/ui/uno/swdet2.cxx                                  |    2 
 vcl/inc/vcl/wrkwin.hxx                                       |   24 +-
 vcl/source/window/wrkwin.cxx                                 |   16 +
 28 files changed, 221 insertions(+), 119 deletions(-)

New commits:
commit 9514056f83ac2c7f8041cf2232e9737d9d9579ce
Author: Pierre-Eric Pelloux-Prayer <pierre-eric at lanedo.com>
Date:   Fri Oct 5 15:30:11 2012 +0200

    vml import: only apply width-percent attribute if it's != 0
    
    This fixes an issue with a shape defined with these attributes:
    mso-width-percent:0;mso-height-percent:0 and
    mso-width-relative:page;mso-height-relative:page;
    where all points were then located in (0,0)
    
    Change-Id: I51070ad2b2e4e05ab64f16813472ca1d7099fb09
    Reviewed-on: https://gerrit.libreoffice.org/775
    Reviewed-by: Petr Mladek <pmladek at suse.cz>
    Tested-by: Petr Mladek <pmladek at suse.cz>

diff --git a/oox/source/vml/vmlshape.cxx b/oox/source/vml/vmlshape.cxx
index 1e9573e..fde972c 100644
--- a/oox/source/vml/vmlshape.cxx
+++ b/oox/source/vml/vmlshape.cxx
@@ -464,7 +464,9 @@ Reference< XShape > SimpleShape::implConvertAndInsert( const Reference< XShapes
             if ( maTypeModel.maWidthRelative.isEmpty() || maTypeModel.maWidthRelative.equalsAscii( "page" ) )
             {
                 sal_Int16 nWidth = maTypeModel.maWidthPercent.toInt32() / 10;
-                PropertySet( xShape ).setAnyProperty(PROP_RelativeWidth, makeAny( nWidth ) );
+                // Only apply if nWidth != 0
+                if ( nWidth )
+                    PropertySet( xShape ).setAnyProperty(PROP_RelativeWidth, makeAny( nWidth ) );
             }
         }
         if ( !maTypeModel.maHeightPercent.isEmpty( ) )
@@ -473,7 +475,9 @@ Reference< XShape > SimpleShape::implConvertAndInsert( const Reference< XShapes
             if ( maTypeModel.maHeightRelative.isEmpty() || maTypeModel.maHeightRelative.equalsAscii( "page" ) )
             {
                 sal_Int16 nHeight = maTypeModel.maHeightPercent.toInt32() / 10;
-                PropertySet( xShape ).setAnyProperty(PROP_RelativeHeight, makeAny( nHeight ) );
+                // Only apply if nHeight != 0
+                if ( nHeight )
+                    PropertySet( xShape ).setAnyProperty(PROP_RelativeHeight, makeAny( nHeight ) );
             }
         }
     }
commit cfa355b30e03afef50350b9f7a00a669ef422241
Author: Cédric Bosdonnat <cedric.bosdonnat at free.fr>
Date:   Fri Nov 23 17:51:16 2012 +0100

    fdo#52182: Fixed click in frames located in header/footer
    
    Using a distance to click to select the best object to select between
    normal text and background object.
    
    (cherry picked from commit e8fbe97900f13305b17015d9044993bde4adab36)
    
    Conflicts:
    	sw/source/ui/docvw/edtwin.cxx
    	sw/source/ui/inc/edtwin.hxx
    
    Change-Id: Ib5b53161c7af2c16f4df379382f2e53fc6d8092b
    Signed-off-by: Michael Stahl <mstahl at redhat.com>

diff --git a/sw/source/core/doc/notxtfrm.cxx b/sw/source/core/doc/notxtfrm.cxx
index d3ca641..f116e11 100644
--- a/sw/source/core/doc/notxtfrm.cxx
+++ b/sw/source/core/doc/notxtfrm.cxx
@@ -609,7 +609,7 @@ sal_Bool SwNoTxtFrm::GetCharRect( SwRect &rRect, const SwPosition& rPos,
 
 
 sal_Bool SwNoTxtFrm::GetCrsrOfst(SwPosition* pPos, Point& ,
-                             SwCrsrMoveState* ) const
+                             SwCrsrMoveState*, bool ) const
 {
     SwCntntNode* pCNd = (SwCntntNode*)GetNode();
     pPos->nNode = *pCNd;
diff --git a/sw/source/core/inc/cellfrm.hxx b/sw/source/core/inc/cellfrm.hxx
index 0bc62ae..958806e 100644
--- a/sw/source/core/inc/cellfrm.hxx
+++ b/sw/source/core/inc/cellfrm.hxx
@@ -48,7 +48,7 @@ public:
     SwCellFrm( const SwTableBox &, SwFrm*, bool bInsertContent = true );
     ~SwCellFrm();
 
-    virtual sal_Bool GetCrsrOfst( SwPosition *, Point&, SwCrsrMoveState* = 0 ) const;
+    virtual sal_Bool GetCrsrOfst( SwPosition *, Point&, SwCrsrMoveState* = 0, bool bTestBackground = false ) const;
     virtual void Paint( SwRect const&,
                         SwPrintData const*const pPrintData = NULL ) const;
     virtual void CheckDirection( sal_Bool bVert );
diff --git a/sw/source/core/inc/flyfrm.hxx b/sw/source/core/inc/flyfrm.hxx
index 170064e..635451b 100644
--- a/sw/source/core/inc/flyfrm.hxx
+++ b/sw/source/core/inc/flyfrm.hxx
@@ -163,7 +163,7 @@ public:
                         SwPrintData const*const pPrintData = NULL ) const;
     virtual Size ChgSize( const Size& aNewSize );
     virtual sal_Bool GetCrsrOfst( SwPosition *, Point&,
-                              SwCrsrMoveState* = 0 ) const;
+                              SwCrsrMoveState* = 0, bool bTestBackground = false ) const;
 
     virtual void  CheckDirection( sal_Bool bVert );
     virtual void Cut();
diff --git a/sw/source/core/inc/frame.hxx b/sw/source/core/inc/frame.hxx
index e2213cf..729d358 100644
--- a/sw/source/core/inc/frame.hxx
+++ b/sw/source/core/inc/frame.hxx
@@ -786,7 +786,7 @@ public:
     virtual bool    FillSelection( SwSelectionList& rList, const SwRect& rRect ) const;
 
     virtual sal_Bool    GetCrsrOfst( SwPosition *, Point&,
-                                 SwCrsrMoveState* = 0 ) const;
+                                 SwCrsrMoveState* = 0, bool bTestBackground = false ) const;
     virtual sal_Bool    GetCharRect( SwRect &, const SwPosition&,
                                  SwCrsrMoveState* = 0 ) const;
     virtual void Paint( SwRect const&,
diff --git a/sw/source/core/inc/layfrm.hxx b/sw/source/core/inc/layfrm.hxx
index 4c4e4e6..a8d4bc4 100644
--- a/sw/source/core/inc/layfrm.hxx
+++ b/sw/source/core/inc/layfrm.hxx
@@ -92,7 +92,7 @@ public:
     virtual bool    FillSelection( SwSelectionList& rList, const SwRect& rRect ) const;
 
     virtual sal_Bool  GetCrsrOfst( SwPosition *, Point&,
-                               SwCrsrMoveState* = 0 ) const;
+                               SwCrsrMoveState* = 0, bool bTestBackground = false ) const;
 
     virtual void Cut();
     virtual void Paste( SwFrm* pParent, SwFrm* pSibling = 0 );
diff --git a/sw/source/core/inc/notxtfrm.hxx b/sw/source/core/inc/notxtfrm.hxx
index 17494b0..f8c1033 100644
--- a/sw/source/core/inc/notxtfrm.hxx
+++ b/sw/source/core/inc/notxtfrm.hxx
@@ -61,7 +61,7 @@ public:
     virtual sal_Bool GetCharRect( SwRect &, const SwPosition&,
                               SwCrsrMoveState* = 0) const;
     sal_Bool GetCrsrOfst(SwPosition* pPos, Point& aPoint,
-                     SwCrsrMoveState* = 0) const;
+                     SwCrsrMoveState* = 0, bool bTestBackground = false) const;
 
     const Size &GetGrfSize() const  { return GetSize(); }
     void GetGrfArea( SwRect &rRect, SwRect * = 0, sal_Bool bMirror = sal_True ) const;
diff --git a/sw/source/core/inc/pagefrm.hxx b/sw/source/core/inc/pagefrm.hxx
index 0091e24..688ab5b 100644
--- a/sw/source/core/inc/pagefrm.hxx
+++ b/sw/source/core/inc/pagefrm.hxx
@@ -183,7 +183,7 @@ public:
     void PlaceFly( SwFlyFrm* pFly, SwFlyFrmFmt* pFmt );
 
     virtual sal_Bool GetCrsrOfst( SwPosition *, Point&,
-                              SwCrsrMoveState* = 0 ) const;
+                              SwCrsrMoveState* = 0, bool bTestBackground = false ) const;
         // erfrage vom Client Informationen
     virtual sal_Bool GetInfo( SfxPoolItem& ) const;
 
diff --git a/sw/source/core/inc/rootfrm.hxx b/sw/source/core/inc/rootfrm.hxx
index 85c2a07..f71b2eb 100644
--- a/sw/source/core/inc/rootfrm.hxx
+++ b/sw/source/core/inc/rootfrm.hxx
@@ -201,7 +201,7 @@ public:
           void     SetDrawPage( SdrPage* pNew ){ pDrawPage = pNew; }
 
     virtual sal_Bool  GetCrsrOfst( SwPosition *, Point&,
-                               SwCrsrMoveState* = 0 ) const;
+                               SwCrsrMoveState* = 0, bool bTestBackground = false ) const;
 
     virtual void Paint( SwRect const&,
                         SwPrintData const*const pPrintData = NULL ) const;
diff --git a/sw/source/core/inc/txtfrm.hxx b/sw/source/core/inc/txtfrm.hxx
index e8da527..6e03dda 100644
--- a/sw/source/core/inc/txtfrm.hxx
+++ b/sw/source/core/inc/txtfrm.hxx
@@ -285,7 +285,7 @@ public:
     //naechsten ist. Wenn der SPoint ausserhalb der SSize liegt,
     //liefert die Funktion sal_False, sal_True sonst.
     virtual sal_Bool GetCrsrOfst( SwPosition *, Point&,
-                                  SwCrsrMoveState* = 0) const;
+                                  SwCrsrMoveState* = 0, bool bTestBackground = false ) const;
 
     // GetKeyCrsrOfst sorgt dafuer, dass der Frame nicht gewechselt wird
     // (z.B. Wechsel in den zeichengebundenen Frame).
diff --git a/sw/source/core/layout/trvlfrm.cxx b/sw/source/core/layout/trvlfrm.cxx
index ef9ec60..2ffc033 100644
--- a/sw/source/core/layout/trvlfrm.cxx
+++ b/sw/source/core/layout/trvlfrm.cxx
@@ -31,6 +31,7 @@
 #include <hintids.hxx>
 #include <hints.hxx>
 #include <tools/bigint.hxx>
+#include <tools/line.hxx>
 #include <editeng/opaqitem.hxx>
 #include <editeng/protitem.hxx>
 #include <vcl/settings.hxx>
@@ -65,9 +66,11 @@
 #include <cfloat>
 #include <swselectionlist.hxx>
 
+#include <basegfx/numeric/ftools.hxx>
+
 namespace {
     bool lcl_GetCrsrOfst_Objects( const SwPageFrm* pPageFrm, bool bSearchBackground,
-           SwPosition *pPos, Point& rPoint, SwCrsrMoveState* pCMS, long& rSurface )
+           SwPosition *pPos, Point& rPoint, SwCrsrMoveState* pCMS  )
     {
         bool bRet = false;
         Point aPoint( rPoint );
@@ -91,7 +94,6 @@ namespace {
                    !pFly->IsProtected() ) &&
                  pFly->GetCrsrOfst( pPos, aPoint, pCMS ) )
             {
-                rSurface = pFly->Frm().Width() * pFly->Frm().Height();
                 bRet = true;
                 break;
             }
@@ -103,18 +105,19 @@ namespace {
         return bRet;
     }
 
-    long lcl_GetSurface( SwPosition* pPos )
+    double lcl_getDistance( const SwRect& rRect, const Point& rPoint )
     {
-        SwRect aArea;
-
-        SwNode& rNode = pPos->nNode.GetNode();
-
-        if ( rNode.IsCntntNode() )
-            aArea = rNode.GetCntntNode()->FindLayoutRect();
+        double nDist = 0.0;
 
-        // FIXME Handle the other kinds of nodes?
+        // If the point is inside the rectangle, then distance is 0
+        // Otherwise, compute the distance to the center of the rectangle.
+        if ( !rRect.IsInside( rPoint ) )
+        {
+            Line aLine( rPoint, rRect.Center( ) );
+            nDist = aLine.GetLength( );
+        }
 
-        return aArea.Height() * aArea.Width();
+        return nDist;
     }
 }
 
@@ -166,7 +169,7 @@ static SwCrsrOszControl aOszCtrl = { 0, 0, 0 };
 |*
 |*************************************************************************/
 sal_Bool SwLayoutFrm::GetCrsrOfst( SwPosition *pPos, Point &rPoint,
-                               SwCrsrMoveState* pCMS ) const
+                               SwCrsrMoveState* pCMS, bool ) const
 {
     sal_Bool bRet = sal_False;
     const SwFrm *pFrm = Lower();
@@ -201,7 +204,7 @@ sal_Bool SwLayoutFrm::GetCrsrOfst( SwPosition *pPos, Point &rPoint,
 |*************************************************************************/
 
 sal_Bool SwPageFrm::GetCrsrOfst( SwPosition *pPos, Point &rPoint,
-                             SwCrsrMoveState* pCMS ) const
+                             SwCrsrMoveState* pCMS, bool bTestBackground ) const
 {
     sal_Bool bRet     = sal_False;
     Point aPoint( rPoint );
@@ -222,14 +225,11 @@ sal_Bool SwPageFrm::GetCrsrOfst( SwPosition *pPos, Point &rPoint,
     //hineinsetzen, dadurch sollten alle Aenderungen unmoeglich sein.
     if ( GetSortedObjs() )
     {
-        long nObjSurface = 0; // Unused
-        bRet = lcl_GetCrsrOfst_Objects( this, false, pPos, rPoint, pCMS, nObjSurface );
+        bRet = lcl_GetCrsrOfst_Objects( this, false, pPos, rPoint, pCMS );
     }
 
     if ( !bRet )
     {
-        long nTextSurface = 0;
-        long nBackSurface = 0;
         SwPosition aBackPos( *pPos );
         SwPosition aTextPos( *pPos );
 
@@ -238,7 +238,6 @@ sal_Bool SwPageFrm::GetCrsrOfst( SwPosition *pPos, Point &rPoint,
         //aktuellen an. Mit Flys ist es dann allerdings vorbei.
         if ( SwLayoutFrm::GetCrsrOfst( &aTextPos, aPoint, pCMS ) )
         {
-            nTextSurface = lcl_GetSurface( &aTextPos );
             bTextRet = sal_True;
         }
         else
@@ -252,8 +251,6 @@ sal_Bool SwPageFrm::GetCrsrOfst( SwPosition *pPos, Point &rPoint,
             if ( pCMS && pCMS->bStop )
                 return sal_False;
 
-            nTextSurface = pCnt->Frm().Height() * pCnt->Frm().Width();
-
             OSL_ENSURE( pCnt, "Crsr is gone to a Black hole" );
             if( pCMS && pCMS->pFill && pCnt->IsTxtFrm() )
                 bTextRet = pCnt->GetCrsrOfst( &aTextPos, rPoint, pCMS );
@@ -272,11 +269,10 @@ sal_Bool SwPageFrm::GetCrsrOfst( SwPosition *pPos, Point &rPoint,
         // Check objects in the background if nothing else matched
         if ( GetSortedObjs() )
         {
-            bBackRet = lcl_GetCrsrOfst_Objects( this, true, &aBackPos, rPoint, pCMS, nBackSurface );
+            bBackRet = lcl_GetCrsrOfst_Objects( this, true, &aBackPos, rPoint, pCMS );
         }
 
-        // TODO Pick up the best approaching selection
-        if ( bTextRet && bBackRet && ( nTextSurface > nBackSurface ) )
+        if ( ( bTestBackground && bBackRet ) || !bTextRet )
         {
             bRet = bBackRet;
             pPos->nNode = aBackPos.nNode;
@@ -284,9 +280,49 @@ sal_Bool SwPageFrm::GetCrsrOfst( SwPosition *pPos, Point &rPoint,
         }
         else
         {
-            bRet = bTextRet;
-            pPos->nNode = aTextPos.nNode;
-            pPos->nContent = aTextPos.nContent;
+            /* In order to provide a selection as accurable as possible when we have both
+             * text and brackground object, then we compute the distance between both
+             * would-be positions and the click point. The shortest distance wins.
+             */
+            SwCntntNode* pTextNd = aTextPos.nNode.GetNode( ).GetCntntNode( );
+            double nTextDistance = 0;
+            bool bValidTextDistance = false;
+            if ( pTextNd )
+            {
+                SwCntntFrm* pTextFrm = pTextNd->getLayoutFrm( getRootFrm( ) );
+                SwRect rTextRect;
+                pTextFrm->GetCharRect( rTextRect, aTextPos );
+
+                nTextDistance = lcl_getDistance( rTextRect, rPoint );
+                bValidTextDistance = true;
+            }
+
+            double nBackDistance = 0;
+            bool bValidBackDistance = false;
+            SwCntntNode* pBackNd = aBackPos.nNode.GetNode( ).GetCntntNode( );
+            if ( pBackNd )
+            {
+                // FIXME There are still cases were we don't have the proper node here.
+                SwCntntFrm* pBackFrm = pBackNd->getLayoutFrm( getRootFrm( ) );
+                SwRect rBackRect;
+                pBackFrm->GetCharRect( rBackRect, aBackPos );
+
+                nBackDistance = lcl_getDistance( rBackRect, rPoint );
+                bValidBackDistance = true;
+            }
+
+            if ( bValidTextDistance && bValidBackDistance && basegfx::fTools::more( nTextDistance, nBackDistance ) )
+            {
+                bRet = bBackRet;
+                pPos->nNode = aBackPos.nNode;
+                pPos->nContent = aBackPos.nContent;
+            }
+            else
+            {
+                bRet = bTextRet;
+                pPos->nNode = aTextPos.nNode;
+                pPos->nContent = aTextPos.nContent;
+            }
         }
     }
 
@@ -362,7 +398,7 @@ bool SwRootFrm::FillSelection( SwSelectionList& aSelList, const SwRect& rRect) c
 |*
 |*************************************************************************/
 sal_Bool SwRootFrm::GetCrsrOfst( SwPosition *pPos, Point &rPoint,
-                             SwCrsrMoveState* pCMS ) const
+                             SwCrsrMoveState* pCMS, bool bTestBackground ) const
 {
     sal_Bool bOldAction = IsCallbackActionEnabled();
     ((SwRootFrm*)this)->SetCallbackActionEnabled( sal_False );
@@ -389,7 +425,7 @@ sal_Bool SwRootFrm::GetCrsrOfst( SwPosition *pPos, Point &rPoint,
     }
     if ( pPage )
     {
-        pPage->SwPageFrm::GetCrsrOfst( pPos, rPoint, pCMS );
+        pPage->SwPageFrm::GetCrsrOfst( pPos, rPoint, pCMS, bTestBackground );
     }
 
     ((SwRootFrm*)this)->SetCallbackActionEnabled( bOldAction );
@@ -414,7 +450,7 @@ sal_Bool SwRootFrm::GetCrsrOfst( SwPosition *pPos, Point &rPoint,
 |*
 |*************************************************************************/
 sal_Bool SwCellFrm::GetCrsrOfst( SwPosition *pPos, Point &rPoint,
-                             SwCrsrMoveState* pCMS ) const
+                             SwCrsrMoveState* pCMS, bool ) const
 {
     // cell frame does not necessarily have a lower (split table cell)
     if ( !Lower() )
@@ -491,7 +527,7 @@ sal_Bool SwCellFrm::GetCrsrOfst( SwPosition *pPos, Point &rPoint,
 //am weitesten oben liegt.
 
 sal_Bool SwFlyFrm::GetCrsrOfst( SwPosition *pPos, Point &rPoint,
-                            SwCrsrMoveState* pCMS ) const
+                            SwCrsrMoveState* pCMS, bool ) const
 {
     aOszCtrl.Entry( this );
 
diff --git a/sw/source/core/layout/unusedf.cxx b/sw/source/core/layout/unusedf.cxx
index d28eb5f..f12f19c 100644
--- a/sw/source/core/layout/unusedf.cxx
+++ b/sw/source/core/layout/unusedf.cxx
@@ -54,7 +54,7 @@ bool SwFrm::FillSelection( SwSelectionList& , const SwRect& ) const
     return false;
 }
 
-sal_Bool SwFrm::GetCrsrOfst( SwPosition *, Point&, SwCrsrMoveState*  ) const
+sal_Bool SwFrm::GetCrsrOfst( SwPosition *, Point&, SwCrsrMoveState*, bool  ) const
 {
     OSL_FAIL( "GetCrsrOfst of the base class, hi!" );
     return sal_False;
diff --git a/sw/source/core/text/frmcrsr.cxx b/sw/source/core/text/frmcrsr.cxx
index 1ca3794..aad6a6d 100644
--- a/sw/source/core/text/frmcrsr.cxx
+++ b/sw/source/core/text/frmcrsr.cxx
@@ -684,7 +684,7 @@ sal_Bool SwTxtFrm::_GetCrsrOfst(SwPosition* pPos, const Point& rPoint,
  *************************************************************************/
 
 sal_Bool SwTxtFrm::GetCrsrOfst(SwPosition* pPos, Point& rPoint,
-                               SwCrsrMoveState* pCMS ) const
+                               SwCrsrMoveState* pCMS, bool ) const
 {
     MSHORT nChgFrm = 2;
     if( pCMS )
commit a0cb3007fffaada0619caa879ae44a27354881e9
Author: Miklos Vajna <vmiklos at suse.cz>
Date:   Mon Dec 10 12:51:01 2012 +0100

    oox: v:textbox's inset attribute should be imported in Hmm, not in Emu
    
    Trivial reproducer: http://people.freedesktop.org/~vmiklos/2012/simple-textbox.docx
    
    Change-Id: I030f7153326affc5a01e7ede1ddf1164fa500071
    (cherry picked from commit 5bc835d48f1e5373b3a31bd166fadfdf19b3588f)

diff --git a/oox/source/vml/vmltextboxcontext.cxx b/oox/source/vml/vmltextboxcontext.cxx
index 841c150..3f188e3 100644
--- a/oox/source/vml/vmltextboxcontext.cxx
+++ b/oox/source/vml/vmltextboxcontext.cxx
@@ -137,16 +137,16 @@ TextBoxContext::TextBoxContext( ContextHandler2Helper& rParent, TextBox& rTextBo
         OUString inset = rAttribs.getString( XML_inset ).get();
         OUString value;
         ConversionHelper::separatePair( value, inset, inset, ',' );
-        rTextBox.borderDistanceLeft = ConversionHelper::decodeMeasureToEmu( graphicHelper,
+        rTextBox.borderDistanceLeft = ConversionHelper::decodeMeasureToHmm( graphicHelper,
             value.isEmpty() ? "0.1in" : value, 0, false, false );
         ConversionHelper::separatePair( value, inset, inset, ',' );
-        rTextBox.borderDistanceTop = ConversionHelper::decodeMeasureToEmu( graphicHelper,
+        rTextBox.borderDistanceTop = ConversionHelper::decodeMeasureToHmm( graphicHelper,
             value.isEmpty() ? "0.05in" : value, 0, false, false );
         ConversionHelper::separatePair( value, inset, inset, ',' );
-        rTextBox.borderDistanceRight = ConversionHelper::decodeMeasureToEmu( graphicHelper,
+        rTextBox.borderDistanceRight = ConversionHelper::decodeMeasureToHmm( graphicHelper,
             value.isEmpty() ? "0.1in" : value, 0, false, false );
         ConversionHelper::separatePair( value, inset, inset, ',' );
-        rTextBox.borderDistanceBottom = ConversionHelper::decodeMeasureToEmu( graphicHelper,
+        rTextBox.borderDistanceBottom = ConversionHelper::decodeMeasureToHmm( graphicHelper,
             value.isEmpty() ? "0.05in" : value, 0, false, false );
         rTextBox.borderDistanceSet = true;
     }
commit 4c92421e7049dc94ed2b1083a13d51e735b94c90
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Nov 29 09:48:24 2012 +0000

    .dot files sometimes rejected by writer, bnc#793422
    
    because CWW8 appears twice, once for normal .doc and once for .dot. So a .dot
    files is tested twice if it's supported by the WW8 filter. Depending on the
    (effectively arbitrary) order they appear in the list .dots may fail the "is a
    normal non template .doc" test after the "is a template .dot" test and get
    rejected as a CWW8 candidate.
    
    Change-Id: I88aec29fdd5f9ec4dd4ad2813ff3c6b8fa5c5461
    Signed-off-by: Tor Lillqvist <tlillqvist at suse.com>

diff --git a/sw/source/filter/basflt/iodetect.cxx b/sw/source/filter/basflt/iodetect.cxx
index b99d57c..f32fa1c 100644
--- a/sw/source/filter/basflt/iodetect.cxx
+++ b/sw/source/filter/basflt/iodetect.cxx
@@ -266,6 +266,12 @@ sal_Bool SwIoSystem::IsFileFilter(SfxMedium& rMedium, const String& rFmtName)
                     }
                 }
             }
+            //The same underlying filter can appear multiple times in the
+            //filter list, e.g. CWW8 filter twice, once for .doc and once for
+            //.dot.  We just care here if its either, not enforce that it's
+            //both which would be a bit of an odd requirement
+            if (bRet)
+                break;
         }
 
         pFltr = aIter.Next();
commit a4d8430cf797c3ba6ce5408f1b994e55e54b7bff
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Nov 29 09:29:19 2012 +0000

    optional ppFlt argument never used
    
    Change-Id: Ib2c68091f14d04818ae5e7db0ad7b8a1ec151f4f
    Signed-off-by: Tor Lillqvist <tlillqvist at suse.com>

diff --git a/sw/inc/iodetect.hxx b/sw/inc/iodetect.hxx
index cc58b29..f8ff622 100644
--- a/sw/inc/iodetect.hxx
+++ b/sw/inc/iodetect.hxx
@@ -111,8 +111,7 @@ public:
 
     // Detect whether the given file is in the given format.
     // For now, only our own filters are supported!
-    static sal_Bool IsFileFilter( SfxMedium& rMedium, const String& rFmtName,
-            const SfxFilter** ppFlt = 0 );
+    static sal_Bool IsFileFilter(SfxMedium& rMedium, const String& rFmtName);
 
     static sal_Bool IsValidStgFilter( SotStorage& , const SfxFilter& );
     static sal_Bool IsValidStgFilter( const com::sun::star::uno::Reference < com::sun::star::embed::XStorage >& rStg, const SfxFilter& rFilter);
diff --git a/sw/source/filter/basflt/iodetect.cxx b/sw/source/filter/basflt/iodetect.cxx
index 7a72a6f..b99d57c 100644
--- a/sw/source/filter/basflt/iodetect.cxx
+++ b/sw/source/filter/basflt/iodetect.cxx
@@ -211,8 +211,7 @@ void TerminateBuffer(sal_Char *pBuffer, sal_uLong nBytesRead, sal_uLong nBufferL
 
 /* Feststellen ob das File in dem entsprechenden Format vorliegt. */
 /* Z.z werden nur unsere eigene Filter unterstuetzt               */
-sal_Bool SwIoSystem::IsFileFilter( SfxMedium& rMedium, const String& rFmtName,
-        const SfxFilter** ppFilter )
+sal_Bool SwIoSystem::IsFileFilter(SfxMedium& rMedium, const String& rFmtName)
 {
     sal_Bool bRet = sal_False;
 
@@ -267,9 +266,6 @@ sal_Bool SwIoSystem::IsFileFilter( SfxMedium& rMedium, const String& rFmtName,
                     }
                 }
             }
-
-            if( bRet && ppFilter  )
-                *ppFilter = pFltr;
         }
 
         pFltr = aIter.Next();
diff --git a/sw/source/ui/uno/swdet2.cxx b/sw/source/ui/uno/swdet2.cxx
index 40e4be5..5594438 100644
--- a/sw/source/ui/uno/swdet2.cxx
+++ b/sw/source/ui/uno/swdet2.cxx
@@ -65,7 +65,7 @@ sal_uLong SwFilterDetect::DetectFilter( SfxMedium& rMedium, const SfxFilter** pp
         String aPrefFlt = (*ppFilter)->GetUserData();
 
         // detection for TextFilter needs an additional checking
-        sal_Bool bDetected = SwIoSystem::IsFileFilter( rMedium, aPrefFlt );
+        sal_Bool bDetected = SwIoSystem::IsFileFilter(rMedium, aPrefFlt);
         return bDetected ? nRet : ERRCODE_ABORT;
     }
 
commit dfb25f8c69e5b2521c2e911d06cadc0329afea9d
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Nov 29 09:23:37 2012 +0000

    Simplify SwIoSystem::IsFileFilter
    
    bRet = bRet && (pFltr->GetUserData().equals(rFmtName)); is already inside an if
    bRet = bRet && (pFltr->GetUserData().equals(rFmtName)); condition
    
    bRet = xStg.Is() && IsValidStgFilter( *xStg, *pFltr ); is already inside an
    if ( xStg.Is() ) condition
    
    Change-Id: I2115041d99b6fcbae7a829557c37627d03b5ee24
    Signed-off-by: Tor Lillqvist <tlillqvist at suse.com>

diff --git a/sw/source/filter/basflt/iodetect.cxx b/sw/source/filter/basflt/iodetect.cxx
index 41adf67..7a72a6f 100644
--- a/sw/source/filter/basflt/iodetect.cxx
+++ b/sw/source/filter/basflt/iodetect.cxx
@@ -244,8 +244,7 @@ sal_Bool SwIoSystem::IsFileFilter( SfxMedium& rMedium, const String& rFmtName,
                 if ( xStor.is() )
                     bRet = IsValidStgFilter( xStor, *pFltr );
                 else if ( xStg.Is() )
-                    bRet = xStg.Is() && IsValidStgFilter( *xStg, *pFltr );
-                bRet = bRet && (pFltr->GetUserData() == rFmtName);
+                    bRet = IsValidStgFilter( *xStg, *pFltr );
             }
             else if( !xStg.Is() && !xStor.is() )
             {
commit e93ab20b7a7b0e45abf93e5380354feafbbc8d70
Author: Kohei Yoshida <kohei.yoshida at gmail.com>
Date:   Sat Dec 8 00:00:49 2012 -0500

    bnc#791952: Setting properties for all data labels.
    
    You can set different properties to individual data labels.  But setting
    new properties to all data labels should overwrite the individual settings.
    
    Change-Id: I934bad89326115aa83feb86275cf380d701a5686

diff --git a/chart2/source/controller/dialogs/res_DataLabel.cxx b/chart2/source/controller/dialogs/res_DataLabel.cxx
index 1690ecd..c50d2b4 100644
--- a/chart2/source/controller/dialogs/res_DataLabel.cxx
+++ b/chart2/source/controller/dialogs/res_DataLabel.cxx
@@ -291,14 +291,15 @@ void DataLabelResources::EnableControls()
 {
     m_aCBSymbol.Enable( m_aCBNumber.IsChecked() || (m_aCBPercent.IsChecked() && m_aCBPercent.IsEnabled()) || m_aCBCategory.IsChecked() );
 
-    //enable separator
+    // Enable or disable separator, placement and direction based on the check
+    // box states. Note that the check boxes are tri-state.
     {
         long nNumberOfCheckedLabelParts = 0;
-        if( m_aCBNumber.IsChecked() )
+        if (m_aCBNumber.GetState() != STATE_NOCHECK)
             ++nNumberOfCheckedLabelParts;
-        if( m_aCBPercent.IsChecked() && m_aCBPercent.IsEnabled() )
+        if (m_aCBPercent.GetState() != STATE_NOCHECK && m_aCBPercent.IsEnabled())
             ++nNumberOfCheckedLabelParts;
-        if( m_aCBCategory.IsChecked() )
+        if (m_aCBCategory.GetState() != STATE_NOCHECK)
             ++nNumberOfCheckedLabelParts;
         m_aSeparatorResources.Enable( nNumberOfCheckedLabelParts > 1 );
         bool bEnableTextDir = nNumberOfCheckedLabelParts > 0;
diff --git a/chart2/source/controller/main/ChartController_Properties.cxx b/chart2/source/controller/main/ChartController_Properties.cxx
index 19f146a..005c076 100644
--- a/chart2/source/controller/main/ChartController_Properties.cxx
+++ b/chart2/source/controller/main/ChartController_Properties.cxx
@@ -242,7 +242,7 @@ SAL_WNODEPRECATED_DECLARATIONS_PUSH
                                         xObjectProperties, xSeries, rDrawModel.GetItemPool(), rDrawModel,
                                         pNumberFormatterWrapper,
                                         uno::Reference< lang::XMultiServiceFactory >( xChartModel, uno::UNO_QUERY ),
-                                        eMapTo, pRefSize, bDataSeries, bUseSpecialFillColor, nSpecialFillColor, false,
+                                        eMapTo, pRefSize, bDataSeries, bUseSpecialFillColor, nSpecialFillColor, true,
                                         nNumberFormat, nPercentNumberFormat );
                     break;
             }
commit 39b678049d06ca4429ef44769df45873df0b2b8d
Author: Kohei Yoshida <kohei.yoshida at gmail.com>
Date:   Fri Dec 7 21:14:50 2012 -0500

    bnc#791952: Use "center" label placement for "Best fit" in pie charts.
    
    It works better this way for Excel interoperability.  In Excel, Best fit
    is slightly different than the center placement, but the two are pretty
    close in pie charts.
    
    Change-Id: I7f04a1babb04fd488d8cf90df247c294fa9d7b67

diff --git a/chart2/source/view/charttypes/PieChart.cxx b/chart2/source/view/charttypes/PieChart.cxx
index 8d558f1..e1ecf5b 100644
--- a/chart2/source/view/charttypes/PieChart.cxx
+++ b/chart2/source/view/charttypes/PieChart.cxx
@@ -460,9 +460,15 @@ void PieChart::createShapes()
                     }
 
                     sal_Int32 nLabelPlacement = pSeries->getLabelPlacement( nPointIndex, m_xChartTypeModel, m_nDimension, m_pPosHelper->isSwapXAndY() );
+
+                    // AVOID_OVERLAP is in fact "Best fit" in the UI.
                     bool bMovementAllowed = ( nLabelPlacement == ::com::sun::star::chart::DataLabelPlacement::AVOID_OVERLAP );
                     if( bMovementAllowed )
-                        nLabelPlacement = ::com::sun::star::chart::DataLabelPlacement::OUTSIDE;
+                        // Use center for "Best fit" for now. In the future we
+                        // may want to implement a real best fit algorithm.
+                        // But center is good enough, and close to what Excel
+                        // does.
+                        nLabelPlacement = ::com::sun::star::chart::DataLabelPlacement::CENTER;
 
                     LabelAlignment eAlignment(LABEL_ALIGN_CENTER);
                     sal_Int32 nScreenValueOffsetInRadiusDirection = 0 ;
commit 8cecddb79fcf8efe62c7e97eec8993ae89760d06
Author: Kohei Yoshida <kohei.yoshida at gmail.com>
Date:   Fri Dec 7 19:48:50 2012 -0500

    bnc#791952: Better placement of 3D pie chart data labels.
    
    This value appears to control the logical vertical offset of data labels
    along the z-axis for 3D pie charts (no effect in 2D pie charts).  With
    -0.5, the data labels appear lifted from the top surface of the pie chart.
    With -1.0, the labels get placed right at the top surface, which improves
    the precision of data label positions.
    
    With this change, data labels that are centered are really centered inside
    their respective pie segments.
    
    Change-Id: I26d5d7cb7f68bd09131b70bcb4fc030ac924bcce

diff --git a/chart2/source/view/charttypes/PieChart.cxx b/chart2/source/view/charttypes/PieChart.cxx
index 5e7e167..8d558f1 100644
--- a/chart2/source/view/charttypes/PieChart.cxx
+++ b/chart2/source/view/charttypes/PieChart.cxx
@@ -442,7 +442,7 @@ void PieChart::createShapes()
                 }
 
                 //create data point
-                double fLogicZ = -0.5;//as defined
+                double fLogicZ = -1.0; // For 3D pie chart label position
                 uno::Reference<drawing::XShape> xPointShape(
                     createDataPoint( xSeriesGroupShape_Shapes, xPointProperties
                                     , fUnitCircleStartAngleDegree, fUnitCircleWidthAngleDegree
commit d1b31ff322cbd3f6d5192b81f5621e47e66532d4
Author: Kohei Yoshida <kohei.yoshida at gmail.com>
Date:   Wed Dec 5 12:53:03 2012 -0500

    fdo#57497: Remove group table data when all group dimensions are gone.
    
    Otherwise ungrouping date grouped dimension may crash, or produce
    incorrect results.
    
    Change-Id: I3634e3c0bf8336fc1221f5d234cb7e01eb1f07c6

diff --git a/sc/inc/dpsave.hxx b/sc/inc/dpsave.hxx
index 14a0032..4225d1b 100644
--- a/sc/inc/dpsave.hxx
+++ b/sc/inc/dpsave.hxx
@@ -345,6 +345,8 @@ public:
     const ScDPDimensionSaveData* GetExistingDimensionData() const
         { return pDimensionData; }
 
+    void RemoveAllGroupDimensions( const rtl::OUString& rSrcDimName, std::vector<rtl::OUString>* pDeletedNames = NULL );
+
     SC_DLLPUBLIC ScDPDimensionSaveData* GetDimensionData(); // create if not there
     void SetDimensionData( const ScDPDimensionSaveData* pNew ); // copied
     void BuildAllDimensionMembers(ScDPTableData* pData);
diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx
index cab47a6..795bea3 100644
--- a/sc/qa/unit/ucalc.cxx
+++ b/sc/qa/unit/ucalc.cxx
@@ -2688,6 +2688,35 @@ void Test::testPivotTableDateGrouping()
         CPPUNIT_ASSERT_MESSAGE("Table output check failed", bSuccess);
     }
 
+    // Remove all date grouping. The source dimension "Date" has two
+    // external dimensions ("Years" and "Quarters") and one internal ("Date"
+    // the same name but different hierarchy).  Remove all of them.
+    pSaveData = pDPObj->GetSaveData();
+    pSaveData->RemoveAllGroupDimensions(aBaseDimName);
+    pDPObj->SetSaveData(*pSaveData);
+    pDPObj->ReloadGroupTableData();
+    pDPObj->InvalidateData();
+
+    aOutRange = refresh(pDPObj);
+    {
+        // Expected output table content.  0 = empty cell
+        const char* aOutputCheck[][2] = {
+            { "Date", 0 },
+            { "2011-01-01", "1" },
+            { "2011-03-02", "2" },
+            { "2011-09-03", "7" },
+            { "2012-01-04", "3" },
+            { "2012-02-23", "4" },
+            { "2012-02-24", "5" },
+            { "2012-03-15", "6" },
+            { "2012-12-25", "8" },
+            { "Total Result", "36" }
+        };
+
+        bSuccess = checkDPTableOutput<2>(m_pDoc, aOutRange, aOutputCheck, "Remove all date grouping.");
+        CPPUNIT_ASSERT_MESSAGE("Table output check failed", bSuccess);
+    }
+
     pDPs->FreeTable(pDPObj);
     CPPUNIT_ASSERT_EQUAL_MESSAGE("There should be no more tables.", pDPs->GetCount(), static_cast<size_t>(0));
     CPPUNIT_ASSERT_EQUAL_MESSAGE("There shouldn't be any more cache stored.",
diff --git a/sc/source/core/data/dpobject.cxx b/sc/source/core/data/dpobject.cxx
index f4b39ff..8db3c16 100644
--- a/sc/source/core/data/dpobject.cxx
+++ b/sc/source/core/data/dpobject.cxx
@@ -567,8 +567,18 @@ void ScDPObject::ReloadGroupTableData()
 
     const ScDPDimensionSaveData* pDimData = pSaveData->GetExistingDimensionData();
     if (!pDimData || !pDimData->HasGroupDimensions())
-        // No group dimensions exist.
+    {
+        // No group dimensions exist.  Check if it currently has group
+        // dimensions, and if so, remove all of them.
+        ScDPGroupTableData* pData = dynamic_cast<ScDPGroupTableData*>(mpTableData.get());
+        if (pData)
+        {
+            // Replace the existing group table data with the source data.
+            shared_ptr<ScDPTableData> pSource = pData->GetSourceTableData();
+            mpTableData = pSource;
+        }
         return;
+    }
 
     ScDPGroupTableData* pData = dynamic_cast<ScDPGroupTableData*>(mpTableData.get());
     if (pData)
diff --git a/sc/source/core/data/dpsave.cxx b/sc/source/core/data/dpsave.cxx
index 5c987da..f86dce4 100644
--- a/sc/source/core/data/dpsave.cxx
+++ b/sc/source/core/data/dpsave.cxx
@@ -1221,6 +1221,43 @@ bool ScDPSaveData::IsEmpty() const
     return true; // no entries that are not hidden
 }
 
+void ScDPSaveData::RemoveAllGroupDimensions( const OUString& rSrcDimName, std::vector<OUString>* pDeletedNames )
+{
+    if (!pDimensionData)
+        // No group dimensions exist.  Nothing to do.
+        return;
+
+    // Remove numeric group dimension (exists once at most). No need to delete
+    // anything in save data (grouping was done inplace in an existing base
+    // dimension).
+    pDimensionData->RemoveNumGroupDimension(rSrcDimName);
+
+    // Remove named group dimension(s). Dimensions have to be removed from
+    // dimension save data and from save data too.
+    const ScDPSaveGroupDimension* pExistingGroup = pDimensionData->GetGroupDimForBase(rSrcDimName);
+    while ( pExistingGroup )
+    {
+        rtl::OUString aGroupDimName = pExistingGroup->GetGroupDimName();
+        pDimensionData->RemoveGroupDimension(aGroupDimName);     // pExistingGroup is deleted
+
+        // also remove SaveData settings for the dimension that no longer exists
+        RemoveDimensionByName(aGroupDimName);
+
+        if (pDeletedNames)
+            pDeletedNames->push_back(aGroupDimName);
+
+        // see if there are more group dimensions
+        pExistingGroup = pDimensionData->GetGroupDimForBase(rSrcDimName);
+
+        if ( pExistingGroup && pExistingGroup->GetGroupDimName() == aGroupDimName )
+        {
+            // still get the same group dimension?
+            OSL_FAIL("couldn't remove group dimension");
+            pExistingGroup = NULL;      // avoid endless loop
+        }
+    }
+}
+
 ScDPDimensionSaveData* ScDPSaveData::GetDimensionData()
 {
     if (!pDimensionData)
diff --git a/sc/source/ui/view/dbfunc3.cxx b/sc/source/ui/view/dbfunc3.cxx
index bd3fa19..3f3992a 100644
--- a/sc/source/ui/view/dbfunc3.cxx
+++ b/sc/source/ui/view/dbfunc3.cxx
@@ -973,52 +973,23 @@ void ScDBFunc::DateGroupDataPilot( const ScDPNumGroupInfo& rInfo, sal_Int32 nPar
     if (aEntries.empty())
         return;
 
+    std::vector<rtl::OUString> aDeletedNames;
     bool bIsDataLayout;
     OUString aDimName = pDPObj->GetDimName( nSelectDimension, bIsDataLayout );
 
     ScDPSaveData aData( *pDPObj->GetSaveData() );
     ScDPDimensionSaveData* pDimData = aData.GetDimensionData();     // created if not there
 
-    // find original base
+    // find the source dimension name.
     rtl::OUString aBaseDimName = aDimName;
     if( const ScDPSaveGroupDimension* pBaseGroupDim = pDimData->GetNamedGroupDim( aDimName ) )
         aBaseDimName = pBaseGroupDim->GetSourceDimName();
 
-    // remove all existing parts (the grouping is built completely new)
-
-    /*  Remove numeric group dimension (exists once at most). No need
-        to delete anything in save data (grouping was done inplace in
-        an existing base dimension). */
-    pDimData->RemoveNumGroupDimension( aBaseDimName );
-
-    /*  Remove named group dimension(s). Collect deleted dimension
-        names which may be reused while recreating the groups.
-        Dimensions have to be removed from dimension save data and from
-        save data too. */
-    std::vector<rtl::OUString> aDeletedNames;
-    const ScDPSaveGroupDimension* pExistingGroup = pDimData->GetGroupDimForBase( aBaseDimName );
-    while ( pExistingGroup )
-    {
-        rtl::OUString aGroupDimName = pExistingGroup->GetGroupDimName();
-        pDimData->RemoveGroupDimension( aGroupDimName );     // pExistingGroup is deleted
-
-        // also remove SaveData settings for the dimension that no longer exists
-        aData.RemoveDimensionByName( aGroupDimName );
-
-        /*  The name can be used for the new group dimensions, although
-            it is still in use with the DataPilotSource. */
-        aDeletedNames.push_back( aGroupDimName );
-
-        // see if there are more group dimensions
-        pExistingGroup = pDimData->GetGroupDimForBase( aBaseDimName );
-
-        if ( pExistingGroup && pExistingGroup->GetGroupDimName() == aGroupDimName )
-        {
-            // still get the same group dimension?
-            OSL_FAIL("couldn't remove group dimension");
-            pExistingGroup = NULL;      // avoid endless loop
-        }
-    }
+    // Remove all group dimensions associated with this source dimension. For
+    // date grouping, we need to remove all existing groups for the affected
+    // source dimension and build new one(s) from scratch.  Keep the deleted
+    // names so that they can be reused during re-construction.
+    aData.RemoveAllGroupDimensions(aBaseDimName, &aDeletedNames);
 
     if ( nParts )
     {
commit fd2aec565e3f26b059d88e0c08d7d54ca47c2f92
Author: Radek Doulik <rodo at novell.com>
Date:   Wed Nov 28 13:32:57 2012 +0100

    use snap rectangle instead of logic rectangle
    
     - so that pictures inserted into rotated placeholders are placed
       in the transformed rectangle and don't endup at wrong position
       e.g. outside of slide
    
    Change-Id: I2f3d206b43639c094f7dfb1d25e42b9cbf7dd102

diff --git a/sd/source/ui/view/sdview4.cxx b/sd/source/ui/view/sdview4.cxx
index 43e0d50..ed1a87c 100644
--- a/sd/source/ui/view/sdview4.cxx
+++ b/sd/source/ui/view/sdview4.cxx
@@ -130,7 +130,7 @@ SdrGrafObj* View::InsertGraphic( const Graphic& rGraphic, sal_Int8& rAction,
             }
             else
             {
-                pNewGrafObj = new SdrGrafObj( rGraphic, pPickObj->GetLogicRect() );
+                pNewGrafObj = new SdrGrafObj( rGraphic, pPickObj->GetSnapRect() );
                 pNewGrafObj->SetEmptyPresObj(sal_True);
             }
 
commit e5c3764b92ef59b42531dcf1a1553958f92037b9
Author: Luboš Luňák <l.lunak at suse.cz>
Date:   Mon Nov 26 14:54:34 2012 +0100

    make presentation spanning all screens work (bnc#758138)
    
    This reverts an API "improvement" from 6ee5dfa150d408179e20a5525ff7ec46649e0e58
    that tried to use -1 as the current screen/display but failed. The check
    for nDisplayScreen being in range broke all-screens (which is
    represented as last_screen+1 value, which is broken in its own way, as e.g.
    the screen count can change). The same way -1 as the default value is broken,
    as everywhere else invalid invalid screen number means spanning all screens.
    The extra overloads without a default value should take care of that.
    
    Conflicts:
    	vcl/source/window/wrkwin.cxx
    
    Change-Id: Ie118038eacacebc007c25860732d5904ad0de2b9
    Signed-off-by: Thorsten Behrens <tbehrens at suse.com>

diff --git a/vcl/inc/vcl/wrkwin.hxx b/vcl/inc/vcl/wrkwin.hxx
index c9a3da9..d29a178 100644
--- a/vcl/inc/vcl/wrkwin.hxx
+++ b/vcl/inc/vcl/wrkwin.hxx
@@ -80,21 +80,23 @@ public:
 
     virtual sal_Bool    Close();
 
-    /** The default value of nDisplayScreen = -1 means "don't care" and
-        allows to backends to use any screen they like (most probably
-        the current one).
-
-        NOTE: The default value cannot be 0, because 0 is a legitimate
-        Display Screen number.
-     */
-    void            ShowFullScreenMode( sal_Bool bFullScreenMode = sal_True,
-                                        sal_Int32 nDisplayScreen = -1 );
+    void            ShowFullScreenMode( sal_Bool bFullScreenMode,
+                                        sal_Int32 nDisplayScreen );
+    /**
+     @overload Calls ShowFullScreenMode( bFullScreenMode, GetScreenNumber()).
+    */
+    void            ShowFullScreenMode( sal_Bool bFullScreenMode = sal_True );
     void            EndFullScreenMode() { ShowFullScreenMode( sal_False ); }
     sal_Bool        IsFullScreenMode() const { return mbFullScreenMode; }
 
+    void            StartPresentationMode( sal_Bool   bPresentation,
+                                           sal_uInt16 nFlags,
+                                           sal_Int32  nDisplayScreen );
+    /**
+     @overload Calls StartPresentationMode( bFullScreenMode, nFlags, GetScreenNumber()).
+    */
     void            StartPresentationMode( sal_Bool   bPresentation = sal_True,
-                                           sal_uInt16 nFlags = 0,
-                                           sal_Int32  nDisplayScreen = 0 );
+                                           sal_uInt16 nFlags = 0 );
     void            EndPresentationMode() {  StartPresentationMode( sal_False ); }
     sal_Bool        IsPresentationMode() const { return mbPresentationMode; }
 
diff --git a/vcl/source/window/wrkwin.cxx b/vcl/source/window/wrkwin.cxx
index a4f79d2..df595a3 100644
--- a/vcl/source/window/wrkwin.cxx
+++ b/vcl/source/window/wrkwin.cxx
@@ -183,17 +183,16 @@ WorkWindow::~WorkWindow()
 
 // -----------------------------------------------------------------------
 
+void WorkWindow::ShowFullScreenMode( sal_Bool bFullScreenMode )
+{
+    return ShowFullScreenMode( bFullScreenMode, GetScreenNumber());
+}
+
 void WorkWindow::ShowFullScreenMode( sal_Bool bFullScreenMode, sal_Int32 nDisplayScreen )
 {
     if ( !mbFullScreenMode == !bFullScreenMode )
         return;
 
-    if( (nDisplayScreen < 0)
-    || (nDisplayScreen >= static_cast<sal_Int32>(Application::GetScreenCount()) ) )
-    {
-        nDisplayScreen = GetScreenNumber();
-    }
-
     mbFullScreenMode = bFullScreenMode != 0;
     if ( !mbSysChild )
     {
@@ -216,6 +215,11 @@ void WorkWindow::ShowFullScreenMode( sal_Bool bFullScreenMode, sal_Int32 nDispla
 
 // -----------------------------------------------------------------------
 
+void WorkWindow::StartPresentationMode( sal_Bool bPresentation, sal_uInt16 nFlags )
+{
+    return StartPresentationMode( bPresentation, nFlags, GetScreenNumber());
+}
+
 void WorkWindow::StartPresentationMode( sal_Bool bPresentation, sal_uInt16 nFlags, sal_Int32 nDisplayScreen )
 {
     if ( !bPresentation == !mbPresentationMode )


More information about the Libreoffice-commits mailing list