611ac47
From a1b579010e8d4835e344badbacd6e27db68d7d21 Mon Sep 17 00:00:00 2001
611ac47
From: Michael Stahl <mstahl@redhat.com>
611ac47
Date: Thu, 27 Nov 2014 23:38:38 +0100
611ac47
Subject: [PATCH] fdo#79303: Revert "fdo#70861 SwToSfxPageDescAttr: fix call to
611ac47
 ...
611ac47
611ac47
... SvxExtParagraphTabPage"
611ac47
611ac47
This reverts commit 5ce19ddcb6595c71980aecfa1e8c0827343159a4.
611ac47
611ac47
It is now simply wrong to claim that a SID_ATTR_PARA_PAGENUM item with
611ac47
value 0 is set, when that is a valid offset value.
611ac47
611ac47
SwTxtShell::Execute() will call SfxToSwPageDescAttr() which pulls the
611ac47
SID_ATTR_PARA_PAGENUM out of the item set and sets it.
611ac47
611ac47
Change-Id: If5a155c2874486b3ef7d01883fe73f8e5fca46fe
611ac47
Signed-off-by: Andras Timar <andras.timar@collabora.com>
611ac47
(cherry picked from commit d12fc79394842951807ab8c58a810cd9c5848cb7)
611ac47
611ac47
fdo#70861: cui: fix crash in SvxExtParagraphTabPage
611ac47
611ac47
SvxExtParagraphTabPage::Reset() must not request a pool default for
611ac47
SID_ATTR_PARA_PAGENUM because it simply does not exist; the item is
611ac47
backed by a member of SwPageDesc in Writer.
611ac47
611ac47
(cherry picked from commit 9c1a1b98776ca2216d82af303394a09f2bac0471)
611ac47
Signed-off-by: Andras Timar <andras.timar@collabora.com>
611ac47
611ac47
Conflicts:
611ac47
	cui/source/tabpages/paragrph.cxx
611ac47
611ac47
Change-Id: I9b157f048cd986566f9b01f3677b53d5974b6c8d
611ac47
(cherry picked from commit 7cbc78da69a755b8a994c46c5f04bee0b4b0dd1b)
611ac47
---
611ac47
 cui/source/tabpages/paragrph.cxx | 2 +-
611ac47
 sw/source/ui/utlui/uitool.cxx    | 5 ++---
611ac47
 2 files changed, 3 insertions(+), 4 deletions(-)
611ac47
611ac47
diff --git a/cui/source/tabpages/paragrph.cxx b/cui/source/tabpages/paragrph.cxx
611ac47
index f8e7db1..5d564c1 100644
611ac47
--- a/cui/source/tabpages/paragrph.cxx
611ac47
+++ b/cui/source/tabpages/paragrph.cxx
611ac47
@@ -1562,7 +1562,7 @@ void SvxExtParagraphTabPage::Reset( const SfxItemSet& rSet )
611ac47
 
611ac47
     _nWhich = GetWhich( SID_ATTR_PARA_PAGENUM );
611ac47
 
611ac47
-    if ( rSet.GetItemState(_nWhich) >= SFX_ITEM_AVAILABLE )
611ac47
+    if ( rSet.GetItemState(_nWhich) >= SFX_ITEM_SET )
611ac47
     {
611ac47
         const sal_uInt16 nPageNum =
611ac47
             ( (const SfxUInt16Item&)rSet.Get( _nWhich ) ).GetValue();
611ac47
diff --git a/sw/source/ui/utlui/uitool.cxx b/sw/source/ui/utlui/uitool.cxx
611ac47
index 512d0bd..e0c4a36 100644
611ac47
--- a/sw/source/ui/utlui/uitool.cxx
611ac47
+++ b/sw/source/ui/utlui/uitool.cxx
611ac47
@@ -642,10 +642,9 @@ void SwToSfxPageDescAttr( SfxItemSet& rCoreSet )
611ac47
         bPut = false;
611ac47
     }
611ac47
 
611ac47
-    // TODO for now always pass a page number to cui, it can't make a
611ac47
-    // difference between 0 and no page number at the moment.
611ac47
+    if (oNumOffset)
611ac47
     {
611ac47
-        SfxUInt16Item aPageNum( SID_ATTR_PARA_PAGENUM, oNumOffset ? oNumOffset.get() : 0 );
611ac47
+        SfxUInt16Item aPageNum( SID_ATTR_PARA_PAGENUM, oNumOffset.get() );
611ac47
         rCoreSet.Put( aPageNum );
611ac47
     }
611ac47
 
611ac47
-- 
611ac47
1.9.3
611ac47