summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorPetr Mladek <pmladek@suse.cz>2013-05-01 13:05:06 +0200
committerPetr Mladek <pmladek@suse.cz>2013-05-01 13:05:06 +0200
commit93e11e4fb697aaea63c99308f980e4c932bd1efa (patch)
tree1892e49932d8d7b7656ae504113a40e4e39f876f /svx
parenta5b6a379a2d628040db98060c2adfe8f2fac5607 (diff)
parentc6786add5a58268e11aa027c47054344040db1bc (diff)
Merge tag 'libreoffice-4.0.3.2' into suse-4.0
Tag libreoffice-4.0.3.2 Conflicts: basic/qa/cppunit/test_vba.cxx basic/source/runtime/step2.cxx dictionaries helpcontent2 instsetoo_native/util/openoffice.lst libvisio/UnpackedTarball_visio.mk sc/source/ui/vba/vbaapplication.cxx sc/source/ui/vba/vbavalidation.cxx solenv/inc/minor.mk sw/qa/extras/ooxmlimport/ooxmlimport.cxx translations Change-Id: Ic1f06489175f3db92d6bbcebb9732fadc1c61fed
Diffstat (limited to 'svx')
-rw-r--r--svx/Package_inc.mk1
-rw-r--r--svx/inc/svx/itextprovider.hxx42
-rw-r--r--svx/inc/svx/sdr/properties/textproperties.hxx4
-rw-r--r--svx/inc/svx/svdotext.hxx3
-rw-r--r--svx/source/customshapes/EnhancedCustomShapeGeometry.cxx4
-rw-r--r--svx/source/fmcomp/gridctrl.cxx2
-rw-r--r--svx/source/sdr/properties/textproperties.cxx38
-rw-r--r--svx/source/table/cell.cxx52
-rw-r--r--svx/source/table/tablelayouter.cxx2
-rw-r--r--svx/source/table/viewcontactoftableobj.cxx8
10 files changed, 134 insertions, 22 deletions
diff --git a/svx/Package_inc.mk b/svx/Package_inc.mk
index 3eac0948f077..fa3313d38ba1 100644
--- a/svx/Package_inc.mk
+++ b/svx/Package_inc.mk
@@ -31,6 +31,7 @@ $(eval $(call gb_Package_add_file,svx_inc,inc/svx/xftdiit.hxx,svx/xftdiit.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/fntctl.hxx,svx/fntctl.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/svdattr.hxx,svx/svdattr.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/imapdlg.hxx,svx/imapdlg.hxx))
+$(eval $(call gb_Package_add_file,svx_inc,inc/svx/itextprovider.hxx,svx/itextprovider.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/linkwarn.hxx,svx/linkwarn.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/formatpaintbrushctrl.hxx,svx/formatpaintbrushctrl.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/xcolit.hxx,svx/xcolit.hxx))
diff --git a/svx/inc/svx/itextprovider.hxx b/svx/inc/svx/itextprovider.hxx
new file mode 100644
index 000000000000..3202e4d65495
--- /dev/null
+++ b/svx/inc/svx/itextprovider.hxx
@@ -0,0 +1,42 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#if !defined SVX_ITEXTPROVIDER_HXX_INCLUDED
+#define SVX_ITEXTPROVIDER_HXX_INCLUDED
+
+#include <sal/types.h>
+
+#include <svx/svxdllapi.h>
+
+class SdrText;
+
+namespace svx
+{
+
+ /** This interface provides access to text object(s) in an SdrObject.
+
+ */
+ class SVX_DLLPUBLIC ITextProvider
+ {
+ public:
+ /** Return the number of texts available for this object. */
+ virtual sal_Int32 getTextCount() const = 0;
+
+ /** Return the nth available text. */
+ virtual SdrText* getText(sal_Int32 nIndex) const = 0;
+
+ protected:
+ ~ITextProvider() {}
+ };
+
+}
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svx/inc/svx/sdr/properties/textproperties.hxx b/svx/inc/svx/sdr/properties/textproperties.hxx
index ac6a613e2c2a..456b104e60ec 100644
--- a/svx/inc/svx/sdr/properties/textproperties.hxx
+++ b/svx/inc/svx/sdr/properties/textproperties.hxx
@@ -20,6 +20,7 @@
#ifndef _SDR_PROPERTIES_TEXTPROPERTIES_HXX
#define _SDR_PROPERTIES_TEXTPROPERTIES_HXX
+#include <svx/itextprovider.hxx>
#include <svx/sdr/properties/attributeproperties.hxx>
#include "svx/svxdllapi.h"
@@ -45,6 +46,9 @@ namespace sdr
// react on ItemSet changes
virtual void ItemSetChanged(const SfxItemSet& rSet);
+ /// Get the TextProvider related to our SdrObject
+ virtual const svx::ITextProvider& getTextProvider() const;
+
public:
// basic constructor
explicit TextProperties(SdrObject& rObj);
diff --git a/svx/inc/svx/svdotext.hxx b/svx/inc/svx/svdotext.hxx
index 5f1eeac67bab..551cf58382f1 100644
--- a/svx/inc/svx/svdotext.hxx
+++ b/svx/inc/svx/svdotext.hxx
@@ -21,6 +21,7 @@
#define _SVDOTEXT_HXX
#include <vcl/field.hxx>
+#include <svx/itextprovider.hxx>
#include <svx/svdoattr.hxx>
#include <svx/svdtrans.hxx> // GeoStat
#include <tools/datetime.hxx>
@@ -123,7 +124,7 @@ namespace sdr
// SdrTextObj
//************************************************************
-class SVX_DLLPUBLIC SdrTextObj : public SdrAttrObj
+class SVX_DLLPUBLIC SdrTextObj : public SdrAttrObj, public svx::ITextProvider
{
private:
// Cell needs access to ImpGetDrawOutliner();
diff --git a/svx/source/customshapes/EnhancedCustomShapeGeometry.cxx b/svx/source/customshapes/EnhancedCustomShapeGeometry.cxx
index 6a8c442bc79a..4f069a2b85ce 100644
--- a/svx/source/customshapes/EnhancedCustomShapeGeometry.cxx
+++ b/svx/source/customshapes/EnhancedCustomShapeGeometry.cxx
@@ -227,7 +227,7 @@ static const SvxMSDffTextRectangles mso_sptRightTriangleTextRect[] =
};
static const SvxMSDffVertPair mso_sptRightTriangleGluePoints[] =
{
- { 10800, 0 }, { 5400, 10800 }, { 0, 21600 }, { 10800, 21600 }, { 21600, 21600 }, { 16200, 10800 }
+ { 0, 0 }, { 0, 10800 }, { 0, 21600 }, { 10800, 21600 }, { 21600, 21600 }, { 10800, 10800 }
};
static const mso_CustomShape msoRightTriangle =
{
@@ -460,7 +460,7 @@ static const SvxMSDffTextRectangles mso_sptIsocelesTriangleTextRect[] =
};
static const SvxMSDffVertPair mso_sptIsocelesTriangleGluePoints[] =
{
- { 10800, 0 }, { 1 MSO_I, 10800 }, { 0, 21600 }, { 10800, 21600 }, { 21600, 21600 }, { 7 MSO_I, 10800 }
+ { 0 MSO_I, 0 }, { 1 MSO_I, 10800 }, { 0, 21600 }, { 10800, 21600 }, { 21600, 21600 }, { 7 MSO_I, 10800 }
};
static const SvxMSDffHandle mso_sptIsocelesTriangleHandle[] =
{
diff --git a/svx/source/fmcomp/gridctrl.cxx b/svx/source/fmcomp/gridctrl.cxx
index 9a4081656770..2663b8f93087 100644
--- a/svx/source/fmcomp/gridctrl.cxx
+++ b/svx/source/fmcomp/gridctrl.cxx
@@ -3397,7 +3397,7 @@ void DbGridControl::KeyInput( const KeyEvent& rEvt )
{
size_t Location = GetModelColumnPos( nColId );
DbGridColumn* pColumn = ( Location < m_aColumns.size() ) ? m_aColumns[ Location ] : NULL;
- OStringTransfer::CopyString( GetCurrentRowCellText( pColumn,m_xPaintRow ), this );
+ OStringTransfer::CopyString( GetCurrentRowCellText( pColumn, m_xCurrentRow ), this );
return;
}
}
diff --git a/svx/source/sdr/properties/textproperties.cxx b/svx/source/sdr/properties/textproperties.cxx
index e4eb5cd272ed..db1a34a849d8 100644
--- a/svx/source/sdr/properties/textproperties.cxx
+++ b/svx/source/sdr/properties/textproperties.cxx
@@ -82,14 +82,15 @@ namespace sdr
void TextProperties::ItemSetChanged(const SfxItemSet& rSet)
{
SdrTextObj& rObj = (SdrTextObj&)GetSdrObject();
- sal_Int32 nText = rObj.getTextCount();
+ const svx::ITextProvider& rTextProvider(getTextProvider());
+ sal_Int32 nText = rTextProvider.getTextCount();
// #i101556# ItemSet has changed -> new version
maVersion++;
while( --nText >= 0 )
{
- SdrText* pText = rObj.getText( nText );
+ SdrText* pText = rTextProvider.getText( nText );
OutlinerParaObject* pParaObj = pText ? pText->GetOutlinerParaObject() : 0;
@@ -170,10 +171,11 @@ namespace sdr
{
SdrOutliner& rOutliner = rObj.ImpGetDrawOutliner();
- sal_Int32 nCount = rObj.getTextCount();
+ const svx::ITextProvider& rTextProvider(getTextProvider());
+ sal_Int32 nCount = rTextProvider.getTextCount();
while( nCount-- )
{
- SdrText* pText = rObj.getText( nCount );
+ SdrText* pText = rTextProvider.getText( nCount );
OutlinerParaObject* pParaObj = pText->GetOutlinerParaObject();
if( pParaObj )
{
@@ -223,6 +225,11 @@ namespace sdr
}
}
+ const svx::ITextProvider& TextProperties::getTextProvider() const
+ {
+ return static_cast<const SdrTextObj&>(GetSdrObject());
+ }
+
void TextProperties::SetStyleSheet(SfxStyleSheet* pNewStyleSheet, sal_Bool bDontRemoveHardAttr)
{
SdrTextObj& rObj = (SdrTextObj&)GetSdrObject();
@@ -237,11 +244,12 @@ namespace sdr
{
SdrOutliner& rOutliner = rObj.ImpGetDrawOutliner();
- sal_Int32 nText = rObj.getTextCount();
+ const svx::ITextProvider& rTextProvider(getTextProvider());
+ sal_Int32 nText = rTextProvider.getTextCount();
while( --nText >= 0 )
{
- SdrText* pText = rObj.getText( nText );
+ SdrText* pText = rTextProvider.getText( nText );
OutlinerParaObject* pParaObj = pText ? pText->GetOutlinerParaObject() : 0;
if( !pParaObj )
@@ -396,11 +404,12 @@ namespace sdr
&& !rObj.IsLinkedText())
{
Outliner* pOutliner = SdrMakeOutliner(OUTLINERMODE_OUTLINEOBJECT, rObj.GetModel());
- sal_Int32 nText = rObj.getTextCount();
+ const svx::ITextProvider& rTextProvider(getTextProvider());
+ sal_Int32 nText = rTextProvider.getTextCount();
while( --nText >= 0 )
{
- SdrText* pText = rObj.getText( nText );
+ SdrText* pText = rTextProvider.getText( nText );
OutlinerParaObject* pParaObj = pText ? pText->GetOutlinerParaObject() : 0;
if( !pParaObj )
@@ -542,6 +551,7 @@ namespace sdr
SdrTextObj& rObj = (SdrTextObj&)GetSdrObject();
if(rObj.HasText())
{
+ const svx::ITextProvider& rTextProvider(getTextProvider());
if(HAS_BASE(SfxStyleSheet, &rBC))
{
SfxSimpleHint* pSimple = PTR_CAST(SfxSimpleHint, &rHint);
@@ -551,10 +561,10 @@ namespace sdr
{
rObj.SetPortionInfoChecked(sal_False);
- sal_Int32 nText = rObj.getTextCount();
+ sal_Int32 nText = rTextProvider.getTextCount();
while( --nText > 0 )
{
- OutlinerParaObject* pParaObj = rObj.getText(nText )->GetOutlinerParaObject();
+ OutlinerParaObject* pParaObj = rTextProvider.getText( nText )->GetOutlinerParaObject();
if( pParaObj )
pParaObj->ClearPortionInfo();
}
@@ -574,10 +584,10 @@ namespace sdr
if(SFX_HINT_DYING == nId)
{
rObj.SetPortionInfoChecked(sal_False);
- sal_Int32 nText = rObj.getTextCount();
+ sal_Int32 nText = rTextProvider.getTextCount();
while( --nText > 0 )
{
- OutlinerParaObject* pParaObj = rObj.getText(nText )->GetOutlinerParaObject();
+ OutlinerParaObject* pParaObj = rTextProvider.getText( nText )->GetOutlinerParaObject();
if( pParaObj )
pParaObj->ClearPortionInfo();
}
@@ -596,10 +606,10 @@ namespace sdr
if(!aOldName.Equals(aNewName))
{
- sal_Int32 nText = rObj.getTextCount();
+ sal_Int32 nText = rTextProvider.getTextCount();
while( --nText > 0 )
{
- OutlinerParaObject* pParaObj = rObj.getText(nText )->GetOutlinerParaObject();
+ OutlinerParaObject* pParaObj = rTextProvider.getText( nText )->GetOutlinerParaObject();
if( pParaObj )
pParaObj->ChangeStyleSheetName(eFamily, aOldName, aNewName);
}
diff --git a/svx/source/table/cell.cxx b/svx/source/table/cell.cxx
index e931007c20f4..9a52903d6de7 100644
--- a/svx/source/table/cell.cxx
+++ b/svx/source/table/cell.cxx
@@ -99,6 +99,46 @@ static const SvxItemPropertySet* ImplGetSvxCellPropertySet()
return &aSvxCellPropertySet;
}
+namespace
+{
+
+class CellTextProvider : public svx::ITextProvider
+{
+public:
+ explicit CellTextProvider(const sdr::table::CellRef xCell);
+ virtual ~CellTextProvider();
+
+private:
+ virtual sal_Int32 getTextCount() const;
+ virtual SdrText* getText(sal_Int32 nIndex) const;
+
+private:
+ const sdr::table::CellRef m_xCell;
+};
+
+CellTextProvider::CellTextProvider(const sdr::table::CellRef xCell)
+ : m_xCell(xCell)
+{
+}
+
+CellTextProvider::~CellTextProvider()
+{
+}
+
+sal_Int32 CellTextProvider::getTextCount() const
+{
+ return 1;
+}
+
+SdrText* CellTextProvider::getText(sal_Int32 nIndex) const
+{
+ (void) nIndex;
+ assert(nIndex == 0);
+ return m_xCell.get();
+}
+
+}
+
namespace sdr
{
namespace properties
@@ -109,6 +149,8 @@ namespace sdr
// create a new itemset
SfxItemSet& CreateObjectSpecificItemSet(SfxItemPool& rPool);
+ const svx::ITextProvider& getTextProvider() const;
+
public:
// basic constructor
CellProperties(SdrObject& rObj, sdr::table::Cell* pCell );
@@ -131,6 +173,9 @@ namespace sdr
void SetStyleSheet(SfxStyleSheet* pNewStyleSheet, sal_Bool bDontRemoveHardAttr);
sdr::table::CellRef mxCell;
+
+ private:
+ const CellTextProvider maTextProvider;
};
// create a new itemset
@@ -153,15 +198,22 @@ namespace sdr
0, 0));
}
+ const svx::ITextProvider& CellProperties::getTextProvider() const
+ {
+ return maTextProvider;
+ }
+
CellProperties::CellProperties(SdrObject& rObj, sdr::table::Cell* pCell)
: TextProperties(rObj)
, mxCell(pCell)
+ , maTextProvider(mxCell)
{
}
CellProperties::CellProperties(const CellProperties& rProps, SdrObject& rObj, sdr::table::Cell* pCell)
: TextProperties(rProps, rObj)
, mxCell( pCell )
+ , maTextProvider(mxCell)
{
}
diff --git a/svx/source/table/tablelayouter.cxx b/svx/source/table/tablelayouter.cxx
index 15d85e9a251f..b581d8ff52c4 100644
--- a/svx/source/table/tablelayouter.cxx
+++ b/svx/source/table/tablelayouter.cxx
@@ -1024,7 +1024,7 @@ void TableLayouter::UpdateBorderLayout()
for( aPos.mnCol = 0; aPos.mnCol < nColCount; aPos.mnCol++ )
{
CellRef xCell( getCell( aPos ) );
- if( !xCell.is() || xCell->isMerged() )
+ if( !xCell.is() )
continue;
const SvxBoxItem* pThisAttr = (const SvxBoxItem*)xCell->GetItemSet().GetItem( SDRATTR_TABLE_BORDER );
diff --git a/svx/source/table/viewcontactoftableobj.cxx b/svx/source/table/viewcontactoftableobj.cxx
index a74dc60a836b..1f9f7d22571d 100644
--- a/svx/source/table/viewcontactoftableobj.cxx
+++ b/svx/source/table/viewcontactoftableobj.cxx
@@ -357,7 +357,7 @@ namespace drawinglayer
}
}
- if(!getRightLine().isEmpty() && getRightIsOutside())
+ if(!getRightLine().isEmpty())
{
// create right line from top to bottom
const basegfx::B2DPoint aStart(getTransform() * basegfx::B2DPoint(1.0, 0.0));
@@ -622,9 +622,11 @@ namespace sdr
// get basic lines
impGetLine(aLeftLine, rTableLayouter, nX, nY, false, nColCount, nRowCount, bIsRTL);
- impGetLine(aBottomLine, rTableLayouter, nX, nYBottom, true, nColCount, nRowCount, bIsRTL);
+ //To resolve the bug fdo#59117
+ //In RTL table as BottomLine & TopLine are drawn from Left Side to Right, nX should be nX-1
+ impGetLine(aBottomLine, rTableLayouter, bIsRTL?nX-1:nX, nYBottom, true, nColCount, nRowCount, bIsRTL);
impGetLine(aRightLine, rTableLayouter, nXRight, nY, false, nColCount, nRowCount, bIsRTL);
- impGetLine(aTopLine, rTableLayouter, nX, nY, true, nColCount, nRowCount, bIsRTL);
+ impGetLine(aTopLine, rTableLayouter, bIsRTL?nX-1:nX, nY, true, nColCount, nRowCount, bIsRTL);
// get the neighbor cells' borders
impGetLine(aLeftFromTLine, rTableLayouter, nX, nY - 1, false, nColCount, nRowCount, bIsRTL);