[Libreoffice-commits] core.git: Branch 'private/kohei/calc-data-stream' - 86 commits - chart2/AllLangResTarget_chartcontroller.mk chart2/Library_chartcontroller.mk chart2/source chart2/uiconfig chart2/UIConfig_chart2.mk connectivity/source editeng/source external/hsqldb extras/source filter/Library_xmlfd.mk filter/source framework/source helpcontent2 icon-themes/tango include/svx include/vcl ios/shared oox/source sc/AllLangResTarget_sc.mk sc/inc sc/qa sc/source sc/uiconfig sc/UIConfig_scalc.mk sd/qa sd/source sd/uiconfig sd/UIConfig_sdraw.mk solenv/bin starmath/source svtools/source svx/inc svx/source svx/uiconfig svx/UIConfig_svx.mk sw/qa sw/source vcl/source writerfilter/source

Kohei Yoshida kohei.yoshida at collabora.com
Mon Dec 30 09:37:38 PST 2013


Rebased ref, commits from common ancestor:
commit 8b958cbe49c3891ed3ce190b847c60398b7551ea
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date:   Mon Dec 30 12:16:35 2013 -0500

    Parse CSV lines in the reader thread.
    
    Change-Id: I6329a0e6e6fa6576df2ed473482d558bfd6cce08

diff --git a/sc/inc/stringutil.hxx b/sc/inc/stringutil.hxx
index 08e5c1e..d275007 100644
--- a/sc/inc/stringutil.hxx
+++ b/sc/inc/stringutil.hxx
@@ -126,6 +126,9 @@ public:
     static bool parseSimpleNumber(
         const OUString& rStr, sal_Unicode dsep, sal_Unicode gsep, double& rVal);
 
+    static bool parseSimpleNumber(
+        const char* p, size_t n, char dsep, char gsep, double& rVal);
+
     static sal_Int32 SC_DLLPUBLIC GetQuotedTokenCount(const OUString &rIn, const OUString& rQuotedPairs, sal_Unicode cTok = ';' );
     static OUString  SC_DLLPUBLIC GetQuotedToken(const OUString &rIn, sal_Int32 nToken, const OUString& rQuotedPairs,
                                         sal_Unicode cTok,  sal_Int32& rIndex );
diff --git a/sc/source/core/tool/stringutil.cxx b/sc/source/core/tool/stringutil.cxx
index e711bcb..5bdc2c2 100644
--- a/sc/source/core/tool/stringutil.cxx
+++ b/sc/source/core/tool/stringutil.cxx
@@ -18,11 +18,13 @@
  */
 
 #include "stringutil.hxx"
-#include "rtl/ustrbuf.hxx"
-#include "rtl/math.hxx"
 #include "global.hxx"
 #include "svl/zforlist.hxx"
 
+#include <rtl/ustrbuf.hxx>
+#include <rtl/strbuf.hxx>
+#include <rtl/math.hxx>
+
 ScSetStringParam::ScSetStringParam() :
     mpNumFormatter(NULL),
     mbDetectNumberFormat(true),
@@ -194,6 +196,150 @@ bool ScStringUtil::parseSimpleNumber(
     return true;
 }
 
+bool ScStringUtil::parseSimpleNumber(
+    const char* p, size_t n, char dsep, char gsep, double& rVal)
+{
+    // Actually almost the entire pre-check is unnecessary and we could call
+    // rtl::math::stringToDouble() just after having exchanged ascii space with
+    // non-breaking space, if it wasn't for check of grouped digits. The NaN
+    // and Inf cases that are accepted by stringToDouble() could be detected
+    // using rtl::math::isFinite() on the result.
+
+    /* TODO: The grouped digits check isn't even valid for locales that do not
+     * group in thousands ... e.g. Indian locales. But that's something also
+     * the number scanner doesn't implement yet, only the formatter. */
+
+    OStringBuffer aBuf;
+
+    size_t i = 0;
+    const char* pLast = p + (n-1);
+    sal_Int32 nPosDSep = -1, nPosGSep = -1;
+    sal_uInt32 nDigitCount = 0;
+    sal_Int32 nPosExponent = -1;
+
+    // Skip preceding spaces.
+    for (i = 0; i < n; ++i, ++p)
+    {
+        char c = *p;
+        if (c != ' ')
+            // first non-space character.  Exit.
+            break;
+    }
+
+    if (i == n)
+        // the whole string is space.  Fail.
+        return false;
+
+    n -= i; // Subtract the length of the preceding spaces.
+
+    // Determine the last non-space character.
+    for (; p != pLast; --pLast, --n)
+    {
+        char c = *pLast;
+        if (c != ' ')
+            // Non space character. Exit.
+            break;
+    }
+
+    for (i = 0; i < n; ++i, ++p)
+    {
+        char c = *p;
+
+        if ('0' <= c && c <= '9')
+        {
+            // this is a digit.
+            aBuf.append(c);
+            ++nDigitCount;
+        }
+        else if (c == dsep)
+        {
+            // this is a decimal separator.
+
+            if (nPosDSep >= 0)
+                // a second decimal separator -> not a valid number.
+                return false;
+
+            if (nPosGSep >= 0 && i - nPosGSep != 4)
+                // the number has a group separator and the decimal sep is not
+                // positioned correctly.
+                return false;
+
+            nPosDSep = i;
+            nPosGSep = -1;
+            aBuf.append(c);
+            nDigitCount = 0;
+        }
+        else if (c == gsep)
+        {
+            // this is a group (thousand) separator.
+
+            if (i == 0)
+                // not allowed as the first character.
+                return false;
+
+            if (nPosDSep >= 0)
+                // not allowed after the decimal separator.
+                return false;
+
+            if (nPosGSep >= 0 && nDigitCount != 3)
+                // must be exactly 3 digits since the last group separator.
+                return false;
+
+            if (nPosExponent >= 0)
+                // not allowed in exponent.
+                return false;
+
+            nPosGSep = i;
+            nDigitCount = 0;
+        }
+        else if (c == '-' || c == '+')
+        {
+            // A sign must be the first character if it's given, or immediately
+            // follow the exponent character if present.
+            if (i == 0 || (nPosExponent >= 0 && i == static_cast<size_t>(nPosExponent+1)))
+                aBuf.append(c);
+            else
+                return false;
+        }
+        else if (c == 'E' || c == 'e')
+        {
+            // this is an exponent designator.
+
+            if (nPosExponent >= 0)
+                // Only one exponent allowed.
+                return false;
+
+            if (nPosGSep >= 0 && nDigitCount != 3)
+                // must be exactly 3 digits since the last group separator.
+                return false;
+
+            aBuf.append(c);
+            nPosExponent = i;
+            nPosDSep = -1;
+            nPosGSep = -1;
+            nDigitCount = 0;
+        }
+        else
+            return false;
+    }
+
+    // finished parsing the number.
+
+    if (nPosGSep >= 0 && nDigitCount != 3)
+        // must be exactly 3 digits since the last group separator.
+        return false;
+
+    rtl_math_ConversionStatus eStatus = rtl_math_ConversionStatus_Ok;
+    sal_Int32 nParseEnd = 0;
+    OString aString( aBuf.makeStringAndClear());
+    rVal = ::rtl::math::stringToDouble( aString, dsep, gsep, &eStatus, &nParseEnd);
+    if (eStatus != rtl_math_ConversionStatus_Ok || nParseEnd < aString.getLength())
+        // Not a valid number or not entire string consumed.
+        return false;
+
+    return true;
+}
+
 sal_Int32 ScStringUtil::GetQuotedTokenCount(const OUString &rIn, const OUString& rQuotedPairs, sal_Unicode cTok )
 {
     assert( !(rQuotedPairs.getLength()%2) );
diff --git a/sc/source/ui/docshell/datastream.cxx b/sc/source/ui/docshell/datastream.cxx
index 1b7f0d2..a21cba4 100644
--- a/sc/source/ui/docshell/datastream.cxx
+++ b/sc/source/ui/docshell/datastream.cxx
@@ -56,6 +56,8 @@ double datastream_get_time(int nIdx)
     return fTimes[ nIdx ];
 }
 
+namespace {
+
 inline double getNow()
 {
     TimeValue now;
@@ -63,6 +65,50 @@ inline double getNow()
     return static_cast<double>(now.Seconds) + static_cast<double>(now.Nanosec) / 1000000000.0;
 }
 
+#if ENABLE_ORCUS
+
+class CSVHandler
+{
+    DataStream::Line& mrLine;
+    size_t mnColCount;
+    size_t mnCols;
+    const char* mpLineHead;
+
+public:
+    CSVHandler( DataStream::Line& rLine, size_t nColCount ) :
+        mrLine(rLine), mnColCount(nColCount), mnCols(0), mpLineHead(rLine.maLine.getStr()) {}
+
+    void begin_parse() {}
+    void end_parse() {}
+    void begin_row() {}
+    void end_row() {}
+
+    void cell(const char* p, size_t n)
+    {
+        if (mnCols >= mnColCount)
+            return;
+
+        DataStream::Cell aCell;
+        if (ScStringUtil::parseSimpleNumber(p, n, '.', ',', aCell.mfValue))
+        {
+            aCell.mbValue = true;
+        }
+        else
+        {
+            aCell.mbValue = false;
+            aCell.maStr.Pos = std::distance(mpLineHead, p);
+            aCell.maStr.Size = n;
+        }
+        mrLine.maCells.push_back(aCell);
+
+        ++mnCols;
+    }
+};
+
+#endif
+
+}
+
 namespace datastreams {
 
 class CallerThread : public salhelper::Thread
@@ -96,7 +142,7 @@ private:
     }
 };
 
-void emptyLineQueue( std::queue<LinesList*>& rQueue )
+void emptyLineQueue( std::queue<DataStream::LinesType*>& rQueue )
 {
     while (!rQueue.empty())
     {
@@ -108,22 +154,34 @@ void emptyLineQueue( std::queue<LinesList*>& rQueue )
 class ReaderThread : public salhelper::Thread
 {
     SvStream *mpStream;
+    size_t mnColCount;
     bool mbTerminate;
     osl::Mutex maMtxTerminate;
 
-    std::queue<LinesList* > maPendingLines;
-    std::queue<LinesList* > maUsedLines;
+    std::queue<DataStream::LinesType*> maPendingLines;
+    std::queue<DataStream::LinesType*> maUsedLines;
     osl::Mutex maMtxLines;
 
     osl::Condition maCondReadStream;
     osl::Condition maCondConsume;
 
+#if ENABLE_ORCUS
+    orcus::csv_parser_config maConfig;
+#endif
+
 public:
 
-    ReaderThread(SvStream *pData):
+    ReaderThread(SvStream *pData, size_t nColCount):
         Thread("ReaderThread"),
         mpStream(pData),
-        mbTerminate(false) {}
+        mnColCount(nColCount),
+        mbTerminate(false)
+    {
+#if ENABLE_ORCUS
+        maConfig.delimiters.push_back(',');
+        maConfig.text_qualifier = '"';
+#endif
+    }
 
     virtual ~ReaderThread()
     {
@@ -156,9 +214,9 @@ public:
         maCondConsume.reset();
     }
 
-    LinesList* popNewLines()
+    DataStream::LinesType* popNewLines()
     {
-        LinesList* pLines = maPendingLines.front();
+        DataStream::LinesType* pLines = maPendingLines.front();
         maPendingLines.pop();
         return pLines;
     }
@@ -174,7 +232,7 @@ public:
         return !maPendingLines.empty();
     }
 
-    void pushUsedLines( LinesList* pLines )
+    void pushUsedLines( DataStream::LinesType* pLines )
     {
         maUsedLines.push(pLines);
     }
@@ -189,7 +247,7 @@ private:
     {
         while (!isTerminateRequested())
         {
-            LinesList* pLines = NULL;
+            DataStream::LinesType* pLines = NULL;
             osl::ResettableMutexGuard aGuard(maMtxLines);
 
             if (!maUsedLines.empty())
@@ -202,12 +260,20 @@ private:
             else
             {
                 aGuard.clear(); // unlock
-                pLines = new LinesList(10);
+                pLines = new DataStream::LinesType(10);
             }
 
             // Read & store new lines from stream.
-            for (size_t i = 0; i < pLines->size(); ++i)
-                mpStream->ReadLine( pLines->at(i) );
+            for (size_t i = 0, n = pLines->size(); i < n; ++i)
+            {
+                DataStream::Line& rLine = (*pLines)[i];
+                rLine.maCells.clear();
+                mpStream->ReadLine(rLine.maLine);
+
+                CSVHandler aHdl(rLine, mnColCount);
+                orcus::csv_parser<CSVHandler> parser(rLine.maLine.getStr(), rLine.maLine.getLength(), aHdl, maConfig);
+                parser.parse();
+            }
 
             aGuard.reset(); // lock
             while (!isTerminateRequested() && maPendingLines.size() >= 8)
@@ -228,6 +294,19 @@ private:
 
 }
 
+DataStream::Cell::Cell() : mfValue(0.0), mbValue(true) {}
+
+DataStream::Cell::Cell( const Cell& r ) : mbValue(r.mbValue)
+{
+    if (r.mbValue)
+        mfValue = r.mfValue;
+    else
+    {
+        maStr.Pos = r.maStr.Pos;
+        maStr.Size = r.maStr.Size;
+    }
+}
+
 void DataStream::MakeToolbarVisible()
 {
     css::uno::Reference< css::frame::XFrame > xFrame =
@@ -312,13 +391,13 @@ DataStream::~DataStream()
     delete mpLines;
 }
 
-OString DataStream::ConsumeLine()
+DataStream::Line DataStream::ConsumeLine()
 {
     if (!mpLines || mnLinesCount >= mpLines->size())
     {
         mnLinesCount = 0;
         if (mxReaderThread->isTerminateRequested())
-            return OString();
+            return Line();
 
         osl::ResettableMutexGuard aGuard(mxReaderThread->getLinesMutex());
         if (mpLines)
@@ -402,7 +481,7 @@ void DataStream::StartImport()
             pStream = new SvScriptStream(msURL);
         else
             pStream = new SvFileStream(msURL, STREAM_READ);
-        mxReaderThread = new datastreams::ReaderThread( pStream );
+        mxReaderThread = new datastreams::ReaderThread(pStream, maStartRange.aEnd.Col() - maStartRange.aStart.Col() + 1);
         mxReaderThread->launch();
     }
     mbRunning = true;
@@ -476,79 +555,10 @@ void DataStream::MoveData()
 
 #if ENABLE_ORCUS
 
-namespace {
-
-struct StrVal
-{
-    ScAddress maPos;
-    OUString maStr;
-
-    StrVal( const ScAddress& rPos, const OUString& rStr ) : maPos(rPos), maStr(rStr) {}
-};
-
-struct NumVal
-{
-    ScAddress maPos;
-    double mfVal;
-
-    NumVal( const ScAddress& rPos, double fVal ) : maPos(rPos), mfVal(fVal) {}
-};
-
-typedef std::vector<StrVal> StrValArray;
-typedef std::vector<NumVal> NumValArray;
-
-/**
- * This handler handles a single line CSV input.
- */
-class CSVHandler
-{
-    ScAddress maPos;
-    SCCOL mnEndCol;
-
-    StrValArray maStrs;
-    NumValArray maNums;
-
-public:
-    CSVHandler( const ScAddress& rPos, SCCOL nEndCol ) : maPos(rPos), mnEndCol(nEndCol) {}
-
-    void begin_parse() {}
-    void end_parse() {}
-    void begin_row() {}
-    void end_row() {}
-
-    void cell(const char* p, size_t n)
-    {
-        if (maPos.Col() <= mnEndCol)
-        {
-            OUString aStr(p, n, RTL_TEXTENCODING_UTF8);
-            double fVal;
-            if (ScStringUtil::parseSimpleNumber(aStr, '.', ',', fVal))
-                maNums.push_back(NumVal(maPos, fVal));
-            else
-                maStrs.push_back(StrVal(maPos, aStr));
-        }
-        maPos.IncCol();
-    }
-
-    const StrValArray& getStrs() const { return maStrs; }
-    const NumValArray& getNums() const { return maNums; }
-};
-
-}
-
 void DataStream::Text2Doc()
 {
-    OString aLine = ConsumeLine();
-    orcus::csv_parser_config aConfig;
-    aConfig.delimiters.push_back(',');
-    aConfig.text_qualifier = '"';
-    CSVHandler aHdl(ScAddress(maStartRange.aStart.Col(), mnCurRow, maStartRange.aStart.Tab()), maStartRange.aEnd.Col());
-    orcus::csv_parser<CSVHandler> parser(aLine.getStr(), aLine.getLength(), aHdl, aConfig);
-    parser.parse();
-
-    const StrValArray& rStrs = aHdl.getStrs();
-    const NumValArray& rNums = aHdl.getNums();
-    if (rStrs.empty() && rNums.empty() && mbRefreshOnEmptyLine)
+    Line aLine = ConsumeLine();
+    if (aLine.maCells.empty() && mbRefreshOnEmptyLine)
     {
         // Empty line detected.  Trigger refresh and discard it.
         Refresh();
@@ -559,15 +569,24 @@ void DataStream::Text2Doc()
 
     MoveData();
     {
-        StrValArray::const_iterator it = rStrs.begin(), itEnd = rStrs.end();
-        for (; it != itEnd; ++it)
-            maDocAccess.setStringCell(it->maPos, it->maStr);
-    }
-
-    {
-        NumValArray::const_iterator it = rNums.begin(), itEnd = rNums.end();
-        for (; it != itEnd; ++it)
-            maDocAccess.setNumericCell(it->maPos, it->mfVal);
+        std::vector<Cell>::const_iterator it = aLine.maCells.begin(), itEnd = aLine.maCells.end();
+        SCCOL nCol = maStartRange.aStart.Col();
+        const char* pLineHead = aLine.maLine.getStr();
+        for (; it != itEnd; ++it, ++nCol)
+        {
+            const Cell& rCell = *it;
+            if (rCell.mbValue)
+            {
+                maDocAccess.setNumericCell(
+                    ScAddress(nCol, mnCurRow, maStartRange.aStart.Tab()), rCell.mfValue);
+            }
+            else
+            {
+                maDocAccess.setStringCell(
+                    ScAddress(nCol, mnCurRow, maStartRange.aStart.Tab()),
+                    OUString(pLineHead+rCell.maStr.Pos, rCell.maStr.Size, RTL_TEXTENCODING_UTF8));
+            }
+        }
     }
 
     fTimes[ DEBUG_TIME_IMPORT ] = getNow() - fStart;
diff --git a/sc/source/ui/inc/datastream.hxx b/sc/source/ui/inc/datastream.hxx
index 5a4d8cd..5af2dc7 100644
--- a/sc/source/ui/inc/datastream.hxx
+++ b/sc/source/ui/inc/datastream.hxx
@@ -33,15 +33,37 @@ namespace datastreams {
     class ReaderThread;
 }
 
-typedef std::vector<OString> LinesList;
 
 class DataStream : boost::noncopyable
 {
-    OString ConsumeLine();
-    void MoveData();
-    void Text2Doc();
-
 public:
+    struct Cell
+    {
+        struct Str
+        {
+            size_t Pos;
+            size_t Size;
+        };
+
+        union
+        {
+            Str maStr;
+            double mfValue;
+        };
+
+        bool mbValue;
+
+        Cell();
+        Cell( const Cell& r );
+    };
+
+    struct Line
+    {
+        OString maLine;
+        std::vector<Cell> maCells;
+    };
+    typedef std::vector<Line> LinesType;
+
     enum MoveType { NO_MOVE, RANGE_DOWN, MOVE_DOWN, MOVE_UP };
     enum { SCRIPT_STREAM = 1, VALUES_IN_LINE = 2 };
 
@@ -75,6 +97,9 @@ public:
     void SetRefreshOnEmptyLine( bool bVal );
 
 private:
+    Line ConsumeLine();
+    void MoveData();
+    void Text2Doc();
     void Refresh();
 
 private:
@@ -89,7 +114,7 @@ private:
     bool mbRunning;
     bool mbValuesInLine;
     bool mbRefreshOnEmptyLine;
-    LinesList* mpLines;
+    LinesType* mpLines;
     size_t mnLinesCount;
     size_t mnLinesSinceRefresh;
     double mfLastRefreshTime;
commit fa0ad32a016e011394bde307e126ad385e6aa68b
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date:   Fri Dec 27 23:22:54 2013 -0500

    Disallow direct access to member variables.
    
    Change-Id: I82d6c2a2c2844fbb6c2976327b129e42f6b63053

diff --git a/sc/source/ui/docshell/datastream.cxx b/sc/source/ui/docshell/datastream.cxx
index 6a8e61a..1b7f0d2 100644
--- a/sc/source/ui/docshell/datastream.cxx
+++ b/sc/source/ui/docshell/datastream.cxx
@@ -110,12 +110,15 @@ class ReaderThread : public salhelper::Thread
     SvStream *mpStream;
     bool mbTerminate;
     osl::Mutex maMtxTerminate;
-public:
-    osl::Condition maProduceResume;
-    osl::Condition maConsumeResume;
-    osl::Mutex maMtxLines;
+
     std::queue<LinesList* > maPendingLines;
     std::queue<LinesList* > maUsedLines;
+    osl::Mutex maMtxLines;
+
+    osl::Condition maCondReadStream;
+    osl::Condition maCondConsume;
+
+public:
 
     ReaderThread(SvStream *pData):
         Thread("ReaderThread"),
@@ -144,7 +147,41 @@ public:
     void endThread()
     {
         requestTerminate();
-        maProduceResume.set();
+        maCondReadStream.set();
+    }
+
+    void waitForNewLines()
+    {
+        maCondConsume.wait();
+        maCondConsume.reset();
+    }
+
+    LinesList* popNewLines()
+    {
+        LinesList* pLines = maPendingLines.front();
+        maPendingLines.pop();
+        return pLines;
+    }
+
+    void resumeReadStream()
+    {
+        if (maPendingLines.size() <= 4)
+            maCondReadStream.set(); // start producer again
+    }
+
+    bool hasNewLines()
+    {
+        return !maPendingLines.empty();
+    }
+
+    void pushUsedLines( LinesList* pLines )
+    {
+        maUsedLines.push(pLines);
+    }
+
+    osl::Mutex& getLinesMutex()
+    {
+        return maMtxLines;
     }
 
 private:
@@ -157,6 +194,7 @@ private:
 
             if (!maUsedLines.empty())
             {
+                // Re-use lines from previous runs.
                 pLines = maUsedLines.front();
                 maUsedLines.pop();
                 aGuard.clear(); // unlock
@@ -167,6 +205,7 @@ private:
                 pLines = new LinesList(10);
             }
 
+            // Read & store new lines from stream.
             for (size_t i = 0; i < pLines->size(); ++i)
                 mpStream->ReadLine( pLines->at(i) );
 
@@ -175,12 +214,12 @@ private:
             {
                 // pause reading for a bit
                 aGuard.clear(); // unlock
-                maProduceResume.wait();
-                maProduceResume.reset();
+                maCondReadStream.wait();
+                maCondReadStream.reset();
                 aGuard.reset(); // lock
             }
             maPendingLines.push(pLines);
-            maConsumeResume.set();
+            maCondConsume.set();
             if (!mpStream->good())
                 requestTerminate();
         }
@@ -281,22 +320,19 @@ OString DataStream::ConsumeLine()
         if (mxReaderThread->isTerminateRequested())
             return OString();
 
-        osl::ResettableMutexGuard aGuard(mxReaderThread->maMtxLines);
+        osl::ResettableMutexGuard aGuard(mxReaderThread->getLinesMutex());
         if (mpLines)
-            mxReaderThread->maUsedLines.push(mpLines);
+            mxReaderThread->pushUsedLines(mpLines);
 
-        while (mxReaderThread->maPendingLines.empty())
+        while (!mxReaderThread->hasNewLines())
         {
             aGuard.clear(); // unlock
-            mxReaderThread->maConsumeResume.wait();
-            mxReaderThread->maConsumeResume.reset();
+            mxReaderThread->waitForNewLines();
             aGuard.reset(); // lock
         }
 
-        mpLines = mxReaderThread->maPendingLines.front();
-        mxReaderThread->maPendingLines.pop();
-        if (mxReaderThread->maPendingLines.size() <= 4)
-            mxReaderThread->maProduceResume.set(); // start producer again
+        mpLines = mxReaderThread->popNewLines();
+        mxReaderThread->resumeReadStream();
     }
     return mpLines->at(mnLinesCount++);
 }
commit 79a9754441b605c025f92bc446c325b69238e4b1
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date:   Fri Dec 27 22:40:14 2013 -0500

    Protect access to the terminate flag.
    
    Change-Id: I9c47e8f114f3d4dcdd5e62b1fffd2b65e7bfb00e

diff --git a/sc/source/ui/docshell/datastream.cxx b/sc/source/ui/docshell/datastream.cxx
index d71233b..6a8e61a 100644
--- a/sc/source/ui/docshell/datastream.cxx
+++ b/sc/source/ui/docshell/datastream.cxx
@@ -108,20 +108,19 @@ void emptyLineQueue( std::queue<LinesList*>& rQueue )
 class ReaderThread : public salhelper::Thread
 {
     SvStream *mpStream;
+    bool mbTerminate;
+    osl::Mutex maMtxTerminate;
 public:
-    bool mbTerminateReading;
     osl::Condition maProduceResume;
     osl::Condition maConsumeResume;
-    osl::Mutex maLinesProtector;
+    osl::Mutex maMtxLines;
     std::queue<LinesList* > maPendingLines;
     std::queue<LinesList* > maUsedLines;
 
     ReaderThread(SvStream *pData):
-        Thread("ReaderThread")
-        ,mpStream(pData)
-        ,mbTerminateReading(false)
-    {
-    }
+        Thread("ReaderThread"),
+        mpStream(pData),
+        mbTerminate(false) {}
 
     virtual ~ReaderThread()
     {
@@ -130,19 +129,31 @@ public:
         emptyLineQueue(maUsedLines);
     }
 
+    bool isTerminateRequested()
+    {
+        osl::MutexGuard aGuard(maMtxTerminate);
+        return mbTerminate;
+    }
+
+    void requestTerminate()
+    {
+        osl::MutexGuard aGuard(maMtxTerminate);
+        mbTerminate = true;
+    }
+
     void endThread()
     {
-        mbTerminateReading = true;
+        requestTerminate();
         maProduceResume.set();
     }
 
 private:
     virtual void execute() SAL_OVERRIDE
     {
-        while (!mbTerminateReading)
+        while (!isTerminateRequested())
         {
             LinesList* pLines = NULL;
-            osl::ResettableMutexGuard aGuard(maLinesProtector);
+            osl::ResettableMutexGuard aGuard(maMtxLines);
 
             if (!maUsedLines.empty())
             {
@@ -160,7 +171,7 @@ private:
                 mpStream->ReadLine( pLines->at(i) );
 
             aGuard.reset(); // lock
-            while (!mbTerminateReading && maPendingLines.size() >= 8)
+            while (!isTerminateRequested() && maPendingLines.size() >= 8)
             {
                 // pause reading for a bit
                 aGuard.clear(); // unlock
@@ -171,7 +182,7 @@ private:
             maPendingLines.push(pLines);
             maConsumeResume.set();
             if (!mpStream->good())
-                mbTerminateReading = true;
+                requestTerminate();
         }
     }
 };
@@ -267,11 +278,13 @@ OString DataStream::ConsumeLine()
     if (!mpLines || mnLinesCount >= mpLines->size())
     {
         mnLinesCount = 0;
-        if (mxReaderThread->mbTerminateReading)
+        if (mxReaderThread->isTerminateRequested())
             return OString();
-        osl::ResettableMutexGuard aGuard(mxReaderThread->maLinesProtector);
+
+        osl::ResettableMutexGuard aGuard(mxReaderThread->maMtxLines);
         if (mpLines)
             mxReaderThread->maUsedLines.push(mpLines);
+
         while (mxReaderThread->maPendingLines.empty())
         {
             aGuard.clear(); // unlock
@@ -279,6 +292,7 @@ OString DataStream::ConsumeLine()
             mxReaderThread->maConsumeResume.reset();
             aGuard.reset(); // lock
         }
+
         mpLines = mxReaderThread->maPendingLines.front();
         mxReaderThread->maPendingLines.pop();
         if (mxReaderThread->maPendingLines.size() <= 4)
commit 92e5b50c2c7926a226a3a698d568610fa1f465ed
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date:   Fri Dec 27 21:57:25 2013 -0500

    Misc cleanup.
    
    Change-Id: Ia3d0f2e098804dabdbdd324562097b9f69528d35

diff --git a/sc/source/ui/docshell/datastream.cxx b/sc/source/ui/docshell/datastream.cxx
index 4e7e1ee..d71233b 100644
--- a/sc/source/ui/docshell/datastream.cxx
+++ b/sc/source/ui/docshell/datastream.cxx
@@ -96,6 +96,15 @@ private:
     }
 };
 
+void emptyLineQueue( std::queue<LinesList*>& rQueue )
+{
+    while (!rQueue.empty())
+    {
+        delete rQueue.front();
+        rQueue.pop();
+    }
+}
+
 class ReaderThread : public salhelper::Thread
 {
     SvStream *mpStream;
@@ -117,23 +126,14 @@ public:
     virtual ~ReaderThread()
     {
         delete mpStream;
-        while (!maPendingLines.empty())
-        {
-            delete maPendingLines.front();
-            maPendingLines.pop();
-        }
-        while (!maUsedLines.empty())
-        {
-            delete maUsedLines.front();
-            maUsedLines.pop();
-        }
+        emptyLineQueue(maPendingLines);
+        emptyLineQueue(maUsedLines);
     }
 
     void endThread()
     {
         mbTerminateReading = true;
         maProduceResume.set();
-        join();
     }
 
 private:
@@ -141,8 +141,9 @@ private:
     {
         while (!mbTerminateReading)
         {
-            LinesList *pLines = 0;
+            LinesList* pLines = NULL;
             osl::ResettableMutexGuard aGuard(maLinesProtector);
+
             if (!maUsedLines.empty())
             {
                 pLines = maUsedLines.front();
@@ -154,11 +155,14 @@ private:
                 aGuard.clear(); // unlock
                 pLines = new LinesList(10);
             }
+
             for (size_t i = 0; i < pLines->size(); ++i)
                 mpStream->ReadLine( pLines->at(i) );
+
             aGuard.reset(); // lock
             while (!mbTerminateReading && maPendingLines.size() >= 8)
-            { // pause reading for a bit
+            {
+                // pause reading for a bit
                 aGuard.clear(); // unlock
                 maProduceResume.wait();
                 maProduceResume.reset();
@@ -251,7 +255,10 @@ DataStream::~DataStream()
     mxThread->maStart.set();
     mxThread->join();
     if (mxReaderThread.is())
+    {
         mxReaderThread->endThread();
+        mxReaderThread->join();
+    }
     delete mpLines;
 }
 
commit 8591de009a4fed6264f236bbcafb2accae70754f
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Mon Dec 30 14:14:38 2013 +0100

    Related: fdo#70624 RTF export: fix crash when header contains a page break
    
    I don't even try to imagine how such a thing can be created and/or how
    layout should handle that; but it turns out that the ODT bugdoc indeed
    contains a fo:break-before="page" in the header, and we at least should
    not crash on it.
    
    Fix the problem by simple moving the init of m_pSections before the
    WritePageDescTable() call.
    
    Change-Id: If414e2f6184c58fcfd8b761d3b43fa0fc22d3903

diff --git a/sw/qa/core/exportdata/rtf/pass/fdo70624.odt b/sw/qa/core/exportdata/rtf/pass/fdo70624.odt
new file mode 100644
index 0000000..1b177e8
Binary files /dev/null and b/sw/qa/core/exportdata/rtf/pass/fdo70624.odt differ
diff --git a/sw/source/filter/ww8/rtfexport.cxx b/sw/source/filter/ww8/rtfexport.cxx
index 89539ea..5113f93 100644
--- a/sw/source/filter/ww8/rtfexport.cxx
+++ b/sw/source/filter/ww8/rtfexport.cxx
@@ -525,6 +525,9 @@ void RtfExport::ExportDocument_Impl()
     // Record changes?
     if (nsRedlineMode_t::REDLINE_ON & mnRedlineMode)
         Strm() << OOO_STRING_SVTOOLS_RTF_REVISIONS;
+    // Init sections
+    m_pSections = new MSWordSections( *this );
+
     // Page description
     WritePageDescTable();
 
@@ -693,9 +696,6 @@ void RtfExport::ExportDocument_Impl()
 
     Strm() << SAL_NEWLINE_STRING;
 
-    // Init sections
-    m_pSections = new MSWordSections( *this );
-
     WriteMainText();
 
     Strm() << '}';
commit ee6eadfc617a1ce3bc2b489523ac713b99482404
Author: Muthu Subramanian <sumuthu at collabora.com>
Date:   Mon Dec 30 18:05:48 2013 +0530

    fdo#72998: Add unit test case.

diff --git a/sd/qa/unit/data/pptx/cshapes.pptx b/sd/qa/unit/data/pptx/cshapes.pptx
new file mode 100644
index 0000000..b546206
Binary files /dev/null and b/sd/qa/unit/data/pptx/cshapes.pptx differ
diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx
index cd6f9b0..015b6e1 100644
--- a/sd/qa/unit/import-tests.cxx
+++ b/sd/qa/unit/import-tests.cxx
@@ -22,6 +22,7 @@
 #include <rsc/rscsfx.hxx>
 
 #include <svx/svdotext.hxx>
+#include <svx/svdoashp.hxx>
 #include <animations/animationnodehelper.hxx>
 
 #include <com/sun/star/drawing/XDrawPage.hpp>
@@ -57,6 +58,7 @@ public:
     void testN828390_4();
     void testN828390_5();
     void testFdo68594();
+    void testFdo72998();
 
     CPPUNIT_TEST_SUITE(SdFiltersTest);
     CPPUNIT_TEST(testDocumentLayout);
@@ -71,6 +73,7 @@ public:
     CPPUNIT_TEST(testN828390_4);
     CPPUNIT_TEST(testN828390_5);
     CPPUNIT_TEST(testFdo68594);
+    CPPUNIT_TEST(testFdo72998);
 
     CPPUNIT_TEST_SUITE_END();
 };
@@ -389,6 +392,29 @@ void SdFiltersTest::testFdo68594()
     CPPUNIT_ASSERT_MESSAGE( "Placeholder color mismatch", pC->GetValue().GetColor() == 0);
 }
 
+void SdFiltersTest::testFdo72998()
+{
+    ::sd::DrawDocShellRef xDocShRef = loadURL(getURLFromSrc("/sd/qa/unit/data/pptx/cshapes.pptx"));
+    CPPUNIT_ASSERT_MESSAGE( "failed to load", xDocShRef.Is() );
+    CPPUNIT_ASSERT_MESSAGE( "not in destruction", !xDocShRef->IsInDestruction() );
+
+    SdDrawDocument *pDoc = xDocShRef->GetDoc();
+    CPPUNIT_ASSERT_MESSAGE( "no document", pDoc != NULL );
+    const SdrPage *pPage = pDoc->GetPage(1);
+    CPPUNIT_ASSERT_MESSAGE( "no page", pPage != NULL );
+    {
+        SdrObjCustomShape *pObj = dynamic_cast<SdrObjCustomShape *>(pPage->GetObj(2));
+        const SdrCustomShapeGeometryItem& rGeometryItem = (const SdrCustomShapeGeometryItem&)pObj->GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY );
+        CPPUNIT_ASSERT_MESSAGE( "not a custom shape", pObj );
+        const ::com::sun::star::uno::Any* pViewBox = ((SdrCustomShapeGeometryItem&)rGeometryItem).GetPropertyValueByName( OUString( "ViewBox" ) );
+        CPPUNIT_ASSERT_MESSAGE( "Missing ViewBox", pViewBox );
+        com::sun::star::awt::Rectangle aViewBox;
+        CPPUNIT_ASSERT( (*pViewBox >>= aViewBox ) );
+        CPPUNIT_ASSERT_MESSAGE( "Width should be zero - for forcing scale to 1", !aViewBox.Width );
+        CPPUNIT_ASSERT_MESSAGE( "Height should be zero - for forcing scale to 1", !aViewBox.Height );
+    }
+}
+
 void SdFiltersTest::testFdo64512()
 {
     ::sd::DrawDocShellRef xDocShRef = loadURL(getURLFromSrc("/sd/qa/unit/data/fdo64512.odp"));
commit b104133abe2a377f1397cce3fa6e1bc7d85d4020
Author: Julien Nabet <serval2412 at yahoo.fr>
Date:   Mon Dec 30 11:37:00 2013 +0100

    Resolves: fdo#73137 undo name for 'Covariance' is different
    
    Change-Id: I7e151ee99ef644090608fd861c9fae83c3206c1d

diff --git a/sc/source/ui/StatisticsDialogs/CovarianceDialog.cxx b/sc/source/ui/StatisticsDialogs/CovarianceDialog.cxx
index 432ca46..1054d77 100644
--- a/sc/source/ui/StatisticsDialogs/CovarianceDialog.cxx
+++ b/sc/source/ui/StatisticsDialogs/CovarianceDialog.cxx
@@ -28,6 +28,11 @@ ScCovarianceDialog::ScCovarianceDialog(
             "CovarianceDialog", "modules/scalc/ui/covariancedialog.ui" )
 {}
 
+sal_Int16 ScCovarianceDialog::GetUndoNameId()
+{
+    return STR_COVARIANCE_UNDO_NAME;
+}
+
 sal_Bool ScCovarianceDialog::Close()
 {
     return DoClose( ScCovarianceDialogWrapper::GetChildWindowId() );
diff --git a/sc/source/ui/inc/CovarianceDialog.hxx b/sc/source/ui/inc/CovarianceDialog.hxx
index 9325af2..8361cd1 100644
--- a/sc/source/ui/inc/CovarianceDialog.hxx
+++ b/sc/source/ui/inc/CovarianceDialog.hxx
@@ -25,6 +25,7 @@ public:
 protected:
     virtual const OUString getLabel();
     virtual const OUString getTemplate();
+    virtual sal_Int16 GetUndoNameId();
 };
 
 #endif
commit 0b236154c3a664739761c22670729915116c1c74
Author: Julien Nabet <serval2412 at yahoo.fr>
Date:   Mon Dec 30 10:54:25 2013 +0100

    Resolves: fdo#73138 undo name for 'Chi Squared' is different
    
    Change-Id: Iedb01a2bd08f56befb351d00cebd0fb20b57def4

diff --git a/sc/source/ui/StatisticsDialogs/StatisticsDialogs.src b/sc/source/ui/StatisticsDialogs/StatisticsDialogs.src
index 5af2f07..1ab64d5 100644
--- a/sc/source/ui/StatisticsDialogs/StatisticsDialogs.src
+++ b/sc/source/ui/StatisticsDialogs/StatisticsDialogs.src
@@ -213,7 +213,7 @@ Resource RID_STATISTICS_DLGS
     };
     String STR_DISTRIBUTION_CHI_SQUARED
     {
-        Text [ en-US ] = "Geometric";
+        Text [ en-US ] = "Chi Squared";
     };
     String STR_DISTRIBUTION_GEOMETRIC
     {
commit 24b89acffeafe4361a63121b8ec2463c97f863e9
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Dec 30 00:47:02 2013 +0000

    valgrind: invalid read on deleted SwPageFrm
    
    VALGRIND=memcheck make CppunitTest_sw_ooxmlimport
    
    ==2829== Invalid read of size 2
    ==2829==    at 0x10B9A2CC: SwPageFrm::GetPhyPageNum() const (pagefrm.hxx:191)
    ==2829==    by 0x1107A768: SwLayAction::InternalAction() (layact.cxx:573)
    ==2829==    by 0x1107A0B6: SwLayAction::Action() (layact.cxx:448)
    ==2829==    by 0x114E025E: SwViewShell::CalcLayout() (viewsh.cxx:915)
    ==2829==    by 0xFC52E5B: SwModelTestBase::calcLayout() (swmodeltestbase.hxx:214)
    ==2829==    by 0xFC54167: SwModelTestBase::load(char const*, char const*) (swmodeltestbase.hxx:425)
    ==2829==    by 0xFC52A74: SwModelTestBase::executeImportTest(char const*) (swmodeltestbase.hxx:131)
    ==2829==    by 0xFC6B046: testN830205::Import() (ooxmlimport.cxx:1248)
    ==2829==    by 0xFC99A6B: CppUnit::TestCaller<testN830205>::runTest() (TestCaller.h:166)
    ==2829==    by 0x4CAE1D3: CppUnit::TestCaseMethodFunctor::operator()() const (TestCase.cpp:32)
    ==2829==    by 0xCF009E2: (anonymous namespace)::Prot::protect(CppUnit::Functor const&, CppUnit::ProtectorContext const&) (unobootstrapprotector.cxx:88)
    ==2829==    by 0x4CA630E: CppUnit::ProtectorChain::ProtectFunctor::operator()() const (ProtectorChain.cpp:20)
    ==2829==    by 0xBB0E535: (anonymous namespace)::Prot::protect(CppUnit::Functor const&, CppUnit::ProtectorContext const&) (unoexceptionprotector.cxx:64)
    ==2829==    by 0x4CA630E: CppUnit::ProtectorChain::ProtectFunctor::operator()() const (ProtectorChain.cpp:20)
    ==2829==    by 0x4C97C83: CppUnit::DefaultProtector::protect(CppUnit::Functor const&, CppUnit::ProtectorContext const&) (DefaultProtector.cpp:15)
    ==2829==    by 0x4CA630E: CppUnit::ProtectorChain::ProtectFunctor::operator()() const (ProtectorChain.cpp:20)
    ==2829==    by 0x4CA61A3: CppUnit::ProtectorChain::protect(CppUnit::Functor const&, CppUnit::ProtectorContext const&) (ProtectorChain.cpp:77)
    ==2829==    by 0x4CBD3B9: CppUnit::TestResult::protect(CppUnit::Functor const&, CppUnit::Test*, std::string const&) (TestResult.cpp:181)
    ==2829==    by 0x4CADCA3: CppUnit::TestCase::run(CppUnit::TestResult*) (TestCase.cpp:92)
    ==2829==    by 0x4CAEA3F: CppUnit::TestComposite::doRunChildTests(CppUnit::TestResult*) (TestComposite.cpp:64)
    ==2829==    by 0x4CAE8C9: CppUnit::TestComposite::run(CppUnit::TestResult*) (TestComposite.cpp:23)
    ==2829==    by 0x4CAEA3F: CppUnit::TestComposite::doRunChildTests(CppUnit::TestResult*) (TestComposite.cpp:64)
    ==2829==    by 0x4CAE8C9: CppUnit::TestComposite::run(CppUnit::TestResult*) (TestComposite.cpp:23)
    ==2829==    by 0x4CC45A5: CppUnit::TestRunner::WrappingSuite::run(CppUnit::TestResult*) (TestRunner.cpp:47)
    ==2829==    by 0x4CBD0C3: CppUnit::TestResult::runTest(CppUnit::Test*) (TestResult.cpp:148)
    ==2829==    by 0x4CC4803: CppUnit::TestRunner::run(CppUnit::TestResult&, std::string const&) (TestRunner.cpp:96)
    ==2829==    by 0x403F3E: (anonymous namespace)::ProtectedFixtureFunctor::run() const (cppunittester.cxx:150)
    ==2829==    by 0x4045C6: sal_main() (cppunittester.cxx:242)
    ==2829==    by 0x40420E: main (cppunittester.cxx:166)
    ==2829==  Address 0x2b4bbd48 is 312 bytes inside a block of size 320 free'd
    ==2829==    at 0x4A074C4: free (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
    ==2829==    by 0x4F386E7: rtl_freeMemory_SYSTEM(void*) (alloc_global.cxx:276)
    ==2829==    by 0x4F3899E: rtl_freeMemory (alloc_global.cxx:346)
    ==2829==    by 0x4F37494: rtl_cache_free (alloc_cache.cxx:1231)
    ==2829==    by 0x13D7EF6D: FixedMemPool::Free(void*) (mempool.cxx:48)
    ==2829==    by 0x1106890F: SwPageFrm::operator delete(void*, unsigned long) (in /home/caolan/LibreOffice/core/instdir/program/libswlo.so)
    ==2829==    by 0x110A113A: SwPageFrm::~SwPageFrm() (pagechg.cxx:301)
    ==2829==    by 0x110A3713: SwFrm::CheckPageDescs(SwPageFrm*, unsigned char) (pagechg.cxx:1122)
    ==2829==    by 0x1107A717: SwLayAction::InternalAction() (layact.cxx:566)
    ==2829==    by 0x1107A0B6: SwLayAction::Action() (layact.cxx:448)
    ==2829==    by 0x114E025E: SwViewShell::CalcLayout() (viewsh.cxx:915)
    ==2829==    by 0xFC52E5B: SwModelTestBase::calcLayout() (swmodeltestbase.hxx:214)
    ==2829==    by 0xFC54167: SwModelTestBase::load(char const*, char const*) (swmodeltestbase.hxx:425)
    ==2829==    by 0xFC52A74: SwModelTestBase::executeImportTest(char const*) (swmodeltestbase.hxx:131)
    ==2829==    by 0xFC6B046: testN830205::Import() (ooxmlimport.cxx:1248)
    ==2829==    by 0xFC99A6B: CppUnit::TestCaller<testN830205>::runTest() (TestCaller.h:166)
    ==2829==    by 0x4CAE1D3: CppUnit::TestCaseMethodFunctor::operator()() const (TestCase.cpp:32)
    ==2829==    by 0xCF009E2: (anonymous namespace)::Prot::protect(CppUnit::Functor const&, CppUnit::ProtectorContext const&) (unobootstrapprotector.cxx:88)
    ==2829==    by 0x4CA630E: CppUnit::ProtectorChain::ProtectFunctor::operator()() const (ProtectorChain.cpp:20)
    ==2829==    by 0xBB0E535: (anonymous namespace)::Prot::protect(CppUnit::Functor const&, CppUnit::ProtectorContext const&) (unoexceptionprotector.cxx:64)
    ==2829==    by 0x4CA630E: CppUnit::ProtectorChain::ProtectFunctor::operator()() const (ProtectorChain.cpp:20)
    ==2829==    by 0x4C97C83: CppUnit::DefaultProtector::protect(CppUnit::Functor const&, CppUnit::ProtectorContext const&) (DefaultProtector.cpp:15)
    ==2829==    by 0x4CA630E: CppUnit::ProtectorChain::ProtectFunctor::operator()() const (ProtectorChain.cpp:20)
    ==2829==    by 0x4CA61A3: CppUnit::ProtectorChain::protect(CppUnit::Functor const&, CppUnit::ProtectorContext const&) (ProtectorChain.cpp:77)
    ==2829==    by 0x4CBD3B9: CppUnit::TestResult::protect(CppUnit::Functor const&, CppUnit::Test*, std::string const&) (TestResult.cpp:181)
    ==2829==    by 0x4CADCA3: CppUnit::TestCase::run(CppUnit::TestResult*) (TestCase.cpp:92)
    ==2829==    by 0x4CAEA3F: CppUnit::TestComposite::doRunChildTests(CppUnit::TestResult*) (TestComposite.cpp:64)
    ==2829==    by 0x4CAE8C9: CppUnit::TestComposite::run(CppUnit::TestResult*) (TestComposite.cpp:23)
    ==2829==    by 0x4CAEA3F: CppUnit::TestComposite::doRunChildTests(CppUnit::TestResult*) (TestComposite.cpp:64)
    ==2829==    by 0x4CAE8C9: CppUnit::TestComposite::run(CppUnit::TestResult*) (TestComposite.cpp:23)
    ==2829==    by 0x4CC45A5: CppUnit::TestRunner::WrappingSuite::run(CppUnit::TestResult*) (TestRunner.cpp:47)
    ==2829==    by 0x4CBD0C3: CppUnit::TestResult::runTest(CppUnit::Test*) (TestResult.cpp:148)
    ==2829==    by 0x4CC4803: CppUnit::TestRunner::run(CppUnit::TestResult&, std::string const&) (TestRunner.cpp:96)
    ==2829==    by 0x403F3E: (anonymous namespace)::ProtectedFixtureFunctor::run() const (cppunittester.cxx:150)
    ==2829==    by 0x4045C6: sal_main() (cppunittester.cxx:242)
    ==2829==    by 0x40420E: main (cppunittester.cxx:166)
    
    Revert "Revert "bnc#382137 SwFrm::CheckPageDescs: notify clients about deleted SwPageFrm""
    
    This reverts commit 97035c95c27b34313eadd09692804045f67f440a seeing as the modified
    SwFrm::CheckPageDescs that updates the passed in previous page if it will be
    deleted is better than crashing and adds it to the other callsite that deletes the
    page.
    
    Change-Id: I653bab423ffa704aef45c2a7b2ac0699b72e9d3a

diff --git a/sw/source/core/inc/frame.hxx b/sw/source/core/inc/frame.hxx
index 36a9622..721deee 100644
--- a/sw/source/core/inc/frame.hxx
+++ b/sw/source/core/inc/frame.hxx
@@ -598,7 +598,7 @@ public:
     inline void SetFixSize( sal_Bool bNew ) { mbFixSize = bNew; }
 
     // check all pages (starting from the given) and correct them if needed
-    static void CheckPageDescs( SwPageFrm *pStart, sal_Bool bNotifyFields = sal_True );
+    static void CheckPageDescs( SwPageFrm *pStart, sal_Bool bNotifyFields = sal_True, SwPageFrm** ppPrev = 0);
 
     // might return 0, with and without const
     SwFrm               *GetNext()  { return mpNext; }
diff --git a/sw/source/core/layout/layact.cxx b/sw/source/core/layout/layact.cxx
index 4325e38..033ed4a 100644
--- a/sw/source/core/layout/layact.cxx
+++ b/sw/source/core/layout/layact.cxx
@@ -563,7 +563,7 @@ void SwLayAction::InternalAction()
             SwPageFrm *pTmp = pPage->GetPrev() ?
                                         (SwPageFrm*)pPage->GetPrev() : pPage;
             SetCheckPages( sal_True );
-            SwFrm::CheckPageDescs( pPage );
+            SwFrm::CheckPageDescs( pPage, sal_True, &pTmp );
             SetCheckPages( sal_False );
             nCheckPageNum = USHRT_MAX;
             pPage = pTmp;
diff --git a/sw/source/core/layout/pagechg.cxx b/sw/source/core/layout/pagechg.cxx
index 2cfb864..0cbf9f3 100644
--- a/sw/source/core/layout/pagechg.cxx
+++ b/sw/source/core/layout/pagechg.cxx
@@ -1044,7 +1044,7 @@ void SwPageFrm::PrepareRegisterChg()
 |*      einfache zu bereinigen.
 |*
 |*************************************************************************/
-void SwFrm::CheckPageDescs( SwPageFrm *pStart, sal_Bool bNotifyFields )
+void SwFrm::CheckPageDescs( SwPageFrm *pStart, sal_Bool bNotifyFields, SwPageFrm** ppPrev )
 {
     OSL_ENSURE( pStart, "Keine Startpage." );
 
@@ -1119,10 +1119,15 @@ void SwFrm::CheckPageDescs( SwPageFrm *pStart, sal_Bool bNotifyFields )
             {
                 SwPageFrm *pTmp = (SwPageFrm*)pPage->GetNext();
                 pPage->Cut();
+                bool bUpdatePrev = false;
+                if (ppPrev && *ppPrev == pPage)
+                    bUpdatePrev = true;
                 delete pPage;
                 if ( pStart == pPage )
                     pStart = pTmp;
                 pPage = pTmp;
+                if (bUpdatePrev)
+                    *ppPrev = pTmp;
                 continue;
             }
             else if ( pPage->IsEmptyPage() && !pFmtWish &&  //2.
@@ -1199,10 +1204,15 @@ void SwFrm::CheckPageDescs( SwPageFrm *pStart, sal_Bool bNotifyFields )
                 //Nachfolger, also ist die Leerseite ueberfluessig.
                 SwPageFrm *pTmp = (SwPageFrm*)pPage->GetNext();
                 pPage->Cut();
+                bool bUpdatePrev = false;
+                if (ppPrev && *ppPrev == pPage)
+                    bUpdatePrev = true;
                 delete pPage;
                 if ( pStart == pPage )
                     pStart = pTmp;
                 pPage = pTmp;
+                if (bUpdatePrev)
+                    *ppPrev = pTmp;
                 continue;
             }
         }
commit 5249a2022aa7152cba5bb6541eade43b9e77b755
Author: Steve Yin <steve_y at apache.org>
Date:   Fri Dec 27 05:30:08 2013 +0000

    Resolves: #i123910# reference in validation condition changed...
    
    to #REF! in exported xls file
    
    (cherry picked from commit 81912caea58b89f9490ba4b9e3a3127071e23190)
    
    Change-Id: Iab560847f4528ffdcc68b365951cc6c55ca9075c

diff --git a/sc/source/filter/inc/worksheethelper.hxx b/sc/source/filter/inc/worksheethelper.hxx
index 9e23161..d93ccc4 100644
--- a/sc/source/filter/inc/worksheethelper.hxx
+++ b/sc/source/filter/inc/worksheethelper.hxx
@@ -152,6 +152,7 @@ struct ValidationModel
     ApiCellRangeList    maRanges;
     ApiTokenSequence    maTokens1;
     ApiTokenSequence    maTokens2;
+    OUString     msRef;
     OUString     maInputTitle;
     OUString     maInputMessage;
     OUString     maErrorTitle;
diff --git a/sc/source/filter/oox/worksheetfragment.cxx b/sc/source/filter/oox/worksheetfragment.cxx
index 927eb2b..81b6411b 100644
--- a/sc/source/filter/oox/worksheetfragment.cxx
+++ b/sc/source/filter/oox/worksheetfragment.cxx
@@ -147,6 +147,7 @@ void DataValidationsContext::importDataValidation( const AttributeList& rAttribs
 {
     mxValModel.reset( new ValidationModel );
     getAddressConverter().convertToCellRangeList( mxValModel->maRanges, rAttribs.getString( XML_sqref, OUString() ), getSheetIndex(), true );
+    mxValModel->msRef          = rAttribs.getString( XML_sqref, OUString() );
     mxValModel->maInputTitle   = rAttribs.getXString( XML_promptTitle, OUString() );
     mxValModel->maInputMessage = rAttribs.getXString( XML_prompt, OUString() );
     mxValModel->maErrorTitle   = rAttribs.getXString( XML_errorTitle, OUString() );
diff --git a/sc/source/filter/oox/worksheethelper.cxx b/sc/source/filter/oox/worksheethelper.cxx
index 5974560..47b759d 100644
--- a/sc/source/filter/oox/worksheethelper.cxx
+++ b/sc/source/filter/oox/worksheethelper.cxx
@@ -1103,6 +1103,26 @@ void WorksheetGlobals::finalizeValidationRanges() const
         {
             PropertySet aValProps( xValidation );
 
+            try
+            {
+                sal_Int32 nIndex = 0;
+                OUString aToken = aIt->msRef.getToken( 0, ' ', nIndex );
+
+                Reference<XSpreadsheet> xSheet = getSheetFromDoc( getCurrentSheetIndex() );
+                Reference<XCellRange> xDBCellRange;
+                Reference<XCell> xCell;
+                xDBCellRange = xSheet->getCellRangeByName( aToken );
+
+                xCell = xDBCellRange->getCellByPosition( 0, 0 );
+                Reference<XCellAddressable> xCellAddressable( xCell, UNO_QUERY_THROW );
+                CellAddress aFirstCell = xCellAddressable->getCellAddress();
+                Reference<XSheetCondition> xCondition( xValidation, UNO_QUERY_THROW );
+                xCondition->setSourcePosition( aFirstCell );
+            }
+            catch(const Exception&)
+            {
+            }
+
             // convert validation type to API enum
             ValidationType eType = ValidationType_ANY;
             switch( aIt->mnType )
commit ecc62c9cd21bec2580d5a936c7784735bff89504
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Sun Dec 29 23:24:38 2013 +0000

    convert solver progress dialog to .ui
    
    Change-Id: I259f7d75591121be584e3a8cfe514232a404c0fa

diff --git a/sc/AllLangResTarget_sc.mk b/sc/AllLangResTarget_sc.mk
index ae6faa2..9bf3000 100644
--- a/sc/AllLangResTarget_sc.mk
+++ b/sc/AllLangResTarget_sc.mk
@@ -36,7 +36,6 @@ $(eval $(call gb_SrsTarget_add_files,sc/res,\
     sc/source/ui/src/popup.src \
     sc/source/ui/src/autofmt.src \
     sc/source/ui/src/globstr.src \
-    sc/source/ui/src/optsolver.src \
     sc/source/ui/src/toolbox.src \
     sc/source/ui/src/scfuncs.src \
     sc/source/ui/src/textdlgs.src \
diff --git a/sc/UIConfig_scalc.mk b/sc/UIConfig_scalc.mk
index 41bcb7c..2473b25 100644
--- a/sc/UIConfig_scalc.mk
+++ b/sc/UIConfig_scalc.mk
@@ -137,6 +137,7 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/scalc,\
 	sc/uiconfig/scalc/ui/sidebarnumberformat \
 	sc/uiconfig/scalc/ui/sidebarcellappearance \
 	sc/uiconfig/scalc/ui/solverdlg \
+	sc/uiconfig/scalc/ui/solverprogressdialog \
 	sc/uiconfig/scalc/ui/solversuccessdialog \
 	sc/uiconfig/scalc/ui/sortcriteriapage \
 	sc/uiconfig/scalc/ui/sortdialog \
diff --git a/sc/inc/helpids.h b/sc/inc/helpids.h
index 8d989dd..e13c082 100644
--- a/sc/inc/helpids.h
+++ b/sc/inc/helpids.h
@@ -162,7 +162,6 @@
 
 #define HID_SC_SOLVEROPTIONS                                    "SC_HID_SC_SOLVEROPTIONS"
 #define HID_SC_SOLVEROPTIONS_LB                                 "SC_HID_SC_SOLVEROPTIONS_LB"
-#define HID_SC_SOLVER_PROGRESS                                  "SC_HID_SC_SOLVER_PROGRESS"
 
 #define HID_SCDLG_CONFLICTS                                     "SC_HID_SCDLG_CONFLICTS"
 
diff --git a/sc/inc/sc.hrc b/sc/inc/sc.hrc
index 0b0f398..7230fee 100644
--- a/sc/inc/sc.hrc
+++ b/sc/inc/sc.hrc
@@ -1094,7 +1094,6 @@
 #define RID_SCDLG_DPSHOWDETAIL          (SC_DIALOGS_START + 137)
 
 #define RID_SCDLG_SOLVEROPTIONS         (SC_DIALOGS_START + 139)
-#define RID_SCDLG_SOLVER_PROGRESS       (SC_DIALOGS_START + 142)
 
 #define RID_SCDLG_CONFLICTS             (SC_DIALOGS_START + 145)
 #define RID_SCDLG_SHAREDOCUMENT         (SC_DIALOGS_START + 146)
diff --git a/sc/source/ui/inc/optsolver.hrc b/sc/source/ui/inc/optsolver.hrc
deleted file mode 100644
index bbb3bce..0000000
--- a/sc/source/ui/inc/optsolver.hrc
+++ /dev/null
@@ -1,33 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- *   Licensed to the Apache Software Foundation (ASF) under one or more
- *   contributor license agreements. See the NOTICE file distributed
- *   with this work for additional information regarding copyright
- *   ownership. The ASF licenses this file to you under the Apache
- *   License, Version 2.0 (the "License"); you may not use this file
- *   except in compliance with the License. You may obtain a copy of
- *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-#include "sc.hrc"
-
-#define FT_PROGRESS             7
-#define FT_TIMELIMIT            8
-
-#define FL_CONDITIONS           1
-#define FL_BUTTONS              2
-
-#define BTN_HELP                2
-#define BTN_CLOSE               3
-#define BTN_OK                  4
-#define BTN_CANCEL              5
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/optsolver.hxx b/sc/source/ui/inc/optsolver.hxx
index 1f850d7..f4af6ef 100644
--- a/sc/source/ui/inc/optsolver.hxx
+++ b/sc/source/ui/inc/optsolver.hxx
@@ -206,14 +206,10 @@ private:
 
 class ScSolverProgressDialog : public ModelessDialog
 {
-    FixedText       maFtProgress;
-    FixedText       maFtTime;
-    FixedLine       maFlButtons;
-    OKButton        maBtnOk;
+    FixedText* m_pFtTime;
 
 public:
     ScSolverProgressDialog( Window* pParent );
-    ~ScSolverProgressDialog();
 
     void    HideTimeLimit();
     void    SetTimeLimit( sal_Int32 nSeconds );
diff --git a/sc/source/ui/miscdlgs/optsolver.cxx b/sc/source/ui/miscdlgs/optsolver.cxx
index 7648ac2..3a02d8d 100644
--- a/sc/source/ui/miscdlgs/optsolver.cxx
+++ b/sc/source/ui/miscdlgs/optsolver.cxx
@@ -38,7 +38,6 @@
 #include "solveroptions.hxx"
 #include "solverutil.hxx"
 #include "globstr.hrc"
-#include "optsolver.hrc"
 
 #include "optsolver.hxx"
 
@@ -47,33 +46,23 @@
 
 using namespace com::sun::star;
 
-//----------------------------------------------------------------------------
-
-ScSolverProgressDialog::ScSolverProgressDialog( Window* pParent )
-    : ModelessDialog( pParent, ScResId( RID_SCDLG_SOLVER_PROGRESS ) ),
-    maFtProgress    ( this, ScResId( FT_PROGRESS ) ),
-    maFtTime        ( this, ScResId( FT_TIMELIMIT ) ),
-    maFlButtons     ( this, ScResId( FL_BUTTONS ) ),
-    maBtnOk         ( this, ScResId( BTN_OK ) )
-{
-    maBtnOk.Enable(false);
-    FreeResource();
-}
-
-ScSolverProgressDialog::~ScSolverProgressDialog()
+ScSolverProgressDialog::ScSolverProgressDialog(Window* pParent)
+    : ModelessDialog(pParent, "SolverProgressDialog",
+        "modules/scalc/ui/solverprogressdialog.ui")
 {
+    get(m_pFtTime, "progress");
 }
 
 void ScSolverProgressDialog::HideTimeLimit()
 {
-    maFtTime.Hide();
+    m_pFtTime->Hide();
 }
 
 void ScSolverProgressDialog::SetTimeLimit( sal_Int32 nSeconds )
 {
-    OUString aOld = maFtTime.GetText();
-    OUString aNew = aOld.getToken(0,'#') + OUString::number( nSeconds ) + aOld.getToken(1,'#');
-    maFtTime.SetText( aNew );
+    OUString aOld = m_pFtTime->GetText();
+    OUString aNew = aOld.replaceFirst("#", OUString::number(nSeconds));
+    m_pFtTime->SetText( aNew );
 }
 
 //----------------------------------------------------------------------------
diff --git a/sc/source/ui/src/optsolver.src b/sc/source/ui/src/optsolver.src
deleted file mode 100644
index 9ab6de1..0000000
--- a/sc/source/ui/src/optsolver.src
+++ /dev/null
@@ -1,59 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- *   Licensed to the Apache Software Foundation (ASF) under one or more
- *   contributor license agreements. See the NOTICE file distributed
- *   with this work for additional information regarding copyright
- *   ownership. The ASF licenses this file to you under the Apache
- *   License, Version 2.0 (the "License"); you may not use this file
- *   except in compliance with the License. You may obtain a copy of
- *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-#include "optsolver.hrc"
-
-ModelessDialog RID_SCDLG_SOLVER_PROGRESS
-{
-    OutputSize = TRUE ;
-    HelpId = HID_SC_SOLVER_PROGRESS ;
-    SVLook = TRUE ;
-    Size = MAP_APPFONT ( 118 , 72 ) ;
-    Moveable = TRUE ;
-    Closeable = FALSE ;
-    FixedText FT_PROGRESS
-    {
-        Pos = MAP_APPFONT ( 6 , 11 ) ;
-        Size = MAP_APPFONT ( 106 , 8 ) ;
-        Center = TRUE ;
-        Text [ en-US ] = "Solving in progress..." ;
-    };
-    FixedText FT_TIMELIMIT
-    {
-        Pos = MAP_APPFONT ( 6 , 25 ) ;
-        Size = MAP_APPFONT ( 106 , 8 ) ;
-        Center = TRUE ;
-        Text [ en-US ] = "(time limit # seconds)" ;
-    };
-    FixedLine FL_BUTTONS
-    {
-        Pos = MAP_APPFONT ( 0 , 41 ) ;
-        Size = MAP_APPFONT ( 118 , 8 ) ;
-    };
-    OKButton BTN_OK
-    {
-        Pos = MAP_APPFONT ( 34 , 52 ) ;
-        Size = MAP_APPFONT ( 50 , 14 ) ;
-        TabStop = TRUE ;
-        DefButton = TRUE ;
-    };
-    Text [ en-US ] = "Solving..." ;
-};
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/uiconfig/scalc/ui/solverprogressdialog.ui b/sc/uiconfig/scalc/ui/solverprogressdialog.ui
new file mode 100644
index 0000000..1e43f56
--- /dev/null
+++ b/sc/uiconfig/scalc/ui/solverprogressdialog.ui
@@ -0,0 +1,90 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+  <!-- interface-requires gtk+ 3.0 -->
+  <object class="GtkDialog" id="SolverProgressDialog">
+    <property name="can_focus">False</property>
+    <property name="border_width">6</property>
+    <property name="title" translatable="yes">Solving...</property>
+    <property name="type_hint">dialog</property>
+    <child internal-child="vbox">
+      <object class="GtkBox" id="dialog-vbox1">
+        <property name="can_focus">False</property>
+        <property name="orientation">vertical</property>
+        <property name="spacing">12</property>
+        <child>
+          <object class="GtkGrid" id="grid1">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="row_spacing">24</property>
+            <child>
+              <object class="GtkLabel" id="label2">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="xalign">0</property>
+                <property name="label" translatable="yes">Solving in progress...</property>
+              </object>
+              <packing>
+                <property name="left_attach">0</property>
+                <property name="top_attach">0</property>
+                <property name="width">1</property>
+                <property name="height">1</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkLabel" id="progress">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="xalign">0</property>
+                <property name="label" translatable="yes">(time limit # seconds)</property>
+              </object>
+              <packing>
+                <property name="left_attach">0</property>
+                <property name="top_attach">1</property>
+                <property name="width">1</property>
+                <property name="height">1</property>
+              </packing>
+            </child>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">True</property>
+            <property name="position">0</property>
+          </packing>
+        </child>
+        <child internal-child="action_area">
+          <object class="GtkButtonBox" id="dialog-action_area1">
+            <property name="can_focus">False</property>
+            <property name="layout_style">end</property>
+            <child>
+              <object class="GtkButton" id="ok">
+                <property name="label">gtk-ok</property>
+                <property name="visible">True</property>
+                <property name="sensitive">False</property>
+                <property name="can_focus">True</property>
+                <property name="can_default">True</property>
+                <property name="has_default">True</property>
+                <property name="receives_default">True</property>
+                <property name="use_underline">True</property>
+                <property name="use_stock">True</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">True</property>
+                <property name="position">0</property>
+              </packing>
+            </child>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">True</property>
+            <property name="pack_type">end</property>
+            <property name="position">2</property>
+          </packing>
+        </child>
+      </object>
+    </child>
+    <action-widgets>
+      <action-widget response="0">ok</action-widget>
+    </action-widgets>
+  </object>
+</interface>
diff --git a/sc/uiconfig/scalc/ui/solversuccessdialog.ui b/sc/uiconfig/scalc/ui/solversuccessdialog.ui
index c0e4619..3c01f37 100644
--- a/sc/uiconfig/scalc/ui/solversuccessdialog.ui
+++ b/sc/uiconfig/scalc/ui/solversuccessdialog.ui
@@ -23,7 +23,7 @@
                 <property name="xalign">0</property>
                 <property name="label" translatable="yes">Do you want to keep the result or do you want to restore previous values?</property>
                 <property name="wrap">True</property>
-                <property name="max_width_chars">52</property>
+                <property name="max_width_chars">40</property>
               </object>
               <packing>
                 <property name="left_attach">0</property>
commit e2591cdeeb9a7d2d87e8c8772eed3ece6056fae1
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Sun Dec 29 23:29:21 2013 +0000

    drop STRING_MAXLEN uses from connectivity
    
    Change-Id: I12a999c2c6bdd119c2e3e544bbbdabb0b0ce2ba2

diff --git a/connectivity/source/drivers/calc/CDatabaseMetaData.cxx b/connectivity/source/drivers/calc/CDatabaseMetaData.cxx
index c2f87a2..97fe37f 100644
--- a/connectivity/source/drivers/calc/CDatabaseMetaData.cxx
+++ b/connectivity/source/drivers/calc/CDatabaseMetaData.cxx
@@ -253,7 +253,7 @@ OUString SAL_CALL OCalcDatabaseMetaData::getURL(  ) throw(SQLException, RuntimeE
 sal_Int32 SAL_CALL OCalcDatabaseMetaData::getMaxBinaryLiteralLength(  ) throw(SQLException, RuntimeException)
 {
     SAL_INFO( "connectivity.drivers", "calc Ocke.Janssen at sun.com OCalcDatabaseMetaData::getMaxBinaryLiteralLength" );
-    return STRING_MAXLEN;
+    return SAL_MAX_INT32;
 }
 
 // -------------------------------------------------------------------------
@@ -261,13 +261,13 @@ sal_Int32 SAL_CALL OCalcDatabaseMetaData::getMaxBinaryLiteralLength(  ) throw(SQ
 sal_Int32 SAL_CALL OCalcDatabaseMetaData::getMaxCharLiteralLength(  ) throw(SQLException, RuntimeException)
 {
     SAL_INFO( "connectivity.drivers", "calc Ocke.Janssen at sun.com OCalcDatabaseMetaData::getMaxCharLiteralLength" );
-    return STRING_MAXLEN;
+    return SAL_MAX_INT32;
 }
 // -------------------------------------------------------------------------
 sal_Int32 SAL_CALL OCalcDatabaseMetaData::getMaxColumnNameLength(  ) throw(SQLException, RuntimeException)
 {
     SAL_INFO( "connectivity.drivers", "calc Ocke.Janssen at sun.com OCalcDatabaseMetaData::getMaxColumnNameLength" );
-    return STRING_MAXLEN;
+    return SAL_MAX_INT32;
 }
 // -------------------------------------------------------------------------
 sal_Int32 SAL_CALL OCalcDatabaseMetaData::getMaxColumnsInIndex(  ) throw(SQLException, RuntimeException)
diff --git a/connectivity/source/drivers/dbase/DDatabaseMetaData.cxx b/connectivity/source/drivers/dbase/DDatabaseMetaData.cxx
index 45aaabd..2419b86 100644
--- a/connectivity/source/drivers/dbase/DDatabaseMetaData.cxx
+++ b/connectivity/source/drivers/dbase/DDatabaseMetaData.cxx
@@ -333,7 +333,7 @@ OUString SAL_CALL ODbaseDatabaseMetaData::getURL(  ) throw(SQLException, Runtime
 sal_Int32 SAL_CALL ODbaseDatabaseMetaData::getMaxBinaryLiteralLength(  ) throw(SQLException, RuntimeException)
 {
     SAL_INFO( "connectivity.drivers", "dbase Ocke.Janssen at sun.com ODbaseDatabaseMetaData::getMaxBinaryLiteralLength" );
-    return STRING_MAXLEN;
+    return SAL_MAX_INT32;
 }
 // -------------------------------------------------------------------------
 sal_Int32 SAL_CALL ODbaseDatabaseMetaData::getMaxCharLiteralLength(  ) throw(SQLException, RuntimeException)
diff --git a/connectivity/source/drivers/file/FDatabaseMetaData.cxx b/connectivity/source/drivers/file/FDatabaseMetaData.cxx
index a70e588..c233c59 100644
--- a/connectivity/source/drivers/file/FDatabaseMetaData.cxx
+++ b/connectivity/source/drivers/file/FDatabaseMetaData.cxx
@@ -340,7 +340,7 @@ sal_Int32 SAL_CALL ODatabaseMetaData::getMaxCatalogNameLength(  ) throw(SQLExcep
 sal_Int32 SAL_CALL ODatabaseMetaData::getMaxCharLiteralLength(  ) throw(SQLException, RuntimeException)
 {
     SAL_INFO( "connectivity.drivers", "file Ocke.Janssen at sun.com ODatabaseMetaData::getMaxCharLiteralLength" );
-    return STRING_MAXLEN;
+    return SAL_MAX_INT32;
 }
 // -------------------------------------------------------------------------
 sal_Int32 SAL_CALL ODatabaseMetaData::getMaxColumnNameLength(  ) throw(SQLException, RuntimeException)
commit 3cec54b5e865badf239f6217d2a01375e81cfb66
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Dec 30 00:11:29 2013 +0000

    Updated core
    Project: help  df73415915aa0159b7e1d4eb949b738e00044915

diff --git a/helpcontent2 b/helpcontent2
index 49e2eb4..df73415 160000
--- a/helpcontent2
+++ b/helpcontent2
@@ -1 +1 @@
-Subproject commit 49e2eb49dfb63f248299c483fb1e67a31622a35a
+Subproject commit df73415915aa0159b7e1d4eb949b738e00044915
commit eb91348f8dee9ca6f46050a7170ff2bb39c13146
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Sun Dec 29 21:22:27 2013 +0000

    convert solver success dialog to .ui
    
    Change-Id: Ia9062a21afde96510a4953d1b51e7e59e9012fb7

diff --git a/sc/UIConfig_scalc.mk b/sc/UIConfig_scalc.mk
index cddbd87..41bcb7c 100644
--- a/sc/UIConfig_scalc.mk
+++ b/sc/UIConfig_scalc.mk
@@ -137,6 +137,7 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/scalc,\
 	sc/uiconfig/scalc/ui/sidebarnumberformat \
 	sc/uiconfig/scalc/ui/sidebarcellappearance \
 	sc/uiconfig/scalc/ui/solverdlg \
+	sc/uiconfig/scalc/ui/solversuccessdialog \
 	sc/uiconfig/scalc/ui/sortcriteriapage \
 	sc/uiconfig/scalc/ui/sortdialog \
 	sc/uiconfig/scalc/ui/sortkey \
diff --git a/sc/inc/helpids.h b/sc/inc/helpids.h
index 22526d6..8d989dd 100644
--- a/sc/inc/helpids.h
+++ b/sc/inc/helpids.h
@@ -163,7 +163,6 @@
 #define HID_SC_SOLVEROPTIONS                                    "SC_HID_SC_SOLVEROPTIONS"
 #define HID_SC_SOLVEROPTIONS_LB                                 "SC_HID_SC_SOLVEROPTIONS_LB"
 #define HID_SC_SOLVER_PROGRESS                                  "SC_HID_SC_SOLVER_PROGRESS"
-#define HID_SC_SOLVER_SUCCESS                                   "SC_HID_SC_SOLVER_SUCCESS"
 
 #define HID_SCDLG_CONFLICTS                                     "SC_HID_SCDLG_CONFLICTS"
 
diff --git a/sc/inc/sc.hrc b/sc/inc/sc.hrc
index d97cfcf..0b0f398 100644
--- a/sc/inc/sc.hrc
+++ b/sc/inc/sc.hrc
@@ -1095,7 +1095,6 @@
 
 #define RID_SCDLG_SOLVEROPTIONS         (SC_DIALOGS_START + 139)
 #define RID_SCDLG_SOLVER_PROGRESS       (SC_DIALOGS_START + 142)
-#define RID_SCDLG_SOLVER_SUCCESS        (SC_DIALOGS_START + 144)
 
 #define RID_SCDLG_CONFLICTS             (SC_DIALOGS_START + 145)
 #define RID_SCDLG_SHAREDOCUMENT         (SC_DIALOGS_START + 146)
diff --git a/sc/source/ui/inc/optsolver.hrc b/sc/source/ui/inc/optsolver.hrc
index f72063e..bbb3bce 100644
--- a/sc/source/ui/inc/optsolver.hrc
+++ b/sc/source/ui/inc/optsolver.hrc
@@ -21,9 +21,6 @@
 
 #define FT_PROGRESS             7
 #define FT_TIMELIMIT            8
-#define FT_SUCCESS              11
-#define FT_RESULT               12
-#define FT_QUESTION             13
 
 #define FL_CONDITIONS           1
 #define FL_BUTTONS              2
diff --git a/sc/source/ui/inc/optsolver.hxx b/sc/source/ui/inc/optsolver.hxx
index aaf756d..1f850d7 100644
--- a/sc/source/ui/inc/optsolver.hxx
+++ b/sc/source/ui/inc/optsolver.hxx
@@ -229,16 +229,14 @@ public:
 
 class ScSolverSuccessDialog : public ModalDialog
 {
-    FixedText       maFtSuccess;
-    FixedText       maFtResult;
-    FixedText       maFtQuestion;
-    FixedLine       maFlButtons;
-    OKButton        maBtnOk;
-    CancelButton    maBtnCancel;
+    FixedText* m_pFtResult;
+    PushButton* m_pBtnOk;
+    PushButton* m_pBtnCancel;
+
+    DECL_LINK(ClickHdl, PushButton*);
 
 public:
     ScSolverSuccessDialog( Window* pParent, const OUString& rSolution );
-    ~ScSolverSuccessDialog();
 };
 
 
diff --git a/sc/source/ui/miscdlgs/optsolver.cxx b/sc/source/ui/miscdlgs/optsolver.cxx
index d0020e2..7648ac2 100644
--- a/sc/source/ui/miscdlgs/optsolver.cxx
+++ b/sc/source/ui/miscdlgs/optsolver.cxx
@@ -88,21 +88,24 @@ ScSolverNoSolutionDialog::ScSolverNoSolutionDialog( Window* pParent, const OUStr
 //----------------------------------------------------------------------------
 
 ScSolverSuccessDialog::ScSolverSuccessDialog( Window* pParent, const OUString& rSolution )
-    : ModalDialog( pParent, ScResId( RID_SCDLG_SOLVER_SUCCESS ) ),
-    maFtSuccess     ( this, ScResId( FT_SUCCESS ) ),
-    maFtResult      ( this, ScResId( FT_RESULT ) ),
-    maFtQuestion    ( this, ScResId( FT_QUESTION ) ),
-    maFlButtons     ( this, ScResId( FL_BUTTONS ) ),
-    maBtnOk         ( this, ScResId( BTN_OK ) ),
-    maBtnCancel     ( this, ScResId( BTN_CANCEL ) )
+    : ModalDialog(pParent, "SolverSuccessDialog", "modules/scalc/ui/solversuccessdialog.ui")
 {
-    OUString aMessage = maFtResult.GetText() + " " + rSolution;
-    maFtResult.SetText( aMessage );
-    FreeResource();
+    get(m_pFtResult, "result");
+    get(m_pBtnOk, "ok");
+    m_pBtnOk->SetClickHdl(LINK(this, ScSolverSuccessDialog, ClickHdl));
+    get(m_pBtnCancel, "cancel");
+    m_pBtnCancel->SetClickHdl(LINK(this, ScSolverSuccessDialog, ClickHdl));
+    OUString aMessage = m_pFtResult->GetText() + " " + rSolution;
+    m_pFtResult->SetText(aMessage);
 }
 
-ScSolverSuccessDialog::~ScSolverSuccessDialog()
+IMPL_LINK( ScSolverSuccessDialog, ClickHdl, PushButton*, pBtn )
 {
+    if (pBtn == m_pBtnOk)
+        EndDialog(true);
+    else
+        EndDialog(false);
+    return 0;
 }
 
 //----------------------------------------------------------------------------
diff --git a/sc/source/ui/src/optsolver.src b/sc/source/ui/src/optsolver.src
index 1de4b5e..9ab6de1 100644
--- a/sc/source/ui/src/optsolver.src
+++ b/sc/source/ui/src/optsolver.src
@@ -56,54 +56,4 @@ ModelessDialog RID_SCDLG_SOLVER_PROGRESS
     Text [ en-US ] = "Solving..." ;
 };
 
-
-ModalDialog RID_SCDLG_SOLVER_SUCCESS
-{
-    OutputSize = TRUE ;
-    HelpId = HID_SC_SOLVER_SUCCESS ;
-    SVLook = TRUE ;
-    Size = MAP_APPFONT ( 138 , 89 ) ;
-    Moveable = TRUE ;
-    FixedText FT_SUCCESS
-    {
-        Pos = MAP_APPFONT ( 6 , 8 ) ;
-        Size = MAP_APPFONT ( 126 , 8 ) ;
-        Text [ en-US ] = "Solving successfully finished." ;
-    };
-    FixedText FT_RESULT
-    {
-        Pos = MAP_APPFONT ( 6 , 22 ) ;
-        Size = MAP_APPFONT ( 126 , 8 ) ;
-        Text [ en-US ] = "Result:" ;
-    };
-    FixedText FT_QUESTION
-    {
-        Pos = MAP_APPFONT ( 6 , 36 ) ;
-        Size = MAP_APPFONT ( 126 , 16 ) ;
-        WordBreak = TRUE ;
-        Text [ en-US ] = "Do you want to keep the result or do you want to restore previous values?" ;
-    };
-    FixedLine FL_BUTTONS
-    {
-        Pos = MAP_APPFONT ( 0 , 58 ) ;
-        Size = MAP_APPFONT ( 138 , 8 ) ;
-    };
-    OKButton BTN_OK
-    {
-        Pos = MAP_APPFONT ( 6 , 69 ) ;
-        Size = MAP_APPFONT ( 60 , 14 ) ;
-        TabStop = TRUE ;
-        DefButton = TRUE ;
-        Text [ en-US ] = "Keep Result" ;
-    };
-    CancelButton BTN_CANCEL
-    {
-        Pos = MAP_APPFONT ( 72 , 69 ) ;
-        Size = MAP_APPFONT ( 60 , 14 ) ;
-        TabStop = TRUE ;
-        Text [ en-US ] = "Restore Previous" ;
-    };
-    Text [ en-US ] = "Solving Result" ;
-};
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/uiconfig/scalc/ui/solversuccessdialog.ui b/sc/uiconfig/scalc/ui/solversuccessdialog.ui
new file mode 100644
index 0000000..c0e4619
--- /dev/null
+++ b/sc/uiconfig/scalc/ui/solversuccessdialog.ui
@@ -0,0 +1,119 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+  <!-- interface-requires gtk+ 3.0 -->
+  <object class="GtkDialog" id="SolverSuccessDialog">
+    <property name="can_focus">False</property>
+    <property name="border_width">6</property>
+    <property name="title" translatable="yes">Solving Result</property>
+    <property name="type_hint">dialog</property>
+    <child internal-child="vbox">
+      <object class="GtkBox" id="dialog-vbox1">
+        <property name="can_focus">False</property>
+        <property name="orientation">vertical</property>
+        <property name="spacing">12</property>
+        <child>
+          <object class="GtkGrid" id="grid1">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="row_spacing">24</property>
+            <child>
+              <object class="GtkLabel" id="label1">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="xalign">0</property>
+                <property name="label" translatable="yes">Do you want to keep the result or do you want to restore previous values?</property>
+                <property name="wrap">True</property>
+                <property name="max_width_chars">52</property>
+              </object>
+              <packing>
+                <property name="left_attach">0</property>
+                <property name="top_attach">2</property>
+                <property name="width">1</property>
+                <property name="height">1</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkLabel" id="label2">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="xalign">0</property>
+                <property name="label" translatable="yes">Solving successfully finished.</property>
+              </object>
+              <packing>
+                <property name="left_attach">0</property>
+                <property name="top_attach">0</property>
+                <property name="width">1</property>
+                <property name="height">1</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkLabel" id="result">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="xalign">0</property>
+                <property name="label" translatable="yes">Result:</property>
+              </object>
+              <packing>
+                <property name="left_attach">0</property>
+                <property name="top_attach">1</property>
+                <property name="width">1</property>
+                <property name="height">1</property>
+              </packing>
+            </child>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">True</property>
+            <property name="position">0</property>
+          </packing>
+        </child>
+        <child internal-child="action_area">
+          <object class="GtkButtonBox" id="dialog-action_area1">
+            <property name="can_focus">False</property>
+            <property name="layout_style">end</property>
+            <child>
+              <object class="GtkButton" id="ok">
+                <property name="label">Keep Result</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="can_default">True</property>
+                <property name="has_default">True</property>
+                <property name="receives_default">True</property>
+                <property name="use_underline">True</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">True</property>
+                <property name="position">0</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkButton" id="cancel">
+                <property name="label">Restore Previous</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">True</property>
+                <property name="use_underline">True</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">True</property>
+                <property name="position">1</property>
+              </packing>
+            </child>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">True</property>
+            <property name="pack_type">end</property>
+            <property name="position">2</property>
+          </packing>
+        </child>
+      </object>
+    </child>
+    <action-widgets>
+      <action-widget response="0">ok</action-widget>
+      <action-widget response="0">cancel</action-widget>
+    </action-widgets>
+  </object>
+</interface>
commit 5825567cbaf516037906770ef73bf87f076c5d80
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Sun Dec 29 23:22:02 2013 +0000

    Updated core
    Project: help  49e2eb49dfb63f248299c483fb1e67a31622a35a

diff --git a/helpcontent2 b/helpcontent2
index 05f1ba9..49e2eb4 160000
--- a/helpcontent2
+++ b/helpcontent2
@@ -1 +1 @@
-Subproject commit 05f1ba9337a7d0274a9deeacb5891df61afceed1
+Subproject commit 49e2eb49dfb63f248299c483fb1e67a31622a35a
commit c0b2debe6c82cddd681d7874b95237f0669cd36c
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Sun Dec 29 20:56:20 2013 +0100

    writerfilter: unused NS_rtf::LN_shpvalue
    
    Change-Id: I908ab52770aaabc3e2049e2b6d3ab7f7acf25643

diff --git a/writerfilter/source/dmapper/GraphicImport.cxx b/writerfilter/source/dmapper/GraphicImport.cxx
index c7b1272..501a6be 100644
--- a/writerfilter/source/dmapper/GraphicImport.cxx
+++ b/writerfilter/source/dmapper/GraphicImport.cxx
@@ -633,12 +633,6 @@ void GraphicImport::lcl_attribute(Id nName, Value & val)
             break;
         case NS_rtf::LN_shpname:
             break;
-        case NS_rtf::LN_shpvalue:
-        {
-            if( NS_dff::LN_shpwzDescription == sal::static_int_cast<Id>(m_pImpl->nShapeOptionType) )
-                ProcessShapeOptions( val );
-        }
-        break;
 
         //BLIP store entry
         case NS_rtf::LN_shpbtWin32:
diff --git a/writerfilter/source/doctok/resources.xmi b/writerfilter/source/doctok/resources.xmi
index 555a244..c2a2610 100644
--- a/writerfilter/source/doctok/resources.xmi
+++ b/writerfilter/source/doctok/resources.xmi
@@ -26368,28 +26368,6 @@
             </UML:Operation>
           </UML:Classifier.feature>
           <UML:Classifier.feature>
-            <UML:Operation name="value">
-              <UML:ModelElement.taggedValue>
-                <UML:TaggedValue>
-                  <UML:TaggedValue.dataValue>rtf:shpvalue</UML:TaggedValue.dataValue>
-                  <UML:TaggedValue.type>
-                    <UML:TagDefinition xmi.idref="opid"/>
-                  </UML:TaggedValue.type>
-                </UML:TaggedValue>
-              </UML:ModelElement.taggedValue>
-              <UML:BehavioralFeature.parameter>
-                <UML:Parameter kind="return" name="return">
-                  <UML:Parameter.type>
-                    <UML:Class xmi.idref="Value"/>
-                  </UML:Parameter.type>
-                </UML:Parameter>
-              </UML:BehavioralFeature.parameter>
-              <UML:ModelElement.stereotype>
-                <UML:Stereotype xmi.idref="attribute"/>
-              </UML:ModelElement.stereotype>
-            </UML:Operation>
-          </UML:Classifier.feature>
-          <UML:Classifier.feature>
             <UML:Operation name="stringValue">
               <UML:ModelElement.taggedValue>
                 <UML:TaggedValue>
commit 7f5494f3c4bf14209a119c6b21c02e10075503ae
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Sun Dec 29 20:54:12 2013 +0100

    writerfilter: unused NS_rtf::LN_shppid
    
    Change-Id: Idf63d7a4659a96bb6e2050194ba595a321696313

diff --git a/writerfilter/source/dmapper/GraphicImport.cxx b/writerfilter/source/dmapper/GraphicImport.cxx
index 6fa2eef..c7b1272 100644
--- a/writerfilter/source/dmapper/GraphicImport.cxx
+++ b/writerfilter/source/dmapper/GraphicImport.cxx
@@ -627,9 +627,6 @@ void GraphicImport::lcl_attribute(Id nName, Value & val)
             break;// Shape has a shape type property
         case NS_rtf::LN_shptypename:
             break;// shape type name
-        case NS_rtf::LN_shppid:
-            m_pImpl->nShapeOptionType = nIntValue;
-            break; //type of shape option
         case NS_rtf::LN_shpfBid:
             break; //ignored
         case NS_rtf::LN_shpfComplex:
diff --git a/writerfilter/source/doctok/resources.xmi b/writerfilter/source/doctok/resources.xmi
index e62f7c5..555a244 100644
--- a/writerfilter/source/doctok/resources.xmi
+++ b/writerfilter/source/doctok/resources.xmi
@@ -26230,64 +26230,6 @@
             </UML:TaggedValue>
           </UML:ModelElement.taggedValue>
           <UML:Classifier.feature>
-            <UML:Attribute name="pid">
-              <UML:ModelElement.taggedValue>
-                <UML:TaggedValue>
-                  <UML:TaggedValue.dataValue>Property ID</UML:TaggedValue.dataValue>
-                  <UML:TaggedValue.type>
-                    <UML:TagDefinition xmi.idref="comment"/>
-                  </UML:TaggedValue.type>
-                </UML:TaggedValue>
-              </UML:ModelElement.taggedValue>
-              <UML:ModelElement.taggedValue>
-                <UML:TaggedValue>
-                  <UML:TaggedValue.dataValue>0x0</UML:TaggedValue.dataValue>
-                  <UML:TaggedValue.type>
-                    <UML:TagDefinition xmi.idref="offset"/>
-                  </UML:TaggedValue.type>
-                </UML:TaggedValue>
-              </UML:ModelElement.taggedValue>
-              <UML:ModelElement.taggedValue>
-                <UML:TaggedValue>
-                  <UML:TaggedValue.dataValue>14</UML:TaggedValue.dataValue>
-                  <UML:TaggedValue.type>
-                    <UML:TagDefinition xmi.idref="bits"/>
-                  </UML:TaggedValue.type>
-                </UML:TaggedValue>
-              </UML:ModelElement.taggedValue>
-              <UML:ModelElement.taggedValue>
-                <UML:TaggedValue>
-                  <UML:TaggedValue.dataValue>0x3fff</UML:TaggedValue.dataValue>
-                  <UML:TaggedValue.type>
-                    <UML:TagDefinition xmi.idref="mask"/>
-                  </UML:TaggedValue.type>
-                </UML:TaggedValue>
-              </UML:ModelElement.taggedValue>
-              <UML:ModelElement.taggedValue>
-                <UML:TaggedValue>
-                  <UML:TaggedValue.dataValue>0</UML:TaggedValue.dataValue>
-                  <UML:TaggedValue.type>
-                    <UML:TagDefinition xmi.idref="shift"/>
-                  </UML:TaggedValue.type>
-                </UML:TaggedValue>
-              </UML:ModelElement.taggedValue>
-              <UML:ModelElement.taggedValue>
-                <UML:TaggedValue>
-                  <UML:TaggedValue.dataValue>rtf:shppid</UML:TaggedValue.dataValue>
-                  <UML:TaggedValue.type>
-                    <UML:TagDefinition xmi.idref="attrid"/>
-                  </UML:TaggedValue.type>
-                </UML:TaggedValue>
-              </UML:ModelElement.taggedValue>
-              <UML:StructuralFeature.type>
-                <UML:DataType xmi.idref="U16"/>
-              </UML:StructuralFeature.type>
-              <UML:ModelElement.stereotype>
-                <UML:Stereotype xmi.idref="attribute"/>
-              </UML:ModelElement.stereotype>
-            </UML:Attribute>
-          </UML:Classifier.feature>
-          <UML:Classifier.feature>
             <UML:Attribute name="fBid">
               <UML:ModelElement.taggedValue>
                 <UML:TaggedValue>
commit 7d1f0555f83bf117f4771041550c99b29efdb833
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Sun Dec 29 20:50:44 2013 +0100

    writerfilter: unused NS_rtf::LN_shpop
    
    Change-Id: I83ff7a646ab2ae8e06996115500c02730c867b8f

diff --git a/writerfilter/source/dmapper/GraphicImport.cxx b/writerfilter/source/dmapper/GraphicImport.cxx
index f90d411..6fa2eef 100644
--- a/writerfilter/source/dmapper/GraphicImport.cxx
+++ b/writerfilter/source/dmapper/GraphicImport.cxx
@@ -634,12 +634,6 @@ void GraphicImport::lcl_attribute(Id nName, Value & val)
             break; //ignored
         case NS_rtf::LN_shpfComplex:
             break;
-        case NS_rtf::LN_shpop:
-        {
-            if(NS_dff::LN_shpwzDescription != sal::static_int_cast<Id>(m_pImpl->nShapeOptionType) )
-                ProcessShapeOptions( val );
-        }
-        break;
         case NS_rtf::LN_shpname:
             break;
         case NS_rtf::LN_shpvalue:
diff --git a/writerfilter/source/doctok/resources.xmi b/writerfilter/source/doctok/resources.xmi
index 157f10d..e62f7c5 100644
--- a/writerfilter/source/doctok/resources.xmi
+++ b/writerfilter/source/doctok/resources.xmi
@@ -26404,64 +26404,6 @@
             </UML:Attribute>
           </UML:Classifier.feature>
           <UML:Classifier.feature>
-            <UML:Attribute name="op">
-              <UML:ModelElement.taggedValue>
-                <UML:TaggedValue>
-                  <UML:TaggedValue.dataValue>Value</UML:TaggedValue.dataValue>
-                  <UML:TaggedValue.type>
-                    <UML:TagDefinition xmi.idref="comment"/>
-                  </UML:TaggedValue.type>
-                </UML:TaggedValue>
-              </UML:ModelElement.taggedValue>
-              <UML:ModelElement.taggedValue>
-                <UML:TaggedValue>
-                  <UML:TaggedValue.dataValue>0x2</UML:TaggedValue.dataValue>
-                  <UML:TaggedValue.type>
-                    <UML:TagDefinition xmi.idref="offset"/>
-                  </UML:TaggedValue.type>
-                </UML:TaggedValue>
-              </UML:ModelElement.taggedValue>
-              <UML:ModelElement.taggedValue>
-                <UML:TaggedValue>
-                  <UML:TaggedValue.dataValue>32</UML:TaggedValue.dataValue>
-                  <UML:TaggedValue.type>
-                    <UML:TagDefinition xmi.idref="bits"/>
-                  </UML:TaggedValue.type>
-                </UML:TaggedValue>
-              </UML:ModelElement.taggedValue>
-              <UML:ModelElement.taggedValue>
-                <UML:TaggedValue>
-                  <UML:TaggedValue.dataValue/>
-                  <UML:TaggedValue.type>
-                    <UML:TagDefinition xmi.idref="mask"/>
-                  </UML:TaggedValue.type>
-                </UML:TaggedValue>
-              </UML:ModelElement.taggedValue>
-              <UML:ModelElement.taggedValue>
-                <UML:TaggedValue>
-                  <UML:TaggedValue.dataValue>0</UML:TaggedValue.dataValue>
-                  <UML:TaggedValue.type>
-                    <UML:TagDefinition xmi.idref="shift"/>
-                  </UML:TaggedValue.type>
-                </UML:TaggedValue>
-              </UML:ModelElement.taggedValue>
-              <UML:ModelElement.taggedValue>
-                <UML:TaggedValue>
-                  <UML:TaggedValue.dataValue>rtf:shpop</UML:TaggedValue.dataValue>
-                  <UML:TaggedValue.type>
-                    <UML:TagDefinition xmi.idref="attrid"/>
-                  </UML:TaggedValue.type>
-                </UML:TaggedValue>
-              </UML:ModelElement.taggedValue>
-              <UML:StructuralFeature.type>
-                <UML:DataType xmi.idref="U32"/>
-              </UML:StructuralFeature.type>
-              <UML:ModelElement.stereotype>
-                <UML:Stereotype xmi.idref="attribute"/>
-              </UML:ModelElement.stereotype>
-            </UML:Attribute>
-          </UML:Classifier.feature>
-          <UML:Classifier.feature>
             <UML:Operation name="name">
               <UML:ModelElement.taggedValue>
                 <UML:TaggedValue>
commit 91bb53928b9a00b1dbfa734baf60c9f0a19dc6ad
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Sun Dec 29 20:46:35 2013 +0100

    writerfilter: unused NS_dff::LN_shpfPrint
    
    Change-Id: I919e44db53dde4869bfb7d1e41dabb6573667c7a

diff --git a/writerfilter/source/dmapper/GraphicImport.cxx b/writerfilter/source/dmapper/GraphicImport.cxx
index e293b0c..f90d411 100644
--- a/writerfilter/source/dmapper/GraphicImport.cxx
+++ b/writerfilter/source/dmapper/GraphicImport.cxx
@@ -1256,8 +1256,6 @@ void GraphicImport::ProcessShapeOptions(Value& val)
             //todo: changes have to be applied depending on the orientation, see SwWW8ImplReader::AdjustULWrapForWordMargins()
             m_pImpl->nBottomMargin = nIntValue / 360;
         break;
-        case NS_dff::LN_shpfPrint              /*959*/:
-            break;  // rtf:shpfPrint
         default:
             OSL_FAIL( "shape option unsupported?");
     }
diff --git a/writerfilter/source/doctok/resources.xmi b/writerfilter/source/doctok/resources.xmi
index ad50f51..157f10d 100644
--- a/writerfilter/source/doctok/resources.xmi
+++ b/writerfilter/source/doctok/resources.xmi
@@ -43667,62 +43667,6 @@
           </UML:ModelElement.taggedValue>
         </UML:Class>
         <!--DFFOPT dyWrapDistBottom-->
-        <!--DFFOPT fPrint-->
-        <UML:Class xmi.id="fPrint" name="fPrint">
-          <UML:ModelElement.stereotype>
-            <UML:Stereotype xmi.idref="dffopt"/>
-          </UML:ModelElement.stereotype>
-          <UML:ModelElement.taggedValue>
-            <UML:TaggedValue>
-              <UML:TaggedValue.dataValue>dff:shpfPrint</UML:TaggedValue.dataValue>
-              <UML:TaggedValue.type>
-                <UML:TagDefinition xmi.idref="optname"/>
-              </UML:TaggedValue.type>
-            </UML:TaggedValue>
-          </UML:ModelElement.taggedValue>
-          <UML:ModelElement.taggedValue>
-            <UML:TaggedValue>
-              <UML:TaggedValue.dataValue>959</UML:TaggedValue.dataValue>
-              <UML:TaggedValue.type>
-                <UML:TagDefinition xmi.idref="fopid"/>
-              </UML:TaggedValue.type>
-            </UML:TaggedValue>
-          </UML:ModelElement.taggedValue>
-          <UML:ModelElement.taggedValue>
-            <UML:TaggedValue>
-              <UML:TaggedValue.dataValue>U8</UML:TaggedValue.dataValue>
-              <UML:TaggedValue.type>
-                <UML:TagDefinition xmi.idref="type"/>
-              </UML:TaggedValue.type>
-            </UML:TaggedValue>
-          </UML:ModelElement.taggedValue>
-          <UML:ModelElement.taggedValue>
-            <UML:TaggedValue>
-              <UML:TaggedValue.dataValue>1</UML:TaggedValue.dataValue>
-              <UML:TaggedValue.type>
-                <UML:TagDefinition xmi.idref="isbool"/>
-              </UML:TaggedValue.type>
-            </UML:TaggedValue>
-          </UML:ModelElement.taggedValue>
-          <UML:ModelElement.taggedValue>
-            <UML:TaggedValue>
-              <UML:TaggedValue.dataValue>TRUE</UML:TaggedValue.dataValue>
-              <UML:TaggedValue.type>
-                <UML:TagDefinition xmi.idref="default"/>
-              </UML:TaggedValue.type>
-            </UML:TaggedValue>
-          </UML:ModelElement.taggedValue>
-          <UML:ModelElement.taggedValue>
-            <UML:TaggedValue>
-              <UML:TaggedValue.dataValue>Print this
-              shape</UML:TaggedValue.dataValue>
-              <UML:TaggedValue.type>
-                <UML:TagDefinition xmi.idref="comment"/>
-              </UML:TaggedValue.type>
-            </UML:TaggedValue>
-          </UML:ModelElement.taggedValue>
-        </UML:Class>
-        <!--DFFOPT fPrint-->
         <!--DFFOPT-->
       </UML:Namespace.ownedElement>
     </UML:Model>
commit 5b373ef6d718879c359da74b5aeb63e818192f5e
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Sun Dec 29 21:18:05 2013 +0000

    convert tab background color to .ui
    
    Change-Id: I121d4abd3227b96a274f1983e61ca313728419f7

diff --git a/extras/source/glade/libreoffice-catalog.xml.in b/extras/source/glade/libreoffice-catalog.xml.in
index 157a34f..082e216 100644
--- a/extras/source/glade/libreoffice-catalog.xml.in
+++ b/extras/source/glade/libreoffice-catalog.xml.in
@@ -296,6 +296,9 @@
     <glade-widget-class title="TableValueSet" name="sdlo-TableValueSet"
                         generic-name="Set of Table Value Options" parent="GtkDrawingArea"
                         icon-name="widget-gtk-drawingarea"/>
+    <glade-widget-class title="ScTabBgColorValueSet" name="scuilo-ScTabBgColorValueSet"
+                        generic-name="Set of Tab Color Options" parent="GtkDrawingArea"
+                        icon-name="widget-gtk-drawingarea"/>
     <glade-widget-class title="CsvTableBox" name="sclo-ScCsvTableBox"
                         generic-name="CSV Table Box" parent="GtkDrawingArea"
                         icon-name="widget-gtk-drawingarea"/>
diff --git a/sc/UIConfig_scalc.mk b/sc/UIConfig_scalc.mk
index 248ce4b..cddbd87 100644
--- a/sc/UIConfig_scalc.mk
+++ b/sc/UIConfig_scalc.mk
@@ -146,6 +146,7 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/scalc,\
 	sc/uiconfig/scalc/ui/subtotaloptionspage \
 	sc/uiconfig/scalc/ui/subtotalgrppage \
 	sc/uiconfig/scalc/ui/statisticsinfopage \
+	sc/uiconfig/scalc/ui/tabcolordialog \
 	sc/uiconfig/scalc/ui/textimportoptions \
 	sc/uiconfig/scalc/ui/textimportcsv \
 	sc/uiconfig/scalc/ui/tpviewpage \
diff --git a/sc/inc/sc.hrc b/sc/inc/sc.hrc
index f86b840..d97cfcf 100644
--- a/sc/inc/sc.hrc
+++ b/sc/inc/sc.hrc
@@ -1104,7 +1104,6 @@
 #define RID_SCDLG_RETYPEPASS_INPUT      (SC_DIALOGS_START + 151)
 
 #define RID_POPUP_FILTER                (SC_DIALOGS_START + 153)
-#define RID_SCDLG_TAB_BG_COLOR          (SC_DIALOGS_START + 154)
 #define RID_COND_ENTRY                  (SC_DIALOGS_START + 156)
 
 #define RID_ICON_SET_ENTRY              (SC_DIALOGS_START + 158)
diff --git a/sc/inc/scabstdlg.hxx b/sc/inc/scabstdlg.hxx
index b5ecda2..243bf24 100644
--- a/sc/inc/scabstdlg.hxx
+++ b/sc/inc/scabstdlg.hxx
@@ -463,8 +463,7 @@ public:
                                                                 const OUString& rTitle, //Dialog Title
                                                                 const OUString& rTabBgColorNoColorText, //Label for no tab color
                                                                 const Color& rDefaultColor, //Currently selected Color
-                                                                const OString& ,
-                                                                int nId ) = 0;
+                                                                const OString& ) = 0;
 
     virtual AbstractScImportOptionsDlg * CreateScImportOptionsDlg ( Window*                 pParent,
                                                                     int nId,
diff --git a/sc/source/ui/attrdlg/scdlgfact.cxx b/sc/source/ui/attrdlg/scdlgfact.cxx
index aa1a9bf..743f989 100644
--- a/sc/source/ui/attrdlg/scdlgfact.cxx
+++ b/sc/source/ui/attrdlg/scdlgfact.cxx
@@ -1005,27 +1005,15 @@ AbstractScStringInputDlg * ScAbstractDialogFactory_Impl::CreateScStringInputDlg
     return new AbstractScStringInputDlg_Impl( pDlg );
 }
 
-AbstractScTabBgColorDlg * ScAbstractDialogFactory_Impl::CreateScTabBgColorDlg (
+AbstractScTabBgColorDlg * ScAbstractDialogFactory_Impl::CreateScTabBgColorDlg(
                                                             Window* pParent,
                                                             const OUString& rTitle,
                                                             const OUString& rTabBgColorNoColorText,
                                                             const Color& rDefaultColor,
-                                                            const OString& sHelpId ,
-                                                            int nId )
+                                                            const OString& sHelpId)
 {
-    ScTabBgColorDlg * pDlg=NULL;
-    switch ( nId )
-        {
-        case RID_SCDLG_TAB_BG_COLOR :
-            pDlg = new ScTabBgColorDlg( pParent, rTitle, rTabBgColorNoColorText, rDefaultColor, sHelpId );
-            break;
-        default:
-            break;
-        }
-
-    if ( pDlg )
-        return new AbstractScTabBgColorDlg_Impl( pDlg );
-    return 0;
+    ScTabBgColorDlg * pDlg = new ScTabBgColorDlg( pParent, rTitle, rTabBgColorNoColorText, rDefaultColor, sHelpId );
+    return new AbstractScTabBgColorDlg_Impl( pDlg );
 }
 
 AbstractScImportOptionsDlg * ScAbstractDialogFactory_Impl::CreateScImportOptionsDlg ( Window*               pParent,
diff --git a/sc/source/ui/attrdlg/scdlgfact.hxx b/sc/source/ui/attrdlg/scdlgfact.hxx
index 1cdf525..78a9d2b 100644
--- a/sc/source/ui/attrdlg/scdlgfact.hxx
+++ b/sc/source/ui/attrdlg/scdlgfact.hxx
@@ -532,8 +532,7 @@ public:
                                                                 const OUString& rTitle, //Dialog Title
                                                                 const OUString& rTabBgColorNoColorText, //Label for no tab color
                                                                 const Color& rDefaultColor, //Currently selected Color
-                                                                const OString& sHelpId ,
-                                                                int nId );
+                                                                const OString& sHelpId );
 
     virtual AbstractScImportOptionsDlg * CreateScImportOptionsDlg ( Window*                 pParent,
                                                                     int nId,
diff --git a/sc/source/ui/inc/miscdlgs.hrc b/sc/source/ui/inc/miscdlgs.hrc
index fc5d694..b8c9a9e 100644
--- a/sc/source/ui/inc/miscdlgs.hrc
+++ b/sc/source/ui/inc/miscdlgs.hrc
@@ -101,8 +101,4 @@
 #define STR_GROUP       1
 #define STR_UNGROUP     2
 
-// Tab Bg Color
-#define TAB_BG_COLOR_CT_BORDER 1
-#define TAB_BG_COLOR_SET_BGDCOLOR 2
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/tabbgcolordlg.hxx b/sc/source/ui/inc/tabbgcolordlg.hxx
index e274fef..fb8330f 100644
--- a/sc/source/ui/inc/tabbgcolordlg.hxx
+++ b/sc/source/ui/inc/tabbgcolordlg.hxx
@@ -35,29 +35,29 @@ public:
                      const OUString& rTabBgColorNoColorText,
                      const Color& rDefaultColor,
                      const OString& nHelpId );
-    ~ScTabBgColorDlg();
 
     void GetSelectedColor( Color& rColor ) const;
 
-private:
     class ScTabBgColorValueSet : public SvxColorValueSet
     {
     public:
-        ScTabBgColorValueSet(Control* pParent, const ResId& rResId, ScTabBgColorDlg* pTabBgColorDlg);
+        ScTabBgColorValueSet(Window* pParent, WinBits nStyle);
+        void SetDialog(ScTabBgColorDlg* pTabBgColorDlg)
+        {
+            m_pTabBgColorDlg = pTabBgColorDlg;
+        }
 
         virtual void KeyInput( const KeyEvent& rKEvt );
     private:
-        ScTabBgColorDlg* aTabBgColorDlg;
+        ScTabBgColorDlg* m_pTabBgColorDlg;
     };
 
-    Control                 aBorderWin;
-    ScTabBgColorValueSet    aTabBgColorSet;
-    OKButton                aBtnOk;
-    CancelButton            aBtnCancel;
-    HelpButton              aBtnHelp;
-    Color                   aTabBgColor;
-    const OUString          aTabBgColorNoColorText;
-    OString                 msHelpId;
+private:
+    ScTabBgColorValueSet*   m_pTabBgColorSet;
+    OKButton*               m_pBtnOk;
+    Color                   m_aTabBgColor;
+    const OUString          m_aTabBgColorNoColorText;
+    OString                 m_sHelpId;
 
     void            FillColorValueSets_Impl();
 
diff --git a/sc/source/ui/miscdlgs/tabbgcolordlg.cxx b/sc/source/ui/miscdlgs/tabbgcolordlg.cxx
index 2c7d226..e19317a 100644
--- a/sc/source/ui/miscdlgs/tabbgcolordlg.cxx
+++ b/sc/source/ui/miscdlgs/tabbgcolordlg.cxx
@@ -34,6 +34,7 @@
 #include <tools/resid.hxx>
 #include <editeng/editrids.hrc>
 #include <editeng/eerdll.hxx>
+#include <vcl/builder.hxx>
 
 #include <boost/scoped_ptr.hpp>
 
@@ -41,41 +42,34 @@
 
 #define HDL(hdl) LINK(this,ScTabBgColorDlg,hdl)
 
-ScTabBgColorDlg::ScTabBgColorDlg( Window*         pParent,
-                                  const OUString&   rTitle,

... etc. - the rest is truncated


More information about the Libreoffice-commits mailing list