diff options
author | Sascha Ballach <sab@openoffice.org> | 2001-03-20 15:19:41 +0000 |
---|---|---|
committer | Sascha Ballach <sab@openoffice.org> | 2001-03-20 15:19:41 +0000 |
commit | 72535ada7635a7fad587527511bd8c507ba85bae (patch) | |
tree | 2d7c03b5ff587bc85bd82efae826cbcf68e6f867 /sc/source/filter | |
parent | ccf0cbc467a247fbefe71644ed09214e1d1faf49 (diff) |
#85178#, now I remember the shape position by myself
Diffstat (limited to 'sc/source/filter')
-rw-r--r-- | sc/source/filter/xml/XMLTableShapeImportHelper.cxx | 26 | ||||
-rw-r--r-- | sc/source/filter/xml/XMLTableShapeResizer.cxx | 22 | ||||
-rw-r--r-- | sc/source/filter/xml/XMLTableShapeResizer.hxx | 12 | ||||
-rw-r--r-- | sc/source/filter/xml/xmlsubti.cxx | 8 | ||||
-rw-r--r-- | sc/source/filter/xml/xmlsubti.hxx | 6 |
5 files changed, 44 insertions, 30 deletions
diff --git a/sc/source/filter/xml/XMLTableShapeImportHelper.cxx b/sc/source/filter/xml/XMLTableShapeImportHelper.cxx index e580f78e38f9..05150598ee6f 100644 --- a/sc/source/filter/xml/XMLTableShapeImportHelper.cxx +++ b/sc/source/filter/xml/XMLTableShapeImportHelper.cxx @@ -2,9 +2,9 @@ * * $RCSfile: XMLTableShapeImportHelper.cxx,v $ * - * $Revision: 1.10 $ + * $Revision: 1.11 $ * - * last change: $Author: sab $ $Date: 2001-02-09 18:25:14 $ + * last change: $Author: sab $ $Date: 2001-03-20 16:19:41 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -122,8 +122,10 @@ void XMLTableShapeImportHelper::finishShape( XMLShapeImportHelper::finishShape( rShape, xAttrList, rShapes ); sal_Bool bBackground(sal_False); Rectangle* pRect = NULL; - sal_Int32 X(-1); - sal_Int32 Y(-1); + sal_Int32 nEndX(-1); + sal_Int32 nEndY(-1); + sal_Int32 nStartX(-1); + sal_Int32 nStartY(-1); sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0; table::CellAddress aEndCell; for( sal_Int16 i=0; i < nAttrCount; i++ ) @@ -137,15 +139,19 @@ void XMLTableShapeImportHelper::finishShape( &aLocalName ); if(nPrefix = XML_NAMESPACE_TABLE) { + if (aLocalName.compareToAscii(sXML_x) ==0) + static_cast<ScXMLImport&>(mrImporter).GetMM100UnitConverter().convertMeasure(nStartX, rValue); + if (aLocalName.compareToAscii(sXML_y) ==0) + static_cast<ScXMLImport&>(mrImporter).GetMM100UnitConverter().convertMeasure(nStartY, rValue); if (aLocalName.compareToAscii(sXML_end_cell_address) == 0) { sal_Int32 nOffset(0); ScXMLConverter::GetAddressFromString(aEndCell, rValue, static_cast<ScXMLImport&>(mrImporter).GetDocument(), nOffset); } else if (aLocalName.compareToAscii(sXML_end_x) == 0) - static_cast<ScXMLImport&>(mrImporter).GetMM100UnitConverter().convertMeasure(X, rValue); + static_cast<ScXMLImport&>(mrImporter).GetMM100UnitConverter().convertMeasure(nEndX, rValue); else if (aLocalName.compareToAscii(sXML_end_y) == 0) - static_cast<ScXMLImport&>(mrImporter).GetMM100UnitConverter().convertMeasure(Y, rValue); + static_cast<ScXMLImport&>(mrImporter).GetMM100UnitConverter().convertMeasure(nEndY, rValue); else if (aLocalName.compareToAscii(sXML_table_background) == 0) if (rValue.compareToAscii(sXML_true) == 0) bBackground = sal_True; @@ -165,8 +171,12 @@ void XMLTableShapeImportHelper::finishShape( if (!bOnTable) { - if (X >= 0 && Y >= 0) - static_cast<ScXMLImport&>(mrImporter).GetTables().AddShape(rShape, aStartCell, aEndCell, X, Y); + if (nEndX >= 0 && nEndY >= 0 && + nStartX >= 0 && nStartY >= 0) + static_cast<ScXMLImport&>(mrImporter).GetTables().AddShape(rShape, aStartCell, aEndCell, + nStartX, nStartY, nEndX, nEndY); + else + DBG_ERROR("no or wrong position given"); SvxShape* pShapeImp = SvxShape::getImplementation(rShape); if (pShapeImp) { diff --git a/sc/source/filter/xml/XMLTableShapeResizer.cxx b/sc/source/filter/xml/XMLTableShapeResizer.cxx index f32cbfc0b67c..1ea444e43b60 100644 --- a/sc/source/filter/xml/XMLTableShapeResizer.cxx +++ b/sc/source/filter/xml/XMLTableShapeResizer.cxx @@ -2,9 +2,9 @@ * * $RCSfile: XMLTableShapeResizer.cxx,v $ * - * $Revision: 1.4 $ + * $Revision: 1.5 $ * - * last change: $Author: sab $ $Date: 2001-01-04 14:18:30 $ + * last change: $Author: sab $ $Date: 2001-03-20 16:19:41 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -93,14 +93,16 @@ ScMyShapeResizer::~ScMyShapeResizer() void ScMyShapeResizer::AddShape(uno::Reference <drawing::XShape>& rShape, table::CellAddress& rStartAddress, table::CellAddress& rEndAddress, - sal_Int32 nX, sal_Int32 nY) + sal_Int32 nStartX, sal_Int32 nStartY, sal_Int32 nEndX, sal_Int32 nEndY) { ScMyToResizeShape aShape; aShape.xShape = rShape; aShape.aEndCell = rEndAddress; aShape.aStartCell = rStartAddress; - aShape.nY = nY; - aShape.nX = nX; + aShape.nStartY = nStartY; + aShape.nStartX = nStartX; + aShape.nEndY = nEndY; + aShape.nEndX = nEndX; aShapes.push_back(aShape); } @@ -144,17 +146,17 @@ void ScMyShapeResizer::ResizeShapes(uno::Reference< sheet::XSpreadsheet > xSheet pRect = new Rectangle(rImport.GetDocument()->GetMMRect( static_cast<USHORT>(aItr->aEndCell.Column), static_cast<USHORT>(aItr->aEndCell.Row), static_cast<USHORT>(aItr->aEndCell.Column), static_cast<USHORT>(aItr->aEndCell.Row), aItr->aEndCell.Sheet )); - sal_Int32 Y (nHeight - aItr->nY); - aItr->nX += pRect->Left(); + sal_Int32 Y (nHeight - aItr->nEndY); + aItr->nEndX += pRect->Left(); Y = pRect->Bottom() - Y; - awt::Point aPoint = aItr->xShape->getPosition(); + awt::Point aPoint(aItr->nStartX, aItr->nStartY);// = aItr->xShape->getPosition(); awt::Size aSize = aItr->xShape->getSize(); aPoint.X += aRefPoint.X; aPoint.Y += aRefPoint.Y; - aSize.Width = aItr->nX - aPoint.X; + aSize.Width = aItr->nEndX - aPoint.X; aSize.Height = Y - aPoint.Y; - aItr->xShape->setSize(aSize); aItr->xShape->setPosition(aPoint); + aItr->xShape->setSize(aSize); delete pRect; } } diff --git a/sc/source/filter/xml/XMLTableShapeResizer.hxx b/sc/source/filter/xml/XMLTableShapeResizer.hxx index 87f5e15f9c2a..f7d4e257094c 100644 --- a/sc/source/filter/xml/XMLTableShapeResizer.hxx +++ b/sc/source/filter/xml/XMLTableShapeResizer.hxx @@ -2,9 +2,9 @@ * * $RCSfile: XMLTableShapeResizer.hxx,v $ * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * - * last change: $Author: sab $ $Date: 2001-02-05 13:43:01 $ + * last change: $Author: sab $ $Date: 2001-03-20 16:19:41 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -82,8 +82,10 @@ struct ScMyToResizeShape com::sun::star::uno::Reference <com::sun::star::drawing::XShape> xShape; com::sun::star::table::CellAddress aEndCell; com::sun::star::table::CellAddress aStartCell; - sal_Int32 nX; - sal_Int32 nY; + sal_Int32 nStartX; + sal_Int32 nStartY; + sal_Int32 nEndX; + sal_Int32 nEndY; }; typedef std::vector<ScMyToResizeShape> ScMyToResizeShapes; @@ -99,7 +101,7 @@ public: void AddShape(com::sun::star::uno::Reference <com::sun::star::drawing::XShape>& rShape, com::sun::star::table::CellAddress& rStartAddress, com::sun::star::table::CellAddress& rEndAddress, - sal_Int32 nX, sal_Int32 nY); + sal_Int32 nStartX, sal_Int32 nStartY, sal_Int32 nEndX, sal_Int32 nEndY); void ResizeShapes(::com::sun::star::uno::Reference< ::com::sun::star::sheet::XSpreadsheet > xSheet); }; diff --git a/sc/source/filter/xml/xmlsubti.cxx b/sc/source/filter/xml/xmlsubti.cxx index ff41b730431b..fa5a5781fc33 100644 --- a/sc/source/filter/xml/xmlsubti.cxx +++ b/sc/source/filter/xml/xmlsubti.cxx @@ -2,9 +2,9 @@ * * $RCSfile: xmlsubti.cxx,v $ * - * $Revision: 1.14 $ + * $Revision: 1.15 $ * - * last change: $Author: sab $ $Date: 2001-02-23 06:59:22 $ + * last change: $Author: sab $ $Date: 2001-03-20 16:19:41 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -719,7 +719,7 @@ sal_Bool ScMyTables::HasXShapes() void ScMyTables::AddShape(uno::Reference <drawing::XShape>& rShape, table::CellAddress& rStartAddress, table::CellAddress& rEndAddress, - sal_Int32 nX, sal_Int32 nY) + sal_Int32 nStartX, sal_Int32 nStartY, sal_Int32 nEndX, sal_Int32 nEndY) { - aResizeShapes.AddShape(rShape, rStartAddress, rEndAddress, nX, nY); + aResizeShapes.AddShape(rShape, rStartAddress, rEndAddress, nStartX, nStartY, nEndX, nEndY); } diff --git a/sc/source/filter/xml/xmlsubti.hxx b/sc/source/filter/xml/xmlsubti.hxx index 46b95e82739a..f67a4ebee1fe 100644 --- a/sc/source/filter/xml/xmlsubti.hxx +++ b/sc/source/filter/xml/xmlsubti.hxx @@ -2,9 +2,9 @@ * * $RCSfile: xmlsubti.hxx,v $ * - * $Revision: 1.11 $ + * $Revision: 1.12 $ * - * last change: $Author: sab $ $Date: 2001-02-28 08:19:33 $ + * last change: $Author: sab $ $Date: 2001-03-20 16:19:41 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -202,7 +202,7 @@ public: void AddShape(com::sun::star::uno::Reference <com::sun::star::drawing::XShape>& rShape, com::sun::star::table::CellAddress& rStartAddress, com::sun::star::table::CellAddress& rEndAddress, - sal_Int32 nX, sal_Int32 nY); + sal_Int32 nStartX, sal_Int32 nStartY, sal_Int32 nEndX, sal_Int32 nEndY); }; #endif |