summaryrefslogtreecommitdiff
path: root/sc/source/ui
diff options
context:
space:
mode:
Diffstat (limited to 'sc/source/ui')
-rw-r--r--sc/source/ui/app/transobj.cxx20
-rw-r--r--sc/source/ui/docshell/docfunc.cxx1
-rw-r--r--sc/source/ui/docshell/docsh.cxx4
-rw-r--r--sc/source/ui/docshell/docsh3.cxx10
-rw-r--r--sc/source/ui/undo/undobase.cxx8
-rw-r--r--sc/source/ui/undo/undoblk.cxx4
-rw-r--r--sc/source/ui/undo/undoblk3.cxx6
-rw-r--r--sc/source/ui/undo/undostyl.cxx6
-rw-r--r--sc/source/ui/unoobj/styleuno.cxx24
-rw-r--r--sc/source/ui/view/viewfunc.cxx12
10 files changed, 47 insertions, 48 deletions
diff --git a/sc/source/ui/app/transobj.cxx b/sc/source/ui/app/transobj.cxx
index df4435a3014e..5990bb1b7d42 100644
--- a/sc/source/ui/app/transobj.cxx
+++ b/sc/source/ui/app/transobj.cxx
@@ -337,13 +337,13 @@ bool ScTransferObj::GetData( const datatransfer::DataFlavor& rFlavor, const OUSt
Rectangle aMMRect = pDoc->GetMMRect( aBlock.aStart.Col(), aBlock.aStart.Row(),
aBlock.aEnd.Col(), aBlock.aEnd.Row(),
aBlock.aStart.Tab() );
- VirtualDevice aVirtDev;
- aVirtDev.SetOutputSizePixel( aVirtDev.LogicToPixel( aMMRect.GetSize(), MAP_100TH_MM ) );
+ ScopedVclPtr<VirtualDevice> pVirtDev( new VirtualDevice() );
+ pVirtDev->SetOutputSizePixel( pVirtDev->LogicToPixel( aMMRect.GetSize(), MAP_100TH_MM ) );
- PaintToDev( &aVirtDev, pDoc, 1.0, aBlock, false );
+ PaintToDev( pVirtDev, pDoc, 1.0, aBlock, false );
- aVirtDev.SetMapMode( MapMode( MAP_PIXEL ) );
- Bitmap aBmp = aVirtDev.GetBitmap( Point(), aVirtDev.GetOutputSize() );
+ pVirtDev->SetMapMode( MapMode( MAP_PIXEL ) );
+ Bitmap aBmp = pVirtDev->GetBitmap( Point(), pVirtDev->GetOutputSize() );
bOK = SetBitmapEx( aBmp, rFlavor );
}
else if ( nFormat == SotClipboardFormatId::GDIMETAFILE )
@@ -358,17 +358,17 @@ bool ScTransferObj::GetData( const datatransfer::DataFlavor& rFlavor, const OUSt
// like SvEmbeddedTransfer::GetData:
GDIMetaFile aMtf;
- VirtualDevice aVDev;
+ ScopedVclPtr<VirtualDevice> pVDev( new VirtualDevice() );
MapMode aMapMode( pEmbObj->GetMapUnit() );
Rectangle aVisArea( pEmbObj->GetVisArea( ASPECT_CONTENT ) );
- aVDev.EnableOutput( false );
- aVDev.SetMapMode( aMapMode );
+ pVDev->EnableOutput( false );
+ pVDev->SetMapMode( aMapMode );
aMtf.SetPrefSize( aVisArea.GetSize() );
aMtf.SetPrefMapMode( aMapMode );
- aMtf.Record( &aVDev );
+ aMtf.Record( pVDev );
- pEmbObj->DoDraw( &aVDev, Point(), aVisArea.GetSize(), JobSetup(), ASPECT_CONTENT );
+ pEmbObj->DoDraw( pVDev, Point(), aVisArea.GetSize(), JobSetup(), ASPECT_CONTENT );
aMtf.Stop();
aMtf.WindStart();
diff --git a/sc/source/ui/docshell/docfunc.cxx b/sc/source/ui/docshell/docfunc.cxx
index f7b09073af4b..b166a3139f5b 100644
--- a/sc/source/ui/docshell/docfunc.cxx
+++ b/sc/source/ui/docshell/docfunc.cxx
@@ -2764,7 +2764,6 @@ bool ScDocFunc::MoveBlock( const ScRange& rSource, const ScAddress& rDestPos,
if ( !bIncludeFiltered && pClipDoc->HasClipFilteredRows() )
UnmergeCells( aPasteDest, false );
- VirtualDevice aVirtDev;
bool bDestHeight = AdjustRowHeight(
ScRange( 0,nDestRow,nDestTab, MAXCOL,nDestEndRow,nDestEndTab ),
false );
diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx
index f5a44e4ff6a6..93a6aa31d678 100644
--- a/sc/source/ui/docshell/docsh.cxx
+++ b/sc/source/ui/docshell/docsh.cxx
@@ -1457,7 +1457,7 @@ bool ScDocShell::ConvertFrom( SfxMedium& rMedium )
Fraction aZoom( 1, 1 );
double nPPTX = ScGlobal::nScreenPPTX * (double) aZoom / GetOutputFactor(); // Factor is printer display ratio
double nPPTY = ScGlobal::nScreenPPTY * (double) aZoom;
- VirtualDevice aVirtDev;
+ ScopedVclPtr<VirtualDevice> pVirtDev( new VirtualDevice() );
// all sheets (for Excel import)
SCTAB nTabCount = aDocument.GetTableCount();
for (SCTAB nTab=0; nTab<nTabCount; nTab++)
@@ -1480,7 +1480,7 @@ bool ScDocShell::ConvertFrom( SfxMedium& rMedium )
aColWidthParam[nCol].mbSimpleText = false;
sal_uInt16 nWidth = aDocument.GetOptimalColWidth(
- nCol, nTab, &aVirtDev, nPPTX, nPPTY, aZoom, aZoom, false, &aMark,
+ nCol, nTab, pVirtDev, nPPTX, nPPTY, aZoom, aZoom, false, &aMark,
&aColWidthParam[nCol] );
aDocument.SetColWidth( nCol, nTab,
nWidth + (sal_uInt16)ScGlobal::nLastColWidthExtra );
diff --git a/sc/source/ui/docshell/docsh3.cxx b/sc/source/ui/docshell/docsh3.cxx
index 2ee72312c5dd..60f25703e424 100644
--- a/sc/source/ui/docshell/docsh3.cxx
+++ b/sc/source/ui/docshell/docsh3.cxx
@@ -368,11 +368,11 @@ void ScDocShell::CalcOutputFactor()
pRefDev->SetFont(aOldFont);
pRefDev->SetMapMode(aOldMode);
- VirtualDevice aVirtWindow( *Application::GetDefaultDevice() );
- aVirtWindow.SetMapMode(MAP_PIXEL);
- pPattern->GetFont(aDefFont, SC_AUTOCOL_BLACK, &aVirtWindow); // font color doesn't matter here
- aVirtWindow.SetFont(aDefFont);
- nWindowWidth = aVirtWindow.GetTextWidth(aTestString);
+ ScopedVclPtr<VirtualDevice> pVirtWindow( new VirtualDevice( *Application::GetDefaultDevice() ) );
+ pVirtWindow->SetMapMode(MAP_PIXEL);
+ pPattern->GetFont(aDefFont, SC_AUTOCOL_BLACK, pVirtWindow); // font color doesn't matter here
+ pVirtWindow->SetFont(aDefFont);
+ nWindowWidth = pVirtWindow->GetTextWidth(aTestString);
nWindowWidth = (long) ( nWindowWidth / ScGlobal::nScreenPPTX * HMM_PER_TWIPS );
if (nPrinterWidth && nWindowWidth)
diff --git a/sc/source/ui/undo/undobase.cxx b/sc/source/ui/undo/undobase.cxx
index 23fa4ed4d7b3..39e221a0af81 100644
--- a/sc/source/ui/undo/undobase.cxx
+++ b/sc/source/ui/undo/undobase.cxx
@@ -257,7 +257,7 @@ bool ScBlockUndo::AdjustHeight()
{
ScDocument& rDoc = pDocShell->GetDocument();
- VirtualDevice aVirtDev;
+ ScopedVclPtr<VirtualDevice> pVirtDev( new VirtualDevice() );
Fraction aZoomX( 1, 1 );
Fraction aZoomY = aZoomX;
double nPPTX, nPPTY;
@@ -277,7 +277,7 @@ bool ScBlockUndo::AdjustHeight()
nPPTY = ScGlobal::nScreenPPTY;
}
- sc::RowHeightContext aCxt(nPPTX, nPPTY, aZoomX, aZoomY, &aVirtDev);
+ sc::RowHeightContext aCxt(nPPTX, nPPTY, aZoomX, aZoomY, pVirtDev);
bool bRet = rDoc.SetOptimalHeight(
aCxt, aBlockRange.aStart.Row(), aBlockRange.aEnd.Row(), aBlockRange.aStart.Tab());
@@ -355,7 +355,7 @@ void ScMultiBlockUndo::AdjustHeight()
{
ScDocument& rDoc = pDocShell->GetDocument();
- VirtualDevice aVirtDev;
+ ScopedVclPtr<VirtualDevice> pVirtDev( new VirtualDevice() );
Fraction aZoomX( 1, 1 );
Fraction aZoomY = aZoomX;
double nPPTX, nPPTY;
@@ -375,7 +375,7 @@ void ScMultiBlockUndo::AdjustHeight()
nPPTY = ScGlobal::nScreenPPTY;
}
- sc::RowHeightContext aCxt(nPPTX, nPPTY, aZoomX, aZoomY, &aVirtDev);
+ sc::RowHeightContext aCxt(nPPTX, nPPTY, aZoomX, aZoomY, pVirtDev);
for (size_t i = 0, n = maBlockRanges.size(); i < n; ++i)
{
const ScRange& r = *maBlockRanges[i];
diff --git a/sc/source/ui/undo/undoblk.cxx b/sc/source/ui/undo/undoblk.cxx
index 15e0a90533c6..d6817c7753c0 100644
--- a/sc/source/ui/undo/undoblk.cxx
+++ b/sc/source/ui/undo/undoblk.cxx
@@ -1182,11 +1182,11 @@ void ScUndoDragDrop::PaintArea( ScRange aRange, sal_uInt16 nExtFlags ) const
if (pViewShell)
{
- VirtualDevice aVirtDev;
+ ScopedVclPtr<VirtualDevice> pVirtDev( new VirtualDevice() );
ScViewData& rViewData = pViewShell->GetViewData();
sc::RowHeightContext aCxt(
rViewData.GetPPTX(), rViewData.GetPPTY(), rViewData.GetZoomX(), rViewData.GetZoomY(),
- &aVirtDev);
+ pVirtDev);
if (rDoc.SetOptimalHeight(aCxt, aRange.aStart.Row(), aRange.aEnd.Row(), aRange.aStart.Tab()))
{
diff --git a/sc/source/ui/undo/undoblk3.cxx b/sc/source/ui/undo/undoblk3.cxx
index 5b765052d421..85ae2b85c012 100644
--- a/sc/source/ui/undo/undoblk3.cxx
+++ b/sc/source/ui/undo/undoblk3.cxx
@@ -841,7 +841,7 @@ void ScUndoAutoFormat::Redo()
if (bSize)
{
- VirtualDevice aVirtDev;
+ ScopedVclPtr<VirtualDevice> pVirtDev( new VirtualDevice() );
Fraction aZoomX(1,1);
Fraction aZoomY = aZoomX;
double nPPTX,nPPTY;
@@ -863,7 +863,7 @@ void ScUndoAutoFormat::Redo()
bool bFormula = false; // remember
- sc::RowHeightContext aCxt(nPPTX, nPPTY, aZoomX, aZoomY, &aVirtDev);
+ sc::RowHeightContext aCxt(nPPTX, nPPTY, aZoomX, aZoomY, pVirtDev);
for (SCTAB nTab=nStartZ; nTab<=nEndZ; nTab++)
{
ScMarkData aDestMark;
@@ -886,7 +886,7 @@ void ScUndoAutoFormat::Redo()
if (!rDoc.ColHidden(nCol, nTab))
{
sal_uInt16 nThisSize = STD_EXTRA_WIDTH + rDoc.GetOptimalColWidth( nCol, nTab,
- &aVirtDev, nPPTX, nPPTY, aZoomX, aZoomY, bFormula,
+ pVirtDev, nPPTX, nPPTY, aZoomX, aZoomY, bFormula,
&aDestMark );
rDoc.SetColWidth( nCol, nTab, nThisSize );
rDoc.ShowCol( nCol, nTab, true );
diff --git a/sc/source/ui/undo/undostyl.cxx b/sc/source/ui/undo/undostyl.cxx
index 41f733a1d6c1..96fbf37cf94b 100644
--- a/sc/source/ui/undo/undostyl.cxx
+++ b/sc/source/ui/undo/undostyl.cxx
@@ -106,12 +106,12 @@ static void lcl_DocStyleChanged( ScDocument* pDoc, SfxStyleSheetBase* pStyle, bo
{
//! move to document or docshell
- VirtualDevice aVDev;
- Point aLogic = aVDev.LogicToPixel( Point(1000,1000), MAP_TWIP );
+ ScopedVclPtr<VirtualDevice> pVDev( new VirtualDevice() );
+ Point aLogic = pVDev->LogicToPixel( Point(1000,1000), MAP_TWIP );
double nPPTX = aLogic.X() / 1000.0;
double nPPTY = aLogic.Y() / 1000.0;
Fraction aZoom(1,1);
- pDoc->StyleSheetChanged( pStyle, bRemoved, &aVDev, nPPTX, nPPTY, aZoom, aZoom );
+ pDoc->StyleSheetChanged( pStyle, bRemoved, pVDev, nPPTX, nPPTY, aZoom, aZoom );
ScInputHandler* pHdl = SC_MOD()->GetInputHdl();
if (pHdl)
diff --git a/sc/source/ui/unoobj/styleuno.cxx b/sc/source/ui/unoobj/styleuno.cxx
index 97cf5747f2c3..3a6cdaa873c8 100644
--- a/sc/source/ui/unoobj/styleuno.cxx
+++ b/sc/source/ui/unoobj/styleuno.cxx
@@ -755,12 +755,12 @@ void SAL_CALL ScStyleFamilyObj::removeByName( const OUString& aName )
if ( eFamily == SFX_STYLE_FAMILY_PARA )
{
// wie ScViewFunc::RemoveStyleSheetInUse
- VirtualDevice aVDev;
- Point aLogic = aVDev.LogicToPixel( Point(1000,1000), MAP_TWIP );
+ ScopedVclPtr<VirtualDevice> pVDev( new VirtualDevice() );
+ Point aLogic = pVDev->LogicToPixel( Point(1000,1000), MAP_TWIP );
double nPPTX = aLogic.X() / 1000.0;
double nPPTY = aLogic.Y() / 1000.0;
Fraction aZoom(1,1);
- rDoc.StyleSheetChanged( pStyle, false, &aVDev, nPPTX, nPPTY, aZoom, aZoom );
+ rDoc.StyleSheetChanged( pStyle, false, pVDev, nPPTX, nPPTY, aZoom, aZoom );
pDocShell->PostPaint( 0,0,0, MAXCOL,MAXROW,MAXTAB, PAINT_GRID|PAINT_LEFT );
pDocShell->SetDocumentModified();
@@ -1096,12 +1096,12 @@ void SAL_CALL ScStyleObj::setParentStyle( const OUString& rParentStyle )
{
// Zeilenhoehen anpassen...
- VirtualDevice aVDev;
- Point aLogic = aVDev.LogicToPixel( Point(1000,1000), MAP_TWIP );
+ ScopedVclPtr<VirtualDevice> pVDev( new VirtualDevice() );
+ Point aLogic = pVDev->LogicToPixel( Point(1000,1000), MAP_TWIP );
double nPPTX = aLogic.X() / 1000.0;
double nPPTY = aLogic.Y() / 1000.0;
Fraction aZoom(1,1);
- rDoc.StyleSheetChanged( pStyle, false, &aVDev, nPPTX, nPPTY, aZoom, aZoom );
+ rDoc.StyleSheetChanged( pStyle, false, pVDev, nPPTX, nPPTY, aZoom, aZoom );
if (!rDoc.IsImportingXML())
{
@@ -1463,12 +1463,12 @@ void SAL_CALL ScStyleObj::setAllPropertiesToDefault()
{
// row heights
- VirtualDevice aVDev;
- Point aLogic = aVDev.LogicToPixel( Point(1000,1000), MAP_TWIP );
+ ScopedVclPtr<VirtualDevice> pVDev( new VirtualDevice() );
+ Point aLogic = pVDev->LogicToPixel( Point(1000,1000), MAP_TWIP );
double nPPTX = aLogic.X() / 1000.0;
double nPPTY = aLogic.Y() / 1000.0;
Fraction aZoom(1,1);
- rDoc.StyleSheetChanged( pStyle, false, &aVDev, nPPTX, nPPTY, aZoom, aZoom );
+ rDoc.StyleSheetChanged( pStyle, false, pVDev, nPPTX, nPPTY, aZoom, aZoom );
if (!rDoc.IsImportingXML())
{
@@ -1845,12 +1845,12 @@ void ScStyleObj::SetOnePropertyValue( const OUString& rPropertyName, const SfxIt
{
// Zeilenhoehen anpassen...
- VirtualDevice aVDev;
- Point aLogic = aVDev.LogicToPixel( Point(1000,1000), MAP_TWIP );
+ ScopedVclPtr<VirtualDevice> pVDev( new VirtualDevice() );
+ Point aLogic = pVDev->LogicToPixel( Point(1000,1000), MAP_TWIP );
double nPPTX = aLogic.X() / 1000.0;
double nPPTY = aLogic.Y() / 1000.0;
Fraction aZoom(1,1);
- rDoc.StyleSheetChanged( pStyle, false, &aVDev, nPPTX, nPPTY, aZoom, aZoom );
+ rDoc.StyleSheetChanged( pStyle, false, pVDev, nPPTX, nPPTY, aZoom, aZoom );
if (!rDoc.IsImportingXML())
{
diff --git a/sc/source/ui/view/viewfunc.cxx b/sc/source/ui/view/viewfunc.cxx
index 9e1a7e143c4c..c3942f0006f9 100644
--- a/sc/source/ui/view/viewfunc.cxx
+++ b/sc/source/ui/view/viewfunc.cxx
@@ -1403,9 +1403,9 @@ void ScViewFunc::RemoveStyleSheetInUse( const SfxStyleSheetBase* pStyleSheet )
ScDocShellModificator aModificator( *pDocSh );
- VirtualDevice aVirtDev;
- aVirtDev.SetMapMode(MAP_PIXEL);
- pDoc->StyleSheetChanged( pStyleSheet, true, &aVirtDev,
+ ScopedVclPtr<VirtualDevice> pVirtDev( new VirtualDevice() );
+ pVirtDev->SetMapMode(MAP_PIXEL);
+ pDoc->StyleSheetChanged( pStyleSheet, true, pVirtDev,
rViewData.GetPPTX(),
rViewData.GetPPTY(),
rViewData.GetZoomX(),
@@ -1429,9 +1429,9 @@ void ScViewFunc::UpdateStyleSheetInUse( const SfxStyleSheetBase* pStyleSheet )
ScDocShellModificator aModificator( *pDocSh );
- VirtualDevice aVirtDev;
- aVirtDev.SetMapMode(MAP_PIXEL);
- pDoc->StyleSheetChanged( pStyleSheet, false, &aVirtDev,
+ ScopedVclPtr<VirtualDevice> pVirtDev( new VirtualDevice() );
+ pVirtDev->SetMapMode(MAP_PIXEL);
+ pDoc->StyleSheetChanged( pStyleSheet, false, pVirtDev,
rViewData.GetPPTX(),
rViewData.GetPPTY(),
rViewData.GetZoomX(),