[PATCH 7/9] cleaned dead code in calc ui view
pjacquod
pjacquod at alumni.ethz.ch
Sat Nov 20 13:31:33 PST 2010
---
sc/source/ui/view/printfun.cxx | 41 ---------------------------
sc/source/ui/view/viewdata.cxx | 8 ++--
sc/source/ui/view/viewfun3.cxx | 61 +---------------------------------------
3 files changed, 5 insertions(+), 105 deletions(-)
diff --git a/sc/source/ui/view/printfun.cxx b/sc/source/ui/view/printfun.cxx
index 0f08fe0..a173b4f 100644
--- a/sc/source/ui/view/printfun.cxx
+++ b/sc/source/ui/view/printfun.cxx
@@ -519,7 +519,6 @@ void ScPrintFunc::DrawToDev( ScDocument* pDoc, OutputDevice* pDev, double /* nPr
Rectangle aLines;
ScRange aRange( nX1,nY1,nTab, nX2,nY2,nTab );
-// BOOL bAddLines = pDoc->HasLines( aRange, aLines );
long nTwipsSizeX = 0;
for (SCCOL i=nX1; i<=nX2; i++)
@@ -553,9 +552,6 @@ void ScPrintFunc::DrawToDev( ScDocument* pDoc, OutputDevice* pDev, double /* nPr
if (bEmbed)
pDoc->SetEmbedded(aERange);
-/* if (!bMetaFile)
- pDev->SetMapMode(MAP_PIXEL);
-*/
long nScrX = aRect.Left();
long nScrY = aRect.Top();
@@ -798,7 +794,6 @@ long ScPrintFunc::TextHeight( const EditTextObject* pObject )
if (!pObject)
return 0;
-// pEditEngine->SetPageNo( nTotalPages );
pEditEngine->SetTextNewDefaults( *pObject, *pEditDefaults, FALSE );
return (long) pEditEngine->GetTextHeight();
@@ -1024,8 +1019,6 @@ void ScPrintFunc::InitParam( const ScPrintOptions* pOptions )
// Die Tabellen-Abfrage ist schon in DocShell::Print, hier immer
aAreaParam.aPrintArea.aStart.SetTab(nPrintTab);
aAreaParam.aPrintArea.aEnd.SetTab(nPrintTab);
-
-// lcl_LimitRange( aAreaParam.aPrintArea, nPrintTab ); // ganze Zeilen/Spalten...
}
else if ( pDoc->HasPrintRange() )
{
@@ -1183,7 +1176,6 @@ void lcl_DrawGraphic( const SvxBrushItem &rBrush, OutputDevice *pOut, OutputDevi
Size aDrawSize = aGrfSize;
bool bDraw = TRUE;
-// bool bRetouche = TRUE;
switch ( ePos )
{
case GPOS_LT: aPos = rOrg.TopLeft();
@@ -1218,7 +1210,6 @@ void lcl_DrawGraphic( const SvxBrushItem &rBrush, OutputDevice *pOut, OutputDevi
case GPOS_AREA:
aPos = rOrg.TopLeft();
aDrawSize = rOrg.GetSize();
-// bRetouche = FALSE;
break;
case GPOS_TILED:
{
@@ -1268,7 +1259,6 @@ void lcl_DrawGraphic( const SvxBrushItem &rBrush, OutputDevice *pOut, OutputDevi
}
bDraw = FALSE;
-// bRetouche = FALSE;
}
break;
@@ -1335,7 +1325,6 @@ void ScPrintFunc::DrawBorder( long nScrX, long nScrY, long nScrW, long nScrH,
if ( pBackground && !bCellContrast )
{
-// Rectangle aBackRect( Point(nScrX+nLeft, nScrY+nTop), Size(nEffWidth,nEffHeight) );
if (pBackground->GetGraphicPos() != GPOS_NONE)
{
OutputDevice* pRefDev;
@@ -1424,8 +1413,6 @@ void ScPrintFunc::DrawBorder( long nScrX, long nScrY, long nScrW, long nScrH,
nScrX+nLeft, nScrY+nTop, 0,0, 0,0, nScaleX, nScaleY );
aOutputData.SetUseStyleColor( bUseStyleColor );
-// pDev->SetMapMode(aTwipMode);
-
if (pBorderData)
aOutputData.DrawFrame();
@@ -1683,42 +1670,25 @@ void ScPrintFunc::PrintArea( SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2,
aOutputData.SetRefDevice( pRefDev );
}
-// aOutputData.SetMetaFileMode(TRUE);
if( aTableParam.bCellContent )
aOutputData.DrawBackground();
pDev->SetClipRegion( Rectangle( aPos, Size( aOutputData.GetScrW(), aOutputData.GetScrH() ) ) );
pDev->SetClipRegion();
-// aOutputData.SetMetaFileMode(FALSE);
if( aTableParam.bCellContent )
{
aOutputData.DrawExtraShadow( bShLeft, bShTop, bShRight, bShBottom );
aOutputData.DrawFrame();
aOutputData.DrawStrings();
-
- // pDev->SetMapMode(aLogicMode);
aOutputData.DrawEdit(FALSE);
}
-// pDev->SetMapMode(aOffsetMode);
if (aTableParam.bGrid)
aOutputData.DrawGrid( TRUE, FALSE ); // keine Seitenumbrueche
-/*!!!!!!!!!!! Notizen in Tabelle markieren ??????????????????????????
-
- if (aTableParam.bNotes)
- {
- pDev->SetMapMode(aOffsetMode);
- aOutputData.PrintNoteMarks(aNotePosList);
- pDev->SetMapMode(aLogicMode);
- }
-*/
-
aOutputData.AddPDFNotes(); // has no effect if not rendering PDF with notes enabled
-// pDev->SetMapMode(aDrawMode);
-
// test if all paint parts are hidden, then a paint is not necessary at all
if(!bHideAllDrawingLayer)
{
@@ -1941,7 +1911,6 @@ long ScPrintFunc::DoNotes( long nNoteStart, BOOL bDoPrint, ScPreviewLocationData
Font aMarkFont;
ScAutoFontColorMode eColorMode = bUseStyleColor ? SC_AUTOCOL_DISPLAY : SC_AUTOCOL_PRINT;
((const ScPatternAttr&)pDoc->GetPool()->GetDefaultItem(ATTR_PATTERN)).GetFont( aMarkFont, eColorMode );
-//? aMarkFont.SetWeight( WEIGHT_BOLD );
pDev->SetFont( aMarkFont );
long nMarkLen = pDev->GetTextWidth(
String::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM("GW99999:")));
@@ -2045,7 +2014,6 @@ long ScPrintFunc::PrintNotes( long nPageNo, long nNoteStart, BOOL bDoPrint, ScPr
if ( pPrinter && bDoPrint )
{
DBG_ERROR( "StartPage does not exist anymore" );
- // pPrinter->StartPage();
}
if ( bDoPrint || pLocationData )
@@ -2069,7 +2037,6 @@ long ScPrintFunc::PrintNotes( long nPageNo, long nNoteStart, BOOL bDoPrint, ScPr
if ( pPrinter && bDoPrint )
{
DBG_ERROR( "EndPage does not exist anymore" );
- // pPrinter->EndPage();
}
return nCount;
@@ -2135,7 +2102,6 @@ void ScPrintFunc::PrintPage( long nPageNo, SCCOL nX1, SCROW nY1, SCCOL nX2, SCRO
if ( pPrinter && bDoPrint )
{
DBG_ERROR( "StartPage does not exist anymore" );
- // pPrinter->StartPage();
}
// Kopf- und Fusszeilen (ohne Zentrierung)
@@ -2229,9 +2195,6 @@ void ScPrintFunc::PrintPage( long nPageNo, SCCOL nX1, SCROW nY1, SCCOL nX2, SCRO
long nStartX = ((long) ( nLeftSpace * nScaleX ));
long nStartY = ((long) ( nTopSpace * nScaleY ));
-// nStartX -= aOffset.X(); // schon im MapMode
-// nStartY -= aOffset.Y();
-
long nInnerStartX = nStartX;
long nInnerStartY = nStartY;
if (pBorderItem)
@@ -2420,7 +2383,6 @@ void ScPrintFunc::PrintPage( long nPageNo, SCCOL nX1, SCROW nY1, SCCOL nX2, SCRO
if ( pPrinter && bDoPrint )
{
DBG_ERROR( "EndPage does not exist anymore" );
- // pPrinter->EndPage();
}
aLastSourceRange = ScRange( nX1, nY1, nPrintTab, nX2, nY2, nPrintTab );
@@ -2566,7 +2528,6 @@ long ScPrintFunc::CountPages() // setzt auch nPagesX, nPagesY
}
else
{
-// nZoom = 100; // nZoom auf letztem Wert stehenlassen !!!
nPagesX = nPagesY = nTotalY = 0;
return 0;
}
@@ -2646,8 +2607,6 @@ void ScPrintFunc::InitModes() // aus nZoom etc. die MapModes setzen
aOffset = Point( aSrcOffset.X()*100/nZoom, aSrcOffset.Y()*100/nZoom );
long nEffZoom = nZoom * (long) nManualZoom;
-
-// nScaleX = nScaleY = 1.0; // Ausgabe in Twips
nScaleX = nScaleY = HMM_PER_TWIPS; // Ausgabe in 1/100 mm
Fraction aZoomFract( nEffZoom,10000 );
diff --git a/sc/source/ui/view/viewdata.cxx b/sc/source/ui/view/viewdata.cxx
index 130184f..3d4d046 100644
--- a/sc/source/ui/view/viewdata.cxx
+++ b/sc/source/ui/view/viewdata.cxx
@@ -1082,7 +1082,7 @@ void ScViewData::SetEditEngine( ScSplitPos eWhich,
if (!bWasThere)
pNewEngine->InsertView(pEditView[eWhich]);
- // Hintergrundfarbe der Zelle
+ // background color of the cell
Color aBackCol = ((const SvxBrushItem&)pPattern->GetItem(ATTR_BACKGROUND)).GetColor();
ScModule* pScMod = SC_MOD();
@@ -1092,8 +1092,8 @@ void ScViewData::SetEditEngine( ScSplitPos eWhich,
}
pEditView[eWhich]->SetBackgroundColor( aBackCol );
- pEditView[eWhich]->Invalidate(); // noetig ??
- // noetig, wenn Position geaendert
+ pEditView[eWhich]->Invalidate(); // needed ??
+ // needed, wenn position changed
}
IMPL_LINK_INLINE_START( ScViewData, EmptyEditHdl, EditStatus *, EMPTYARG )
@@ -1593,7 +1593,7 @@ Point ScViewData::GetScrPos( SCCOL nWhereX, SCROW nWhereY, ScSplitPos eWhich,
}
//
-// Anzahl Zellen auf einem Bildschirm
+// Number of cells on a screen
//
SCCOL ScViewData::CellsAtX( SCsCOL nPosX, SCsCOL nDir, ScHSplitPos eWhichX, USHORT nScrSizeX ) const
diff --git a/sc/source/ui/view/viewfun3.cxx b/sc/source/ui/view/viewfun3.cxx
index e374252..eb23c96 100644
--- a/sc/source/ui/view/viewfun3.cxx
+++ b/sc/source/ui/view/viewfun3.cxx
@@ -58,18 +58,12 @@
#define _MODALDLG_HXX
#define _MOREBUTTON_HXX
#define _OUTLINER_HXX
-//#define _PRNDLG_HXX
-//#define _POLY_HXX
#define _PVRWIN_HXX
-//#define _QUEUE_HXX
#define _RULER_HXX
#define _SCRWIN_HXX
#define _SETBRW_HXX
-//#define _STACK_HXX
-//#define _STATUS_HXX ***
#define _STDCTRL_HXX
#define _STDMENU_HXX
-//#define _TAB_HXX
#define _TABBAR_HXX
#define _TREELIST_HXX
#define _VALUESET_HXX
@@ -80,38 +74,23 @@
#define _VCONT_HXX
#define _VDRWOBJ_HXX
-//#define _SELENG_HXX
-//#define _SOUND_HXX
-//#define _SYSDLG_HXX
-
-
-
-
#define _PASSWD_HXX
#define _SFX_DOCFILE_HXX
-//#define _SFX_DOCFILT_HXX
#define _SFX_DOCINF_HXX
#define _SFX_DOCSH_HXX
-//#define _SFXDOCFILT_HXX
-//#define _SFXDOCINF_HXX
-//#define _SFXDOCSH_HXX
#define _SFX_PRNMON_HXX
#define _SFX_RESMGR_HXX
#define _SFX_TEMPLDLG_HXX
-//#define _SFXAPPWIN_HXX
#define _SFXBASIC_HXX
#define _SFXCTRLITEM
#define _SFXDLGCFG_HXX
-//#define _SFXDISPATCH_HXX
#define _SFXFILEDLG_HXX
-//#define _SFXIMGMGR_HXX
#define _SFXIPFRM_HXX
#define _SFX_MACRO_HXX
#define _SFXMNUITEM_HXX
#define _SFXMNUMGR_HXX
#define _SFXMULTISEL_HXX
-//#define _SFXMSG_HXX
#define _SFXMSGDESCR_HXX
#define _SFXMSGPOOL_HXX
#define _SFX_MINFITEM_HXX
@@ -124,14 +103,6 @@
#define _SFXTBXMGR_HXX
#define _SI_HXX
-//#define _SI_DLL_HXX
-//#define _SIDLL_HXX
-//#define _SI_NOITEMS
-//#define _SI_NOOTHERFORMS
-//#define _SI_NOSBXCONTROLS
-//#define _SINOSBXCONTROLS
-//#define _SI_NODRW
-//#define _SI_NOCONTROL
#define _SVBOXITM_HXX
#define _SVCONTNR_HXX //
@@ -140,7 +111,6 @@
#define _SVDRAG_HXX
#define _SVINCVW_HXX
-//#define _SV_MULTISEL_HXX
#define _SVRTV_HXX
#define _SVTABBX_HXX
#define _SVTREEBOX_HXX
@@ -211,7 +181,7 @@
#include "drwtrans.hxx"
#include "docuno.hxx"
#include "clipparam.hxx"
-#include "undodat.hxx" // Amelia Wang
+#include "undodat.hxx"
using namespace com::sun::star;
@@ -722,13 +692,8 @@ void ScViewFunc::PasteFromSystem()
PasteFromSystem( SOT_FORMATSTR_ID_EMBED_SOURCE_OLE );
else if (aDataHelper.HasFormat( SOT_FORMATSTR_ID_LINK_SOURCE_OLE ))
PasteFromSystem( SOT_FORMATSTR_ID_LINK_SOURCE_OLE );
-// else
-// ErrorMessage(STR_PASTE_ERROR);
}
-// else
-// ErrorMessage(STR_PASTE_ERROR);
}
-
// keine Fehlermeldung, weil SID_PASTE in der idl das FastCall-Flag hat,
// also auch gerufen wird, wenn nichts im Clipboard steht (#42531#)
}
@@ -1107,18 +1072,6 @@ BOOL ScViewFunc::PasteFromClip( USHORT nFlags, ScDocument* pClipDoc,
{
nUnfilteredRows += p->aEnd.Row() - p->aStart.Row() + 1;
}
-#if 0
- /* This isn't needed but could be a desired restriction. */
- // For filtered, destination rows have to be an exact multiple of
- // source rows. Note that nDestSizeY is size-1 (difference), so
- // nDestSizeY==0 fits always.
- if ((nUnfilteredRows % (nDestSizeY+1)) != 0)
- {
- /* FIXME: this should be a more descriptive error message then. */
- ErrorMessage(STR_MSSG_PASTEFROMCLIP_0);
- return FALSE;
- }
-#endif
}
SCCOL nMarkAddX = 0;
@@ -1253,12 +1206,6 @@ BOOL ScViewFunc::PasteFromClip( USHORT nFlags, ScDocument* pClipDoc,
nUndoEndCol = sal::static_int_cast<SCCOL>( nUndoEndCol + nEndCol );
nUndoEndRow = sal::static_int_cast<SCROW>( nUndoEndRow + nEndRow ); // destination area, expanded for merged cells
-// if (nUndoEndCol < nEndCol) nUndoEndCol = nEndCol;
-// if (nUndoEndRow < nEndRow) nUndoEndRow = nEndRow;
-
-// nUndoEndCol += nMarkAddX;
-// nUndoEndRow += nMarkAddY;
-
if (nUndoEndCol>MAXCOL || nUndoEndRow>MAXROW)
{
ErrorMessage(STR_PASTE_FULL);
@@ -1279,9 +1226,6 @@ BOOL ScViewFunc::PasteFromClip( USHORT nFlags, ScDocument* pClipDoc,
//! Test auf Ueberlappung
//! nur wirkliche Schnittmenge testen !!!!!!!
- // pDoc->HasCommonAttr( StartCol,nStartRow, nUndoEndCol,nUndoEndRow, nStartTab,
- // pClipDoc, nClipStartX, nClipStartY );
-
ScDocFunc& rDocFunc = pDocSh->GetDocFunc();
if ( bRecord )
{
@@ -1434,9 +1378,6 @@ BOOL ScViewFunc::PasteFromClip( USHORT nFlags, ScDocument* pClipDoc,
TRUE, FALSE, bIncludeFiltered );
}
- //
- //
- //
pDocSh->UpdatePaintExt( nExtFlags, nStartCol, nStartRow, nStartTab,
nEndCol, nEndRow, nEndTab ); // content after the change
--
1.7.1
--------------070903000307090300090306
Content-Type: text/x-patch;
name="0008-remove-dead-code-in-calc-ui-vbremove-dead-code-in-ca.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
filename*0="0008-remove-dead-code-in-calc-ui-vbremove-dead-code-in-ca.pa";
filename*1="tch"
More information about the LibreOffice
mailing list