Re: [PATCH] fdo#47018 fix Impress crash on modifying bullet

2013-04-12 Thread Stephan van den Akker
Hi, Cao,

Just checked your patch (Change-Id:
I57d1245db650d12e6b2c05baece379038b673689) merged with:

Version: 4.1.0.0.alpha0+
Build ID: 0b897dd455968862e348de2c5e1c57d4d73640b

This patch indeed fixes all of the problems mentioned in fdo#47018,
including the crash.

Brilliant. Thanks a lot, Cao!

AFAIK the patched code is used in Impress, but also in Calc and Draw. I'll
be running this build at the office for a couple of days. I'll let you know
if I notice any unwanted side effects in other use cases.

Greetings,

Stephan


2013/4/12 Stephan van den Akker stephanv...@gmail.com

 Hi Cao,

 That sounds great!

 Building LO now with your patch. Stay tuned

 Greetings,

 Stephan




 2013/4/12 Cao Cuong Ngo cao.cuong@gmail.com


 Hi Stephan,

 Thanks for taking the time to test it :-)

 I've made a new patch that fixes the crash and the copy/paste action.

 You can try it here

 https://gerrit.libreoffice.org/3352

 Best,
 Cao Cuong Ngo


 On 04/09/2013 05:05 PM, Stephan van den Akker wrote:

   Just tested this patch, applied to:

 Version: 4.1.0.0.alpha0+
 Build ID: 2705fc72df2058332773b5cb04a6b4d207f5e39

  The proposed patch will prevent the crash, but it seems that the
 underlying problem is not solved by this:
 The bullets do not survive the copy / paste action of the
 EditEngineFormat: Copy/paste of bulletted text into an already bulletted
 empty line still makes the bullet disappear.

  So I would say that there is progress, but IMHO the patch doesn't
 warrant the closing of fdo#47018.

  Greetings, and thanks for the good work.

  Stephan van den Akker


 2013/4/9 Stephan van den Akker stephanv...@gmail.com

 Building LO with this patch now. I will report my findings asap.


 2013/4/9 Cao Cuong Ngo (via Code Review) ger...@gerrit.libreoffice.org

 Hi,

 I have submitted a patch for review:

 https://gerrit.libreoffice.org/3285

 To pull it, you can do:

 git pull ssh://gerrit.libreoffice.org:29418/corerefs/changes/85/3285/1

 fdo#47018 fix Impress crash on modifying bullet

 Add verifying of numbering rule to avoid invalidated attribute

 Change-Id: Ifc3db3f09f9358d272245f1e00fad2802f5881ee
 ---
 M sd/source/ui/func/fuolbull.cxx
 1 file changed, 11 insertions(+), 1 deletion(-)



 diff --git a/sd/source/ui/func/fuolbull.cxx
 b/sd/source/ui/func/fuolbull.cxx
 index ae29032..49fd245 100644
 --- a/sd/source/ui/func/fuolbull.cxx
 +++ b/sd/source/ui/func/fuolbull.cxx
 @@ -22,6 +22,7 @@
  #include svl/intitem.hxx
  #include editeng/outliner.hxx
  #include editeng/eeitem.hxx
 +#include editeng/numitem.hxx
  #include sfx2/request.hxx

  #include editeng/editdata.hxx
 @@ -64,7 +65,16 @@

  SfxItemSet aNewAttr( mpViewShell-GetPool(),
   EE_ITEMS_START, EE_ITEMS_END );
 -aNewAttr.Put( aEditAttr, sal_False );
 +
 +// fdo#47018 verify numbering rule
 +const SfxPoolItem* pItem;
 +sal_uInt16 nWhich =
 aEditAttr.GetPool()-GetWhich(SID_ATTR_NUMBERING_RULE);
 +aEditAttr.GetItemState(nWhich, sal_False, pItem);
 +const sal_uInt16 levelCount =
 (*((SvxNumBulletItem*)pItem)-GetNumRule()).GetLevelCount();
 +
 +// check if the attribute is valid
 +if ( levelCount )
 +aNewAttr.Put( aEditAttr, sal_False );

  // create and execute dialog
  SdAbstractDialogFactory* pFact =
 SdAbstractDialogFactory::Create();

 --
 To view, visit https://gerrit.libreoffice.org/3285
 To unsubscribe, visit https://gerrit.libreoffice.org/settings

 Gerrit-MessageType: newchange
 Gerrit-Change-Id: Ifc3db3f09f9358d272245f1e00fad2802f5881ee
 Gerrit-PatchSet: 1
 Gerrit-Project: core
 Gerrit-Branch: master
 Gerrit-Owner: Cao Cuong Ngo cao.cuong@gmail.com

 ___
 LibreOffice mailing list
 LibreOffice@lists.freedesktop.org
 http://lists.freedesktop.org/mailman/listinfo/libreoffice






___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


Re: [PATCH] fdo#47018 fix Impress crash on modifying bullet

2013-04-12 Thread Cao Cuong Ngo
Hi Stephan,

In fact a more proper solution is to write everything to SvStream and
restores from it in pasting ( which is currently not completely
implemented).
I've finish the attributes loading from SvStream here
https://gerrit.libreoffice.org/#/c/3369/.
However, in numpages.cxx the tab picking page is messed up between
SvxNumBulletItem and SvxBulletItem, so everything is infered as
SvxNumBulletItem now!
The result is that we can only store and load from numbering type, not
bullet nor graphics yet...

Thanks,
CC Ngo.

On 04/12/2013 12:28 PM, Stephan van den Akker wrote:
 Hi, Cao,

 Just checked your patch (Change-Id:
 I57d1245db650d12e6b2c05baece379038b673689) merged with:

 Version: 4.1.0.0.alpha0+
 Build ID: 0b897dd455968862e348de2c5e1c57d4d73640b

 This patch indeed fixes all of the problems mentioned in fdo#47018,
 including the crash.

 Brilliant. Thanks a lot, Cao!

 AFAIK the patched code is used in Impress, but also in Calc and Draw.
 I'll be running this build at the office for a couple of days. I'll
 let you know if I notice any unwanted side effects in other use cases.

 Greetings,

 Stephan


 2013/4/12 Stephan van den Akker stephanv...@gmail.com
 mailto:stephanv...@gmail.com

 Hi Cao,

 That sounds great!

 Building LO now with your patch. Stay tuned

 Greetings,

 Stephan




 2013/4/12 Cao Cuong Ngo cao.cuong@gmail.com
 mailto:cao.cuong@gmail.com


 Hi Stephan,

 Thanks for taking the time to test it :-)

 I've made a new patch that fixes the crash and the copy/paste
 action.

 You can try it here

 https://gerrit.libreoffice.org/3352

 Best,
 Cao Cuong Ngo


 On 04/09/2013 05:05 PM, Stephan van den Akker wrote:
 Just tested this patch, applied to:

 Version: 4.1.0.0.alpha0+
 Build ID: 2705fc72df2058332773b5cb04a6b4d207f5e39

 The proposed patch will prevent the crash, but it seems that
 the underlying problem is not solved by this:
 The bullets do not survive the copy / paste action of the
 EditEngineFormat: Copy/paste of bulletted text into an
 already bulletted empty line still makes the bullet disappear.

 So I would say that there is progress, but IMHO the patch
 doesn't warrant the closing of fdo#47018.

 Greetings, and thanks for the good work.

 Stephan van den Akker


 2013/4/9 Stephan van den Akker stephanv...@gmail.com
 mailto:stephanv...@gmail.com

 Building LO with this patch now. I will report my
 findings asap.


 2013/4/9 Cao Cuong Ngo (via Code Review)
 ger...@gerrit.libreoffice.org
 mailto:ger...@gerrit.libreoffice.org

 Hi,

 I have submitted a patch for review:

 https://gerrit.libreoffice.org/3285

 To pull it, you can do:

 git pull ssh://gerrit.libreoffice.org:29418/core
 http://gerrit.libreoffice.org:29418/core
 refs/changes/85/3285/1

 fdo#47018 fix Impress crash on modifying bullet

 Add verifying of numbering rule to avoid invalidated
 attribute

 Change-Id: Ifc3db3f09f9358d272245f1e00fad2802f5881ee
 ---
 M sd/source/ui/func/fuolbull.cxx
 1 file changed, 11 insertions(+), 1 deletion(-)



 diff --git a/sd/source/ui/func/fuolbull.cxx
 b/sd/source/ui/func/fuolbull.cxx
 index ae29032..49fd245 100644
 --- a/sd/source/ui/func/fuolbull.cxx
 +++ b/sd/source/ui/func/fuolbull.cxx
 @@ -22,6 +22,7 @@
  #include svl/intitem.hxx
  #include editeng/outliner.hxx
  #include editeng/eeitem.hxx
 +#include editeng/numitem.hxx
  #include sfx2/request.hxx

  #include editeng/editdata.hxx
 @@ -64,7 +65,16 @@

  SfxItemSet aNewAttr( mpViewShell-GetPool(),
   EE_ITEMS_START,
 EE_ITEMS_END );
 -aNewAttr.Put( aEditAttr, sal_False );
 +
 +// fdo#47018 verify numbering rule
 +const SfxPoolItem* pItem;
 +sal_uInt16 nWhich =
 aEditAttr.GetPool()-GetWhich(SID_ATTR_NUMBERING_RULE);
 +aEditAttr.GetItemState(nWhich, sal_False,
 pItem);
 +const sal_uInt16 levelCount =
 (*((SvxNumBulletItem*)pItem)-GetNumRule()).GetLevelCount();
 +
 +// check if the attribute is valid
 +if ( levelCount )
 +aNewAttr.Put( 

Re: [PATCH] fdo#47018 fix Impress crash on modifying bullet

2013-04-11 Thread Cao Cuong Ngo

Hi Stephan,

Thanks for taking the time to test it :-)

I've made a new patch that fixes the crash and the copy/paste action.

You can try it here

https://gerrit.libreoffice.org/3352

Best,
Cao Cuong Ngo

On 04/09/2013 05:05 PM, Stephan van den Akker wrote:
 Just tested this patch, applied to:

 Version: 4.1.0.0.alpha0+
 Build ID: 2705fc72df2058332773b5cb04a6b4d207f5e39

 The proposed patch will prevent the crash, but it seems that the
 underlying problem is not solved by this:
 The bullets do not survive the copy / paste action of the
 EditEngineFormat: Copy/paste of bulletted text into an already
 bulletted empty line still makes the bullet disappear.

 So I would say that there is progress, but IMHO the patch doesn't
 warrant the closing of fdo#47018.

 Greetings, and thanks for the good work.

 Stephan van den Akker


 2013/4/9 Stephan van den Akker stephanv...@gmail.com
 mailto:stephanv...@gmail.com

 Building LO with this patch now. I will report my findings asap.


 2013/4/9 Cao Cuong Ngo (via Code Review)
 ger...@gerrit.libreoffice.org
 mailto:ger...@gerrit.libreoffice.org

 Hi,

 I have submitted a patch for review:

 https://gerrit.libreoffice.org/3285

 To pull it, you can do:

 git pull ssh://gerrit.libreoffice.org:29418/core
 http://gerrit.libreoffice.org:29418/core refs/changes/85/3285/1

 fdo#47018 fix Impress crash on modifying bullet

 Add verifying of numbering rule to avoid invalidated attribute

 Change-Id: Ifc3db3f09f9358d272245f1e00fad2802f5881ee
 ---
 M sd/source/ui/func/fuolbull.cxx
 1 file changed, 11 insertions(+), 1 deletion(-)



 diff --git a/sd/source/ui/func/fuolbull.cxx
 b/sd/source/ui/func/fuolbull.cxx
 index ae29032..49fd245 100644
 --- a/sd/source/ui/func/fuolbull.cxx
 +++ b/sd/source/ui/func/fuolbull.cxx
 @@ -22,6 +22,7 @@
  #include svl/intitem.hxx
  #include editeng/outliner.hxx
  #include editeng/eeitem.hxx
 +#include editeng/numitem.hxx
  #include sfx2/request.hxx

  #include editeng/editdata.hxx
 @@ -64,7 +65,16 @@

  SfxItemSet aNewAttr( mpViewShell-GetPool(),
   EE_ITEMS_START, EE_ITEMS_END );
 -aNewAttr.Put( aEditAttr, sal_False );
 +
 +// fdo#47018 verify numbering rule
 +const SfxPoolItem* pItem;
 +sal_uInt16 nWhich =
 aEditAttr.GetPool()-GetWhich(SID_ATTR_NUMBERING_RULE);
 +aEditAttr.GetItemState(nWhich, sal_False, pItem);
 +const sal_uInt16 levelCount =
 (*((SvxNumBulletItem*)pItem)-GetNumRule()).GetLevelCount();
 +
 +// check if the attribute is valid
 +if ( levelCount )
 +aNewAttr.Put( aEditAttr, sal_False );

  // create and execute dialog
  SdAbstractDialogFactory* pFact =
 SdAbstractDialogFactory::Create();

 --
 To view, visit https://gerrit.libreoffice.org/3285
 To unsubscribe, visit https://gerrit.libreoffice.org/settings

 Gerrit-MessageType: newchange
 Gerrit-Change-Id: Ifc3db3f09f9358d272245f1e00fad2802f5881ee
 Gerrit-PatchSet: 1
 Gerrit-Project: core
 Gerrit-Branch: master
 Gerrit-Owner: Cao Cuong Ngo cao.cuong@gmail.com
 mailto:cao.cuong@gmail.com

 ___
 LibreOffice mailing list
 LibreOffice@lists.freedesktop.org
 mailto:LibreOffice@lists.freedesktop.org
 http://lists.freedesktop.org/mailman/listinfo/libreoffice




___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


[PATCH] fdo#47018 fix Impress crash on modifying bullet

2013-04-09 Thread Cao Cuong Ngo (via Code Review)
Hi,

I have submitted a patch for review:

https://gerrit.libreoffice.org/3285

To pull it, you can do:

git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/85/3285/1

fdo#47018 fix Impress crash on modifying bullet

Add verifying of numbering rule to avoid invalidated attribute

Change-Id: Ifc3db3f09f9358d272245f1e00fad2802f5881ee
---
M sd/source/ui/func/fuolbull.cxx
1 file changed, 11 insertions(+), 1 deletion(-)



diff --git a/sd/source/ui/func/fuolbull.cxx b/sd/source/ui/func/fuolbull.cxx
index ae29032..49fd245 100644
--- a/sd/source/ui/func/fuolbull.cxx
+++ b/sd/source/ui/func/fuolbull.cxx
@@ -22,6 +22,7 @@
 #include svl/intitem.hxx
 #include editeng/outliner.hxx
 #include editeng/eeitem.hxx
+#include editeng/numitem.hxx
 #include sfx2/request.hxx
 
 #include editeng/editdata.hxx
@@ -64,7 +65,16 @@
 
 SfxItemSet aNewAttr( mpViewShell-GetPool(),
  EE_ITEMS_START, EE_ITEMS_END );
-aNewAttr.Put( aEditAttr, sal_False );
+
+// fdo#47018 verify numbering rule
+const SfxPoolItem* pItem;
+sal_uInt16 nWhich = 
aEditAttr.GetPool()-GetWhich(SID_ATTR_NUMBERING_RULE);
+aEditAttr.GetItemState(nWhich, sal_False, pItem);
+const sal_uInt16 levelCount = 
(*((SvxNumBulletItem*)pItem)-GetNumRule()).GetLevelCount();
+
+// check if the attribute is valid
+if ( levelCount )
+aNewAttr.Put( aEditAttr, sal_False );
 
 // create and execute dialog
 SdAbstractDialogFactory* pFact = SdAbstractDialogFactory::Create();

-- 
To view, visit https://gerrit.libreoffice.org/3285
To unsubscribe, visit https://gerrit.libreoffice.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ifc3db3f09f9358d272245f1e00fad2802f5881ee
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: master
Gerrit-Owner: Cao Cuong Ngo cao.cuong@gmail.com

___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


Re: [PATCH] fdo#47018 fix Impress crash on modifying bullet

2013-04-09 Thread Stephan van den Akker
Building LO with this patch now. I will report my findings asap.


2013/4/9 Cao Cuong Ngo (via Code Review) ger...@gerrit.libreoffice.org

 Hi,

 I have submitted a patch for review:

 https://gerrit.libreoffice.org/3285

 To pull it, you can do:

 git pull ssh://gerrit.libreoffice.org:29418/corerefs/changes/85/3285/1

 fdo#47018 fix Impress crash on modifying bullet

 Add verifying of numbering rule to avoid invalidated attribute

 Change-Id: Ifc3db3f09f9358d272245f1e00fad2802f5881ee
 ---
 M sd/source/ui/func/fuolbull.cxx
 1 file changed, 11 insertions(+), 1 deletion(-)



 diff --git a/sd/source/ui/func/fuolbull.cxx
 b/sd/source/ui/func/fuolbull.cxx
 index ae29032..49fd245 100644
 --- a/sd/source/ui/func/fuolbull.cxx
 +++ b/sd/source/ui/func/fuolbull.cxx
 @@ -22,6 +22,7 @@
  #include svl/intitem.hxx
  #include editeng/outliner.hxx
  #include editeng/eeitem.hxx
 +#include editeng/numitem.hxx
  #include sfx2/request.hxx

  #include editeng/editdata.hxx
 @@ -64,7 +65,16 @@

  SfxItemSet aNewAttr( mpViewShell-GetPool(),
   EE_ITEMS_START, EE_ITEMS_END );
 -aNewAttr.Put( aEditAttr, sal_False );
 +
 +// fdo#47018 verify numbering rule
 +const SfxPoolItem* pItem;
 +sal_uInt16 nWhich =
 aEditAttr.GetPool()-GetWhich(SID_ATTR_NUMBERING_RULE);
 +aEditAttr.GetItemState(nWhich, sal_False, pItem);
 +const sal_uInt16 levelCount =
 (*((SvxNumBulletItem*)pItem)-GetNumRule()).GetLevelCount();
 +
 +// check if the attribute is valid
 +if ( levelCount )
 +aNewAttr.Put( aEditAttr, sal_False );

  // create and execute dialog
  SdAbstractDialogFactory* pFact =
 SdAbstractDialogFactory::Create();

 --
 To view, visit https://gerrit.libreoffice.org/3285
 To unsubscribe, visit https://gerrit.libreoffice.org/settings

 Gerrit-MessageType: newchange
 Gerrit-Change-Id: Ifc3db3f09f9358d272245f1e00fad2802f5881ee
 Gerrit-PatchSet: 1
 Gerrit-Project: core
 Gerrit-Branch: master
 Gerrit-Owner: Cao Cuong Ngo cao.cuong@gmail.com

 ___
 LibreOffice mailing list
 LibreOffice@lists.freedesktop.org
 http://lists.freedesktop.org/mailman/listinfo/libreoffice

___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


Re: [PATCH] fdo#47018 fix Impress crash on modifying bullet

2013-04-09 Thread Stephan van den Akker
Just tested this patch, applied to:

Version: 4.1.0.0.alpha0+
Build ID: 2705fc72df2058332773b5cb04a6b4d207f5e39

The proposed patch will prevent the crash, but it seems that the underlying
problem is not solved by this:
The bullets do not survive the copy / paste action of the EditEngineFormat:
Copy/paste of bulletted text into an already bulletted empty line still
makes the bullet disappear.

So I would say that there is progress, but IMHO the patch doesn't warrant
the closing of fdo#47018.

Greetings, and thanks for the good work.

Stephan van den Akker


2013/4/9 Stephan van den Akker stephanv...@gmail.com

 Building LO with this patch now. I will report my findings asap.


 2013/4/9 Cao Cuong Ngo (via Code Review) ger...@gerrit.libreoffice.org

 Hi,

 I have submitted a patch for review:

 https://gerrit.libreoffice.org/3285

 To pull it, you can do:

 git pull ssh://gerrit.libreoffice.org:29418/corerefs/changes/85/3285/1

 fdo#47018 fix Impress crash on modifying bullet

 Add verifying of numbering rule to avoid invalidated attribute

 Change-Id: Ifc3db3f09f9358d272245f1e00fad2802f5881ee
 ---
 M sd/source/ui/func/fuolbull.cxx
 1 file changed, 11 insertions(+), 1 deletion(-)



 diff --git a/sd/source/ui/func/fuolbull.cxx
 b/sd/source/ui/func/fuolbull.cxx
 index ae29032..49fd245 100644
 --- a/sd/source/ui/func/fuolbull.cxx
 +++ b/sd/source/ui/func/fuolbull.cxx
 @@ -22,6 +22,7 @@
  #include svl/intitem.hxx
  #include editeng/outliner.hxx
  #include editeng/eeitem.hxx
 +#include editeng/numitem.hxx
  #include sfx2/request.hxx

  #include editeng/editdata.hxx
 @@ -64,7 +65,16 @@

  SfxItemSet aNewAttr( mpViewShell-GetPool(),
   EE_ITEMS_START, EE_ITEMS_END );
 -aNewAttr.Put( aEditAttr, sal_False );
 +
 +// fdo#47018 verify numbering rule
 +const SfxPoolItem* pItem;
 +sal_uInt16 nWhich =
 aEditAttr.GetPool()-GetWhich(SID_ATTR_NUMBERING_RULE);
 +aEditAttr.GetItemState(nWhich, sal_False, pItem);
 +const sal_uInt16 levelCount =
 (*((SvxNumBulletItem*)pItem)-GetNumRule()).GetLevelCount();
 +
 +// check if the attribute is valid
 +if ( levelCount )
 +aNewAttr.Put( aEditAttr, sal_False );

  // create and execute dialog
  SdAbstractDialogFactory* pFact =
 SdAbstractDialogFactory::Create();

 --
 To view, visit https://gerrit.libreoffice.org/3285
 To unsubscribe, visit https://gerrit.libreoffice.org/settings

 Gerrit-MessageType: newchange
 Gerrit-Change-Id: Ifc3db3f09f9358d272245f1e00fad2802f5881ee
 Gerrit-PatchSet: 1
 Gerrit-Project: core
 Gerrit-Branch: master
 Gerrit-Owner: Cao Cuong Ngo cao.cuong@gmail.com

 ___
 LibreOffice mailing list
 LibreOffice@lists.freedesktop.org
 http://lists.freedesktop.org/mailman/listinfo/libreoffice



___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice