summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@suse.com>2012-01-07 20:56:15 -0500
committerKohei Yoshida <kohei.yoshida@suse.com>2012-01-08 14:17:32 -0500
commit365bf7410caaf9a81b0c62b806a221744745a3b9 (patch)
treeeb95351c8d6c87671f6817f5163e11bc688c23fd /sc
parentee61862a385466be28eede2def90674df891fd6e (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.hxx2
-rw-r--r--sc/source/core/data/drwlayer.cxx5
-rw-r--r--sc/source/core/tool/detfunc.cxx5
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,