[Libreoffice-commits] .: 6 commits - sc/inc sc/source
Noel Power
noelp at kemper.freedesktop.org
Fri May 25 03:34:34 PDT 2012
sc/inc/global.hxx | 18 ---
sc/source/core/data/global.cxx | 147 -------------------------------
sc/source/filter/excel/read.cxx | 9 -
sc/source/filter/excel/xiescher.cxx | 22 ----
sc/source/filter/oox/drawingbase.cxx | 5 -
sc/source/filter/oox/drawingfragment.cxx | 7 -
sc/source/ui/unoobj/docuno.cxx | 65 +++++++++++--
sc/source/ui/view/drawutil.cxx | 12 --
sc/source/ui/view/drawvie4.cxx | 2
sc/source/ui/view/drawview.cxx | 2
sc/source/ui/view/gridwin3.cxx | 2
sc/source/ui/view/viewdata.cxx | 7 -
12 files changed, 64 insertions(+), 234 deletions(-)
New commits:
commit 56f450187343688f20f88e68a849c8dcd660b629
Author: Noel Power <noel.power at novell.com>
Date: Thu May 24 17:11:21 2012 +0100
Revert "tweak imported shape position for xls( binary ) format fdo#49430"
This reverts commit 5813422d3eb9657c5a818057be0ebf831ca6a794.
diff --git a/sc/source/filter/excel/read.cxx b/sc/source/filter/excel/read.cxx
index 0b45e5f..08b56bc 100644
--- a/sc/source/filter/excel/read.cxx
+++ b/sc/source/filter/excel/read.cxx
@@ -52,7 +52,6 @@
#include "root.hxx"
#include "imp_op.hxx"
#include "excimp8.hxx"
-#include <sfx2/objsh.hxx>
FltError ImportExcel::Read( void )
{
@@ -1310,14 +1309,6 @@ FltError ImportExcel8::Read( void )
PostDocLoad();
pD->CalcAfterLoad();
- SfxObjectShell* pDocShell = GetDocShell();
-
- if ( pDocShell )
- {
- std::vector< OrientationInfo > savedOrientations;
- ScGlobal::CaptureShapeOrientationInfo( savedOrientations, pDocShell->GetModel() );
- ScGlobal::ApplyShapeOrientationInfo( savedOrientations, pDocShell->GetModel(), *pD );
- }
// import change tracking data
XclImpChangeTrack aImpChTr( GetRoot(), maStrm );
diff --git a/sc/source/filter/excel/xiescher.cxx b/sc/source/filter/excel/xiescher.cxx
index 932f956..74ed03b 100644
--- a/sc/source/filter/excel/xiescher.cxx
+++ b/sc/source/filter/excel/xiescher.cxx
@@ -497,28 +497,6 @@ void XclImpDrawObjBase::PreProcessSdrObject( XclImpDffConverter& rDffConv, SdrOb
}
}
- if ( GetAnchor() )
- {
- ScDrawObjData* pAnchor = ScDrawLayer::GetObjData( &rSdrObj, sal_True);
- if ( pAnchor )
- {
- // Temporarily get start position of shape.
- // At the end of the import we do some post processing
- // to adjust the shape position to take into account
- // errors between the drawing layer and the view/grid
- pAnchor->maStart.SetRow( GetAnchor()->maFirst.mnRow );
- pAnchor->maStart.SetCol( GetAnchor()->maFirst.mnCol );
- pAnchor->maStart.SetTab( GetTab() );
- XclObjAnchor tmpAnchor( *GetAnchor() );
-
- // Calculate the start offset ( from the cell postion )
- Rectangle withOffset = tmpAnchor.GetRect( GetRoot(), GetTab(), MAP_100TH_MM );
- tmpAnchor.mnLX = tmpAnchor.mnTY = tmpAnchor.mnRX = tmpAnchor.mnBY = 0;
- Rectangle noOffset = tmpAnchor.GetRect( GetRoot(), GetTab(), MAP_100TH_MM );
- pAnchor->maStartOffset.X() = withOffset.Left() - noOffset.Left();
- pAnchor->maStartOffset.Y() = withOffset.Top() - noOffset.Top();
- }
- }
// call virtual function for object type specific processing
DoPreProcessSdrObj( rDffConv, rSdrObj );
}
commit 3ed479a1d83916cb5dc3be0eee0aa6fbe65a844a
Author: Noel Power <noel.power at novell.com>
Date: Thu May 24 16:49:55 2012 +0100
Revert "fix bad import positions of shapes & controls fdo#49430"
This reverts commit 9dc4fa1b22a533ba0a6ce0353112c55eef8a14ef.
diff --git a/sc/inc/global.hxx b/sc/inc/global.hxx
index c431598..c4c2e87 100644
--- a/sc/inc/global.hxx
+++ b/sc/inc/global.hxx
@@ -34,7 +34,6 @@
#include <tools/stream.hxx>
#include <osl/endian.h>
#include <com/sun/star/uno/Reference.hxx>
-#include <com/sun/star/table/CellAddress.hpp>
#include "scdllapi.h"
#include <boost/unordered_map.hpp>
@@ -499,27 +498,12 @@ namespace com { namespace sun { namespace star {
namespace i18n {
class XOrdinalSuffix;
}
- namespace frame {
- class XModel;
- }
- namespace drawing {
- class XShape;
- }
}}}
namespace utl {
class TransliterationWrapper;
}
#ifndef _SCALC_EXE
-struct SC_DLLPUBLIC OrientationInfo
-{
- OrientationInfo() : mnVert( 0 ), mnHori( 0 ) {}
- ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > mxShape;
- ::com::sun::star::table::CellAddress maAddress;
- sal_Int32 mnVert;
- sal_Int32 mnHori;
-};
-
class ScGlobal
{
static SvxSearchItem* pSearchItem;
@@ -712,8 +696,6 @@ SC_DLLPUBLIC static const sal_Unicode* FindUnquoted( const sal_Unicode* pStri
/** Obtain the ordinal suffix for a number according to the system locale */
static String GetOrdinalSuffix( sal_Int32 nNumber);
- SC_DLLPUBLIC static void CaptureShapeOrientationInfo( std::vector< OrientationInfo >& infos, const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& rxModel );
- SC_DLLPUBLIC static void ApplyShapeOrientationInfo( std::vector< OrientationInfo >& infos, const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& rxModel, ScDocument& rDoc );
};
#endif
diff --git a/sc/source/core/data/global.cxx b/sc/source/core/data/global.cxx
index c92238d..1de68a0 100644
--- a/sc/source/core/data/global.cxx
+++ b/sc/source/core/data/global.cxx
@@ -63,15 +63,6 @@
#include <unotools/calendarwrapper.hxx>
#include <unotools/collatorwrapper.hxx>
#include <com/sun/star/i18n/CollatorOptions.hpp>
-#include <com/sun/star/frame/XModel.hpp>
-#include <com/sun/star/drawing/XDrawPagesSupplier.hpp>
-#include <com/sun/star/document/XViewDataSupplier.hpp>
-#include <com/sun/star/container/XIndexAccess.hpp>
-#include <com/sun/star/beans/XPropertySet.hpp>
-#include <com/sun/star/table/XCell.hpp>
-#include <com/sun/star/sheet/XSpreadsheet.hpp>
-#include <com/sun/star/sheet/XSpreadsheetDocument.hpp>
-#include <com/sun/star/sheet/XCellAddressable.hpp>
#include <unotools/intlwrapper.hxx>
#include <unotools/syslocale.hxx>
#include <unotools/transliterationwrapper.hxx>
@@ -96,15 +87,11 @@
#include "sc.hrc"
#include "scmod.hxx"
#include "appoptio.hxx"
-#include "unonames.hxx"
-#include "drawview.hxx"
-#include "drawutil.hxx"
-#include "viewdata.hxx"
+
// -----------------------------------------------------------------------
using ::rtl::OUString;
using ::rtl::OUStringBuffer;
-using namespace ::com::sun::star;
ScDocShellRef* ScGlobal::pDrawClipDocShellRef = NULL;
SvxSearchItem* ScGlobal::pSearchItem = NULL;
@@ -1188,139 +1175,5 @@ IntlWrapper* ScGlobal::GetScIntlWrapper()
}
return pLocale;
}
-void ScGlobal::CaptureShapeOrientationInfo( std::vector< OrientationInfo >& infos, const uno::Reference<frame::XModel >& rxModel )
-{
- rtl::OUString sHori( SC_UNONAME_HORIPOS );
- rtl::OUString sVert( SC_UNONAME_VERTPOS );
- uno::Reference<drawing::XDrawPagesSupplier> xDrwSupp( rxModel, uno::UNO_QUERY );
- uno::Reference<container::XIndexAccess> xPages( xDrwSupp.is() ? xDrwSupp->getDrawPages() : NULL, uno::UNO_QUERY );
- if ( xPages.is() )
- {
- for ( sal_Int32 nIndex = 0, nPages = xPages->getCount(); nIndex < nPages; ++nIndex )
- {
- uno::Reference<container::XIndexAccess> xShapes( xPages->getByIndex( nIndex ), uno::UNO_QUERY );
- for ( sal_Int32 nShapeIndex = 0, nShapes = xShapes->getCount(); nShapeIndex < nShapes; ++nShapeIndex )
- {
- uno::Reference< beans::XPropertySet > xShape( xShapes->getByIndex( nShapeIndex ), uno::UNO_QUERY );
- uno::Reference< table::XCell > xCell( xShape->getPropertyValue( rtl::OUString( SC_UNONAME_ANCHOR ) ), uno::UNO_QUERY );
- uno::Reference< sheet::XSpreadsheetDocument > xSpreadSheet( rxModel, uno::UNO_QUERY );
- uno::Reference< container::XIndexAccess > xSheets( xSpreadSheet.is() ? xSpreadSheet->getSheets() : NULL, uno::UNO_QUERY );
- uno::Reference< sheet::XSpreadsheet > xSheet;
- uno::Reference< sheet::XCellAddressable > xAddressable( xCell, uno::UNO_QUERY );
- if ( xSheets.is() && xAddressable.is() && xSpreadSheet.is() )
- xSheet.set( xSheets->getByIndex( xAddressable->getCellAddress().Sheet ), uno::UNO_QUERY );
- // only capture orientation if the shape is anchored to cell
- if ( xShape.is() && xCell.is() && xAddressable.is() && xSheet.is() )
- {
- uno::Reference< beans::XPropertySetInfo > xShapePropInfo = xShape->getPropertySetInfo();
- if ( xShapePropInfo.is() && xShapePropInfo->hasPropertyByName( sHori ) && xShapePropInfo->hasPropertyByName( sVert ) )
- {
- OrientationInfo aShape;
- aShape.mxShape.set( xShape, uno::UNO_QUERY );
- xShape->getPropertyValue( sHori ) >>= aShape.mnHori;
- xShape->getPropertyValue( sVert ) >>= aShape.mnVert;
- aShape.maAddress = xAddressable->getCellAddress();
- infos.push_back( aShape );
- // Remove temporary cell anchor. Ideally we should
- // preserve the cell anchoring but the drawing layer
- // and the ScGridWindow don't calcuate positions in the
- // same way. This means unfortunately ( especially if
- // row heights above the shape are not uniform ) that
- // the shape anchor position and the shape position
- // can be quite skewed. The only alterative
- // unfortunately is to position the shape absolutely
- // rather than relative to a cell address :-(
- xShape->setPropertyValue( rtl::OUString( SC_UNONAME_ANCHOR ), uno::makeAny( xSheet ) );
- }
- }
- }
- }
- }
-}
-
-// Note: this method is only expected to be called when importing an alien
-// document.
-void ScGlobal::ApplyShapeOrientationInfo( std::vector< OrientationInfo >& infos, const uno::Reference< frame::XModel >& rxModel, ScDocument& rDoc )
-{
- // For each shape previously anchored to a cell calculate the shape
- // position ( as the view would ) based on the available zoom and scaling.
- // This prevents the shape being being drawn in an unexpected postion due to
- // a) differences in the calculation of shape position by drawinglayer and
- // the postion of the actual rows drawn by ScGridwin
- // b) affect of UpdateAllRowHeights
- for ( std::vector< OrientationInfo >::iterator it = infos.begin(), it_end = infos.end(); it != it_end; ++it )
- {
- OutputDevice* pDevice = Application::GetDefaultDevice();
- if ( pDevice )
- {
- uno::Reference< document::XViewDataSupplier > xViewSup( rxModel, uno::UNO_QUERY );
- uno::Reference< container::XIndexAccess > xIndexAccess;
- if ( xViewSup.is() )
- xIndexAccess = xViewSup->getViewData();
- uno::Sequence< beans::PropertyValue > aSeq;
- // set up partial view data to calculate zoom, pptx & ppty values
- ScViewData aViewData( NULL, NULL );
- aViewData.InitData( &rDoc );
- // support initialising view data from binary import
- if ( ScExtDocOptions* pDocOptions = rDoc.GetExtDocOptions() )
- {
- aViewData.ReadExtOptions( *pDocOptions );
- }
- else // or from the view data from the model ( oox import )
- {
- if ( xIndexAccess.is() && xIndexAccess->getCount() )
- xIndexAccess->getByIndex(0) >>= aSeq;
- aViewData.ReadUserDataSequence( aSeq );
- }
-
- aViewData.SetTabNo( it->maAddress.Sheet );
-
- long nHeight = 0;
- long nWidth = 0;
-
- MapMode aTmpMode( MAP_TWIP );
- // get postion of shape based on the start anchor
- for ( int i = 0; i < it->maAddress.Column; ++i )
- {
- long nTwip = aViewData.GetDocument()->GetColWidth( i, it->maAddress.Sheet );
- Point aTmpPos = pDevice->LogicToPixel( Point( nTwip, nTwip ), aTmpMode );
- nWidth += ( nTwip * aViewData.GetPPTX() );
- }
- for ( int i = 0; i < it->maAddress.Row; ++i )
- {
- long nTwip = aViewData.GetDocument()->GetRowHeight( i, it->maAddress.Sheet );
- Point aTmpPos = pDevice->LogicToPixel( Point( nTwip, nTwip ), aTmpMode );
- nHeight += ( nTwip * aViewData.GetPPTY() );
- }
-
- // determine the scale that will be used by the view
- Fraction aScaleX;
- Fraction aScaleY;
- SCROW nEndRow = it->maAddress.Row;
- SCCOL nEndCol = it->maAddress.Column;
- aViewData.GetDocument()->GetTableArea( aViewData.GetTabNo(), nEndCol, nEndRow );
- if (nEndCol<20)
- nEndCol = 20;
- if (nEndRow<20)
- nEndRow = 20;
-
- ScDrawUtil::CalcScale( aViewData.GetDocument(), aViewData.GetTabNo(), 0,0, nEndCol,nEndRow, pDevice,aViewData.GetZoomX(),aViewData.GetZoomY(),aViewData.GetPPTX(),aViewData.GetPPTY(), aScaleX,aScaleY );
-
- // finally calculate and apply the position of shape ( including
- // any vertical and horizontal offsets )
- Point aTmpPos( nWidth, nHeight);
- aTmpMode = MapMode ( MAP_100TH_MM );
- aTmpMode.SetScaleX(aScaleX);
- aTmpMode.SetScaleY(aScaleY);
-
- aTmpPos = pDevice->PixelToLogic( aTmpPos, aTmpMode );
- if ( it->mxShape.is() )
- {
- com::sun::star::awt::Point aUnoPos( aTmpPos.X() + it->mnHori, aTmpPos.Y() + it->mnVert );
- it->mxShape->setPosition( aUnoPos );
- }
- }
- }
-}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/oox/drawingbase.cxx b/sc/source/filter/oox/drawingbase.cxx
index c7ff392..4a30a15 100644
--- a/sc/source/filter/oox/drawingbase.cxx
+++ b/sc/source/filter/oox/drawingbase.cxx
@@ -161,7 +161,6 @@ void ShapeAnchor::setCellPos( sal_Int32 nElement, sal_Int32 nParentContext, cons
void ShapeAnchor::importVmlAnchor( const OUString& rAnchor )
{
meAnchorType = ANCHOR_VML;
- meCellAnchorType = CELLANCHOR_PIXEL;
::std::vector< OUString > aTokens;
sal_Int32 nIndex = 0;
@@ -279,16 +278,16 @@ ShapeAnchor::getFromCell() const
void
ShapeAnchor::applyToXShape( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape>& rxShape )
{
- if ( ( meAnchorType == ANCHOR_VML || meAnchorType == ANCHOR_TWOCELL || meAnchorType == ANCHOR_ONECELL ) && getFromCell().is() )
+ if ( ( meAnchorType == ANCHOR_TWOCELL || meAnchorType == ANCHOR_ONECELL ) && getFromCell().is() )
{
PropertySet aShapeProp( rxShape );
+ aShapeProp.setProperty( PROP_Anchor, getFromCell() );
CellAnchorModel offSets;
offSets.mnColOffset = maFrom.mnColOffset;
offSets.mnRowOffset = maFrom.mnRowOffset;
EmuPoint aPos = calcCellAnchorEmu( offSets );
aShapeProp.setProperty( PROP_HoriOrientPosition, lclEmuToHmm( aPos.X ) );
aShapeProp.setProperty( PROP_VertOrientPosition, lclEmuToHmm( aPos.Y ) );
- aShapeProp.setProperty( PROP_Anchor, getFromCell() );
}
}
diff --git a/sc/source/filter/oox/drawingfragment.cxx b/sc/source/filter/oox/drawingfragment.cxx
index 012c9a1..f041287 100644
--- a/sc/source/filter/oox/drawingfragment.cxx
+++ b/sc/source/filter/oox/drawingfragment.cxx
@@ -614,12 +614,7 @@ Reference< XShape > VmlDrawing::createAndInsertClientXShape( const ::oox::vml::S
getBaseFilter().getVbaProject().registerMacroAttacher( xAttacher );
}
}
- if ( !pClientData->maAnchor.isEmpty() )
- {
- ShapeAnchor aAnchor( *this );
- aAnchor.importVmlAnchor( pClientData->maAnchor );
- aAnchor.applyToXShape( xShape );
- }
+
return xShape;
}
}
diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx
index ec1ec10..a1e7a1e 100644
--- a/sc/source/ui/unoobj/docuno.cxx
+++ b/sc/source/ui/unoobj/docuno.cxx
@@ -194,6 +194,55 @@ const SfxItemPropertyMapEntry* lcl_GetRowsPropertyMap()
return aRowsPropertyMap_Impl;
}
+struct OrientationInfo
+{
+ OrientationInfo() : mnVert( 0 ), mnHori( 0 ) {}
+ uno::Reference< beans::XPropertySet > mxShape;
+ sal_Int32 mnVert;
+ sal_Int32 mnHori;
+};
+
+void lcl_captureShapeOrientationInfo( std::vector< OrientationInfo >& infos, ScModelObj& rModel )
+{
+ rtl::OUString sHori( RTL_CONSTASCII_USTRINGPARAM( SC_UNONAME_HORIPOS ) );
+ rtl::OUString sVert( RTL_CONSTASCII_USTRINGPARAM( SC_UNONAME_VERTPOS ) );
+
+ uno::Reference<container::XIndexAccess> xPages( rModel.getDrawPages(), uno::UNO_QUERY );
+ if ( xPages.is() )
+ {
+ for ( sal_Int32 nIndex = 0, nPages = xPages->getCount(); nIndex < nPages; ++nIndex )
+ {
+ uno::Reference<container::XIndexAccess> xShapes( xPages->getByIndex( nIndex ), uno::UNO_QUERY );
+ for ( sal_Int32 nShapeIndex = 0, nShapes = xShapes->getCount(); nShapeIndex < nShapes; ++nShapeIndex )
+ {
+ uno::Reference< beans::XPropertySet > xShape( xShapes->getByIndex( nShapeIndex ), uno::UNO_QUERY );
+ uno::Reference< table::XCell > xCell( xShape->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( SC_UNONAME_ANCHOR ) ) ), uno::UNO_QUERY );
+ // only capture orientation if the shape is anchored to cell
+ if ( xShape.is() && xCell.is() )
+ {
+ uno::Reference< beans::XPropertySetInfo > xPropInfo = xShape->getPropertySetInfo();
+ if ( xPropInfo.is() && xPropInfo->hasPropertyByName( sHori ) && xPropInfo->hasPropertyByName( sVert ) )
+ {
+ OrientationInfo aShape;
+ aShape.mxShape = xShape;
+ xShape->getPropertyValue( sHori ) >>= aShape.mnHori;
+ xShape->getPropertyValue( sVert ) >>= aShape.mnVert;
+ infos.push_back( aShape );
+ }
+ }
+ }
+ }
+ }
+}
+
+void lcl_applyShapeOrientationInfo( std::vector< OrientationInfo >& infos )
+{
+ for ( std::vector< OrientationInfo >::iterator it = infos.begin(), it_end = infos.end(); it != it_end; ++it )
+ {
+ it->mxShape->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( SC_UNONAME_HORIPOS ) ), uno::makeAny( it->mnHori ) );
+ it->mxShape->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( SC_UNONAME_VERTPOS ) ), uno::makeAny( it->mnVert ) );
+ }
+}
using sc::HMMToTwips;
using sc::TwipsToHMM;
@@ -1690,19 +1739,13 @@ void SAL_CALL ScModelObj::setPropertyValue(
// during import ( e.g. oox ) shapes anchored by cell lose
// any additional Hori/Vert orientation ( which offsets the
// shape position relative to the cell ) when
- // UpdateAllRowHeights is called. Here we save Hori/Vert
- // values before calling UpdateAllRowHeights. Also due to
- // differences between the drawing layer and gridwindow
- // position calculations we actually can't reliably use cell
- // anchoring so we need to remove the cell anchoring, custom
- // calculate where the view would position the shape and
- // then position the shape absolutely at the newly
- // calculated postion.
+ // UpdateAllRowHeights is called. Save Hori/Vert values
+ // before calling UpdateAllRowHeights and re-apply them
+ // after
std::vector< OrientationInfo > savedOrientations;
- uno::Reference< frame::XModel > xModel( this );
- ScGlobal::CaptureShapeOrientationInfo( savedOrientations, xModel );
+ lcl_captureShapeOrientationInfo( savedOrientations, *this );
pDocShell->UpdateAllRowHeights();
- ScGlobal::ApplyShapeOrientationInfo( savedOrientations, xModel, *pDoc );
+ lcl_applyShapeOrientationInfo( savedOrientations );
}
}
}
diff --git a/sc/source/ui/view/viewdata.cxx b/sc/source/ui/view/viewdata.cxx
index 71877e8..b09c188 100644
--- a/sc/source/ui/view/viewdata.cxx
+++ b/sc/source/ui/view/viewdata.cxx
@@ -2486,8 +2486,7 @@ void ScViewData::ReadExtOptions( const ScExtDocOptions& rDocOpt )
/* Width of the tabbar, relative to frame window width. We do not have the
correct width of the frame window here -> store in ScTabView, which sets
the size in the next resize. */
- if ( pView )
- pView->SetPendingRelTabBarWidth( rDocSett.mfTabBarWidth );
+ pView->SetPendingRelTabBarWidth( rDocSett.mfTabBarWidth );
// sheet settings
for( SCTAB nTab = 0; nTab < static_cast<SCTAB>(maTabData.size()); ++nTab )
@@ -2790,12 +2789,12 @@ void ScViewData::ReadUserDataSequence(const uno::Sequence <beans::PropertyValue>
nTabNo = nTab;
}
}
- else if (pView && sName.compareToAscii(SC_HORIZONTALSCROLLBARWIDTH) == 0)
+ else if (sName.compareToAscii(SC_HORIZONTALSCROLLBARWIDTH) == 0)
{
if (rSettings[i].Value >>= nTemp32)
pView->SetTabBarWidth(nTemp32);
}
- else if (pView && sName.compareToAscii(SC_RELHORIZONTALTABBARWIDTH) == 0 )
+ else if (sName.compareToAscii(SC_RELHORIZONTALTABBARWIDTH) == 0)
{
double fWidth = 0.0;
if (rSettings[i].Value >>= fWidth)
commit 0a8de8d937ea1e9cb26ea7c89951f559961b49de
Author: Noel Power <noel.power at novell.com>
Date: Thu May 24 16:49:47 2012 +0100
Revert "(reworked )reorg. code a little so ole controls are catered for wrt fdo#49430"
This reverts commit da81525ec2e86364def8b558e16c4e8eca6a121e.
diff --git a/sc/source/filter/oox/drawingfragment.cxx b/sc/source/filter/oox/drawingfragment.cxx
index 977c8de..012c9a1 100644
--- a/sc/source/filter/oox/drawingfragment.cxx
+++ b/sc/source/filter/oox/drawingfragment.cxx
@@ -614,6 +614,12 @@ Reference< XShape > VmlDrawing::createAndInsertClientXShape( const ::oox::vml::S
getBaseFilter().getVbaProject().registerMacroAttacher( xAttacher );
}
}
+ if ( !pClientData->maAnchor.isEmpty() )
+ {
+ ShapeAnchor aAnchor( *this );
+ aAnchor.importVmlAnchor( pClientData->maAnchor );
+ aAnchor.applyToXShape( xShape );
+ }
return xShape;
}
}
@@ -631,12 +637,6 @@ void VmlDrawing::notifyXShapeInserted( const Reference< XShape >& rxShape,
// convert settings from VML client data
if( const ::oox::vml::ClientData* pClientData = rShape.getClientData() )
{
- if ( !pClientData->maAnchor.isEmpty() )
- {
- ShapeAnchor aAnchor( *this );
- aAnchor.importVmlAnchor( pClientData->maAnchor );
- aAnchor.applyToXShape( rxShape );
- }
// specific settings for embedded form controls
try
{
commit 112d94c67b9a27f0df1784ab8f88c051f466b04d
Author: Noel Power <noel.power at novell.com>
Date: Thu May 24 16:49:38 2012 +0100
Revert "WaE: variables set but unused"
This reverts commit d0dcf1d65c79c4c607a1ac24c0c57f4b1a935294.
diff --git a/sc/source/core/data/global.cxx b/sc/source/core/data/global.cxx
index 6ecf6ec..c92238d 100644
--- a/sc/source/core/data/global.cxx
+++ b/sc/source/core/data/global.cxx
@@ -1283,11 +1283,13 @@ void ScGlobal::ApplyShapeOrientationInfo( std::vector< OrientationInfo >& infos,
for ( int i = 0; i < it->maAddress.Column; ++i )
{
long nTwip = aViewData.GetDocument()->GetColWidth( i, it->maAddress.Sheet );
+ Point aTmpPos = pDevice->LogicToPixel( Point( nTwip, nTwip ), aTmpMode );
nWidth += ( nTwip * aViewData.GetPPTX() );
}
for ( int i = 0; i < it->maAddress.Row; ++i )
{
long nTwip = aViewData.GetDocument()->GetRowHeight( i, it->maAddress.Sheet );
+ Point aTmpPos = pDevice->LogicToPixel( Point( nTwip, nTwip ), aTmpMode );
nHeight += ( nTwip * aViewData.GetPPTY() );
}
commit bc30ba74e880122b257cc6aa2965a79851fa4608
Author: Noel Power <noel.power at novell.com>
Date: Thu May 24 14:48:16 2012 +0100
Revert "Fixed #i116848# Shapes are at wrong position"
This reverts commit 31012ab9d7035f942486c87ecc1a79b4d6579975.
diff --git a/sc/source/ui/view/drawvie4.cxx b/sc/source/ui/view/drawvie4.cxx
index 56e0ec4..2bf5be3 100644
--- a/sc/source/ui/view/drawvie4.cxx
+++ b/sc/source/ui/view/drawvie4.cxx
@@ -243,7 +243,7 @@ void ScDrawView::CalcNormScale( Fraction& rFractX, Fraction& rFractY ) const
if (nEndCol<20)
nEndCol = 20;
if (nEndRow<20)
- nEndRow = 20;
+ nEndRow = 1000;
Fraction aZoom(1,1);
ScDrawUtil::CalcScale( pDoc, nTab, 0,0, nEndCol,nEndRow, pDev, aZoom,aZoom,
diff --git a/sc/source/ui/view/drawview.cxx b/sc/source/ui/view/drawview.cxx
index 27beef2..cf9def2 100644
--- a/sc/source/ui/view/drawview.cxx
+++ b/sc/source/ui/view/drawview.cxx
@@ -329,7 +329,7 @@ void ScDrawView::RecalcScale()
if (nEndCol<20)
nEndCol = 20;
if (nEndRow<20)
- nEndRow = 20; // #i116848# instead of a large row number for an empty sheet, heights are multiplied in CalcScale
+ nEndRow = 1000;
ScDrawUtil::CalcScale( pDoc, nTab, 0,0, nEndCol,nEndRow, pDev,aZoomX,aZoomY,nPPTX,nPPTY,
aScaleX,aScaleY );
diff --git a/sc/source/ui/view/gridwin3.cxx b/sc/source/ui/view/gridwin3.cxx
index a071561..228bdd3 100644
--- a/sc/source/ui/view/gridwin3.cxx
+++ b/sc/source/ui/view/gridwin3.cxx
@@ -264,7 +264,7 @@ MapMode ScGridWindow::GetDrawMapMode( bool bForce )
SCROW nEndRow = 0;
pDoc->GetTableArea( nTab, nEndCol, nEndRow );
if (nEndCol<20) nEndCol = 20;
- if (nEndRow<20) nEndRow = 20;
+ if (nEndRow<20) nEndRow = 1000;
ScDrawUtil::CalcScale( pDoc, nTab, 0,0, nEndCol,nEndRow, this,
pViewData->GetZoomX(),pViewData->GetZoomY(),
pViewData->GetPPTX(),pViewData->GetPPTY(),
commit a11fa1a4ac7ab27328b5e5376ea7597b1e69ddd1
Author: Noel Power <noel.power at novell.com>
Date: Thu May 24 14:47:41 2012 +0100
Revert "calc69: #i118068# handle all-hidden case in ScDrawUtil::CalcScale"
This reverts commit 8a838b9fbf46ece9680824cd3a044ab7338bf306.
diff --git a/sc/source/ui/view/drawutil.cxx b/sc/source/ui/view/drawutil.cxx
index bebde55..c4112ae 100644
--- a/sc/source/ui/view/drawutil.cxx
+++ b/sc/source/ui/view/drawutil.cxx
@@ -80,18 +80,6 @@ void ScDrawUtil::CalcScale( ScDocument* pDoc, SCTAB nTab,
nPixelY += ScViewData::ToPixel(nHeight, nPPTY);
}
- // #i116848# To get a large-enough number for PixelToLogic, multiply the integer values
- // instead of using a larger number of rows
- if ( nTwipsY )
- {
- long nMultiply = 2000000 / nTwipsY;
- if ( nMultiply > 1 )
- {
- nTwipsY *= nMultiply;
- nPixelY *= nMultiply;
- }
- }
-
MapMode aHMMMode( MAP_100TH_MM, Point(), rZoomX, rZoomY );
Point aPixelLog = pDev->PixelToLogic( Point( nPixelX,nPixelY ), aHMMMode );
More information about the Libreoffice-commits
mailing list