diff options
author | Kohei Yoshida <kohei.yoshida@suse.com> | 2012-01-07 20:56:15 -0500 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@suse.com> | 2012-01-07 21:03:28 -0500 |
commit | 08708fcc39f300c477aad581e5bdc42e5931dd8c (patch) | |
tree | d905ab798a48ed6bd1325ba547d0da2fe681f08b /sc | |
parent | be9c3de16a29a3bffde9156af346e8b9907121ed (diff) |
Mark detective arrows clearly since we need to treat them differently.
Otherwise it gets confused with normal arrow objects during re-
positioning.
Diffstat (limited to 'sc')
-rw-r--r-- | sc/inc/userdat.hxx | 2 | ||||
-rw-r--r-- | sc/source/core/data/drwlayer.cxx | 5 | ||||
-rw-r--r-- | sc/source/core/tool/detfunc.cxx | 5 |
3 files changed, 5 insertions, 7 deletions
diff --git a/sc/inc/userdat.hxx b/sc/inc/userdat.hxx index ed6adc283292..e0463b39c064 100644 --- a/sc/inc/userdat.hxx +++ b/sc/inc/userdat.hxx @@ -59,7 +59,7 @@ public: class ScDrawObjData : public SdrObjUserData { public: - enum Type { CellNote, ValidationCircle, DrawingObject }; + enum Type { CellNote, ValidationCircle, DetectiveArrow, DrawingObject }; ScAddress maStart; ScAddress maEnd; diff --git a/sc/source/core/data/drwlayer.cxx b/sc/source/core/data/drwlayer.cxx index 087d5102a3e5..cdbb95dabaa3 100644 --- a/sc/source/core/data/drwlayer.cxx +++ b/sc/source/core/data/drwlayer.cxx @@ -643,9 +643,6 @@ void ScDrawLayer::RecalcPos( SdrObject* pObj, ScDrawObjData& rData, bool bNegati SCROW nRow2 = rData.maEnd.Row(); SCTAB nTab2 = rData.maEnd.Tab(); - // detective arrow - bool bArrow = pObj->IsPolyObj() && (pObj->GetPointCount() == 2); - if (rData.meType == ScDrawObjData::ValidationCircle) { // Validation circle for detective. @@ -675,7 +672,7 @@ void ScDrawLayer::RecalcPos( SdrObject* pObj, ScDrawObjData& rData, bool bNegati pObj->SetLogicRect(rData.maLastRect); } } - else if( bArrow ) + else if (rData.meType == ScDrawObjData::DetectiveArrow) { rData.maLastRect = pObj->GetLogicRect(); basegfx::B2DPolygon aCalcPoly; diff --git a/sc/source/core/tool/detfunc.cxx b/sc/source/core/tool/detfunc.cxx index ebf9ef8d3944..9c6d65f4b611 100644 --- a/sc/source/core/tool/detfunc.cxx +++ b/sc/source/core/tool/detfunc.cxx @@ -545,16 +545,17 @@ sal_Bool ScDetectiveFunc::InsertArrow( SCCOL nCol, SCROW nRow, pPage->InsertObject( pArrow ); pModel->AddCalcUndo( new SdrUndoInsertObj( *pArrow ) ); - ScDrawObjData* pData = ScDrawLayer::GetObjData( pArrow, sal_True ); + ScDrawObjData* pData = ScDrawLayer::GetObjData(pArrow, true); if (bFromOtherTab) pData->maStart.SetInvalid(); else pData->maStart.Set( nRefStartCol, nRefStartRow, nTab); pData->maEnd.Set( nCol, nRow, nTab); + pData->meType = ScDrawObjData::DetectiveArrow; Modified(); - return sal_True; + return true; } sal_Bool ScDetectiveFunc::InsertToOtherTab( SCCOL nStartCol, SCROW nStartRow, |