[ooo-build-commit] .: patches/dev300

Kohei Yoshida kohei at kemper.freedesktop.org
Mon Oct 4 11:53:58 PDT 2010


 patches/dev300/apply                         |    3 
 patches/dev300/calc-formula-r1c1-ui-fix.diff |  205 ---------------------------
 2 files changed, 208 deletions(-)

New commits:
commit 6727e315c2e28c3277fe0459c7a38dc9e12e17bc
Author: Kohei Yoshida <kyoshida at novell.com>
Date:   Mon Oct 4 14:53:22 2010 -0400

    Removed calc-formula-r1c1-ui-fix.diff; moved to git.

diff --git a/patches/dev300/apply b/patches/dev300/apply
index 2127d28..829705b 100644
--- a/patches/dev300/apply
+++ b/patches/dev300/apply
@@ -2694,9 +2694,6 @@ calc-insert-current-time-vcl.diff,       kohei
 calc-pdf-export-allow-filtered-range-sc.diff,     n#585028, kohei
 calc-pdf-export-allow-filtered-range-filter.diff, n#585028, kohei
 
-# Fix auto-sum and reference selection for function wizard in R1C1 mode.
-calc-formula-r1c1-ui-fix.diff, n#595078, n#595080, kohei
-
 # Fix handling of DB functions.
 calc-formula-db-function-fix.diff, n#594332, n#595713, kohei
 
diff --git a/patches/dev300/calc-formula-r1c1-ui-fix.diff b/patches/dev300/calc-formula-r1c1-ui-fix.diff
deleted file mode 100644
index 995155f..0000000
--- a/patches/dev300/calc-formula-r1c1-ui-fix.diff
+++ /dev/null
@@ -1,205 +0,0 @@
----
- sc/source/ui/app/inputwin.cxx    |   12 +++++--
- sc/source/ui/formdlg/formula.cxx |   13 +++++--
- sc/source/ui/inc/viewfunc.hxx    |    4 +-
- sc/source/ui/view/viewfun2.cxx   |   71 ++++++++++++++++++++++----------------
- 4 files changed, 61 insertions(+), 39 deletions(-)
-
-diff --git sc/source/ui/app/inputwin.cxx sc/source/ui/app/inputwin.cxx
-index 2a832cd..2b7d074 100644
---- sc/source/ui/app/inputwin.cxx
-+++ sc/source/ui/app/inputwin.cxx
-@@ -395,8 +395,10 @@ void __EXPORT ScInputWindow::Select()
-                             const BOOL bDataFound = pViewSh->GetAutoSumArea( aRangeList );
-                             if ( bDataFound )
-                             {
-+                                ScAddress aAddr = aRangeList.Last()->aEnd;
-+                                aAddr.IncRow();
-                                 const sal_Bool bSubTotal( UseSubTotal( &aRangeList ) );
--                                pViewSh->EnterAutoSum( aRangeList, bSubTotal );	// Block mit Summen fuellen
-+                                pViewSh->EnterAutoSum( aRangeList, bSubTotal, aAddr );
-                             }
-                         }
-                         else
-@@ -412,7 +414,10 @@ void __EXPORT ScInputWindow::Select()
-                                     pViewSh->MarkRange( aRange, FALSE, FALSE );
-                                     pViewSh->SetCursor( aRange.aEnd.Col(), aRange.aEnd.Row() );
-                                     const ScRangeList aRangeList;
--                                    const String aFormula = pViewSh->GetAutoSumFormula( aRangeList, bSubTotal );
-+                                    ScAddress aAddr = aRange.aEnd;
-+                                    aAddr.IncRow();
-+                                    const String aFormula = pViewSh->GetAutoSumFormula(
-+                                        aRangeList, bSubTotal, aAddr );
-                                     SetFuncString( aFormula );
-                                     break;
-                                 }
-@@ -424,7 +429,8 @@ void __EXPORT ScInputWindow::Select()
-                         ScRangeList aRangeList;
-                         const BOOL bDataFound = pViewSh->GetAutoSumArea( aRangeList );
-                         const sal_Bool bSubTotal( UseSubTotal( &aRangeList ) );
--                        const String aFormula = pViewSh->GetAutoSumFormula( aRangeList, bSubTotal );
-+                        ScAddress aAddr = pViewSh->GetViewData()->GetCurPos();
-+                        const String aFormula = pViewSh->GetAutoSumFormula( aRangeList, bSubTotal, aAddr );
-                         SetFuncString( aFormula );
- 
-                         if ( bDataFound && pScMod->IsEditMode() )
-diff --git sc/source/ui/formdlg/formula.cxx sc/source/ui/formdlg/formula.cxx
-index a084737..fe7c63c 100644
---- sc/source/ui/formdlg/formula.cxx
-+++ sc/source/ui/formdlg/formula.cxx
-@@ -452,10 +452,15 @@ void ScFormulaDlg::SetReference( const ScRange& rRef, ScDocument* pRefDoc )
-         }
-         else
-         {
--            USHORT nFmt = ( rRef.aStart.Tab() == aCursorPos.Tab() )
--                                ? SCA_VALID
--                                : SCA_VALID | SCA_TAB_3D;
--            rRef.Format( aRefStr, nFmt, pRefDoc, pRefDoc->GetAddressConvention() );
-+            ScTokenArray aArray;
-+            ScComplexRefData aRefData;
-+            aRefData.InitRangeRel(rRef, aCursorPos);
-+            aArray.AddDoubleReference(aRefData);
-+            ScCompiler aComp(pDoc, aCursorPos, aArray);
-+            aComp.SetGrammar(pDoc->GetGrammar());
-+            ::rtl::OUStringBuffer aBuf;
-+            aComp.CreateStringFromTokenArray(aBuf);
-+            aRefStr = aBuf.makeStringAndClear();
-         }
- 
-         UpdateParaWin(theSel,aRefStr);
-diff --git sc/source/ui/inc/viewfunc.hxx sc/source/ui/inc/viewfunc.hxx
-index 68113f1..060111b 100644
---- sc/source/ui/inc/viewfunc.hxx
-+++ sc/source/ui/inc/viewfunc.hxx
-@@ -93,9 +93,9 @@ public:
-     BYTE			GetSelectionScriptType();
- 
-     BOOL			GetAutoSumArea(ScRangeList& rRangeList);
--    void			EnterAutoSum(const ScRangeList& rRangeList, sal_Bool bSubTotal);
-+    void			EnterAutoSum(const ScRangeList& rRangeList, bool bSubTotal, const ScAddress& rAddr);
-     bool            AutoSum( const ScRange& rRange, bool bSubTotal, bool bSetCursor, bool bContinue );
--    String          GetAutoSumFormula( const ScRangeList& rRangeList, bool bSubTotal );
-+    String          GetAutoSumFormula( const ScRangeList& rRangeList, bool bSubTotal, const ScAddress& rAddr );
- 
-     void			EnterData( SCCOL nCol, SCROW nRow, SCTAB nTab, const String& rString,
-                                BOOL bRecord = TRUE, const EditTextObject* pData = NULL );
-diff --git sc/source/ui/view/viewfun2.cxx sc/source/ui/view/viewfun2.cxx
-index 2030372..2fa1ed2 100644
---- sc/source/ui/view/viewfun2.cxx
-+++ sc/source/ui/view/viewfun2.cxx
-@@ -92,7 +92,12 @@
- #include <basic/sbstar.hxx>
- #include <com/sun/star/container/XNameContainer.hpp>
- #include <com/sun/star/script/XLibraryContainer.hpp>
-+
-+#include <boost/scoped_ptr.hpp>
-+
- using namespace com::sun::star;
-+using ::rtl::OUStringBuffer;
-+using ::rtl::OUString;
- 
- // helper func defined in docfunc.cxx
- void VBA_DeleteModule( ScDocShell& rDocSh, String& sModuleName );
-@@ -507,9 +512,9 @@ BOOL ScViewFunc::GetAutoSumArea( ScRangeList& rRangeList )
- 
- //----------------------------------------------------------------------------
- 
--void ScViewFunc::EnterAutoSum(const ScRangeList& rRangeList, sal_Bool bSubTotal)		// Block mit Summen fuellen
-+void ScViewFunc::EnterAutoSum(const ScRangeList& rRangeList, bool bSubTotal, const ScAddress& rAddr)
- {
--    String aFormula = GetAutoSumFormula( rRangeList, bSubTotal );
-+    String aFormula = GetAutoSumFormula( rRangeList, bSubTotal, rAddr );
-     EnterBlock( aFormula, NULL );
- }
- 
-@@ -662,7 +667,8 @@ bool ScViewFunc::AutoSum( const ScRange& rRange, bool bSubTotal, bool bSetCursor
-                 const ScRange aRange( nCol, nStartRow, nTab, nCol, nSumEndRow, nTab );
-                 if ( lcl_GetAutoSumForColumnRange( pDoc, aRangeList, aRange ) )
-                 {
--                    const String aFormula = GetAutoSumFormula( aRangeList, bSubTotal );
-+                    const String aFormula = GetAutoSumFormula(
-+                        aRangeList, bSubTotal, ScAddress(nCol, nInsRow, nTab));
-                     EnterData( nCol, nInsRow, nTab, aFormula );
-                 }
-             }
-@@ -695,7 +701,7 @@ bool ScViewFunc::AutoSum( const ScRange& rRange, bool bSubTotal, bool bSetCursor
-                 const ScRange aRange( nStartCol, nRow, nTab, nSumEndCol, nRow, nTab );
-                 if ( lcl_GetAutoSumForRowRange( pDoc, aRangeList, aRange ) )
-                 {
--                    const String aFormula = GetAutoSumFormula( aRangeList, bSubTotal );
-+                    const String aFormula = GetAutoSumFormula( aRangeList, bSubTotal, ScAddress(nInsCol, nRow, nTab) );
-                     EnterData( nInsCol, nRow, nTab, aFormula );
-                 }
-             }
-@@ -715,37 +721,42 @@ bool ScViewFunc::AutoSum( const ScRange& rRange, bool bSubTotal, bool bSetCursor
- 
- //----------------------------------------------------------------------------
- 
--String ScViewFunc::GetAutoSumFormula( const ScRangeList& rRangeList, bool bSubTotal )
-+String ScViewFunc::GetAutoSumFormula( const ScRangeList& rRangeList, bool bSubTotal, const ScAddress& rAddr )
- {
--    String aFormula = '=';
--    ScFunctionMgr* pFuncMgr = ScGlobal::GetStarCalcFunctionMgr();
--    const ScFuncDesc* pDesc = NULL;
--    if ( bSubTotal )
--    {
--        pDesc = pFuncMgr->Get( SC_OPCODE_SUB_TOTAL );
--    }
--    else
-+    ScViewData* pViewData = GetViewData();
-+    ScDocument* pDoc = pViewData->GetDocument();
-+    ::boost::scoped_ptr<ScTokenArray> pArray(new ScTokenArray);
-+
-+    pArray->AddOpCode(bSubTotal ? ocSubTotal : ocSum);
-+    pArray->AddOpCode(ocOpen);
-+
-+    if (bSubTotal)
-     {
--        pDesc = pFuncMgr->Get( SC_OPCODE_SUM );
-+        pArray->AddDouble(9);
-+        pArray->AddOpCode(ocSep);
-     }
--    if ( pDesc && pDesc->pFuncName )
-+
-+    ScRangeList aRangeList = rRangeList;
-+    const ScRange* pFirst = aRangeList.First();
-+    for (const ScRange* p = pFirst; p; p = aRangeList.Next())
-     {
--        aFormula += *pDesc->pFuncName;
--        if ( bSubTotal )
--        {
--            aFormula.AppendAscii( RTL_CONSTASCII_STRINGPARAM( "(9;" ) );
--        }
--        else
--        {
--            aFormula += '(';
--        }
--        ScDocument* pDoc = GetViewData()->GetDocument();
--        String aRef;
--        rRangeList.Format( aRef, SCA_VALID, pDoc );
--        aFormula += aRef;
--        aFormula += ')';
-+        if (p != pFirst)
-+            pArray->AddOpCode(ocSep);
-+        ScComplexRefData aRef;
-+        aRef.InitRangeRel(*p, rAddr);
-+        pArray->AddDoubleReference(aRef);
-     }
--    return aFormula;
-+
-+    pArray->AddOpCode(ocClose);
-+
-+    ScCompiler aComp(pDoc, rAddr, *pArray);
-+    aComp.SetGrammar(pDoc->GetGrammar());
-+    OUStringBuffer aBuf;
-+    aComp.CreateStringFromTokenArray(aBuf);
-+    OUString aFormula = aBuf.makeStringAndClear();
-+    aBuf.append(sal_Unicode('='));
-+    aBuf.append(aFormula);
-+    return aBuf.makeStringAndClear();
- }
- 
- //----------------------------------------------------------------------------
--- 
-1.7.0.1
-


More information about the ooo-build-commit mailing list