[Libreoffice-commits] .: Branch 'libreoffice-3-5' - sc/inc sc/source

Kohei Yoshida kohei at kemper.freedesktop.org
Sun Jan 8 11:17:23 PST 2012


 sc/inc/userdat.hxx               |    2 +-
 sc/source/core/data/drwlayer.cxx |    5 +----
 sc/source/core/tool/detfunc.cxx  |    5 +++--
 3 files changed, 5 insertions(+), 7 deletions(-)

New commits:
commit 365bf7410caaf9a81b0c62b806a221744745a3b9
Author: Kohei Yoshida <kohei.yoshida at suse.com>
Date:   Sat Jan 7 20:56:15 2012 -0500

    Mark detective arrows clearly since we need to treat them differently.
    
    Otherwise it gets confused with normal arrow objects during re-
    positioning.

diff --git a/sc/inc/userdat.hxx b/sc/inc/userdat.hxx
index ed6adc2..e0463b3 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 087d510..cdbb95d 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 ebf9ef8..9c6d65f 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,


More information about the Libreoffice-commits mailing list