Kaydet (Commit) b64d19a6 authored tarafından Rodolfo Ribeiro Gomes's avatar Rodolfo Ribeiro Gomes Kaydeden (comit) Markus Mohrhard

German translations and minor clean-up in ScHeaderControls

Some methods properly defined as const methods

Change-Id: I59bc371bbb3adc6df2b96b82a0968a8693622ff8
Signed-off-by: 's avatarRodolfo Ribeiro Gomes <rodolforg@gmail.com>
Reviewed-on: https://gerrit.libreoffice.org/6537Reviewed-by: 's avatarMarkus Mohrhard <markus.mohrhard@googlemail.com>
Tested-by: 's avatarMarkus Mohrhard <markus.mohrhard@googlemail.com>
üst 0d9a5bfb
...@@ -26,9 +26,6 @@ ...@@ -26,9 +26,6 @@
class ScHeaderFunctionSet; class ScHeaderFunctionSet;
class ScHeaderSelectionEngine; class ScHeaderSelectionEngine;
// ---------------------------------------------------------------------------
class ScColBar : public ScHeaderControl class ScColBar : public ScHeaderControl
{ {
ScViewData* pViewData; ScViewData* pViewData;
...@@ -40,19 +37,19 @@ public: ...@@ -40,19 +37,19 @@ public:
ScHeaderFunctionSet* pFunc, ScHeaderSelectionEngine* pEng ); ScHeaderFunctionSet* pFunc, ScHeaderSelectionEngine* pEng );
~ScColBar(); ~ScColBar();
virtual SCCOLROW GetPos(); virtual SCCOLROW GetPos() const;
virtual sal_uInt16 GetEntrySize( SCCOLROW nEntryNo ); virtual sal_uInt16 GetEntrySize( SCCOLROW nEntryNo ) const;
virtual OUString GetEntryText( SCCOLROW nEntryNo ); virtual OUString GetEntryText( SCCOLROW nEntryNo ) const;
virtual bool IsLayoutRTL(); // only for columns virtual bool IsLayoutRTL() const;
virtual void SetEntrySize( SCCOLROW nPos, sal_uInt16 nNewSize ); virtual void SetEntrySize( SCCOLROW nPos, sal_uInt16 nNewSize );
virtual void HideEntries( SCCOLROW nStart, SCCOLROW nEnd ); virtual void HideEntries( SCCOLROW nStart, SCCOLROW nEnd );
virtual void SetMarking( bool bSet ); virtual void SetMarking( bool bSet );
virtual void SelectWindow(); virtual void SelectWindow();
virtual bool IsDisabled(); virtual bool IsDisabled() const;
virtual bool ResizeAllowed(); virtual bool ResizeAllowed() const;
virtual void DrawInvert( long nDragPos ); virtual void DrawInvert( long nDragPos );
...@@ -73,29 +70,26 @@ public: ...@@ -73,29 +70,26 @@ public:
ScHeaderFunctionSet* pFunc, ScHeaderSelectionEngine* pEng ); ScHeaderFunctionSet* pFunc, ScHeaderSelectionEngine* pEng );
~ScRowBar(); ~ScRowBar();
virtual SCCOLROW GetPos(); virtual SCCOLROW GetPos() const;
virtual sal_uInt16 GetEntrySize( SCCOLROW nEntryNo ); virtual sal_uInt16 GetEntrySize( SCCOLROW nEntryNo ) const;
virtual OUString GetEntryText( SCCOLROW nEntryNo ); virtual OUString GetEntryText( SCCOLROW nEntryNo ) const;
virtual bool IsMirrored(); // only for columns virtual bool IsMirrored() const;
virtual SCROW GetHiddenCount( SCROW nEntryNo ); // only for columns virtual SCROW GetHiddenCount( SCROW nEntryNo ) const;
virtual void SetEntrySize( SCCOLROW nPos, sal_uInt16 nNewSize ); virtual void SetEntrySize( SCCOLROW nPos, sal_uInt16 nNewSize );
virtual void HideEntries( SCCOLROW nStart, SCCOLROW nEnd ); virtual void HideEntries( SCCOLROW nStart, SCCOLROW nEnd );
virtual void SetMarking( bool bSet ); virtual void SetMarking( bool bSet );
virtual void SelectWindow(); virtual void SelectWindow();
virtual bool IsDisabled(); virtual bool IsDisabled() const;
virtual bool ResizeAllowed(); virtual bool ResizeAllowed() const;
virtual void DrawInvert( long nDragPos ); virtual void DrawInvert( long nDragPos );
virtual OUString GetDragHelp( long nVal ); virtual OUString GetDragHelp( long nVal );
}; };
#endif #endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
...@@ -49,7 +49,7 @@ private: ...@@ -49,7 +49,7 @@ private:
SCCOLROW nMarkEnd; SCCOLROW nMarkEnd;
bool bMarkRange; bool bMarkRange;
bool bDragging; // Change size bool bDragging; // Resizing
SCCOLROW nDragNo; SCCOLROW nDragNo;
long nDragStart; long nDragStart;
long nDragPos; long nDragPos;
...@@ -57,8 +57,8 @@ private: ...@@ -57,8 +57,8 @@ private:
bool bIgnoreMove; bool bIgnoreMove;
long GetScrPos( SCCOLROW nEntryNo ); long GetScrPos( SCCOLROW nEntryNo ) const;
SCCOLROW GetMousePos( const MouseEvent& rMEvt, bool& rBorder ); SCCOLROW GetMousePos( const MouseEvent& rMEvt, bool& rBorder ) const;
bool IsSelectionAllowed(SCCOLROW nPos) const; bool IsSelectionAllowed(SCCOLROW nPos) const;
void ShowDragHelp(); void ShowDragHelp();
...@@ -80,21 +80,21 @@ protected: ...@@ -80,21 +80,21 @@ protected:
// new methods // new methods
virtual SCCOLROW GetPos() = 0; // current position (Scrolling) virtual SCCOLROW GetPos() const = 0; // current position (Scrolling)
virtual sal_uInt16 GetEntrySize( SCCOLROW nEntryNo ) = 0; // width / height (Pixel) virtual sal_uInt16 GetEntrySize( SCCOLROW nEntryNo ) const = 0; // width / height (Pixel)
virtual OUString GetEntryText( SCCOLROW nEntryNo ) = 0; virtual OUString GetEntryText( SCCOLROW nEntryNo ) const = 0;
virtual SCCOLROW GetHiddenCount( SCCOLROW nEntryNo ); virtual SCCOLROW GetHiddenCount( SCCOLROW nEntryNo ) const;
virtual bool IsLayoutRTL(); virtual bool IsLayoutRTL() const;
virtual bool IsMirrored(); virtual bool IsMirrored() const;
virtual void SetEntrySize( SCCOLROW nPos, sal_uInt16 nNewWidth ) = 0; virtual void SetEntrySize( SCCOLROW nPos, sal_uInt16 nNewWidth ) = 0;
virtual void HideEntries( SCCOLROW nStart, SCCOLROW nEnd ) = 0; virtual void HideEntries( SCCOLROW nStart, SCCOLROW nEnd ) = 0;
virtual void SetMarking( bool bSet ); virtual void SetMarking( bool bSet );
virtual void SelectWindow(); virtual void SelectWindow();
virtual bool IsDisabled(); virtual bool IsDisabled() const;
virtual bool ResizeAllowed(); virtual bool ResizeAllowed() const;
virtual OUString GetDragHelp( long nVal ); virtual OUString GetDragHelp( long nVal );
virtual void DrawInvert( long nDragPos ); virtual void DrawInvert( long nDragPos );
...@@ -117,8 +117,6 @@ public: ...@@ -117,8 +117,6 @@ public:
void SetWidth( long nNew ); void SetWidth( long nNew );
}; };
#endif #endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
...@@ -74,12 +74,12 @@ inline bool ScColBar::UseNumericHeader() const ...@@ -74,12 +74,12 @@ inline bool ScColBar::UseNumericHeader() const
return pViewData->GetDocument()->GetAddressConvention() == formula::FormulaGrammar::CONV_XL_R1C1; return pViewData->GetDocument()->GetAddressConvention() == formula::FormulaGrammar::CONV_XL_R1C1;
} }
SCCOLROW ScColBar::GetPos() SCCOLROW ScColBar::GetPos() const
{ {
return pViewData->GetPosX(eWhich); return pViewData->GetPosX(eWhich);
} }
sal_uInt16 ScColBar::GetEntrySize( SCCOLROW nEntryNo ) sal_uInt16 ScColBar::GetEntrySize( SCCOLROW nEntryNo ) const
{ {
ScDocument* pDoc = pViewData->GetDocument(); ScDocument* pDoc = pViewData->GetDocument();
SCTAB nTab = pViewData->GetTabNo(); SCTAB nTab = pViewData->GetTabNo();
...@@ -89,10 +89,10 @@ sal_uInt16 ScColBar::GetEntrySize( SCCOLROW nEntryNo ) ...@@ -89,10 +89,10 @@ sal_uInt16 ScColBar::GetEntrySize( SCCOLROW nEntryNo )
return (sal_uInt16) ScViewData::ToPixel( pDoc->GetColWidth( static_cast<SCCOL>(nEntryNo), nTab ), pViewData->GetPPTX() ); return (sal_uInt16) ScViewData::ToPixel( pDoc->GetColWidth( static_cast<SCCOL>(nEntryNo), nTab ), pViewData->GetPPTX() );
} }
OUString ScColBar::GetEntryText( SCCOLROW nEntryNo ) OUString ScColBar::GetEntryText( SCCOLROW nEntryNo ) const
{ {
return UseNumericHeader() return UseNumericHeader()
? OUString::number(nEntryNo + 1) //FIXME remove String again ? OUString::number(nEntryNo + 1)
: ScColToAlpha( static_cast<SCCOL>(nEntryNo) ); : ScColToAlpha( static_cast<SCCOL>(nEntryNo) );
} }
...@@ -100,7 +100,7 @@ void ScColBar::SetEntrySize( SCCOLROW nPos, sal_uInt16 nNewSize ) ...@@ -100,7 +100,7 @@ void ScColBar::SetEntrySize( SCCOLROW nPos, sal_uInt16 nNewSize )
{ {
sal_uInt16 nSizeTwips; sal_uInt16 nSizeTwips;
ScSizeMode eMode = SC_SIZE_DIRECT; ScSizeMode eMode = SC_SIZE_DIRECT;
if (nNewSize>0 && nNewSize<10) nNewSize=10; // (Pixel) if (nNewSize < 10) nNewSize = 10; // pixels
if ( nNewSize == HDR_SIZE_OPTIMUM ) if ( nNewSize == HDR_SIZE_OPTIMUM )
{ {
...@@ -191,13 +191,13 @@ void ScColBar::SelectWindow() ...@@ -191,13 +191,13 @@ void ScColBar::SelectWindow()
pViewSh->ActiveGrabFocus(); pViewSh->ActiveGrabFocus();
} }
bool ScColBar::IsDisabled() bool ScColBar::IsDisabled() const
{ {
ScModule* pScMod = SC_MOD(); ScModule* pScMod = SC_MOD();
return pScMod->IsFormulaMode() || pScMod->IsModalMode(); return pScMod->IsFormulaMode() || pScMod->IsModalMode();
} }
bool ScColBar::ResizeAllowed() bool ScColBar::ResizeAllowed() const
{ {
return !pViewData->HasEditView( pViewData->GetActivePart() ); return !pViewData->HasEditView( pViewData->GetActivePart() );
} }
...@@ -217,7 +217,7 @@ OUString ScColBar::GetDragHelp( long nVal ) ...@@ -217,7 +217,7 @@ OUString ScColBar::GetDragHelp( long nVal )
return lcl_MetricString( nTwips, ScGlobal::GetRscString(STR_TIP_WIDTH) ); return lcl_MetricString( nTwips, ScGlobal::GetRscString(STR_TIP_WIDTH) );
} }
bool ScColBar::IsLayoutRTL() // overloaded only for columns bool ScColBar::IsLayoutRTL() const // overloaded only for columns
{ {
return pViewData->GetDocument()->IsLayoutRTL( pViewData->GetTabNo() ); return pViewData->GetDocument()->IsLayoutRTL( pViewData->GetTabNo() );
} }
...@@ -238,12 +238,12 @@ ScRowBar::~ScRowBar() ...@@ -238,12 +238,12 @@ ScRowBar::~ScRowBar()
{ {
} }
SCCOLROW ScRowBar::GetPos() SCCOLROW ScRowBar::GetPos() const
{ {
return pViewData->GetPosY(eWhich); return pViewData->GetPosY(eWhich);
} }
sal_uInt16 ScRowBar::GetEntrySize( SCCOLROW nEntryNo ) sal_uInt16 ScRowBar::GetEntrySize( SCCOLROW nEntryNo ) const
{ {
ScDocument* pDoc = pViewData->GetDocument(); ScDocument* pDoc = pViewData->GetDocument();
SCTAB nTab = pViewData->GetTabNo(); SCTAB nTab = pViewData->GetTabNo();
...@@ -255,7 +255,7 @@ sal_uInt16 ScRowBar::GetEntrySize( SCCOLROW nEntryNo ) ...@@ -255,7 +255,7 @@ sal_uInt16 ScRowBar::GetEntrySize( SCCOLROW nEntryNo )
nTab ), pViewData->GetPPTY() ); nTab ), pViewData->GetPPTY() );
} }
OUString ScRowBar::GetEntryText( SCCOLROW nEntryNo ) OUString ScRowBar::GetEntryText( SCCOLROW nEntryNo ) const
{ {
return OUString::number( nEntryNo + 1 ); return OUString::number( nEntryNo + 1 );
} }
...@@ -264,7 +264,7 @@ void ScRowBar::SetEntrySize( SCCOLROW nPos, sal_uInt16 nNewSize ) ...@@ -264,7 +264,7 @@ void ScRowBar::SetEntrySize( SCCOLROW nPos, sal_uInt16 nNewSize )
{ {
sal_uInt16 nSizeTwips; sal_uInt16 nSizeTwips;
ScSizeMode eMode = SC_SIZE_DIRECT; ScSizeMode eMode = SC_SIZE_DIRECT;
if (nNewSize>0 && nNewSize<10) nNewSize=10; // (Pixel) if (nNewSize < 10) nNewSize = 10; // pixels
if ( nNewSize == HDR_SIZE_OPTIMUM ) if ( nNewSize == HDR_SIZE_OPTIMUM )
{ {
...@@ -355,13 +355,13 @@ void ScRowBar::SelectWindow() ...@@ -355,13 +355,13 @@ void ScRowBar::SelectWindow()
pViewSh->ActiveGrabFocus(); pViewSh->ActiveGrabFocus();
} }
bool ScRowBar::IsDisabled() bool ScRowBar::IsDisabled() const
{ {
ScModule* pScMod = SC_MOD(); ScModule* pScMod = SC_MOD();
return pScMod->IsFormulaMode() || pScMod->IsModalMode(); return pScMod->IsFormulaMode() || pScMod->IsModalMode();
} }
bool ScRowBar::ResizeAllowed() bool ScRowBar::ResizeAllowed() const
{ {
return !pViewData->HasEditView( pViewData->GetActivePart() ); return !pViewData->HasEditView( pViewData->GetActivePart() );
} }
...@@ -381,17 +381,16 @@ OUString ScRowBar::GetDragHelp( long nVal ) ...@@ -381,17 +381,16 @@ OUString ScRowBar::GetDragHelp( long nVal )
return lcl_MetricString( nTwips, ScGlobal::GetRscString(STR_TIP_HEIGHT) ); return lcl_MetricString( nTwips, ScGlobal::GetRscString(STR_TIP_HEIGHT) );
} }
SCROW ScRowBar::GetHiddenCount( SCROW nEntryNo ) // overloaded only for rows SCROW ScRowBar::GetHiddenCount( SCROW nEntryNo ) const // overloaded only for rows
{ {
ScDocument* pDoc = pViewData->GetDocument(); ScDocument* pDoc = pViewData->GetDocument();
SCTAB nTab = pViewData->GetTabNo(); SCTAB nTab = pViewData->GetTabNo();
return pDoc->GetHiddenRowCount( nEntryNo, nTab ); return pDoc->GetHiddenRowCount( nEntryNo, nTab );
} }
bool ScRowBar::IsMirrored() // overloaded only for rows bool ScRowBar::IsMirrored() const // overloaded only for rows
{ {
return pViewData->GetDocument()->IsLayoutRTL( pViewData->GetTabNo() ); return pViewData->GetDocument()->IsLayoutRTL( pViewData->GetTabNo() );
} }
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
...@@ -32,8 +32,6 @@ ...@@ -32,8 +32,6 @@
#include "document.hxx" #include "document.hxx"
#include "markdata.hxx" #include "markdata.hxx"
// -----------------------------------------------------------------------
#define SC_DRAG_MIN 2 #define SC_DRAG_MIN 2
// passes in paint // passes in paint
...@@ -45,8 +43,6 @@ ...@@ -45,8 +43,6 @@
#define SC_HDRPAINT_TEXT 6 #define SC_HDRPAINT_TEXT 6
#define SC_HDRPAINT_COUNT 7 #define SC_HDRPAINT_COUNT 7
//==================================================================
ScHeaderControl::ScHeaderControl( Window* pParent, SelectionEngine* pSelectionEngine, ScHeaderControl::ScHeaderControl( Window* pParent, SelectionEngine* pSelectionEngine,
SCCOLROW nNewSize, bool bNewVertical ) : SCCOLROW nNewSize, bool bNewVertical ) :
Window ( pParent ), Window ( pParent ),
...@@ -77,7 +73,7 @@ ScHeaderControl::ScHeaderControl( Window* pParent, SelectionEngine* pSelectionEn ...@@ -77,7 +73,7 @@ ScHeaderControl::ScHeaderControl( Window* pParent, SelectionEngine* pSelectionEn
Size aSize = LogicToPixel( Size( Size aSize = LogicToPixel( Size(
GetTextWidth(OUString("8888")), GetTextWidth(OUString("8888")),
GetTextHeight() ) ); GetTextHeight() ) );
aSize.Width() += 4; // Platz fuer hervorgehobene Umrandung aSize.Width() += 4; // place for highlight border
aSize.Height() += 3; aSize.Height() += 3;
SetSizePixel( aSize ); SetSizePixel( aSize );
...@@ -89,15 +85,15 @@ ScHeaderControl::ScHeaderControl( Window* pParent, SelectionEngine* pSelectionEn ...@@ -89,15 +85,15 @@ ScHeaderControl::ScHeaderControl( Window* pParent, SelectionEngine* pSelectionEn
void ScHeaderControl::SetWidth( long nNew ) void ScHeaderControl::SetWidth( long nNew )
{ {
OSL_ENSURE( bVertical, "SetDigits nur fuer Zeilenkoepfe erlaubt" ); OSL_ENSURE( bVertical, "SetWidth works only on row headers" );
if ( nNew != nWidth ) if ( nNew != nWidth )
{ {
Size aSize( nNew, GetSizePixel().Height() ); // Hoehe nicht aendern Size aSize( nNew, GetSizePixel().Height() );
SetSizePixel( aSize ); SetSizePixel( aSize );
nWidth = nNew; nWidth = nNew;
Invalidate(); // neu zentrieren Invalidate();
} }
} }
...@@ -130,8 +126,6 @@ void ScHeaderControl::SetMark( bool bNewSet, SCCOLROW nNewStart, SCCOLROW nNewEn ...@@ -130,8 +126,6 @@ void ScHeaderControl::SetMark( bool bNewSet, SCCOLROW nNewStart, SCCOLROW nNewEn
if (!bEnabled) if (!bEnabled)
bNewSet = false; bNewSet = false;
// Variablen setzen
bool bOldSet = bMarkRange; bool bOldSet = bMarkRange;
SCCOLROW nOldStart = nMarkStart; SCCOLROW nOldStart = nMarkStart;
SCCOLROW nOldEnd = nMarkEnd; SCCOLROW nOldEnd = nMarkEnd;
...@@ -150,29 +144,26 @@ void ScHeaderControl::SetMark( bool bNewSet, SCCOLROW nNewStart, SCCOLROW nNewEn ...@@ -150,29 +144,26 @@ void ScHeaderControl::SetMark( bool bNewSet, SCCOLROW nNewStart, SCCOLROW nNewEn
{ {
if ( nNewEnd != nOldEnd ) if ( nNewEnd != nOldEnd )
DoPaint( std::min( nNewEnd, nOldEnd ) + 1, std::max( nNewEnd, nOldEnd ) ); DoPaint( std::min( nNewEnd, nOldEnd ) + 1, std::max( nNewEnd, nOldEnd ) );
// sonst nix
} }
else if ( nNewEnd == nOldEnd ) else if ( nNewEnd == nOldEnd )
DoPaint( std::min( nNewStart, nOldStart ), std::max( nNewStart, nOldStart ) - 1 ); DoPaint( std::min( nNewStart, nOldStart ), std::max( nNewStart, nOldStart ) - 1 );
else if ( nNewStart > nOldEnd || nNewEnd < nOldStart ) else if ( nNewStart > nOldEnd || nNewEnd < nOldStart )
{ {
// zwei Bereiche... // two areas
DoPaint( nOldStart, nOldEnd ); DoPaint( nOldStart, nOldEnd );
DoPaint( nNewStart, nNewEnd ); DoPaint( nNewStart, nNewEnd );
} }
else // irgendwie ueberlappend... (kommt eh nicht oft vor) else // somehow overlapping... (it is not often)
DoPaint( std::min( nNewStart, nOldStart ), std::max( nNewEnd, nOldEnd ) ); DoPaint( std::min( nNewStart, nOldStart ), std::max( nNewEnd, nOldEnd ) );
} }
else else
DoPaint( nNewStart, nNewEnd ); // komplett neu DoPaint( nNewStart, nNewEnd ); // completely new selection
} }
else if ( bOldSet ) else if ( bOldSet )
DoPaint( nOldStart, nOldEnd ); // komplett aufheben DoPaint( nOldStart, nOldEnd ); // cancel selection
// sonst war nix, is nix
} }
long ScHeaderControl::GetScrPos( SCCOLROW nEntryNo ) long ScHeaderControl::GetScrPos( SCCOLROW nEntryNo ) const
{ {
long nScrPos; long nScrPos;
...@@ -239,10 +230,6 @@ void ScHeaderControl::DrawShadedRect( long nStart, long nEnd, const Color& rBase ...@@ -239,10 +230,6 @@ void ScHeaderControl::DrawShadedRect( long nStart, long nEnd, const Color& rBase
DrawRect( Rectangle( nStart, nCenterPos+1, nEnd, nBarSize-1 ) ); DrawRect( Rectangle( nStart, nCenterPos+1, nEnd, nBarSize-1 ) );
} }
//
// Paint
//
void ScHeaderControl::Paint( const Rectangle& rRect ) void ScHeaderControl::Paint( const Rectangle& rRect )
{ {
// fuer VCL ist es wichtig, wenig Aufrufe zu haben, darum werden die aeusseren // fuer VCL ist es wichtig, wenig Aufrufe zu haben, darum werden die aeusseren
...@@ -573,11 +560,7 @@ void ScHeaderControl::Paint( const Rectangle& rRect ) ...@@ -573,11 +560,7 @@ void ScHeaderControl::Paint( const Rectangle& rRect )
} }
} }
// SCCOLROW ScHeaderControl::GetMousePos( const MouseEvent& rMEvt, bool& rBorder ) const
// Maus - Handling
//
SCCOLROW ScHeaderControl::GetMousePos( const MouseEvent& rMEvt, bool& rBorder )
{ {
bool bFound = false; bool bFound = false;
SCCOLROW nCount = 1; SCCOLROW nCount = 1;
...@@ -666,12 +649,13 @@ void ScHeaderControl::MouseButtonDown( const MouseEvent& rMEvt ) ...@@ -666,12 +649,13 @@ void ScHeaderControl::MouseButtonDown( const MouseEvent& rMEvt )
bIgnoreMove = false; bIgnoreMove = false;
SelectWindow(); SelectWindow();
bool bFound; bool bIsBorder;
SCCOLROW nHitNo = GetMousePos( rMEvt, bFound ); SCCOLROW nHitNo = GetMousePos( rMEvt, bIsBorder );
if (!IsSelectionAllowed(nHitNo)) if (!IsSelectionAllowed(nHitNo))
return; return;
if ( ! rMEvt.IsLeft() )
if ( bFound && rMEvt.IsLeft() && ResizeAllowed() ) return;
if ( bIsBorder && ResizeAllowed() )
{ {
nDragNo = nHitNo; nDragNo = nHitNo;
sal_uInt16 nClicks = rMEvt.GetClicks(); sal_uInt16 nClicks = rMEvt.GetClicks();
...@@ -695,7 +679,7 @@ void ScHeaderControl::MouseButtonDown( const MouseEvent& rMEvt ) ...@@ -695,7 +679,7 @@ void ScHeaderControl::MouseButtonDown( const MouseEvent& rMEvt )
bDragMoved = false; bDragMoved = false;
} }
} }
else if (rMEvt.IsLeft()) else
{ {
pSelEngine->SetWindow( this ); pSelEngine->SetWindow( this );
Point aPoint; Point aPoint;
...@@ -706,7 +690,7 @@ void ScHeaderControl::MouseButtonDown( const MouseEvent& rMEvt ) ...@@ -706,7 +690,7 @@ void ScHeaderControl::MouseButtonDown( const MouseEvent& rMEvt )
aVis.Top() = LONG_MIN, aVis.Bottom() = LONG_MAX; aVis.Top() = LONG_MIN, aVis.Bottom() = LONG_MAX;
pSelEngine->SetVisibleArea( aVis ); pSelEngine->SetVisibleArea( aVis );
SetMarking( true ); // muss vor SelMouseButtonDown sein SetMarking( true ); // must precede SelMouseButtonDown
pSelEngine->SelMouseButtonDown( rMEvt ); pSelEngine->SelMouseButtonDown( rMEvt );
// In column/row headers a simple click already is a selection. // In column/row headers a simple click already is a selection.
...@@ -782,9 +766,6 @@ void ScHeaderControl::MouseMove( const MouseEvent& rMEvt ) ...@@ -782,9 +766,6 @@ void ScHeaderControl::MouseMove( const MouseEvent& rMEvt )
return; return;
} }
bool bFound;
(void)GetMousePos( rMEvt, bFound );
if ( bDragging ) if ( bDragging )
{ {
long nNewPos = bVertical ? rMEvt.GetPosPixel().Y() : rMEvt.GetPosPixel().X(); long nNewPos = bVertical ? rMEvt.GetPosPixel().Y() : rMEvt.GetPosPixel().X();
...@@ -801,7 +782,10 @@ void ScHeaderControl::MouseMove( const MouseEvent& rMEvt ) ...@@ -801,7 +782,10 @@ void ScHeaderControl::MouseMove( const MouseEvent& rMEvt )
} }
else else
{ {
if ( bFound && rMEvt.GetButtons()==0 && ResizeAllowed() ) bool bIsBorder;
(void)GetMousePos( rMEvt, bIsBorder );
if ( bIsBorder && rMEvt.GetButtons()==0 && ResizeAllowed() )
SetPointer( Pointer( bVertical ? POINTER_VSIZEBAR : POINTER_HSIZEBAR ) ); SetPointer( Pointer( bVertical ? POINTER_VSIZEBAR : POINTER_HSIZEBAR ) );
else else
SetPointer( Pointer( POINTER_ARROW ) ); SetPointer( Pointer( POINTER_ARROW ) );
...@@ -813,8 +797,8 @@ void ScHeaderControl::MouseMove( const MouseEvent& rMEvt ) ...@@ -813,8 +797,8 @@ void ScHeaderControl::MouseMove( const MouseEvent& rMEvt )
void ScHeaderControl::Tracking( const TrackingEvent& rTEvt ) void ScHeaderControl::Tracking( const TrackingEvent& rTEvt )
{ {
// Weil die SelectionEngine kein Tracking kennt, die Events nur auf // Distribute the tracking events to the various MouseEvents, because
// die verschiedenen MouseHandler verteilen... // SelectionEngine does not know anything about Tracking
if ( rTEvt.IsTrackingCanceled() ) if ( rTEvt.IsTrackingCanceled() )
StopMarking(); StopMarking();
...@@ -829,9 +813,9 @@ void ScHeaderControl::Command( const CommandEvent& rCEvt ) ...@@ -829,9 +813,9 @@ void ScHeaderControl::Command( const CommandEvent& rCEvt )
sal_uInt16 nCmd = rCEvt.GetCommand(); sal_uInt16 nCmd = rCEvt.GetCommand();
if ( nCmd == COMMAND_CONTEXTMENU ) if ( nCmd == COMMAND_CONTEXTMENU )
{ {
StopMarking(); // Selektion / Dragging beenden StopMarking(); // finish selection / dragging
// Popup ausfuehren // execute popup menu
ScTabViewShell* pViewSh = PTR_CAST( ScTabViewShell, ScTabViewShell* pViewSh = PTR_CAST( ScTabViewShell,
SfxViewShell::Current() ); SfxViewShell::Current() );
...@@ -918,14 +902,14 @@ void ScHeaderControl::ShowDragHelp() ...@@ -918,14 +902,14 @@ void ScHeaderControl::ShowDragHelp()
sal_uInt16 nAlign; sal_uInt16 nAlign;
if (!bVertical) if (!bVertical)
{ {
// oberhalb // above
aRect.Left() = aMousePos.X(); aRect.Left() = aMousePos.X();
aRect.Top() = aPos.Y() - 4; aRect.Top() = aPos.Y() - 4;
nAlign = QUICKHELP_BOTTOM|QUICKHELP_CENTER; nAlign = QUICKHELP_BOTTOM|QUICKHELP_CENTER;
} }
else else
{ {
// rechts oben // top right
aRect.Left() = aPos.X() + aSize.Width() + 8; aRect.Left() = aPos.X() + aSize.Width() + 8;
aRect.Top() = aMousePos.Y() - 2; aRect.Top() = aMousePos.Y() - 2;
nAlign = QUICKHELP_LEFT|QUICKHELP_BOTTOM; nAlign = QUICKHELP_LEFT|QUICKHELP_BOTTOM;
...@@ -940,8 +924,7 @@ void ScHeaderControl::ShowDragHelp() ...@@ -940,8 +924,7 @@ void ScHeaderControl::ShowDragHelp()
void ScHeaderControl::RequestHelp( const HelpEvent& rHEvt ) void ScHeaderControl::RequestHelp( const HelpEvent& rHEvt )
{ {
// Wenn eigene QuickHelp angezeigt wird, nicht durch RequestHelp // If the own QuickHelp is displayed, don't let RequestHelp remove it
// wieder wegnehmen lassen
bool bOwn = bDragging && Help::IsQuickHelpEnabled(); bool bOwn = bDragging && Help::IsQuickHelpEnabled();
if (!bOwn) if (!bOwn)
...@@ -952,7 +935,7 @@ void ScHeaderControl::RequestHelp( const HelpEvent& rHEvt ) ...@@ -952,7 +935,7 @@ void ScHeaderControl::RequestHelp( const HelpEvent& rHEvt )
// Dummys fuer virtuelle Methoden // Dummys fuer virtuelle Methoden
// ----------------------------------------------------------------------- // -----------------------------------------------------------------------
SCCOLROW ScHeaderControl::GetHiddenCount( SCCOLROW nEntryNo ) SCCOLROW ScHeaderControl::GetHiddenCount( SCCOLROW nEntryNo ) const
{ {
SCCOLROW nHidden = 0; SCCOLROW nHidden = 0;
while ( nEntryNo < nSize && GetEntrySize( nEntryNo ) == 0 ) while ( nEntryNo < nSize && GetEntrySize( nEntryNo ) == 0 )
...@@ -963,22 +946,22 @@ SCCOLROW ScHeaderControl::GetHiddenCount( SCCOLROW nEntryNo ) ...@@ -963,22 +946,22 @@ SCCOLROW ScHeaderControl::GetHiddenCount( SCCOLROW nEntryNo )
return nHidden; return nHidden;
} }
bool ScHeaderControl::IsLayoutRTL() bool ScHeaderControl::IsLayoutRTL() const
{ {
return false; return false;
} }
bool ScHeaderControl::IsMirrored() bool ScHeaderControl::IsMirrored() const
{ {
return false; return false;
} }
bool ScHeaderControl::IsDisabled() bool ScHeaderControl::IsDisabled() const
{ {
return false; return false;
} }
bool ScHeaderControl::ResizeAllowed() bool ScHeaderControl::ResizeAllowed() const
{ {
return true; return true;
} }
...@@ -1000,6 +983,4 @@ void ScHeaderControl::SetMarking( bool /* bSet */ ) ...@@ -1000,6 +983,4 @@ void ScHeaderControl::SetMarking( bool /* bSet */ )
{ {
} }
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment