[ooo-build-commit] Branch 'ooo/master' - 5 commits - avmedia/prj basic/prj connectivity/prj connectivity/source desktop/prj fpicker/prj framework/prj officecfg/prj readlicense_oo/prj sfx2/prj shell/prj svx/inc svx/prj svx/source sysui/prj uui/prj xmloff/source
Jan Holesovsky
kendy at kemper.freedesktop.org
Wed Jun 17 18:07:34 PDT 2009
avmedia/prj/build.lst | 2
basic/prj/build.lst | 2
connectivity/prj/build.lst | 2
connectivity/source/drivers/evoab2/NResultSet.cxx | 1
desktop/prj/build.lst | 2
fpicker/prj/build.lst | 2
framework/prj/build.lst | 2
officecfg/prj/build.lst | 2
readlicense_oo/prj/build.lst | 2
sfx2/prj/build.lst | 2
shell/prj/build.lst | 2
svx/inc/svx/editview.hxx | 4
svx/inc/svx/outliner.hxx | 3
svx/inc/svx/sdr/contact/viewcontactofsdrobjcustomshape.hxx | 3
svx/inc/svx/svdfppt.hxx | 12
svx/inc/svx/svdoashp.hxx | 2
svx/prj/build.lst | 2
svx/source/customshapes/EnhancedCustomShape2d.cxx | 35
svx/source/customshapes/EnhancedCustomShapeEngine.cxx | 32
svx/source/dialog/imapdlg.cxx | 5
svx/source/editeng/editview.cxx | 51 +
svx/source/editeng/impedit2.cxx | 38
svx/source/outliner/outlvw.cxx | 12
svx/source/sdr/contact/viewcontactofsdrobjcustomshape.cxx | 103 ++
svx/source/sdr/properties/textproperties.cxx | 2
svx/source/svdraw/svdfppt.cxx | 495 +++++++------
svx/source/svdraw/svdoashp.cxx | 119 ++-
svx/source/table/cell.cxx | 5
svx/source/table/cellcursor.cxx | 71 -
svx/source/table/cellcursor.hxx | 2
svx/source/table/tablecontroller.cxx | 22
svx/source/table/tablelayouter.cxx | 136 ++-
svx/source/table/tablemodel.cxx | 118 +--
svx/source/table/tablemodel.hxx | 3
sysui/prj/build.lst | 2
uui/prj/build.lst | 2
xmloff/source/draw/animationexport.cxx | 2
xmloff/source/draw/animationimport.cxx | 2
38 files changed, 885 insertions(+), 419 deletions(-)
New commits:
commit a824675db17bd338d590215cfb65b35e736c18e1
Author: Ivo Hinkelmann <ihi at openoffice.org>
Date: Wed Jun 17 16:21:54 2009 +0000
#i10000# add dependency
diff --git a/avmedia/prj/build.lst b/avmedia/prj/build.lst
index ba1a5f6..1ef04ca 100644
--- a/avmedia/prj/build.lst
+++ b/avmedia/prj/build.lst
@@ -1,4 +1,4 @@
-av avmedia : l10n sfx2 NULL
+av avmedia : l10n tools sfx2 NULL
av avmedia usr1 - all av_mkout NULL
av avmedia\prj get - all av_prj NULL
av avmedia\inc get - all av_inv NULL
commit 376d33aec8bd059043be9275a14fdaa00aecbed8
Author: Ivo Hinkelmann <ihi at openoffice.org>
Date: Wed Jun 17 13:15:46 2009 +0000
CWS-TOOLING: integrate CWS l10ncleanup04
2009-05-28 13:46:54 +0200 ihi r272407 : remove forgotten sdf's
2009-05-25 22:32:35 +0200 ihi r272273 : no WITH_LANG fix
2009-05-25 20:45:58 +0200 ihi r272272 : remove some comments
2009-05-25 19:55:21 +0200 ihi r272271 : svx dialog -> cui l10n move
2009-05-25 18:30:58 +0200 ihi r272268 : build fix
2009-05-18 16:32:02 +0200 ihi r272033 : bash fix
2009-05-18 16:31:32 +0200 ihi r272032 : bash fix
2009-05-14 16:23:39 +0200 ihi r271901 : #i79750# Translation moved to l10n module
2009-05-11 23:36:05 +0200 ihi r271793 : #i79750# Translation moved into own module
diff --git a/avmedia/prj/build.lst b/avmedia/prj/build.lst
index 58fed86..ba1a5f6 100644
--- a/avmedia/prj/build.lst
+++ b/avmedia/prj/build.lst
@@ -1,4 +1,4 @@
-av avmedia : sfx2 NULL
+av avmedia : l10n sfx2 NULL
av avmedia usr1 - all av_mkout NULL
av avmedia\prj get - all av_prj NULL
av avmedia\inc get - all av_inv NULL
diff --git a/basic/prj/build.lst b/basic/prj/build.lst
index 5f8cf00..ec6bd0e 100644
--- a/basic/prj/build.lst
+++ b/basic/prj/build.lst
@@ -1,4 +1,4 @@
-sb basic : offuh svtools sj2 xmlscript framework NULL
+sb basic : l10n offuh svtools sj2 xmlscript framework NULL
sb basic usr1 - all sb_mkout NULL
sb basic\inc nmake - all sb_inc NULL
sb basic\source\app nmake - all sb_app sb_class sb_inc NULL
diff --git a/connectivity/prj/build.lst b/connectivity/prj/build.lst
index 4a35e4a..077c241 100644
--- a/connectivity/prj/build.lst
+++ b/connectivity/prj/build.lst
@@ -1,4 +1,4 @@
-cn connectivity : comphelper MOZ:moz SO:moz_prebuilt svtools UNIXODBC:unixODBC unoil javaunohelper HSQLDB:hsqldb QADEVOOO:qadevOOo NULL
+cn connectivity : l10n comphelper MOZ:moz SO:moz_prebuilt svtools UNIXODBC:unixODBC unoil javaunohelper HSQLDB:hsqldb QADEVOOO:qadevOOo NULL
cn connectivity usr1 - all cn_mkout NULL
cn connectivity\inc nmake - all cn_inc NULL
cn connectivity\com\sun\star\sdbcx\comp\hsqldb nmake - all cn_jhsqldbdb cn_hsqldb cn_inc NULL
diff --git a/desktop/prj/build.lst b/desktop/prj/build.lst
index 89c2d8c..4b6a566 100644
--- a/desktop/prj/build.lst
+++ b/desktop/prj/build.lst
@@ -1,4 +1,4 @@
-dt desktop : sfx2 stoc uui BERKELEYDB:berkeleydb sysui SO:sysui_so BOOST:boost svx xmlhelp NULL
+dt desktop : l10n sfx2 stoc uui BERKELEYDB:berkeleydb sysui SO:sysui_so BOOST:boost svx xmlhelp NULL
dt desktop usr1 - all dt_mkout NULL
dt desktop\inc nmake - all dt_inc NULL
dt desktop\prj get - all dt_prj NULL
diff --git a/fpicker/prj/build.lst b/fpicker/prj/build.lst
index 7f4ee87..87084f1 100644
--- a/fpicker/prj/build.lst
+++ b/fpicker/prj/build.lst
@@ -1,4 +1,4 @@
-fp fpicker : rdbmaker svtools NULL
+fp fpicker : l10n rdbmaker svtools NULL
fp fpicker\inc nmake - all fp_inc NULL
fp fpicker\source\generic nmake - all fp_generic fp_inc NULL
fp fpicker\source\office nmake - all fp_office fp_inc NULL
diff --git a/framework/prj/build.lst b/framework/prj/build.lst
index d7fc149..b981403 100644
--- a/framework/prj/build.lst
+++ b/framework/prj/build.lst
@@ -1,4 +1,4 @@
-fr framework : svtools NULL
+fr framework : l10n svtools NULL
fr framework usr1 - all fr_mkout NULL
fr framework\inc nmake - all fr_inc NULL
fr framework\source\constant nmake - all fr_constant fr_inc NULL
diff --git a/officecfg/prj/build.lst b/officecfg/prj/build.lst
index 88495a6..b128b44 100644
--- a/officecfg/prj/build.lst
+++ b/officecfg/prj/build.lst
@@ -1,4 +1,4 @@
-oc officecfg : soltools solenv transex3 LIBXSLT:libxslt NULL
+oc officecfg : l10n soltools solenv LIBXSLT:libxslt NULL
oc officecfg usr30073 - none NULL
oc officecfg usr1 - all oc_mkout NULL
oc officecfg\registry\schema nmake - all oc_reg_schema NULL
diff --git a/readlicense_oo/prj/build.lst b/readlicense_oo/prj/build.lst
index e302b5d..987672d 100644
--- a/readlicense_oo/prj/build.lst
+++ b/readlicense_oo/prj/build.lst
@@ -1,4 +1,4 @@
-ro readlicense_oo : solenv transex3 LIBXSLT:libxslt NULL
+ro readlicense_oo : l10n solenv LIBXSLT:libxslt NULL
ro readlicense_oo usr1 - all ro_root NULL
ro readlicense_oo\docs\readme nmake - all ro_readme NULL
ro readlicense_oo\html nmake - all ro_html NULL
diff --git a/sfx2/prj/build.lst b/sfx2/prj/build.lst
index 72ba4ac..fc6984c 100644
--- a/sfx2/prj/build.lst
+++ b/sfx2/prj/build.lst
@@ -1,4 +1,4 @@
-sf sfx2 : idl basic xmlscript framework shell setup_native sax SYSTRAY_GTK:libegg NULL
+sf sfx2 : l10n idl basic xmlscript framework shell setup_native sax SYSTRAY_GTK:libegg NULL
sf sfx2 usr1 - all sf_mkout NULL
sf sfx2\inc nmake - all sf_inc NULL
sf sfx2\prj get - all sf_prj NULL
diff --git a/shell/prj/build.lst b/shell/prj/build.lst
index 9758834..01077cb 100644
--- a/shell/prj/build.lst
+++ b/shell/prj/build.lst
@@ -1,4 +1,4 @@
-sl shell : offuh rdbmaker tools sal vcl EXPAT:expat transex3 NULL
+sl shell : l10n offuh rdbmaker tools sal vcl EXPAT:expat NULL
sl shell\inc nmake - all sl_inc NULL
sl shell\source\win32 nmake - w sl_win32 sl_inc NULL
sl shell\source\win32\simplemail nmake - w sl_win32_simplemail sl_inc NULL
diff --git a/svx/prj/build.lst b/svx/prj/build.lst
index 51d1217..5698070 100644
--- a/svx/prj/build.lst
+++ b/svx/prj/build.lst
@@ -1,4 +1,4 @@
-sx svx : connectivity xmloff linguistic jvmfwk avmedia configmgr ucb fileaccess drawinglayer NULL
+sx svx : l10n connectivity xmloff linguistic jvmfwk avmedia configmgr ucb fileaccess drawinglayer NULL
sx svx usr1 - all sx_mkout NULL
sx svx\inc nmake - all sx_inc NULL
sx svx\uiconfig\layout nmake - all sx_layout NULL
diff --git a/sysui/prj/build.lst b/sysui/prj/build.lst
index 151595e..9f6934e 100644
--- a/sysui/prj/build.lst
+++ b/sysui/prj/build.lst
@@ -1,4 +1,4 @@
-su sysui : offapi xml2cmp rdbmaker transex3 setup_native NULL
+su sysui : l10n offapi xml2cmp rdbmaker transex3 setup_native NULL
su sysui\source\win32\QuickStart nmake - w su_win32_quickstart NULL
su sysui\source\win32\QuickStart\so nmake - w su_win32_quickstart_so su_win32_quickstart.w NULL
su sysui\desktop\icons nmake - w su_iconsw NULL
diff --git a/uui/prj/build.lst b/uui/prj/build.lst
index 500a4fc..0ebacfc 100644
--- a/uui/prj/build.lst
+++ b/uui/prj/build.lst
@@ -1,4 +1,4 @@
-uu uui : svtools NULL
+uu uui : l10n svtools NULL
uu uui usr1 - all uu_mkout NULL
uu uui\source nmake - all uu_source NULL
uu uui\util nmake - all uu_util uu_source NULL
commit 1a3a1ba913c73a3ed06b4682128e59d48f343566
Author: Ivo Hinkelmann <ihi at openoffice.org>
Date: Wed Jun 17 12:31:00 2009 +0000
#i10000# fix bad integration
diff --git a/svx/source/table/tablecontroller.cxx b/svx/source/table/tablecontroller.cxx
index c07bb66..2a9aa3e 100644
--- a/svx/source/table/tablecontroller.cxx
+++ b/svx/source/table/tablecontroller.cxx
@@ -582,7 +582,10 @@ void SvxTableController::onInsert( sal_uInt16 nSId )
}
if( bUndo )
+ {
mpModel->EndUndo();
+ mpModel->SetChanged();
+ }
if( mpModel )
mpModel->SetChanged();
@@ -987,6 +990,9 @@ void SvxTableController::MergeMarkedCells()
SdrTableObj* pTableObj = dynamic_cast< ::sdr::table::SdrTableObj* >( mxTableObj.get() );
if( pTableObj )
{
+ if( pTableObj->IsTextEditActive() )
+ mpView->SdrEndTextEdit(sal_True);
+
TableModelNotifyGuard aGuard( mxTable.get() );
MergeRange( aStart.mnCol, aStart.mnRow, aEnd.mnCol, aEnd.mnRow );
}
@@ -1018,6 +1024,9 @@ void SvxTableController::SplitMarkedCells()
SdrTableObj* pTableObj = dynamic_cast< SdrTableObj* >( mxTableObj.get() );
if( pTableObj )
{
+ if( pTableObj->IsTextEditActive() )
+ mpView->SdrEndTextEdit(sal_True);
+
TableModelNotifyGuard aGuard( mxTable.get() );
const bool bUndo = mpModel && mpModel->IsUndoEnabled();
@@ -1476,7 +1485,16 @@ bool SvxTableController::executeAction( sal_uInt16 nAction, bool bSelect, Window
if( bSelect )
gotoCell( pTableObj->getPreviousCell( getSelectionEnd(), true ), false, pWindow, nAction );
else
- gotoCell( pTableObj->getNextCell( getSelectionEnd(), true ), false, pWindow, nAction );
+ {
+ CellPos aSelectionEnd( getSelectionEnd() );
+ CellPos aNextCell( pTableObj->getNextCell( aSelectionEnd, true ) );
+ if( aSelectionEnd == aNextCell )
+ {
+ onInsert( SID_TABLE_INSERT_ROW );
+ aNextCell = pTableObj->getNextCell( aSelectionEnd, true );
+ }
+ gotoCell( aNextCell, false, pWindow, nAction );
+ }
break;
}
}
@@ -1974,7 +1992,7 @@ void SvxTableController::MergeAttrFromSelectedCells(SfxItemSet& rAttr, bool bOnl
for( sal_Int32 nCol = aStart.mnCol; nCol <= aEnd.mnCol; nCol++ )
{
CellRef xCell( dynamic_cast< Cell* >( mxTable->getCellByPosition( nCol, nRow ).get() ) );
- if( xCell.is() )
+ if( xCell.is() && !xCell->isMerged() )
{
const SfxItemSet& rSet = xCell->GetItemSet();
SfxWhichIter aIter(rSet);
commit 362b77882077e3564973a86ffed1e82587852356
Author: Ivo Hinkelmann <ihi at openoffice.org>
Date: Wed Jun 17 11:12:34 2009 +0000
#i10000# #i102672# gcc build fix
diff --git a/connectivity/source/drivers/evoab2/NResultSet.cxx b/connectivity/source/drivers/evoab2/NResultSet.cxx
index b6cb100..1b79c43 100644
--- a/connectivity/source/drivers/evoab2/NResultSet.cxx
+++ b/connectivity/source/drivers/evoab2/NResultSet.cxx
@@ -57,6 +57,7 @@
#include <svtools/syslocale.hxx>
#include <unotools/intlwrapper.hxx>
+#include <cstring>
#include <vector>
namespace connectivity { namespace evoab {
commit 368c8f057ded4b0ac8ddf022e7d2d58a80504e2d
Author: Ivo Hinkelmann <ihi at openoffice.org>
Date: Wed Jun 17 10:58:14 2009 +0000
CWS-TOOLING: integrate CWS impress171
2009-06-02 16:32:02 +0200 cl r272511 : fixed build error
2009-05-29 16:40:09 +0200 cl r272471 : CWS-TOOLING: rebase CWS impress171 to trunk at 272291 (milestone: DEV300:m49)
2009-05-19 15:14:08 +0200 sj r272082 : #i101459# applied patch (writing out StyleTextProperties even if no chars given)
2009-05-19 15:09:31 +0200 sj r272081 : #i101459# applied patch (writing out StyleTextProperties even if no chars given)
2009-05-19 15:09:14 +0200 sj r272080 : #i101459# applied patch (writing out StyleTextProperties even if no chars given)
2009-05-18 13:34:05 +0200 sj r272015 : #i47689# fixed rectangles toolbar
2009-05-13 14:59:08 +0200 sj r271862 : #i101563# fixed crash when loading pptx document
2009-05-12 19:31:58 +0200 sj r271835 : #101684# fixed rotation of customshapes
2009-05-08 16:37:01 +0200 sj r271724 : #i101683,i101584,i48160# added shearing of customshapes, fixed rotation problem
2009-04-28 17:32:14 +0200 sj r271335 : #i48160# fixed gluepoint rotation of customshapes
2009-04-27 16:31:54 +0200 cl r271291 : #i100138# applied patch for japanese reconversion feature
2009-04-27 16:30:52 +0200 cl r271290 : #i100138# applied patch for japanese reconversion feature
2009-04-27 16:28:55 +0200 cl r271289 : #i100138# applied patch for japanese reconversion feature
2009-04-23 14:22:59 +0200 cl r271170 : #i95342# #i96820# #i97298# multiple table handling fixes
2009-04-23 14:18:54 +0200 sj r271169 : #i60368# ignoring gamma values for toolbar/menu icons
2009-04-23 11:54:28 +0200 cl r271146 : #i97298# set style to text even during text edit
2009-04-23 11:46:38 +0200 cl r271145 : fixed compiler error with debug
2009-04-22 19:09:37 +0200 sj r271135 : #i101051# applied patch (proper import of notes page object)
2009-04-22 11:07:54 +0200 cl r271082 : #i96820# modify doc after merging cells
2009-04-22 10:57:35 +0200 cl r271081 : #i100307# applied patch from jlcheng to correctly set modfiy state
2009-04-22 10:31:11 +0200 cl r271079 : #i96736# copy merge information on clone
2009-04-21 08:27:22 +0200 cl r271016 : #i89541# use SfxErrorContext to make the ErrorHandler dialog modal
2009-04-20 17:52:56 +0200 cl r271003 : #i98480# removed 'EndPosition' and 'StartPosition' from styles
2009-04-20 16:41:55 +0200 cl r270994 : #i98403# fixed state handling for selected motion path
2009-04-17 11:35:25 +0200 cl r270931 : #i61274# export to pdf should behave like printing considering layer visibility
2009-04-17 10:00:17 +0200 cl r270924 : #i98967# set default style on any new shape except a page obj
2009-04-16 16:28:20 +0200 cl r270893 : #i98859# use percentage type for relative font height
diff --git a/svx/inc/svx/editview.hxx b/svx/inc/svx/editview.hxx
index dcf0a23..f0b4741 100644
--- a/svx/inc/svx/editview.hxx
+++ b/svx/inc/svx/editview.hxx
@@ -34,6 +34,7 @@
#include <rsc/rscsfx.hxx>
#include <i18npool/lang.h>
#include <tools/color.hxx>
+#include <tools/gen.hxx>
class EditEngine;
class ImpEditEngine;
@@ -242,6 +243,9 @@ public:
void ChangeFontSize( bool bGrow, const FontList* pList );
static bool ChangeFontSize( bool bGrow, SfxItemSet& rSet, const FontList* pFontList );
+
+ String GetSurroundingText() const;
+ Selection GetSurroundingTextSelection() const;
};
#endif // _MyEDITVIEW_HXX
diff --git a/svx/inc/svx/outliner.hxx b/svx/inc/svx/outliner.hxx
index 23ed526..6453898 100644
--- a/svx/inc/svx/outliner.hxx
+++ b/svx/inc/svx/outliner.hxx
@@ -387,6 +387,9 @@ public:
void SetInvalidateMore( USHORT nPixel );
USHORT GetInvalidateMore() const;
+
+ String GetSurroundingText() const;
+ Selection GetSurroundingTextSelection() const;
};
//#if 0 // _SOLAR__PRIVATE
diff --git a/svx/inc/svx/sdr/contact/viewcontactofsdrobjcustomshape.hxx b/svx/inc/svx/sdr/contact/viewcontactofsdrobjcustomshape.hxx
index f6c4b7b..8db1f88 100644
--- a/svx/inc/svx/sdr/contact/viewcontactofsdrobjcustomshape.hxx
+++ b/svx/inc/svx/sdr/contact/viewcontactofsdrobjcustomshape.hxx
@@ -53,6 +53,9 @@ namespace sdr
return (SdrObjCustomShape&)GetSdrObject();
}
+ // #i101684# internal tooling
+ basegfx::B2DRange getCorrectedTextBoundRect() const;
+
public:
// basic constructor, used from SdrObject.
ViewContactOfSdrObjCustomShape(SdrObjCustomShape& rCustomShape);
diff --git a/svx/inc/svx/svdfppt.hxx b/svx/inc/svx/svdfppt.hxx
index 0d9a69a..2c476a4 100644
--- a/svx/inc/svx/svdfppt.hxx
+++ b/svx/inc/svx/svdfppt.hxx
@@ -989,6 +989,18 @@ struct PPTStyleTextPropReader
PPTStyleTextPropReader( SvStream& rIn, SdrPowerPointImport&, const DffRecordHeader& rClientTextBoxHd,
PPTTextRulerInterpreter& rInterpreter, const DffRecordHeader& rExtParaHd, sal_uInt32 nTextInstance );
+ void Init( SvStream& rIn, SdrPowerPointImport&, const DffRecordHeader& rClientTextBoxHd,
+ PPTTextRulerInterpreter& rInterpreter, const DffRecordHeader& rExtParaHd, sal_uInt32 nTextInstance );
+ void ReadParaProps( SvStream& rIn, SdrPowerPointImport& rMan, const DffRecordHeader& rTextHeader,
+ const String& aString, PPTTextRulerInterpreter& rRuler,
+ sal_uInt32& nCharCount, sal_Bool& bTextPropAtom );
+ void ReadCharProps( SvStream& rIn, PPTCharPropSet& aCharPropSet, const String& aString,
+ sal_uInt32& nCharCount, sal_uInt32 nCharAnzRead,
+ sal_Bool& bTextPropAtom, sal_uInt32 nExtParaPos,
+ const std::vector< StyleTextProp9 >& aStyleTextProp9,
+ sal_uInt32& nExtParaFlags, sal_uInt16& nBuBlip,
+ sal_uInt16& nHasAnm, sal_uInt32& nAnmScheme );
+
~PPTStyleTextPropReader();
};
diff --git a/svx/inc/svx/svdoashp.hxx b/svx/inc/svx/svdoashp.hxx
index f28dd48..45cc1fe 100644
--- a/svx/inc/svx/svdoashp.hxx
+++ b/svx/inc/svx/svdoashp.hxx
@@ -199,6 +199,8 @@ public:
virtual void NbcSetSnapRect(const Rectangle& rRect);
virtual void NbcSetLogicRect(const Rectangle& rRect);
+ virtual SdrGluePoint GetVertexGluePoint(USHORT nNum) const;
+
virtual void NbcSetStyleSheet( SfxStyleSheet* pNewStyleSheet, sal_Bool bDontRemoveHardAttr );
// special drag methods
diff --git a/svx/source/customshapes/EnhancedCustomShape2d.cxx b/svx/source/customshapes/EnhancedCustomShape2d.cxx
index 8141b54..61b4f60 100644
--- a/svx/source/customshapes/EnhancedCustomShape2d.cxx
+++ b/svx/source/customshapes/EnhancedCustomShape2d.cxx
@@ -1152,6 +1152,14 @@ sal_Bool EnhancedCustomShape2d::GetHandlePosition( const sal_uInt32 nIndex, Poin
}
rReturnPosition = GetPoint( aHandle.aPosition, sal_True, sal_False );
}
+ const GeoStat aGeoStat( ((SdrObjCustomShape*)pCustomShapeObj)->GetGeoStat() );
+ if ( aGeoStat.nShearWink )
+ {
+ double nTan = aGeoStat.nTan;
+ if ((bFlipV&&!bFlipH )||(bFlipH&&!bFlipV))
+ nTan = -nTan;
+ ShearPoint( rReturnPosition, Point( aLogicRect.GetWidth() / 2, aLogicRect.GetHeight() / 2 ), nTan );
+ }
if ( nRotateAngle )
{
double a = nRotateAngle * F_PI18000;
@@ -1193,6 +1201,15 @@ sal_Bool EnhancedCustomShape2d::SetHandleControllerPosition( const sal_uInt32 nI
double a = -nRotateAngle * F_PI18000;
RotatePoint( aP, Point( aLogicRect.GetWidth() / 2, aLogicRect.GetHeight() / 2 ), sin( a ), cos( a ) );
}
+ const GeoStat aGeoStat( ((SdrObjCustomShape*)pCustomShapeObj)->GetGeoStat() );
+ if ( aGeoStat.nShearWink )
+ {
+ double nTan = -aGeoStat.nTan;
+ if ((bFlipV&&!bFlipH )||(bFlipH&&!bFlipV))
+ nTan = -nTan;
+ ShearPoint( aP, Point( aLogicRect.GetWidth() / 2, aLogicRect.GetHeight() / 2 ), nTan );
+ }
+
double fPos1 = aP.X(); //( bFlipH ) ? aLogicRect.GetWidth() - aP.X() : aP.X();
double fPos2 = aP.Y(); //( bFlipV ) ? aLogicRect.GetHeight() -aP.Y() : aP.Y();
fPos1 /= fXScale;
@@ -2062,13 +2079,17 @@ void EnhancedCustomShape2d::ApplyGluePoints( SdrObject* pObj )
for ( i = 0; i < nCount; i++ )
{
SdrGluePoint aGluePoint;
- const Point& rPoint = GetPoint( seqGluePoints[ i ], sal_True, sal_True );
- double fXRel = rPoint.X();
- double fYRel = rPoint.Y();
- fXRel = aLogicRect.GetWidth() == 0 ? 0.0 : fXRel / aLogicRect.GetWidth() * 10000;
- fYRel = aLogicRect.GetHeight() == 0 ? 0.0 : fYRel / aLogicRect.GetHeight() * 10000;
- aGluePoint.SetPos( Point( (sal_Int32)fXRel, (sal_Int32)fYRel ) );
- aGluePoint.SetPercent( sal_True );
+
+ aGluePoint.SetPos( GetPoint( seqGluePoints[ i ], sal_True, sal_True ) );
+ aGluePoint.SetPercent( sal_False );
+
+// const Point& rPoint = GetPoint( seqGluePoints[ i ], sal_True, sal_True );
+// double fXRel = rPoint.X();
+// double fYRel = rPoint.Y();
+// fXRel = aLogicRect.GetWidth() == 0 ? 0.0 : fXRel / aLogicRect.GetWidth() * 10000;
+// fYRel = aLogicRect.GetHeight() == 0 ? 0.0 : fYRel / aLogicRect.GetHeight() * 10000;
+// aGluePoint.SetPos( Point( (sal_Int32)fXRel, (sal_Int32)fYRel ) );
+// aGluePoint.SetPercent( sal_True );
aGluePoint.SetAlign( SDRVERTALIGN_TOP | SDRHORZALIGN_LEFT );
aGluePoint.SetEscDir( SDRESC_SMART );
SdrGluePointList* pList = pObj->ForceGluePointList();
diff --git a/svx/source/customshapes/EnhancedCustomShapeEngine.cxx b/svx/source/customshapes/EnhancedCustomShapeEngine.cxx
index 6c4e61c..2fad91e 100644
--- a/svx/source/customshapes/EnhancedCustomShapeEngine.cxx
+++ b/svx/source/customshapes/EnhancedCustomShapeEngine.cxx
@@ -307,6 +307,19 @@ REF( com::sun::star::drawing::XShape ) SAL_CALL EnhancedCustomShapeEngine::rende
pRenderedShape = pRenderedShape3d;
}
Rectangle aRect( pSdrObjCustomShape->GetSnapRect() );
+
+ const GeoStat& rGeoStat = ((SdrObjCustomShape*)pSdrObjCustomShape)->GetGeoStat();
+ if ( rGeoStat.nShearWink )
+ {
+ long nShearWink = rGeoStat.nShearWink;
+ double nTan = rGeoStat.nTan;
+ if ((bFlipV&&!bFlipH )||(bFlipH&&!bFlipV))
+ {
+ nShearWink = -nShearWink;
+ nTan = -nTan;
+ }
+ pRenderedShape->Shear( pSdrObjCustomShape->GetSnapRect().Center(), nShearWink, nTan, FALSE);
+ }
if( nRotateAngle )
{
double a = nRotateAngle * F_PI18000;
@@ -374,19 +387,34 @@ com::sun::star::drawing::PolyPolygonBezierCoords SAL_CALL EnhancedCustomShapeEng
if ( pObj )
{
Rectangle aRect( pSdrObjCustomShape->GetSnapRect() );
+ sal_Bool bFlipV = aCustomShape2d.IsFlipVert();
+ sal_Bool bFlipH = aCustomShape2d.IsFlipHorz();
+
+ const GeoStat& rGeoStat = ((SdrObjCustomShape*)pSdrObjCustomShape)->GetGeoStat();
+ if ( rGeoStat.nShearWink )
+ {
+ long nShearWink = rGeoStat.nShearWink;
+ double nTan = rGeoStat.nTan;
+ if ((bFlipV&&!bFlipH )||(bFlipH&&!bFlipV))
+ {
+ nShearWink = -nShearWink;
+ nTan = -nTan;
+ }
+ pObj->Shear( aRect.Center(), nShearWink, nTan, FALSE);
+ }
sal_Int32 nRotateAngle = aCustomShape2d.GetRotateAngle();
if( nRotateAngle )
{
double a = nRotateAngle * F_PI18000;
pObj->NbcRotate( aRect.Center(), nRotateAngle, sin( a ), cos( a ) );
}
- if ( aCustomShape2d.IsFlipHorz() )
+ if ( bFlipH )
{
Point aTop( ( aRect.Left() + aRect.Right() ) >> 1, aRect.Top() );
Point aBottom( aTop.X(), aTop.Y() + 1000 );
pObj->NbcMirror( aTop, aBottom );
}
- if ( aCustomShape2d.IsFlipVert() )
+ if ( bFlipV )
{
Point aLeft( aRect.Left(), ( aRect.Top() + aRect.Bottom() ) >> 1 );
Point aRight( aLeft.X() + 1000, aLeft.Y() );
diff --git a/svx/source/dialog/imapdlg.cxx b/svx/source/dialog/imapdlg.cxx
index 3e991e9..9cf1e4c 100644
--- a/svx/source/dialog/imapdlg.cxx
+++ b/svx/source/dialog/imapdlg.cxx
@@ -60,6 +60,8 @@
#include "com/sun/star/ui/dialogs/TemplateDescription.hpp"
#include <svtools/urihelper.hxx>
#include <svtools/miscopt.hxx>
+#include <svtools/ehdl.hxx>
+#include <svtools/sfxecode.hxx>
#include <sfx2/viewfrm.hxx>
#include <sfx2/objsh.hxx>
#include <sfx2/docfile.hxx>
@@ -654,7 +656,10 @@ void SvxIMapDlg::DoOpen()
aLoadIMap.Read( *pIStm, IMAP_FORMAT_DETECT, String() );
if( pIStm->GetError() )
+ {
+ SfxErrorContext eEC(ERRCODE_SFX_GENERAL,this);
ErrorHandler::HandleError( ERRCODE_IO_GENERAL );
+ }
else
pIMapWnd->SetImageMap( aLoadIMap );
diff --git a/svx/source/editeng/editview.cxx b/svx/source/editeng/editview.cxx
index 0db1b79..39cc8de 100644
--- a/svx/source/editeng/editview.cxx
+++ b/svx/source/editeng/editview.cxx
@@ -1546,3 +1546,54 @@ bool EditView::ChangeFontSize( bool bGrow, SfxItemSet& rSet, const FontList* pFo
}
return bRet;
}
+
+String EditView::GetSurroundingText() const
+{
+ DBG_CHKTHIS( EditView, 0 );
+ DBG_CHKOBJ( pImpEditView->pEditEngine, EditEngine, 0 );
+
+ EditSelection aSel( pImpEditView->GetEditSelection() );
+ aSel.Adjust( PIMPEE->GetEditDoc() );
+
+ if( HasSelection() )
+ {
+ XubString aStr = PIMPEE->GetSelected( aSel );
+
+ // Stop reconversion if the selected text includes a line break.
+ if ( aStr.Search( 0x0A ) == STRING_NOTFOUND )
+ return aStr;
+ else
+ return String();
+ }
+ else
+ {
+ aSel.Min().SetIndex( 0 );
+ aSel.Max().SetIndex( aSel.Max().GetNode()->Len() );
+ return PIMPEE->GetSelected( aSel );
+ }
+}
+
+Selection EditView::GetSurroundingTextSelection() const
+{
+ DBG_CHKTHIS( EditView, 0 );
+
+ ESelection aSelection( GetSelection() );
+ aSelection.Adjust();
+
+ if( HasSelection() )
+ {
+ EditSelection aSel( pImpEditView->GetEditSelection() );
+ aSel.Adjust( PIMPEE->GetEditDoc() );
+ XubString aStr = PIMPEE->GetSelected( aSel );
+
+ // Stop reconversion if the selected text includes a line break.
+ if ( aStr.Search( 0x0A ) == STRING_NOTFOUND )
+ return Selection( 0, aSelection.nEndPos - aSelection.nStartPos );
+ else
+ return Selection( 0, 0 );
+ }
+ else
+ {
+ return Selection( aSelection.nStartPos, aSelection.nEndPos );
+ }
+}
diff --git a/svx/source/editeng/impedit2.cxx b/svx/source/editeng/impedit2.cxx
index 20f6909..ed4c843 100644
--- a/svx/source/editeng/impedit2.cxx
+++ b/svx/source/editeng/impedit2.cxx
@@ -381,7 +381,6 @@ BOOL ImpEditEngine::MouseButtonDown( const MouseEvent& rMEvt, EditView* pView )
void ImpEditEngine::Command( const CommandEvent& rCEvt, EditView* pView )
{
-#ifndef SVX_LIGHT
GetSelEngine().SetCurView( pView );
SetActiveView( pView );
if ( rCEvt.GetCommand() == COMMAND_VOICE )
@@ -642,7 +641,42 @@ void ImpEditEngine::Command( const CommandEvent& rCEvt, EditView* pView )
pView->GetWindow()->SetCursorRect();
}
}
-#endif // !SVX_LIGHT
+ else if ( rCEvt.GetCommand() == COMMAND_SELECTIONCHANGE )
+ {
+ const CommandSelectionChangeData *pData = rCEvt.GetSelectionChangeData();
+
+ ESelection aSelection = pView->GetSelection();
+ aSelection.Adjust();
+
+ if( pView->HasSelection() )
+ {
+ aSelection.nEndPos = aSelection.nStartPos;
+ aSelection.nStartPos += pData->GetStart();
+ aSelection.nEndPos += pData->GetEnd();
+ }
+ else
+ {
+ aSelection.nStartPos = pData->GetStart();
+ aSelection.nEndPos = pData->GetEnd();
+ }
+ pView->SetSelection( aSelection );
+ }
+ else if ( rCEvt.GetCommand() == COMMAND_PREPARERECONVERSION )
+ {
+ if ( pView->HasSelection() )
+ {
+ ESelection aSelection = pView->GetSelection();
+ aSelection.Adjust();
+
+ if ( aSelection.nStartPara != aSelection.nEndPara )
+ {
+ xub_StrLen aParaLen = pEditEngine->GetTextLen( aSelection.nStartPara );
+ aSelection.nEndPara = aSelection.nStartPara;
+ aSelection.nEndPos = aParaLen;
+ pView->SetSelection( aSelection );
+ }
+ }
+ }
GetSelEngine().Command( rCEvt );
}
diff --git a/svx/source/outliner/outlvw.cxx b/svx/source/outliner/outlvw.cxx
index 73e5d76..71387e4 100644
--- a/svx/source/outliner/outlvw.cxx
+++ b/svx/source/outliner/outlvw.cxx
@@ -1635,3 +1635,15 @@ USHORT OutlinerView::GetSelectedScriptType() const
DBG_CHKTHIS(OutlinerView,0);
return pEditView->GetSelectedScriptType();
}
+
+String OutlinerView::GetSurroundingText() const
+{
+ DBG_CHKTHIS(OutlinerView,0);
+ return pEditView->GetSurroundingText();
+}
+
+Selection OutlinerView::GetSurroundingTextSelection() const
+{
+ DBG_CHKTHIS(OutlinerView,0);
+ return pEditView->GetSurroundingTextSelection();
+}
diff --git a/svx/source/sdr/contact/viewcontactofsdrobjcustomshape.cxx b/svx/source/sdr/contact/viewcontactofsdrobjcustomshape.cxx
index caff196..0545052 100644
--- a/svx/source/sdr/contact/viewcontactofsdrobjcustomshape.cxx
+++ b/svx/source/sdr/contact/viewcontactofsdrobjcustomshape.cxx
@@ -37,6 +37,8 @@
#include <svx/sdr/attribute/sdrallattribute.hxx>
#include <svditer.hxx>
#include <svx/sdr/primitive2d/sdrcustomshapeprimitive2d.hxx>
+#include <basegfx/polygon/b2dpolygontools.hxx>
+#include <basegfx/polygon/b2dpolygon.hxx>
//////////////////////////////////////////////////////////////////////////////
@@ -53,6 +55,60 @@ namespace sdr
{
}
+ basegfx::B2DRange ViewContactOfSdrObjCustomShape::getCorrectedTextBoundRect() const
+ {
+ const Rectangle aObjectBound(GetCustomShapeObj().GetGeoRect());
+ Rectangle aTextBound(aObjectBound);
+ GetCustomShapeObj().GetTextBounds(aTextBound);
+ basegfx::B2DRange aTextRange(aTextBound.Left(), aTextBound.Top(), aTextBound.Right(), aTextBound.Bottom());
+ const basegfx::B2DRange aObjectRange(aObjectBound.Left(), aObjectBound.Top(), aObjectBound.Right(), aObjectBound.Bottom());
+
+ // no need to correct if no extra text range
+ if(aTextRange != aObjectRange)
+ {
+ const GeoStat& rGeoStat(GetCustomShapeObj().GetGeoStat());
+
+ // only correct when rotation and/or shear is used
+ if(rGeoStat.nShearWink || rGeoStat.nDrehWink)
+ {
+ // text range needs to be corrected by
+ // aObjectRange.getCenter() - aRotObjectRange.getCenter() since it's
+ // defined differenly by using rotation around object center. Start
+ // with positive part
+ basegfx::B2DVector aTranslation(aObjectRange.getCenter());
+
+ // get rotated and sheared object's range
+ basegfx::B2DRange aRotObjectRange(aObjectRange);
+ basegfx::B2DHomMatrix aRotMatrix;
+
+ aRotMatrix.translate(-aObjectRange.getMinimum().getX(), -aObjectRange.getMinimum().getY());
+
+ if(rGeoStat.nShearWink)
+ {
+ aRotMatrix.shearX(tan((36000 - rGeoStat.nShearWink) * F_PI18000));
+ }
+
+ if(rGeoStat.nDrehWink)
+ {
+ aRotMatrix.rotate((36000 - rGeoStat.nDrehWink) * F_PI18000);
+ }
+
+ aRotMatrix.translate(aObjectRange.getMinimum().getX(), aObjectRange.getMinimum().getY());
+ aRotObjectRange.transform(aRotMatrix);
+
+ // add negative translation part
+ aTranslation -= aRotObjectRange.getCenter();
+
+ // create new range
+ aTextRange = basegfx::B2DRange(
+ aTextRange.getMinX() + aTranslation.getX(), aTextRange.getMinY() + aTranslation.getY(),
+ aTextRange.getMaxX() + aTranslation.getX(), aTextRange.getMaxY() + aTranslation.getY());
+ }
+ }
+
+ return aTextRange;
+ }
+
drawinglayer::primitive2d::Primitive2DSequence ViewContactOfSdrObjCustomShape::createViewIndependentPrimitive2DSequence() const
{
drawinglayer::primitive2d::Primitive2DSequence xRetval;
@@ -88,38 +144,35 @@ namespace sdr
if(bHasText || xGroup.hasElements())
{
// prepare text box geometry
- ::basegfx::B2DHomMatrix aTextBoxMatrix;
+ basegfx::B2DHomMatrix aTextBoxMatrix;
bool bWordWrap(false);
if(bHasText)
{
// take unrotated snap rect as default, then get the
// unrotated text box. Rotation needs to be done centered
- Rectangle aTextBound(GetCustomShapeObj().GetGeoRect());
- GetCustomShapeObj().GetTextBounds(aTextBound);
- const ::basegfx::B2DRange aTextBoxRange(aTextBound.Left(), aTextBound.Top(), aTextBound.Right(), aTextBound.Bottom());
+ const Rectangle aObjectBound(GetCustomShapeObj().GetGeoRect());
+ const basegfx::B2DRange aObjectRange(aObjectBound.Left(), aObjectBound.Top(), aObjectBound.Right(), aObjectBound.Bottom());
- // fill object matrix
- if(!::basegfx::fTools::equalZero(aTextBoxRange.getWidth()))
- {
- aTextBoxMatrix.set(0, 0, aTextBoxRange.getWidth());
- }
+ // #i101684# get the text range unrotated and absolute to the object range
+ const basegfx::B2DRange aTextRange(getCorrectedTextBoundRect());
- if(!::basegfx::fTools::equalZero(aTextBoxRange.getHeight()))
- {
- aTextBoxMatrix.set(1, 1, aTextBoxRange.getHeight());
- }
+ // give text object a size
+ aTextBoxMatrix.scale(aTextRange.getWidth(), aTextRange.getHeight());
+ // check if we have a rotation/shear at all to take care of
const double fExtraTextRotation(GetCustomShapeObj().GetExtraTextRotation());
const GeoStat& rGeoStat(GetCustomShapeObj().GetGeoStat());
- if(rGeoStat.nShearWink || rGeoStat.nDrehWink || !::basegfx::fTools::equalZero(fExtraTextRotation))
+ if(rGeoStat.nShearWink || rGeoStat.nDrehWink || !basegfx::fTools::equalZero(fExtraTextRotation))
{
- const double fHalfWidth(aTextBoxRange.getWidth() * 0.5);
- const double fHalfHeight(aTextBoxRange.getHeight() * 0.5);
-
- // move to it's own center to rotate around it
- aTextBoxMatrix.translate(-fHalfWidth, -fHalfHeight);
+ if(aObjectRange != aTextRange)
+ {
+ // move relative to unrotated object range
+ aTextBoxMatrix.translate(
+ aTextRange.getMinX() - aObjectRange.getMinimum().getX(),
+ aTextRange.getMinY() - aObjectRange.getMinimum().getY());
+ }
if(rGeoStat.nShearWink)
{
@@ -131,16 +184,18 @@ namespace sdr
aTextBoxMatrix.rotate((36000 - rGeoStat.nDrehWink) * F_PI18000);
}
- if(!::basegfx::fTools::equalZero(fExtraTextRotation))
+ if(!basegfx::fTools::equalZero(fExtraTextRotation))
{
aTextBoxMatrix.rotate((360.0 - fExtraTextRotation) * F_PI180);
}
- // move back
- aTextBoxMatrix.translate(fHalfWidth, fHalfHeight);
+ // give text it's target position
+ aTextBoxMatrix.translate(aObjectRange.getMinimum().getX(), aObjectRange.getMinimum().getY());
+ }
+ else
+ {
+ aTextBoxMatrix.translate(aTextRange.getMinX(), aTextRange.getMinY());
}
-
- aTextBoxMatrix.translate(aTextBoxRange.getMinX(), aTextBoxRange.getMinY());
// check if SdrTextWordWrapItem is set
bWordWrap = ((SdrTextWordWrapItem&)(GetCustomShapeObj().GetMergedItem(SDRATTR_TEXT_WORDWRAP))).GetValue();
diff --git a/svx/source/sdr/properties/textproperties.cxx b/svx/source/sdr/properties/textproperties.cxx
index 22ddd79..139d2fb 100644
--- a/svx/source/sdr/properties/textproperties.cxx
+++ b/svx/source/sdr/properties/textproperties.cxx
@@ -237,7 +237,7 @@ namespace sdr
// call parent
AttributeProperties::SetStyleSheet(pNewStyleSheet, bDontRemoveHardAttr);
- if( rObj.GetModel() && !rObj.IsTextEditActive() && !rObj.IsLinkedText() )
+ if( rObj.GetModel() /*&& !rObj.IsTextEditActive()*/ && !rObj.IsLinkedText() )
{
SdrOutliner& rOutliner = rObj.ImpGetDrawOutliner();
diff --git a/svx/source/svdraw/svdfppt.cxx b/svx/source/svdraw/svdfppt.cxx
index 23982e9..38ca489 100644
--- a/svx/source/svdraw/svdfppt.cxx
+++ b/svx/source/svdraw/svdfppt.cxx
@@ -4973,6 +4973,246 @@ void StyleTextProp9::Read( SvStream& rIn )
PPTStyleTextPropReader::PPTStyleTextPropReader( SvStream& rIn, SdrPowerPointImport& rMan, const DffRecordHeader& rTextHeader,
PPTTextRulerInterpreter& rRuler, const DffRecordHeader& rExtParaHd, sal_uInt32 nInstance )
{
+ Init(rIn, rMan, rTextHeader, rRuler, rExtParaHd, nInstance);
+}
+
+void PPTStyleTextPropReader::ReadParaProps( SvStream& rIn, SdrPowerPointImport& rMan, const DffRecordHeader& rTextHeader,
+ const String& aString, PPTTextRulerInterpreter& rRuler,
+ sal_uInt32& nCharCount, sal_Bool& bTextPropAtom )
+{
+ sal_uInt32 nMask = 0; //TODO: nMask initialized here to suppress warning for now, see corresponding TODO below
+ sal_uInt32 nCharAnzRead = 0;
+ sal_uInt16 nDummy16;
+
+ sal_uInt16 nStringLen = aString.Len();
+
+ DffRecordHeader aTextHd2;
+ rTextHeader.SeekToContent( rIn );
+ if ( rMan.SeekToRec( rIn, PPT_PST_StyleTextPropAtom, rTextHeader.GetRecEndFilePos(), &aTextHd2 ) )
+ bTextPropAtom = sal_True;
+ while ( nCharAnzRead <= nStringLen )
+ {
+ PPTParaPropSet aParaPropSet;
+ ImplPPTParaPropSet& aSet = *aParaPropSet.pParaSet;
+ if ( bTextPropAtom )
+ {
+ rIn >> nCharCount
+ >> aParaPropSet.pParaSet->mnDepth; // Einruecktiefe
+
+ nCharCount--;
+
+ rIn >> nMask;
+ aSet.mnAttrSet = nMask & 0x207df7;
+ sal_uInt16 nBulFlg = 0;
+ if ( nMask & 0xF )
+ rIn >> nBulFlg; // Bullet-HardAttr-Flags
+ aSet.mpArry[ PPT_ParaAttr_BulletOn ] = ( nBulFlg & 1 ) ? 1 : 0;
+ aSet.mpArry[ PPT_ParaAttr_BuHardFont ] = ( nBulFlg & 2 ) ? 1 : 0;
+ aSet.mpArry[ PPT_ParaAttr_BuHardColor ] = ( nBulFlg & 4 ) ? 1 : 0;
+
+ if ( nMask & 0x0080 ) // buChar
+ rIn >> aSet.mpArry[ PPT_ParaAttr_BulletChar ];
+ if ( nMask & 0x0010 ) // buTypeface
+ rIn >> aSet.mpArry[ PPT_ParaAttr_BulletFont ];
+ if ( nMask & 0x0040 ) // buSize
+ {
+ rIn >> aSet.mpArry[ PPT_ParaAttr_BulletHeight ];
+ if ( ! ( ( nMask & ( 1 << PPT_ParaAttr_BuHardHeight ) )
+ && ( nBulFlg && ( 1 << PPT_ParaAttr_BuHardHeight ) ) ) )
+ aSet.mnAttrSet ^= 0x40;
+ }
+ if ( nMask & 0x0020 ) // buColor
+ {
+ sal_uInt32 nVal32, nHiByte;
+ rIn >> nVal32;
+ nHiByte = nVal32 >> 24;
+ if ( nHiByte <= 8 )
+ nVal32 = nHiByte | PPT_COLSCHEME;
+ aSet.mnBulletColor = nVal32;
+ }
+ if ( nMask & 0x0800 ) // pfAlignment
+ {
+ rIn >> nDummy16;
+ aSet.mpArry[ PPT_ParaAttr_Adjust ] = nDummy16 & 3;
+ }
+ if ( nMask & 0x1000 ) // pfLineSpacing
+ rIn >> aSet.mpArry[ PPT_ParaAttr_LineFeed ];
+ if ( nMask & 0x2000 ) // pfSpaceBefore
+ rIn >> aSet.mpArry[ PPT_ParaAttr_UpperDist ];
+ if ( nMask & 0x4000 ) // pfSpaceAfter
+ rIn >> aSet.mpArry[ PPT_ParaAttr_LowerDist ];
+ if ( nMask & 0x100 ) // pfLeftMargin
+ rIn >> nDummy16;
+ if ( nMask & 0x400 ) // pfIndent
+ rIn >> nDummy16;
+ if ( nMask & 0x8000 ) // pfDefaultTabSize
+ rIn >> nDummy16;
+ if ( nMask & 0x100000 ) // pfTabStops
+ {
+ sal_uInt16 i, nDistance, nAlignment, nNumberOfTabStops = 0;
+ rIn >> nNumberOfTabStops;
+ for ( i = 0; i < nNumberOfTabStops; i++ )
+ {
+ rIn >> nDistance
+ >> nAlignment;
+ }
+ }
+ if ( nMask & 0x10000 ) // pfBaseLine
+ rIn >> nDummy16;
+ if ( nMask & 0xe0000 ) // pfCharWrap, pfWordWrap, pfOverflow
+ {
+ rIn >> nDummy16;
+ if ( nMask & 0x20000 )
+ aSet.mpArry[ PPT_ParaAttr_AsianLB_1 ] = nDummy16 & 1;
+ if ( nMask & 0x40000 )
+ aSet.mpArry[ PPT_ParaAttr_AsianLB_2 ] = ( nDummy16 >> 1 ) & 1;
+ if ( nMask & 0x80000 )
+ aSet.mpArry[ PPT_ParaAttr_AsianLB_3 ] = ( nDummy16 >> 2 ) & 1;
+ aSet.mnAttrSet |= ( ( nMask >> 17 ) & 7 ) << PPT_ParaAttr_AsianLB_1;
+ }
+ if ( nMask & 0x200000 ) // pfTextDirection
+ rIn >> aSet.mpArry[ PPT_ParaAttr_BiDi ];
+ }
+ else
+ nCharCount = nStringLen;
+
+ if ( rRuler.GetTextOfs( aParaPropSet.pParaSet->mnDepth, aSet.mpArry[ PPT_ParaAttr_TextOfs ] ) )
+ aSet.mnAttrSet |= 1 << PPT_ParaAttr_TextOfs;
+ if ( rRuler.GetBulletOfs( aParaPropSet.pParaSet->mnDepth, aSet.mpArry[ PPT_ParaAttr_BulletOfs ] ) )
+ aSet.mnAttrSet |= 1 << PPT_ParaAttr_BulletOfs;
+ if ( rRuler.GetDefaultTab( aParaPropSet.pParaSet->mnDepth, aSet.mpArry[ PPT_ParaAttr_DefaultTab ] ) )
+ aSet.mnAttrSet |= 1 << PPT_ParaAttr_DefaultTab;
+
+ if ( ( nCharCount > nStringLen ) || ( nStringLen < nCharAnzRead + nCharCount ) )
+ {
+ bTextPropAtom = sal_False;
+ nCharCount = nStringLen - nCharAnzRead;
+ // please fix the right hand side of
+ // PPTParaPropSet& PPTParaPropSet::operator=(PPTParaPropSet&),
+ // it should be a const reference
+ PPTParaPropSet aTmpPPTParaPropSet;
+ aParaPropSet = aTmpPPTParaPropSet;
+ DBG_ERROR( "SJ:PPTStyleTextPropReader::could not get this PPT_PST_StyleTextPropAtom by reading the paragraph attributes" );
+ }
+ PPTParaPropSet* pPara = new PPTParaPropSet( aParaPropSet );
+ pPara->mnOriginalTextPos = nCharAnzRead;
+ aParaPropList.Insert( pPara, LIST_APPEND );
+ if ( nCharCount )
+ {
+ sal_uInt32 nCount;
+ const sal_Unicode* pDat = aString.GetBuffer() + nCharAnzRead;
+ for ( nCount = 0; nCount < nCharCount; nCount++ )
+ {
+ if ( pDat[ nCount ] == 0xd )
+ {
+ pPara = new PPTParaPropSet( aParaPropSet );
+ pPara->mnOriginalTextPos = nCharAnzRead + nCount + 1;
+ aParaPropList.Insert( pPara, LIST_APPEND );
+ }
+ }
+ }
+ nCharAnzRead += nCharCount + 1;
+ }
+}
+
+void PPTStyleTextPropReader::ReadCharProps( SvStream& rIn, PPTCharPropSet& aCharPropSet, const String& aString,
+ sal_uInt32& nCharCount, sal_uInt32 nCharAnzRead,
+ sal_Bool& bTextPropAtom, sal_uInt32 nExtParaPos,
+ const std::vector< StyleTextProp9 >& aStyleTextProp9,
+ sal_uInt32& nExtParaFlags, sal_uInt16& nBuBlip,
+ sal_uInt16& nHasAnm, sal_uInt32& nAnmScheme )
+{
+ sal_uInt32 nMask = 0; //TODO: nMask initialized here to suppress warning for now, see corresponding TODO below
+ sal_uInt16 nDummy16;
+ sal_Int32 nCharsToRead;
+ sal_uInt32 nExtParaNibble = 0;
+
+ sal_uInt16 nStringLen = aString.Len();
+
+ rIn >> nDummy16;
+ nCharCount = nDummy16;
+ rIn >> nDummy16;
+ nCharsToRead = nStringLen - ( nCharAnzRead + nCharCount );
+ if ( nCharsToRead < 0 )
+ {
+ nCharCount = nStringLen - nCharAnzRead;
+ if ( nCharsToRead < -1 )
+ {
+ bTextPropAtom = sal_False;
+ DBG_ERROR( "SJ:PPTStyleTextPropReader::could not get this PPT_PST_StyleTextPropAtom by reading the character attributes" );
+ }
+ }
+ ImplPPTCharPropSet& aSet = *aCharPropSet.pCharSet;
+
+ // character attributes
+ rIn >> nMask;
+ if ( (sal_uInt16)nMask )
+ {
+ aSet.mnAttrSet |= (sal_uInt16)nMask;
+ rIn >> aSet.mnFlags;
+ }
+ if ( nMask & 0x10000 ) // cfTypeface
+ {
+ rIn >> aSet.mnFont;
+ aSet.mnAttrSet |= 1 << PPT_CharAttr_Font;
+ }
+ if ( nMask & 0x200000 ) // cfFEOldTypeface
+ {
+ rIn >> aSet.mnAsianOrComplexFont;
+ aSet.mnAttrSet |= 1 << PPT_CharAttr_AsianOrComplexFont;
+ }
+ if ( nMask & 0x400000 ) // cfANSITypeface
+ {
+ rIn >> aSet.mnANSITypeface;
+ aSet.mnAttrSet |= 1 << PPT_CharAttr_ANSITypeface;
+ }
+ if ( nMask & 0x800000 ) // cfSymbolTypeface
+ {
+ rIn >> aSet.mnSymbolFont;
+ aSet.mnAttrSet |= 1 << PPT_CharAttr_Symbol;
+ }
+ if ( nMask & 0x20000 ) // cfSize
+ {
+ rIn >> aSet.mnFontHeight;
+ aSet.mnAttrSet |= 1 << PPT_CharAttr_FontHeight;
+ }
+ if ( nMask & 0x40000 ) // cfColor
+ {
+ sal_uInt32 nVal;
+ rIn >> nVal;
+ if ( !( nVal & 0xff000000 ) )
+ nVal = PPT_COLSCHEME_HINTERGRUND;
+ aSet.mnColor = nVal;
+ aSet.mnAttrSet |= 1 << PPT_CharAttr_FontColor;
+ }
+ if ( nMask & 0x80000 ) // cfPosition
+ {
+ rIn >> aSet.mnEscapement;
+ aSet.mnAttrSet |= 1 << PPT_CharAttr_Escapement;
+ }
+ if ( nExtParaPos )
+ {
+ sal_uInt32 nExtBuInd = nMask & 0x3c00;
+ if ( nExtBuInd )
+ nExtBuInd = ( aSet.mnFlags & 0x3c00 ) >> 10;
+ if ( nExtBuInd < aStyleTextProp9.size() )
+ {
+ if ( nExtParaNibble && ( ( nExtBuInd + nExtParaNibble ) < aStyleTextProp9.size() ) )
+ nExtBuInd += nExtParaNibble;
+
+ nExtParaFlags = aStyleTextProp9[ nExtBuInd ].mnExtParagraphMask;
+ nBuBlip = aStyleTextProp9[ nExtBuInd ].mnBuBlip;
+ nHasAnm = aStyleTextProp9[ nExtBuInd ].mnHasAnm;
+ nAnmScheme = aStyleTextProp9[ nExtBuInd ].mnAnmScheme;
+ }
+ if ( ( nExtBuInd & 0xf ) == 0xf )
+ nExtParaNibble += 16;
+ }
+}
+
+void PPTStyleTextPropReader::Init( SvStream& rIn, SdrPowerPointImport& rMan, const DffRecordHeader& rTextHeader,
+ PPTTextRulerInterpreter& rRuler, const DffRecordHeader& rExtParaHd, sal_uInt32 nInstance )
+{
sal_uInt32 nMerk = rIn.Tell();
sal_uInt32 nExtParaPos = ( rExtParaHd.nRecType == PPT_PST_ExtendedParagraphAtom ) ? rExtParaHd.nFilePos + 8 : 0;
@@ -5032,7 +5272,7 @@ PPTStyleTextPropReader::PPTStyleTextPropReader( SvStream& rIn, SdrPowerPointImpo
aString = String( pBuf, (sal_uInt16)i );
delete[] pBuf;
}
- else
+ else if( aTextHd.nRecType == PPT_PST_TextBytesAtom )
{
sal_Char *pBuf = new sal_Char[ nMaxLen + 1 ];
pBuf[ nMaxLen ] = 0;
@@ -5057,148 +5297,44 @@ PPTStyleTextPropReader::PPTStyleTextPropReader( SvStream& rIn, SdrPowerPointImpo
aString = String( pBuf, nLen, RTL_TEXTENCODING_MS_1252 );
delete[] pBuf;
}
- if ( aString.Len() )
+ else
{
- sal_uInt32 nMask = 0; //TODO: nMask initialized here to suppress warning for now, see corresponding TODO below
- sal_uInt32 nCharCount, nCharAnzRead = 0;
- sal_Int32 nCharsToRead;
- sal_uInt16 nDummy16;
+ // no chars, but potentially char/para props?
+ sal_uInt32 nCharCount;
sal_Bool bTextPropAtom = sal_False;
+ ReadParaProps( rIn, rMan, rTextHeader, aString, rRuler, nCharCount, bTextPropAtom );
- sal_uInt16 nStringLen = aString.Len();
-
- DffRecordHeader aTextHd2;
- rTextHeader.SeekToContent( rIn );
- if ( rMan.SeekToRec( rIn, PPT_PST_StyleTextPropAtom, rTextHeader.GetRecEndFilePos(), &aTextHd2 ) )
- bTextPropAtom = sal_True;
- while ( nCharAnzRead <= nStringLen )
+ if ( bTextPropAtom )
{
- PPTParaPropSet aParaPropSet;
- ImplPPTParaPropSet& aSet = *aParaPropSet.pParaSet;
- if ( bTextPropAtom )
- {
- rIn >> nCharCount
- >> aParaPropSet.pParaSet->mnDepth; // Einruecktiefe
-
- nCharCount--;
-
- rIn >> nMask;
- aSet.mnAttrSet = nMask & 0x207df7;
- sal_uInt16 nBulFlg = 0;
- if ( nMask & 0xF )
- rIn >> nBulFlg; // Bullet-HardAttr-Flags
- aSet.mpArry[ PPT_ParaAttr_BulletOn ] = ( nBulFlg & 1 ) ? 1 : 0;
- aSet.mpArry[ PPT_ParaAttr_BuHardFont ] = ( nBulFlg & 2 ) ? 1 : 0;
- aSet.mpArry[ PPT_ParaAttr_BuHardColor ] = ( nBulFlg & 4 ) ? 1 : 0;
-
- if ( nMask & 0x0080 ) // buChar
- rIn >> aSet.mpArry[ PPT_ParaAttr_BulletChar ];
- if ( nMask & 0x0010 ) // buTypeface
- rIn >> aSet.mpArry[ PPT_ParaAttr_BulletFont ];
- if ( nMask & 0x0040 ) // buSize
- {
- rIn >> aSet.mpArry[ PPT_ParaAttr_BulletHeight ];
- if ( ! ( ( nMask & ( 1 << PPT_ParaAttr_BuHardHeight ) )
- && ( nBulFlg && ( 1 << PPT_ParaAttr_BuHardHeight ) ) ) )
- aSet.mnAttrSet ^= 0x40;
- }
- if ( nMask & 0x0020 ) // buColor
- {
- sal_uInt32 nVal32, nHiByte;
- rIn >> nVal32;
- nHiByte = nVal32 >> 24;
- if ( nHiByte <= 8 )
- nVal32 = nHiByte | PPT_COLSCHEME;
- aSet.mnBulletColor = nVal32;
- }
- if ( nMask & 0x0800 ) // pfAlignment
- {
- rIn >> nDummy16;
- aSet.mpArry[ PPT_ParaAttr_Adjust ] = nDummy16 & 3;
- }
- if ( nMask & 0x1000 ) // pfLineSpacing
- rIn >> aSet.mpArry[ PPT_ParaAttr_LineFeed ];
- if ( nMask & 0x2000 ) // pfSpaceBefore
- rIn >> aSet.mpArry[ PPT_ParaAttr_UpperDist ];
- if ( nMask & 0x4000 ) // pfSpaceAfter
- rIn >> aSet.mpArry[ PPT_ParaAttr_LowerDist ];
- if ( nMask & 0x100 ) // pfLeftMargin
- rIn >> nDummy16;
- if ( nMask & 0x400 ) // pfIndent
- rIn >> nDummy16;
- if ( nMask & 0x8000 ) // pfDefaultTabSize
- rIn >> nDummy16;
- if ( nMask & 0x100000 ) // pfTabStops
- {
- sal_uInt16 i, nDistance, nAlignment, nNumberOfTabStops = 0;
- rIn >> nNumberOfTabStops;
- for ( i = 0; i < nNumberOfTabStops; i++ )
- {
- rIn >> nDistance
- >> nAlignment;
- }
- }
- if ( nMask & 0x10000 ) // pfBaseLine
- rIn >> nDummy16;
- if ( nMask & 0xe0000 ) // pfCharWrap, pfWordWrap, pfOverflow
- {
- rIn >> nDummy16;
- if ( nMask & 0x20000 )
- aSet.mpArry[ PPT_ParaAttr_AsianLB_1 ] = nDummy16 & 1;
- if ( nMask & 0x40000 )
- aSet.mpArry[ PPT_ParaAttr_AsianLB_2 ] = ( nDummy16 >> 1 ) & 1;
- if ( nMask & 0x80000 )
- aSet.mpArry[ PPT_ParaAttr_AsianLB_3 ] = ( nDummy16 >> 2 ) & 1;
- aSet.mnAttrSet |= ( ( nMask >> 17 ) & 7 ) << PPT_ParaAttr_AsianLB_1;
- }
- if ( nMask & 0x200000 ) // pfTextDirection
- rIn >> aSet.mpArry[ PPT_ParaAttr_BiDi ];
- }
- else
- nCharCount = nStringLen;
+ // yeah, StyleTextProp is there, read it all & push to
+ // aParaPropList
+ PPTCharPropSet aCharPropSet(0);
+ aCharPropSet.mnOriginalTextPos = 0;
- if ( rRuler.GetTextOfs( aParaPropSet.pParaSet->mnDepth, aSet.mpArry[ PPT_ParaAttr_TextOfs ] ) )
- aSet.mnAttrSet |= 1 << PPT_ParaAttr_TextOfs;
- if ( rRuler.GetBulletOfs( aParaPropSet.pParaSet->mnDepth, aSet.mpArry[ PPT_ParaAttr_BulletOfs ] ) )
- aSet.mnAttrSet |= 1 << PPT_ParaAttr_BulletOfs;
- if ( rRuler.GetDefaultTab( aParaPropSet.pParaSet->mnDepth, aSet.mpArry[ PPT_ParaAttr_DefaultTab ] ) )
- aSet.mnAttrSet |= 1 << PPT_ParaAttr_DefaultTab;
-
- if ( ( nCharCount > nStringLen ) || ( nStringLen < nCharAnzRead + nCharCount ) )
- {
- bTextPropAtom = sal_False;
- nCharCount = nStringLen - nCharAnzRead;
- // please fix the right hand side of
- // PPTParaPropSet& PPTParaPropSet::operator=(PPTParaPropSet&),
- // it should be a const reference
- PPTParaPropSet aTmpPPTParaPropSet;
- aParaPropSet = aTmpPPTParaPropSet;
- DBG_ERROR( "SJ:PPTStyleTextPropReader::could not get this PPT_PST_StyleTextPropAtom by reading the paragraph attributes" );
- }
- PPTParaPropSet* pPara = new PPTParaPropSet( aParaPropSet );
- pPara->mnOriginalTextPos = nCharAnzRead;
- aParaPropList.Insert( pPara, LIST_APPEND );
- if ( nCharCount )
- {
- sal_uInt32 nCount;
- const sal_Unicode* pDat = aString.GetBuffer() + nCharAnzRead;
- for ( nCount = 0; nCount < nCharCount; nCount++ )
- {
- if ( pDat[ nCount ] == 0xd )
- {
- pPara = new PPTParaPropSet( aParaPropSet );
- pPara->mnOriginalTextPos = nCharAnzRead + nCount + 1;
- aParaPropList.Insert( pPara, LIST_APPEND );
- }
- }
- }
- nCharAnzRead += nCharCount + 1;
+ sal_uInt32 nCharAnzRead = 0;
+ sal_uInt32 nExtParaFlags = 0, nAnmScheme = 0;
+ sal_uInt16 nBuBlip = 0xffff, nHasAnm = 0;
+ ReadCharProps( rIn, aCharPropSet, aString, nCharCount, nCharAnzRead,
+ bTextPropAtom, nExtParaPos, aStyleTextProp9, nExtParaFlags,
+ nBuBlip, nHasAnm, nAnmScheme );
+
+ aCharPropList.Insert(
+ new PPTCharPropSet( aCharPropSet, 0 ), LIST_APPEND );
}
+ }
+
+ if ( aString.Len() )
+ {
+ sal_uInt32 nCharCount;
+ sal_Bool bTextPropAtom = sal_False;
+
+ ReadParaProps( rIn, rMan, rTextHeader, aString, rRuler, nCharCount, bTextPropAtom );
sal_Bool bEmptyParaPossible = sal_True;
- sal_uInt32 nCurrentPara = nCharAnzRead = 0;
+ sal_uInt32 nCharAnzRead = 0;
+ sal_uInt32 nCurrentPara = 0;
sal_uInt32 nCurrentSpecMarker = (sal_uInt32)(sal_uIntPtr)aSpecMarkerList.First();
- sal_uInt32 nExtParaNibble = 0;
+ sal_uInt16 nStringLen = aString.Len();
while ( nCharAnzRead < nStringLen )
{
@@ -5207,87 +5343,9 @@ PPTStyleTextPropReader::PPTStyleTextPropReader( SvStream& rIn, SdrPowerPointImpo
PPTCharPropSet aCharPropSet( nCurrentPara );
if ( bTextPropAtom )
- {
- rIn >> nDummy16;
- nCharCount = nDummy16;
- rIn >> nDummy16;
- nCharsToRead = nStringLen - ( nCharAnzRead + nCharCount );
- if ( nCharsToRead < 0 )
- {
- nCharCount = nStringLen - nCharAnzRead;
- if ( nCharsToRead < -1 )
- {
- bTextPropAtom = sal_False;
- DBG_ERROR( "SJ:PPTStyleTextPropReader::could not get this PPT_PST_StyleTextPropAtom by reading the character attributes" );
- }
- }
- ImplPPTCharPropSet& aSet = *aCharPropSet.pCharSet;
-
- // character attributes
- rIn >> nMask;
- if ( (sal_uInt16)nMask )
- {
- aSet.mnAttrSet |= (sal_uInt16)nMask;
- rIn >> aSet.mnFlags;
- }
- if ( nMask & 0x10000 ) // cfTypeface
- {
- rIn >> aSet.mnFont;
- aSet.mnAttrSet |= 1 << PPT_CharAttr_Font;
- }
- if ( nMask & 0x200000 ) // cfFEOldTypeface
- {
- rIn >> aSet.mnAsianOrComplexFont;
- aSet.mnAttrSet |= 1 << PPT_CharAttr_AsianOrComplexFont;
- }
- if ( nMask & 0x400000 ) // cfANSITypeface
- {
- rIn >> aSet.mnANSITypeface;
- aSet.mnAttrSet |= 1 << PPT_CharAttr_ANSITypeface;
- }
- if ( nMask & 0x800000 ) // cfSymbolTypeface
- {
- rIn >> aSet.mnSymbolFont;
- aSet.mnAttrSet |= 1 << PPT_CharAttr_Symbol;
- }
- if ( nMask & 0x20000 ) // cfSize
- {
- rIn >> aSet.mnFontHeight;
- aSet.mnAttrSet |= 1 << PPT_CharAttr_FontHeight;
- }
- if ( nMask & 0x40000 ) // cfColor
- {
- sal_uInt32 nVal;
- rIn >> nVal;
- if ( !( nVal & 0xff000000 ) )
- nVal = PPT_COLSCHEME_HINTERGRUND;
- aSet.mnColor = nVal;
- aSet.mnAttrSet |= 1 << PPT_CharAttr_FontColor;
- }
- if ( nMask & 0x80000 ) // cfPosition
- {
- rIn >> aSet.mnEscapement;
- aSet.mnAttrSet |= 1 << PPT_CharAttr_Escapement;
- }
- if ( nExtParaPos )
- {
- sal_uInt32 nExtBuInd = nMask & 0x3c00;
- if ( nExtBuInd )
- nExtBuInd = ( aSet.mnFlags & 0x3c00 ) >> 10;
- if ( nExtBuInd < aStyleTextProp9.size() )
- {
- if ( nExtParaNibble && ( ( nExtBuInd + nExtParaNibble ) < aStyleTextProp9.size() ) )
- nExtBuInd += nExtParaNibble;
-
- nExtParaFlags = aStyleTextProp9[ nExtBuInd ].mnExtParagraphMask;
- nBuBlip = aStyleTextProp9[ nExtBuInd ].mnBuBlip;
- nHasAnm = aStyleTextProp9[ nExtBuInd ].mnHasAnm;
- nAnmScheme = aStyleTextProp9[ nExtBuInd ].mnAnmScheme;
- }
- if ( ( nExtBuInd & 0xf ) == 0xf )
- nExtParaNibble += 16;
- }
- }
+ ReadCharProps( rIn, aCharPropSet, aString, nCharCount, nCharAnzRead,
+ bTextPropAtom, nExtParaPos, aStyleTextProp9, nExtParaFlags,
+ nBuBlip, nHasAnm, nAnmScheme );
else
nCharCount = nStringLen;
@@ -6632,7 +6690,12 @@ PPTTextObj::PPTTextObj( SvStream& rIn, SdrPowerPointImport& rSdrPowerPointImport
mpImplTextObj->mnInstance = nInstance;
UINT32 nFilePos = rIn.Tell();
- if ( rSdrPowerPointImport.SeekToRec2( PPT_PST_TextBytesAtom, PPT_PST_TextCharsAtom, aClientTextBoxHd.GetRecEndFilePos() ) )
+ if ( rSdrPowerPointImport.SeekToRec2( PPT_PST_TextBytesAtom,
+ PPT_PST_TextCharsAtom,
+ aClientTextBoxHd.GetRecEndFilePos() )
+ || rSdrPowerPointImport.SeekToRec( rIn,
+ PPT_PST_StyleTextPropAtom,
+ aClientTextBoxHd.GetRecEndFilePos() ) )
{
PPTTextRulerInterpreter aTextRulerInterpreter( nTextRulerAtomOfs, rSdrPowerPointImport,
aClientTextBoxHd, rIn );
diff --git a/svx/source/svdraw/svdoashp.cxx b/svx/source/svdraw/svdoashp.cxx
index d866b4f..d4e1f7f 100644
--- a/svx/source/svdraw/svdoashp.cxx
+++ b/svx/source/svdraw/svdoashp.cxx
@@ -1630,7 +1630,7 @@ void SdrObjCustomShape::TakeObjInfo(SdrObjTransformInfoRec& rInfo) const
rInfo.bMirror90Allowed =TRUE;
rInfo.bTransparenceAllowed = FALSE;
rInfo.bGradientAllowed = FALSE;
- rInfo.bShearAllowed =FALSE;
+ rInfo.bShearAllowed =TRUE;
rInfo.bEdgeRadiusAllowed=FALSE;
rInfo.bNoContortion =TRUE;
@@ -1965,19 +1965,56 @@ void SdrObjCustomShape::NbcMirror( const Point& rRef1, const Point& rRef2 )
InvalidateRenderGeometry();
}
-void SdrObjCustomShape::Shear( const Point& /*rRef*/, long /*nWink*/, double /*tn*/, FASTBOOL /*bVShear*/)
+void SdrObjCustomShape::Shear( const Point& rRef, long nWink, double tn, FASTBOOL bVShear )
{
-/*
SdrTextObj::Shear( rRef, nWink, tn, bVShear );
InvalidateRenderGeometry();
-*/
}
-void SdrObjCustomShape::NbcShear( const Point& /*rRef*/, long /*nWink*/, double /*tn*/, FASTBOOL /*bVShear*/)
+void SdrObjCustomShape::NbcShear( const Point& rRef, long nWink, double tn, FASTBOOL bVShear )
{
-/*
+ long nDrehWink = aGeo.nDrehWink;
+ if ( nDrehWink )
+ {
+ aGeo.nDrehWink = -nDrehWink;
+ aGeo.RecalcSinCos();
+ NbcRotate( rRef, aGeo.nDrehWink, aGeo.nSin, aGeo.nCos );
+ }
SdrTextObj::NbcShear(rRef,nWink,tn,bVShear);
+ if ( nDrehWink )
+ {
+ aGeo.nDrehWink = nDrehWink;
+ aGeo.RecalcSinCos();
+ Rotate( rRef, aGeo.nDrehWink, aGeo.nSin, aGeo.nCos );
+ }
InvalidateRenderGeometry();
-*/
+}
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+
+SdrGluePoint SdrObjCustomShape::GetVertexGluePoint(USHORT nPosNum) const
+{
+ INT32 nWdt = ImpGetLineWdt(); // #i25616# ((XLineWidthItem&)(GetObjectItem(XATTR_LINEWIDTH))).GetValue();
+
+ // #i25616#
+ if(!LineIsOutsideGeometry())
+ {
+ nWdt++;
+ nWdt /= 2;
+ }
+
+ Point aPt;
+ switch (nPosNum) {
+ case 0: aPt=aRect.TopCenter(); aPt.Y()-=nWdt; break;
+ case 1: aPt=aRect.RightCenter(); aPt.X()+=nWdt; break;
+ case 2: aPt=aRect.BottomCenter(); aPt.Y()+=nWdt; break;
+ case 3: aPt=aRect.LeftCenter(); aPt.X()-=nWdt; break;
+ }
+ if (aGeo.nShearWink!=0) ShearPoint(aPt,aRect.TopLeft(),aGeo.nTan);
+ if (aGeo.nDrehWink!=0) RotatePoint(aPt,aRect.TopLeft(),aGeo.nSin,aGeo.nCos);
+ aPt-=GetSnapRect().Center();
+ SdrGluePoint aGP(aPt);
+ aGP.SetPercent(FALSE);
+ return aGP;
}
////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -2012,6 +2049,53 @@ void SdrObjCustomShape::ImpCheckCustomGluePointsAreAdded()
aNewList.Insert(aCopy);
}
+ sal_Bool bMirroredX = IsMirroredX();
+ sal_Bool bMirroredY = IsMirroredY();
+
+ long nShearWink = aGeo.nShearWink;
+ double fTan = aGeo.nTan;
+
+ if ( aGeo.nDrehWink || nShearWink || bMirroredX || bMirroredY )
+ {
+ Polygon aPoly( aRect );
+ if( nShearWink )
+ {
+ USHORT nPointCount=aPoly.GetSize();
+ for (USHORT i=0; i<nPointCount; i++)
+ ShearPoint(aPoly[i],aRect.Center(), fTan, FALSE );
+ }
+ if ( aGeo.nDrehWink )
+ aPoly.Rotate( aRect.Center(), aGeo.nDrehWink / 10 );
+
+ Rectangle aBoundRect( aPoly.GetBoundRect() );
+ sal_Int32 nXDiff = aBoundRect.Left() - aRect.Left();
+ sal_Int32 nYDiff = aBoundRect.Top() - aRect.Top();
+
+ if (nShearWink&&(bMirroredX&&!bMirroredY)||(bMirroredY&&!bMirroredX))
+ {
+ nShearWink = -nShearWink;
+ fTan = -fTan;
+ }
+
+ Point aRef( aRect.GetWidth() / 2, aRect.GetHeight() / 2 );
+ for ( a = 0; a < aNewList.GetCount(); a++ )
+ {
+ SdrGluePoint& rPoint = aNewList[ a ];
+ Point aGlue( rPoint.GetPos() );
+ if ( nShearWink )
+ ShearPoint( aGlue, aRef, fTan );
+
+ RotatePoint( aGlue, aRef, sin( fObjectRotation * F_PI180 ), cos( fObjectRotation * F_PI180 ) );
+ if ( bMirroredX )
+ aGlue.X() = aRect.GetWidth() - aGlue.X();
+ if ( bMirroredY )
+ aGlue.Y() = aRect.GetHeight() - aGlue.Y();
+ aGlue.X() -= nXDiff;
+ aGlue.Y() -= nYDiff;
+ rPoint.SetPos( aGlue );
+ }
+ }
+
for(a = 0; a < pList->GetCount(); a++)
{
const SdrGluePoint& rCandidate = (*pList)[a];
@@ -2162,12 +2246,13 @@ void SdrObjCustomShape::DragResizeCustomShape( const Rectangle& rNewRect, SdrObj
std::vector< SdrCustomShapeInteraction > aInteractionHandles( GetInteractionHandles( pObj ) );
+ GeoStat aGeoStat( pObj->GetGeoStat() );
if ( aNewRect.TopLeft()!= pObj->aRect.TopLeft() &&
( pObj->aGeo.nDrehWink || pObj->aGeo.nShearWink ) )
{
Point aNewPos( aNewRect.TopLeft() );
- if ( pObj->aGeo.nShearWink ) ShearPoint( aNewPos, aOld.TopLeft(), pObj->aGeo.nTan );
- if ( pObj->aGeo.nDrehWink ) RotatePoint(aNewPos, aOld.TopLeft(), pObj->aGeo.nSin, pObj->aGeo.nCos );
+ if ( pObj->aGeo.nShearWink ) ShearPoint( aNewPos, aOld.TopLeft(), aGeoStat.nTan );
+ if ( pObj->aGeo.nDrehWink ) RotatePoint(aNewPos, aOld.TopLeft(), aGeoStat.nSin, aGeoStat.nCos );
aNewRect.SetPos( aNewPos );
}
if ( aNewRect != pObj->aRect )
@@ -2180,7 +2265,6 @@ void SdrObjCustomShape::DragResizeCustomShape( const Rectangle& rNewRect, SdrObj
Point aTop( ( pObj->GetSnapRect().Left() + pObj->GetSnapRect().Right() ) >> 1, pObj->GetSnapRect().Top() );
Point aBottom( aTop.X(), aTop.Y() + 1000 );
pObj->NbcMirror( aTop, aBottom );
-
}
if ( rNewRect.Top() > rNewRect.Bottom() )
{
@@ -2188,6 +2272,7 @@ void SdrObjCustomShape::DragResizeCustomShape( const Rectangle& rNewRect, SdrObj
Point aRight( aLeft.X() + 1000, aLeft.Y() );
pObj->NbcMirror( aLeft, aRight );
}
+
std::vector< SdrCustomShapeInteraction >::iterator aIter( aInteractionHandles.begin() );
while ( aIter != aInteractionHandles.end() )
{
@@ -3301,13 +3386,13 @@ void SdrObjCustomShape::TRSetBaseGeometry(const basegfx::B2DHomMatrix& rMatrix,
SetSnapRect(aBaseRect);
// shear?
-// if(!basegfx::fTools::equalZero(fShearX))
-// {
-// GeoStat aGeoStat;
-// aGeoStat.nShearWink = FRound((atan(fShearX) / F_PI180) * 100.0);
-// aGeoStat.RecalcTan();
-// Shear(Point(), aGeoStat.nShearWink, aGeoStat.nTan, FALSE);
-// }
+ if(!basegfx::fTools::equalZero(fShearX))
+ {
+ GeoStat aGeoStat;
+ aGeoStat.nShearWink = FRound((atan(fShearX) / F_PI180) * 100.0);
+ aGeoStat.RecalcTan();
+ Shear(Point(), aGeoStat.nShearWink, aGeoStat.nTan, FALSE);
+ }
// rotation?
if(!basegfx::fTools::equalZero(fRotate))
diff --git a/svx/source/table/cell.cxx b/svx/source/table/cell.cxx
index cdd55c9..9b3bca6 100644
--- a/svx/source/table/cell.cxx
+++ b/svx/source/table/cell.cxx
@@ -450,6 +450,11 @@ void Cell::cloneFrom( const CellRef& xCell )
msFormula = xCell->msFormula;
mfValue = xCell->mfValue;
mnError = xCell->mnError;
+
+ mbMerged = xCell->mbMerged;
+ mnRowSpan = xCell->mnRowSpan;
+ mnColSpan = xCell->mnColSpan;
+
}
notifyModified();
}
diff --git a/svx/source/table/cellcursor.cxx b/svx/source/table/cellcursor.cxx
index 5c15eb9..d996af5 100644
--- a/svx/source/table/cellcursor.cxx
+++ b/svx/source/table/cellcursor.cxx
@@ -201,6 +201,9 @@ bool CellCursor::GetMergedSelection( CellPos& rStart, CellPos& rEnd )
if( xCell->isMerged() )
{
findMergeOrigin( mxTable, mnRight, mnBottom, rEnd.mnCol, rEnd.mnRow );
+ // merge not possible if selection is only one cell and all its merges
+ if( rEnd == rStart )
+ return false;
xCell.set( dynamic_cast< Cell* >( mxTable->getCellByPosition( rEnd.mnCol, rEnd.mnRow ).get() ) );
}
}
@@ -271,7 +274,7 @@ void SAL_CALL CellCursor::merge( ) throw (NoSupportException, RuntimeException)
try
{
- merge( aStart.mnCol, aStart.mnRow, aEnd.mnCol - aStart.mnCol + 1, aEnd.mnRow - aStart.mnRow + 1 );
+ mxTable->merge( aStart.mnCol, aStart.mnRow, aEnd.mnCol - aStart.mnCol + 1, aEnd.mnRow - aStart.mnRow + 1 );
mxTable->optimize();
mxTable->setModified(sal_True);
}
@@ -286,40 +289,6 @@ void SAL_CALL CellCursor::merge( ) throw (NoSupportException, RuntimeException)
// -----------------------------------------------------------------------------
-void CellCursor::merge( sal_Int32 nCol, sal_Int32 nRow, sal_Int32 nColSpan, sal_Int32 nRowSpan )
-{
- // merge first cell
- CellRef xOriginCell( dynamic_cast< Cell* >( mxTable->getCellByPosition( nCol, nRow ).get() ) );
- if( xOriginCell.is() )
- {
- xOriginCell->AddUndo();
- xOriginCell->merge( nColSpan, nRowSpan );
- }
-
- const sal_Int32 nLastRow = nRow + nRowSpan;
- const sal_Int32 nLastCol = nCol + nColSpan;
-
- sal_Int32 nTempCol = nCol + 1;
-
- // merge remaining cells
- for( ; nRow < nLastRow; nRow++ )
- {
- for( ; nTempCol < nLastCol; nTempCol++ )
- {
- CellRef xCell( dynamic_cast< Cell* >( mxTable->getCellByPosition( nTempCol, nRow ).get() ) );
- if( xCell.is() && !xCell->isMerged() )
- {
- xCell->AddUndo();
- xCell->setMerged();
- xOriginCell->mergeContent( xCell );
- }
- }
- nTempCol = nCol;
- }
-}
-
-// -----------------------------------------------------------------------------
-
void CellCursor::split_column( sal_Int32 nCol, sal_Int32 nColumns, std::vector< sal_Int32 >& rLeftOvers )
{
const sal_Int32 nRowCount = mxTable->getRowCount();
@@ -362,8 +331,13 @@ void CellCursor::split_column( sal_Int32 nCol, sal_Int32 nColumns, std::vector<
CellRef xCell( dynamic_cast< Cell* >( mxTable->getCellByPosition( nCol, nRow ).get() ) );
if( !xCell.is() || xCell->isMerged() )
{
- // merged cells are ignored, but newly added columns will be added to leftovers
- rLeftOvers[nRow] += nNewCols;
+ if( nNewCols > 0 )
+ {
+ // merged cells are ignored, but newly added columns will be added to leftovers
+ xCell.set( dynamic_cast< Cell* >(mxTable->getCellByPosition( nCol+1, nRow ).get() ) );
+ if( !xCell.is() || !xCell->isMerged() )
+ rLeftOvers[nRow] += nNewCols;
+ }
}
else
{
@@ -388,12 +362,9 @@ void CellCursor::split_column( sal_Int32 nCol, sal_Int32 nColumns, std::vector<
if( nSplits == 0 )
nSplitSpan = nCellsAvailable - ((nSplitSpan+1) * nColumns) - 1;
- xCell->merge( nSplitSpan + 1, nRowSpan + 1);
+ mxTable->merge( nSplitCol, nRow, nSplitSpan + 1, nRowSpan + 1);
if( nSplits > 0 )
- {
nSplitCol += nSplitSpan + 1;
- xCell.set( dynamic_cast< Cell* >( mxTable->getCellByPosition( nSplitCol, nRow ).get() ) );
- }
}
do
@@ -407,7 +378,7 @@ void CellCursor::split_column( sal_Int32 nCol, sal_Int32 nColumns, std::vector<
{
// cope with outside cells, merge if needed
if( nColSpan < (rLeftOvers[nRow] + nNewCols) )
- merge( nCol, nRow, (rLeftOvers[nRow] + nNewCols) + 1, nRowSpan + 1 );
+ mxTable->merge( nCol, nRow, (rLeftOvers[nRow] + nNewCols) + 1, nRowSpan + 1 );
do
{
@@ -476,8 +447,13 @@ void CellCursor::split_row( sal_Int32 nRow, sal_Int32 nRows, std::vector< sal_In
CellRef xCell( dynamic_cast< Cell* >( mxTable->getCellByPosition( nCol, nRow ).get() ) );
if( !xCell.is() || xCell->isMerged() )
{
- // merged cells are ignored, but newly added columns will be added to leftovers
- rLeftOvers[nCol] += nNewRows;
+ if( nNewRows )
+ {
+ // merged cells are ignored, but newly added columns will be added to leftovers
+ xCell.set( dynamic_cast< Cell* >(mxTable->getCellByPosition( nCol, nRow+1 ).get() ) );
+ if( !xCell.is() || !xCell->isMerged() )
+ rLeftOvers[nCol] += nNewRows;
+ }
}
else
{
@@ -502,12 +478,9 @@ void CellCursor::split_row( sal_Int32 nRow, sal_Int32 nRows, std::vector< sal_In
if( nSplits == 0 )
nSplitSpan = nCellsAvailable - ((nSplitSpan+1) * nRows) - 1;
- xCell->merge( nColSpan + 1, nSplitSpan + 1 );
+ mxTable->merge( nCol, nSplitRow, nColSpan + 1, nSplitSpan + 1 );
if( nSplits > 0 )
- {
nSplitRow += nSplitSpan + 1;
- xCell.set( dynamic_cast< Cell* >( mxTable->getCellByPosition( nCol, nSplitRow ).get() ) );
- }
}
do
@@ -521,7 +494,7 @@ void CellCursor::split_row( sal_Int32 nRow, sal_Int32 nRows, std::vector< sal_In
{
// cope with outside cells, merge if needed
if( nRowSpan < (rLeftOvers[nCol] + nNewRows) )
- merge( nCol, nRow, nColSpan + 1, (rLeftOvers[nCol] + nNewRows) + 1 );
+ mxTable->merge( nCol, nRow, nColSpan + 1, (rLeftOvers[nCol] + nNewRows) + 1 );
do
{
diff --git a/svx/source/table/cellcursor.hxx b/svx/source/table/cellcursor.hxx
index b6cde44..87cef8c 100644
--- a/svx/source/table/cellcursor.hxx
+++ b/svx/source/table/cellcursor.hxx
@@ -75,8 +75,6 @@ public:
protected:
bool GetMergedSelection( CellPos& rStart, CellPos& rEnd );
- void merge( sal_Int32 nCol, sal_Int32 nRow, sal_Int32 nColSpan, sal_Int32 nRowSpan );
-
void split_column( sal_Int32 nCol, sal_Int32 nColumns, std::vector< sal_Int32 >& rLeftOvers );
void split_horizontal( sal_Int32 nColumns );
void split_row( sal_Int32 nRow, sal_Int32 nRows, std::vector< sal_Int32 >& rLeftOvers );
diff --git a/svx/source/table/tablelayouter.cxx b/svx/source/table/tablelayouter.cxx
index 06293ea..00402e9 100644
--- a/svx/source/table/tablelayouter.cxx
+++ b/svx/source/table/tablelayouter.cxx
@@ -102,6 +102,9 @@ basegfx::B2ITuple TableLayouter::getCellSize( const CellPos& rPos ) const
sal_Int32 nRowSpan = std::max( xCell->getRowSpan(), (sal_Int32)1 );
while( nRowSpan && (aPos.mnRow < nRowCount) )
{
+ if( ((sal_Int32)maRows.size()) <= aPos.mnRow )
+ break;
+
height += maRows[aPos.mnRow++].mnSize;
nRowSpan--;
}
@@ -110,6 +113,9 @@ basegfx::B2ITuple TableLayouter::getCellSize( const CellPos& rPos ) const
sal_Int32 nColSpan = std::max( xCell->getColumnSpan(), (sal_Int32)1 );
while( nColSpan && (aPos.mnCol < nColCount ) )
{
+ if( ((sal_Int32)maColumns.size()) <= aPos.mnCol )
+ break;
+
width += maColumns[aPos.mnCol++].mnSize;
nColSpan--;
}
@@ -133,11 +139,14 @@ bool TableLayouter::getCellArea( const CellPos& rPos, basegfx::B2IRectangle& rAr
{
const basegfx::B2ITuple aCellSize( getCellSize( rPos ) );
- const sal_Int32 x = maColumns[rPos.mnCol].mnPos;
- const sal_Int32 y = maRows[rPos.mnRow].mnPos;
-
- rArea = basegfx::B2IRectangle( x, y, x + aCellSize.getX(), y + aCellSize.getY() );
- return true;
+ if( (rPos.mnCol < ((sal_Int32)maColumns.size()) && (rPos.mnRow < ((sal_Int32)maRows.size()) ) ) )
+ {
+ const sal_Int32 x = maColumns[rPos.mnCol].mnPos;
+ const sal_Int32 y = maRows[rPos.mnRow].mnPos;
+
+ rArea = basegfx::B2IRectangle( x, y, x + aCellSize.getX(), y + aCellSize.getY() );
+ return true;
+ }
}
}
catch( Exception& )
@@ -321,6 +330,21 @@ sal_Int32 TableLayouter::getVerticalEdge( int nEdgeX, sal_Int32* pnMin /*= 0*/,
// -----------------------------------------------------------------------------
+static bool checkMergeOrigin( const TableModelRef& xTable, sal_Int32 nMergedX, sal_Int32 nMergedY, sal_Int32 nCellX, sal_Int32 nCellY, bool& bRunning )
+{
+ Reference< XMergeableCell > xCell( xTable->getCellByPosition( nCellX, nCellY ), UNO_QUERY );
+ if( xCell.is() && !xCell->isMerged() )
+ {
+ const sal_Int32 nRight = xCell->getColumnSpan() + nCellX;
+ const sal_Int32 nBottom = xCell->getRowSpan() + nCellY;
+ if( (nMergedX < nRight) && (nMergedY < nBottom) )
+ return true;
+
+ bRunning = false;
+ }
+ return false;
+}
+
/** returns true if the cell(nMergedX,nMergedY) is merged with other cells.
the returned cell( rOriginX, rOriginY ) is the origin( top left cell ) of the merge.
*/
@@ -336,49 +360,87 @@ bool findMergeOrigin( const TableModelRef& xTable, sal_Int32 nMergedX, sal_Int32
if( !xCell.is() || !xCell->isMerged() )
return true;
- // check horizontal
- sal_Int32 nCol = nMergedX-1;
- while( nCol >= 0 )
+ bool bCheckVert = true;
+ bool bCheckHorz = true;
+
+ sal_Int32 nMinCol = 0;
+ sal_Int32 nMinRow = 0;
+
+ sal_Int32 nStep = 1, i;
+
+ sal_Int32 nRow, nCol;
+ do
{
- xCell = xCell.query( xTable->getCellByPosition( nCol, nMergedY ) );
- if( xCell.is() && !xCell->isMerged() )
+ if( bCheckVert )
{
- if( xCell->getColumnSpan() > 1 )
+ nRow = nMergedY - nStep;
+ if( nRow >= nMinRow )
+ {
+ nCol = nMergedX;
+ for( i = 0; (i <= nStep) && (nCol >= nMinCol); i++, nCol-- )
+ {
+ if( checkMergeOrigin( xTable, nMergedX, nMergedY, nCol, nRow, bCheckVert ) )
+ {
+ rOriginX = nCol; rOriginY = nRow;
+ return true;
+ }
+
+ if( !bCheckVert )
+ {
+ if( nCol == nMergedX )
+ {
+ nMinRow = nRow+1;
+ }
+ else
+ {
+ bCheckVert = true;
+ }
+ break;
+ }
+ }
+ }
+ else
{
- // hit!
- rOriginX = nCol;
- rOriginY = nMergedY;
- return true;
+ bCheckVert = false;
}
- break;
}
- nCol--;
- }
- // check vertical
- sal_Int32 nRow = nMergedY-1;
- while( nRow >= 0 )
- {
- xCell = xCell.query( xTable->getCellByPosition( nMergedX, nRow ) );
- if( xCell.is() && !xCell->isMerged() )
+ if( bCheckHorz )
{
- if( xCell->getRowSpan() > 1 )
+ nCol = nMergedX - nStep;
+ if( nCol >= nMinCol )
{
- // hit!
- rOriginX = nMergedX;
- rOriginY = nRow;
- return true;
+ nRow = nMergedY;
+ for( i = 0; (i < nStep) && (nRow >= nMinRow); i++, nRow-- )
+ {
+ if( checkMergeOrigin( xTable, nMergedX, nMergedY, nCol, nRow, bCheckHorz ) )
+ {
+ rOriginX = nCol; rOriginY = nRow;
+ return true;
+ }
+
+ if( !bCheckHorz )
+ {
+ if( nRow == nMergedY )
+ {
+ nMinCol = nCol+1;
+ }
+ else
+ {
+ bCheckHorz = true;
+ }
+ break;
+ }
+ }
+ }
+ else
+ {
+ bCheckHorz = false;
}
- break;
}
- nRow--;
+ nStep++;
}
-
- // if origin is not at the edges, it must be the top left cell of the merged edges
- rOriginX = nCol+1;
- rOriginY = nRow+1;
- xCell = xCell.query( xTable->getCellByPosition( rOriginX, rOriginY ) );
- return xCell.is() && (xCell->getRowSpan() > 1) && (xCell->getColumnSpan() > 1);
+ while( bCheckVert || bCheckHorz );
}
catch( Exception& )
{
diff --git a/svx/source/table/tablemodel.cxx b/svx/source/table/tablemodel.cxx
index d74147c..59f1d92 100644
--- a/svx/source/table/tablemodel.cxx
+++ b/svx/source/table/tablemodel.cxx
@@ -52,6 +52,8 @@
#include "svdstr.hrc"
#include "svdglob.hxx"
+//#define PLEASE_DEBUG_THE_TABLES 1
+
using ::rtl::OUString;
using namespace ::osl;
using namespace ::vos;
@@ -620,14 +622,29 @@ void TableModel::notifyModification()
::osl::MutexGuard guard( m_aMutex );
if( (mnNotifyLock == 0) && mpTableObj && mpTableObj->GetModel() )
{
+ mbNotifyPending = false;
+
+ ::cppu::OInterfaceContainerHelper * pModifyListeners = rBHelper.getContainer( XModifyListener::static_type() );
+ if( pModifyListeners )
+ {
+ EventObject aSource;
+ aSource.Source = static_cast< ::cppu::OWeakObject* >(this);
+ pModifyListeners->notifyEach( &XModifyListener::modified, aSource);
+ }
+ }
+ else
+ {
+ mbNotifyPending = true;
+ }
#ifdef PLEASE_DEBUG_THE_TABLES
- FILE* file = fopen( "e:\\table.log","a+" );
+ FILE* file = fopen( "c:\\table.xml","w" );
const sal_Int32 nColCount = getColumnCountImpl();
const sal_Int32 nRowCount = getRowCountImpl();
- fprintf( file, "<table columns=\"%ld\" rows=\"%ld\">\n\r", nColCount, nRowCount );
+ fprintf( file, "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n\r" );
+ fprintf( file, "<table columns=\"%ld\" rows=\"%ld\" updated=\"%s\">\n\r", nColCount, nRowCount, mbNotifyPending ? "false" : "true");
for( sal_Int32 nCol = 0; nCol < nColCount; ++nCol )
{
@@ -647,9 +664,9 @@ void TableModel::notifyModification()
sal_Int32 nColSpan = xCell->getColumnSpan();
sal_Bool bMerged = xCell->isMerged();
- if( nColSpan > 1 )
+ if( nColSpan != 1 )
fprintf( file, " column-span=\"%ld\"", nColSpan );
- if( nRowSpan > 1 )
+ if( nRowSpan != 1 )
fprintf( file, " row-span=\"%ld\"", nRowSpan );
if( bMerged )
@@ -663,20 +680,6 @@ void TableModel::notifyModification()
fprintf( file, "</table>\n\r" );
fclose( file );
#endif
- mbNotifyPending = false;
-
- ::cppu::OInterfaceContainerHelper * pModifyListeners = rBHelper.getContainer( XModifyListener::static_type() );
- if( pModifyListeners )
- {
- EventObject aSource;
- aSource.Source = static_cast< ::cppu::OWeakObject* >(this);
- pModifyListeners->notifyEach( &XModifyListener::modified, aSource);
- }
- }
- else
- {
- mbNotifyPending = true;
- }
}
// -----------------------------------------------------------------------------
@@ -784,19 +787,7 @@ void TableModel::insertColumns( sal_Int32 nIndex, sal_Int32 nCount )
// cell merges over newly created columns, so add the new columns to the merged cell
const sal_Int32 nRowSpan = xCell->getRowSpan();
nColSpan += nCount;
- if( bUndo )
- xCell->AddUndo();
- xCell->merge( nColSpan, nRowSpan );
- // set newly inserted cells to merged state
- for( sal_Int32 nColOffset = 0; nColOffset < nCount; ++nColOffset )
- {
- for( sal_Int32 nRowOffset = 0; nRowOffset < nRowSpan; ++nRowOffset )
- {
- CellRef xMergedCell( getCell( nIndex + nColOffset, nRow + nRowOffset ) );
- if( xMergedCell.is() )
- xMergedCell->setMerged();
- }
- }
+ merge( nCol, nRow, nColSpan, nRowSpan );
}
}
}
@@ -909,7 +900,10 @@ void TableModel::removeColumns( sal_Int32 nIndex, sal_Int32 nCount )
maRows[nRows]->removeColumns( nIndex, nCount );
if( bUndo )
+ {
pModel->EndUndo();
+ pModel->SetChanged();
+ }
}
catch( Exception& )
{
@@ -964,20 +958,7 @@ void TableModel::insertRows( sal_Int32 nIndex, sal_Int32 nCount )
// cell merges over newly created columns, so add the new columns to the merged cell
const sal_Int32 nColSpan = xCell->getColumnSpan();
nRowSpan += nCount;
- if( bUndo )
- xCell->AddUndo();
- xCell->merge( nColSpan, nRowSpan );
-
- // set newly inserted cells to merged state
- for( sal_Int32 nColOffset = 1; nColOffset < nColSpan; ++nColOffset )
- {
- for( sal_Int32 nRowOffset = 0; nRowOffset <= nCount; ++nRowOffset )
- {
- CellRef xMergedCell( getCell( nCol + nColOffset - 1, nIndex + nRowOffset ) );
- if( xMergedCell.is() )
- xMergedCell->setMerged();
- }
- }
+ merge( nCol, nRow, nColSpan, nRowSpan );
}
}
}
@@ -1075,7 +1056,10 @@ void TableModel::removeRows( sal_Int32 nIndex, sal_Int32 nCount )
remove_range<RowVector,RowVector::iterator>( maRows, nIndex, nCount );
if( bUndo )
+ {
pModel->EndUndo();
+ pModel->SetChanged();
+ }
}
catch( Exception& )
{
@@ -1198,6 +1182,50 @@ void TableModel::optimize()
// -----------------------------------------------------------------------------
+void TableModel::merge( sal_Int32 nCol, sal_Int32 nRow, sal_Int32 nColSpan, sal_Int32 nRowSpan )
+{
+ const bool bUndo = pModel && mpTableObj->IsInserted() && pModel->IsUndoEnabled();
+
+ const sal_Int32 nLastRow = nRow + nRowSpan;
+ const sal_Int32 nLastCol = nCol + nColSpan;
+
+ if( (nLastRow > getRowCount()) || (nLastCol > getRowCount() ) )
+ {
+ DBG_ERROR("TableModel::merge(), merge beyound the table!");
+ }
+
+ // merge first cell
+ CellRef xOriginCell( dynamic_cast< Cell* >( getCellByPosition( nCol, nRow ).get() ) );
+ if( xOriginCell.is() )
+ {
+ if( bUndo )
+ xOriginCell->AddUndo();
+ xOriginCell->merge( nColSpan, nRowSpan );
+ }
+
+ sal_Int32 nTempCol = nCol + 1;
+
+ // merge remaining cells
+ for( ; nRow < nLastRow; nRow++ )
+ {
+ for( ; nTempCol < nLastCol; nTempCol++ )
+ {
+ CellRef xCell( dynamic_cast< Cell* >( getCellByPosition( nTempCol, nRow ).get() ) );
+ if( xCell.is() && !xCell->isMerged() )
+ {
+ if( bUndo )
+ xCell->AddUndo();
+ xCell->setMerged();
+ xOriginCell->mergeContent( xCell );
+ }
+ }
+ nTempCol = nCol;
+ }
+}
+
+
+// -----------------------------------------------------------------------------
+
void TableModel::updateRows()
{
sal_Int32 nRow = 0;
diff --git a/svx/source/table/tablemodel.hxx b/svx/source/table/tablemodel.hxx
index 5619c40..58d2d17 100644
--- a/svx/source/table/tablemodel.hxx
+++ b/svx/source/table/tablemodel.hxx
@@ -96,6 +96,9 @@ public:
/** deletes rows and columns that are completly merged. Must be called between BegUndo/EndUndo! */
void optimize();
+ /// merges the cell at the given position with the given span
+ void merge( sal_Int32 nCol, sal_Int32 nRow, sal_Int32 nColSpan, sal_Int32 nRowSpan );
+
// ICellRange
virtual sal_Int32 getLeft();
virtual sal_Int32 getTop();
diff --git a/xmloff/source/draw/animationexport.cxx b/xmloff/source/draw/animationexport.cxx
index 9832732..fcb7384 100644
--- a/xmloff/source/draw/animationexport.cxx
+++ b/xmloff/source/draw/animationexport.cxx
@@ -1564,7 +1564,7 @@ void AnimationsExporterImpl::convertValue( XMLTokenEnum eAttributeName, OUString
case XML_FONT_WEIGHT: nType = XML_TYPE_TEXT_WEIGHT; break;
case XML_FONT_STYLE: nType = XML_TYPE_TEXT_POSTURE; break;
case XML_TEXT_UNDERLINE: nType = XML_TYPE_TEXT_UNDERLINE_STYLE; break;
- case XML_FONT_SIZE: nType = XML_TYPE_CHAR_HEIGHT; break;
+ case XML_FONT_SIZE: nType = XML_TYPE_DOUBLE_PERCENT; break;
case XML_VISIBILITY: nType = XML_SD_TYPE_PRESPAGE_VISIBILITY; break;
case XML_OPACITY:
case XML_TRANSITIONFILTER: nType = XML_TYPE_DOUBLE; break;
diff --git a/xmloff/source/draw/animationimport.cxx b/xmloff/source/draw/animationimport.cxx
index 1c7a1c0..b3f3e07 100644
--- a/xmloff/source/draw/animationimport.cxx
+++ b/xmloff/source/draw/animationimport.cxx
@@ -472,7 +472,7 @@ Any AnimationsImportHelperImpl::convertValue( XMLTokenEnum eAttributeName, const
case XML_FONT_WEIGHT: nType = XML_TYPE_TEXT_WEIGHT; break;
case XML_FONT_STYLE: nType = XML_TYPE_TEXT_POSTURE; break;
case XML_TEXT_UNDERLINE: nType = XML_TYPE_TEXT_UNDERLINE_STYLE; break;
- case XML_FONT_SIZE: nType = XML_TYPE_CHAR_HEIGHT; break;
+ case XML_FONT_SIZE: nType = XML_TYPE_DOUBLE_PERCENT; break;
case XML_VISIBILITY: nType = XML_SD_TYPE_PRESPAGE_VISIBILITY; break;
default:
More information about the ooo-build-commit
mailing list