diff options
author | Jan Holesovsky <kendy@suse.cz> | 2011-10-09 19:55:03 +0200 |
---|---|---|
committer | Jan Holesovsky <kendy@suse.cz> | 2011-10-09 19:55:03 +0200 |
commit | 538da29dca6d97b4712cc32311e7dbfc2d715780 (patch) | |
tree | 7e4c0a8983c359e6211a68ae7047e340bd017ddd | |
parent | 3f4969ea0d0f620a0424f05b1a7fd53f1d259655 (diff) |
Kill unused code in Ruler.
-rw-r--r-- | svtools/inc/svtools/ruler.hxx | 54 | ||||
-rw-r--r-- | svtools/source/control/ruler.cxx | 207 | ||||
-rw-r--r-- | unusedcode.easy | 13 |
3 files changed, 11 insertions, 263 deletions
diff --git a/svtools/inc/svtools/ruler.hxx b/svtools/inc/svtools/ruler.hxx index ba04f9342525..529cb17a0ab4 100644 --- a/svtools/inc/svtools/ruler.hxx +++ b/svtools/inc/svtools/ruler.hxx @@ -209,19 +209,6 @@ the following values initialized: long nPos - offset relative to the origin in pixels sal_uInt16 nStyle - bit style (has to be 0 currently) -SetArrows() displays dimension arrows in the ruler. With dimension arrows set -no subdivisions will be shown any more in the ruler. Therefore, dimension -arrows should always be set along the whole ruler. An array of type RulerArrow -must be passed with the following values initialized: - - long nPos - offset relative to the origin in pixels - long nWidth - the arrow's width - long nLogWidth - the arrow's width in logical unit - sal_uInt16 nStyle - bit style (has to be 0 currently) - -SetSourceUnit() sets the unit in which the logical values are given that are -passed to SetArrows(). The only units accepted are MAP_TWIP and MAP_100TH_MM. - -------------------------------------------------------------------------- If the user should also be able to change the margins tabs, borders, ... @@ -393,18 +380,6 @@ Um vom Dokument ein Drag auszuloesen, gibt es folgende Methoden: Click-Count 2 uebergeben wird auch der DoubleClick-Handler entsprechend gerufen. - - GetDocType() - Dieser Methode wird die Position vom Dokumentfenster uebergeben und - testet, was sich unter der Position befindet. Dabei kann wie bei - StartDocDrag() der entsprechende Test auf ein bestimmtes Element - eingeschraenkt werden. Im Gegensatz zu GetType() liefert diese - Methode immer DontKnow zurueck, falls kein Element getroffen wurde. - Falls man den HitTest selber durchfuehren moechte, kann man - folgende Defines fuer die Toleranz benutzen (Werte gelten fuer - eine Richtung): - RULER_MOUSE_TABLEWIDTH - fuer Tabellenspalten - RULER_MOUSE_MARGINWIDTH - fuer Margins - -------------------------------------------------------------------------- Fuer das Extra-Feld kann der Inhalt bestimmt werden und es gibt Handler, @@ -621,18 +596,6 @@ struct RulerLine sal_uInt16 nStyle; }; -// -------------- -// - RulerArrow - -// -------------- - -struct RulerArrow -{ - long nPos; - long nWidth; - long nLogWidth; - sal_uInt16 nStyle; -}; - class ImplRulerData; // --------- // - Ruler - @@ -698,7 +661,6 @@ private: SVT_DLLPRIVATE void ImplVDrawText( long nX, long nY, const String& rText ); SVT_DLLPRIVATE void ImplDrawTicks( long nMin, long nMax, long nStart, long nCenter ); - SVT_DLLPRIVATE void ImplDrawArrows( long nCenter ); SVT_DLLPRIVATE void ImplDrawBorders( long nMin, long nMax, long nVirTop, long nVirBottom ); SVT_DLLPRIVATE void ImplDrawIndent( const Polygon& rPoly, sal_uInt16 nStyle ); SVT_DLLPRIVATE void ImplDrawIndents( long nMin, long nMax, long nVirTop, long nVirBottom ); @@ -758,7 +720,6 @@ public: long GetWinWidth() const { return mnWinWidth; } void SetPagePos( long nOff = 0, long nWidth = 0 ); long GetPageOffset() const; - long GetPageWidth() const; void SetBorderPos( long nOff = 0 ); long GetBorderOffset() const { return mnBorderOff; } Rectangle GetExtraRect() const { return maExtraRect; } @@ -779,9 +740,6 @@ public: sal_Bool StartDocDrag( const MouseEvent& rMEvt, RulerType eDragType = RULER_TYPE_DONTKNOW ); - RulerType GetDocType( const Point& rPos, - RulerType eDragType = RULER_TYPE_DONTKNOW, - sal_uInt16* pAryPos = NULL ) const; RulerType GetDragType() const { return meDragType; } long GetDragPos() const { return mnDragPos; } sal_uInt16 GetDragAryPos() const { return mnDragAryPos; } @@ -804,27 +762,15 @@ public: void SetMargin1() { SetMargin1( 0, RULER_STYLE_INVISIBLE ); } void SetMargin1( long nPos, sal_uInt16 nMarginStyle = RULER_MARGIN_SIZEABLE ); long GetMargin1() const; - sal_uInt16 GetMargin1Style() const; void SetMargin2() { SetMargin2( 0, RULER_STYLE_INVISIBLE ); } void SetMargin2( long nPos, sal_uInt16 nMarginStyle = RULER_MARGIN_SIZEABLE ); long GetMargin2() const; - sal_uInt16 GetMargin2Style() const; void SetLines( sal_uInt16 n = 0, const RulerLine* pLineAry = NULL ); - sal_uInt16 GetLineCount() const; - const RulerLine* GetLines() const; - - void SetArrows( sal_uInt16 n = 0, const RulerArrow* pArrowAry = NULL ); - sal_uInt16 GetArrowCount() const; - const RulerArrow* GetArrows() const; void SetBorders( sal_uInt16 n = 0, const RulerBorder* pBrdAry = NULL ); - sal_uInt16 GetBorderCount() const; - const RulerBorder* GetBorders() const; void SetIndents( sal_uInt16 n = 0, const RulerIndent* pIndentAry = NULL ); - sal_uInt16 GetIndentCount() const; - const RulerIndent* GetIndents() const; void SetTabs( sal_uInt16 n = 0, const RulerTab* pTabAry = NULL ); sal_uInt16 GetTabCount() const; diff --git a/svtools/source/control/ruler.cxx b/svtools/source/control/ruler.cxx index b3ae722a4555..a5d847cdb6dc 100644 --- a/svtools/source/control/ruler.cxx +++ b/svtools/source/control/ruler.cxx @@ -94,7 +94,6 @@ class ImplRulerData private: RulerLine* pLines; - RulerArrow* pArrows; RulerBorder* pBorders; RulerIndent* pIndents; RulerTab* pTabs; @@ -107,7 +106,6 @@ private: long nMargin1; long nMargin2; sal_uInt16 nLines; - sal_uInt16 nArrows; sal_uInt16 nBorders; sal_uInt16 nIndents; sal_uInt16 nTabs; @@ -182,7 +180,6 @@ ImplRulerData::ImplRulerData() ImplRulerData::~ImplRulerData() { delete[] pLines; - delete[] pArrows; delete[] pBorders; delete[] pIndents; delete[] pTabs; @@ -196,7 +193,6 @@ ImplRulerData& ImplRulerData::operator=( const ImplRulerData& rData ) return *this; delete[] pLines; - delete[] pArrows; delete[] pBorders; delete[] pIndents; delete[] pTabs; @@ -209,12 +205,6 @@ ImplRulerData& ImplRulerData::operator=( const ImplRulerData& rData ) memcpy( pLines, rData.pLines, nLines*sizeof( RulerLine ) ); } - if ( rData.pArrows ) - { - pArrows = new RulerArrow[nArrows]; - memcpy( pArrows, rData.pArrows, nArrows*sizeof( RulerArrow ) ); - } - if ( rData.pBorders ) { pBorders = new RulerBorder[nBorders]; @@ -667,92 +657,6 @@ void Ruler::ImplDrawTicks( long nMin, long nMax, long nStart, long nCenter ) // ----------------------------------------------------------------------- -void Ruler::ImplDrawArrows( long nCenter ) -{ - sal_uInt16 i; - long n1; - long n2; - long n3; - long n4; - long nLogWidth; - String aStr; - String aStr2; - sal_Bool bDrawUnit; - long nTxtWidth; - long nTxtHeight2 = GetTextHeight()/2; - - const vcl::I18nHelper& rI18nHelper = GetSettings().GetLocaleI18nHelper(); - - maVirDev.SetLineColor( GetSettings().GetStyleSettings().GetWindowTextColor() ); - for ( i = 0; i < mpData->nArrows; i++ ) - { - n1 = mpData->pArrows[i].nPos+mpData->nNullVirOff+1; - n2 = n1+mpData->pArrows[i].nWidth-2; - - // Einheit umrechnen - nLogWidth = mpData->pArrows[i].nLogWidth; - if ( meSourceUnit == MAP_TWIP ) - { - if ( nLogWidth >= 100000 ) - nLogWidth = (nLogWidth*254)/144; - else - nLogWidth = (nLogWidth*2540)/1440; - } - if ( nLogWidth >= 1000000 ) - nLogWidth = (nLogWidth / aImplRulerUnitTab[mnUnitIndex].n100THMM) * 1000; - else - nLogWidth = (nLogWidth*1000) / aImplRulerUnitTab[mnUnitIndex].n100THMM; - aStr = rI18nHelper.GetNum( nLogWidth, aImplRulerUnitTab[mnUnitIndex].nUnitDigits, sal_True, sal_False ); - - // Einheit an den String haengen - aStr2 = aStr; - aStr2.AppendAscii( aImplRulerUnitTab[mnUnitIndex].aUnitStr ); - - // Textbreite ermitteln - bDrawUnit = sal_True; - nTxtWidth = GetTextWidth( aStr2 ); - if ( nTxtWidth < mpData->pArrows[i].nWidth-10 ) - aStr = aStr2; - else - { - nTxtWidth = GetTextWidth( aStr ); - if ( nTxtWidth > mpData->pArrows[i].nWidth-10 ) - bDrawUnit = sal_False; - } - - // Ist genuegen Platz fuer Einheiten-String vorhanden - if ( bDrawUnit ) - { - n3 = n1 + ((n2-n1)/2) - 1; - if ( mnWinStyle & WB_HORZ ) - n3 -= nTxtWidth/2; - else - n3 += nTxtWidth/2; - if ( mnWinStyle & WB_HORZ ) - { - n4 = n3 + nTxtWidth + 2; - ImplVDrawLine( n1, nCenter, n3, nCenter ); - ImplVDrawLine( n4, nCenter, n2, nCenter ); - } - else - { - n4 = n3 - nTxtWidth - 2; - ImplVDrawLine( n1, nCenter, n4, nCenter ); - ImplVDrawLine( n3, nCenter, n2, nCenter ); - } - ImplVDrawText( n3, nCenter-nTxtHeight2, aStr ); - } - else - ImplVDrawLine( n1, nCenter, n2, nCenter ); - ImplVDrawLine( n1+1, nCenter-1, n1+1, nCenter+1 ); - ImplVDrawLine( n1+2, nCenter-2, n1+2, nCenter+2 ); - ImplVDrawLine( n2-1, nCenter-1, n2-1, nCenter+1 ); - ImplVDrawLine( n2-2, nCenter-2, n2-2, nCenter+2 ); - } -} - -// ----------------------------------------------------------------------- - void Ruler::ImplDrawBorders( long nMin, long nMax, long nVirTop, long nVirBottom ) { const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings(); @@ -1421,22 +1325,19 @@ void Ruler::ImplFormat() } // Lineal-Beschriftung (nur wenn keine Bemassungspfeile) - if ( !mpData->pArrows ) - { - long nMin = nVirLeft; - long nMax = nP2; - long nStart = mpData->bTextRTL ? mpData->nMargin2 + nNullVirOff : nNullVirOff; - long nCenter = nVirTop+((nVirBottom-nVirTop)/2); + long nMin = nVirLeft; + long nMax = nP2; + long nStart = mpData->bTextRTL ? mpData->nMargin2 + nNullVirOff : nNullVirOff; + long nCenter = nVirTop+((nVirBottom-nVirTop)/2); - // Nicht Schatten uebermalen - if ( nP1 > nVirLeft ) - nMin++; - if ( nP2 < nVirRight ) - nMax--; + // Nicht Schatten uebermalen + if ( nP1 > nVirLeft ) + nMin++; + if ( nP2 < nVirRight ) + nMax--; - // Draw captions - ImplDrawTicks( nMin, nMax, nStart, nCenter ); - } + // Draw captions + ImplDrawTicks( nMin, nMax, nStart, nCenter ); // Draw borders if ( mpData->pBorders ) @@ -1452,10 +1353,6 @@ void Ruler::ImplFormat() ImplDrawTabs( nVirLeft, nP2, nVirTop-1, nVirBottom+1 ); } - // Bemassungspfeile - if ( mpData->pArrows ) - ImplDrawArrows( nVirTop+((nVirBottom-nVirTop)/2) ); - // Wir haben formatiert mbFormat = sal_False; } @@ -2706,30 +2603,6 @@ sal_Bool Ruler::StartDocDrag( const MouseEvent& rMEvt, RulerType eDragType ) // ----------------------------------------------------------------------- -RulerType Ruler::GetDocType( const Point& rPos, RulerType eDragType, - sal_uInt16* pAryPos ) const -{ - ImplRulerHitTest aHitTest; - - // Gegebenenfalls Lineal updaten (damit mit den richtigen Daten - // gearbeitet wird und die Anzeige auch zur Bearbeitung passt) - if ( IsReallyVisible() && mbFormat ) - { - ((Ruler*)this)->ImplDraw(); - ((Ruler*)this)->mnUpdateFlags &= ~RULER_UPDATE_DRAW; - } - - // HitTest durchfuehren - ImplDocHitTest( rPos, eDragType, &aHitTest ); - - // Werte zurueckgeben - if ( pAryPos ) - *pAryPos = aHitTest.nAryPos; - return aHitTest.eType; -} - -// ----------------------------------------------------------------------- - void Ruler::CancelDrag() { if ( mbDrag ) @@ -2998,52 +2871,6 @@ void Ruler::SetLines( sal_uInt16 n, const RulerLine* pLineAry ) // ----------------------------------------------------------------------- -void Ruler::SetArrows( sal_uInt16 n, const RulerArrow* pArrowAry ) -{ - if ( !n || !pArrowAry ) - { - if ( !mpData->pArrows ) - return; - delete[] mpData->pArrows; - mpData->nArrows = 0; - mpData->pArrows = NULL; - } - else - { - if ( mpData->nArrows != n ) - { - delete[] mpData->pArrows; - mpData->nArrows = n; - mpData->pArrows = new RulerArrow[n]; - } - else - { - sal_uInt16 i = n; - const RulerArrow* pAry1 = mpData->pArrows; - const RulerArrow* pAry2 = pArrowAry; - while ( i ) - { - if ( (pAry1->nPos != pAry2->nPos) || - (pAry1->nWidth != pAry2->nWidth) || - (pAry1->nLogWidth != pAry2->nLogWidth) || - (pAry1->nStyle != pAry2->nStyle) ) - break; - pAry1++; - pAry2++; - i--; - } - if ( !i ) - return; - } - - memcpy( mpData->pArrows, pArrowAry, n*sizeof( RulerArrow ) ); - } - - ImplUpdate(); -} - -// ----------------------------------------------------------------------- - void Ruler::SetBorders( sal_uInt16 n, const RulerBorder* pBrdAry ) { if ( !n || !pBrdAry ) @@ -3214,21 +3041,9 @@ void Ruler::SetTextRTL(sal_Bool bRTL) } long Ruler::GetPageOffset() const { return mpData->nPageOff; } -long Ruler::GetPageWidth() const { return mpData->nPageWidth; } long Ruler::GetNullOffset() const { return mpData->nNullOff; } long Ruler::GetMargin1() const { return mpData->nMargin1; } -sal_uInt16 Ruler::GetMargin1Style() const { return mpData->nMargin1Style; } long Ruler::GetMargin2() const { return mpData->nMargin2; } -sal_uInt16 Ruler::GetMargin2Style() const { return mpData->nMargin2Style; } -sal_uInt16 Ruler::GetLineCount() const { return mpData->nLines; } -const RulerLine* Ruler::GetLines() const { return mpData->pLines; } -sal_uInt16 Ruler::GetArrowCount() const { return mpData->nArrows; } -const RulerArrow* Ruler::GetArrows() const { return mpData->pArrows; } -sal_uInt16 Ruler::GetBorderCount() const { return mpData->nBorders; } -const RulerBorder* Ruler::GetBorders() const { return mpData->pBorders; } -sal_uInt16 Ruler::GetIndentCount() const { return mpData->nIndents; } -const RulerIndent* Ruler::GetIndents() const { return mpData->pIndents; } - void Ruler::DrawTicks() { diff --git a/unusedcode.easy b/unusedcode.easy index 535cbf8768bf..1e14592f68a7 100644 --- a/unusedcode.easy +++ b/unusedcode.easy @@ -361,19 +361,6 @@ PropBrwMgr::GetChildWindowId() ProposalList::Remove(rtl::OUString const&) PushButton::GetSymbolAlign() const ResData::Dump() -Ruler::GetArrowCount() const -Ruler::GetArrows() const -Ruler::GetBorderCount() const -Ruler::GetBorders() const -Ruler::GetDocType(Point const&, RulerType, unsigned short*) const -Ruler::GetIndentCount() const -Ruler::GetIndents() const -Ruler::GetLineCount() const -Ruler::GetLines() const -Ruler::GetMargin1Style() const -Ruler::GetMargin2Style() const -Ruler::GetPageWidth() const -Ruler::SetArrows(unsigned short, RulerArrow const*) SVGExport::GetGlyphPlacement() const SVGExport::IsUseGradient() const SVGExport::popClip() |