[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-5.3' - 8 commits - cli_ure/source comphelper/qa comphelper/source configure.ac external/libcmis include/comphelper sc/source svx/source sw/source writerfilter/source
Andras Timar
andras.timar at collabora.com
Tue Apr 4 10:48:19 UTC 2017
cli_ure/source/native/native_share.h | 6
comphelper/qa/string/test_string.cxx | 22 ++
comphelper/source/misc/string.cxx | 36 +++
configure.ac | 2
external/libcmis/UnpackedTarball_cmis.mk | 1
external/libcmis/libcmis-fix-google-drive-2.patch | 125 ++++++++++++
include/comphelper/string.hxx | 9
sc/source/ui/cctrl/checklistmenu.cxx | 10
sc/source/ui/inc/checklistmenu.hxx | 13 +
sc/source/ui/view/gridwin.cxx | 24 --
sc/source/ui/view/gridwin2.cxx | 14 -
svx/source/table/tablelayouter.cxx | 31 +-
sw/source/core/objectpositioning/anchoredobjectposition.cxx | 8
sw/source/filter/ascii/ascatr.cxx | 12 +
writerfilter/source/dmapper/DomainMapperTableHandler.cxx | 6
15 files changed, 272 insertions(+), 47 deletions(-)
New commits:
commit 6a2cbba5ac86068753b55b00ef262037bcc56536
Author: Andras Timar <andras.timar at collabora.com>
Date: Tue Apr 4 12:47:25 2017 +0200
Bump version to 5.3-4
Change-Id: I50cd9de5333f8fe0cbe542ebcf077411e9a959b3
diff --git a/configure.ac b/configure.ac
index 4255257388c1..15563f711ca6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -9,7 +9,7 @@ dnl in order to create a configure script.
# several non-alphanumeric characters, those are split off and used only for the
# ABOUTBOXPRODUCTVERSIONSUFFIX in openoffice.lst. Why that is necessary, no idea.
-AC_INIT([Collabora Office],[5.3.10.3],[],[],[https://collaboraoffice.com/])
+AC_INIT([Collabora Office],[5.3.10.4],[],[],[https://collaboraoffice.com/])
AC_PREREQ([2.59])
commit e3349e2b01dc51ab7e42562b3867721338fe4b25
Author: Szymon Kłos <eszkadev at gmail.com>
Date: Wed Mar 29 21:36:57 2017 +0200
tdf#98416 libcmis: Google Drive 2FA fix
Change-Id: Ice6758d8e9bc0ece57e038561376e7a6d67ab616
Reviewed-on: https://gerrit.libreoffice.org/35880
Reviewed-by: David Tardon <dtardon at redhat.com>
Tested-by: David Tardon <dtardon at redhat.com>
(cherry picked from commit 8d1a56c206e5c2ed6c331049198bb8ebc6176171)
Reviewed-on: https://gerrit.libreoffice.org/35904
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
Tested-by: Caolán McNamara <caolanm at redhat.com>
(cherry picked from commit 9700ba82ab9ffff07ae0c1ea1ca2a6e0d9a7347e)
diff --git a/external/libcmis/UnpackedTarball_cmis.mk b/external/libcmis/UnpackedTarball_cmis.mk
index 8fb247fb87aa..0b76efd254a1 100644
--- a/external/libcmis/UnpackedTarball_cmis.mk
+++ b/external/libcmis/UnpackedTarball_cmis.mk
@@ -17,6 +17,7 @@ $(eval $(call gb_UnpackedTarball_add_patches,cmis, \
external/libcmis/libcmis-libxml2_compatibility.patch \
external/libcmis/libcmis-fix-google-drive.patch \
external/libcmis/libcmis-google-2FA-implementation.patch \
+ external/libcmis/libcmis-fix-google-drive-2.patch \
external/libcmis/libcmis-sharepoint-repository-root.patch \
))
diff --git a/external/libcmis/libcmis-fix-google-drive-2.patch b/external/libcmis/libcmis-fix-google-drive-2.patch
new file mode 100755
index 000000000000..7d11514d82ee
--- /dev/null
+++ b/external/libcmis/libcmis-fix-google-drive-2.patch
@@ -0,0 +1,125 @@
+diff --git a/src/libcmis/oauth2-providers.cxx b/src/libcmis/oauth2-providers.cxx
+index 74c0fec..30fedb0 100644
+--- a/src/libcmis/oauth2-providers.cxx
++++ b/src/libcmis/oauth2-providers.cxx
+@@ -41,6 +41,7 @@
+ #define CHALLENGE_PAGE_ACTION_LEN sizeof( CHALLENGE_PAGE_ACTION ) - 1
+ #define PIN_FORM_ACTION "/signin/challenge/ipp"
+ #define PIN_FORM_ACTION_LEN sizeof( PIN_FORM_ACTION ) - 1
++#define PIN_INPUT_NAME "Pin"
+
+ using namespace std;
+
+@@ -80,7 +81,7 @@ string OAuth2Providers::OAuth2Gdrive( HttpSession* session, const string& authUr
+ // send the first get, receive the html login page
+ res = session->httpGetRequest( authUrl )->getStream( )->str( );
+ }
+- catch ( const CurlException& e )
++ catch ( const CurlException& )
+ {
+ return string( );
+ }
+@@ -102,7 +103,7 @@ string OAuth2Providers::OAuth2Gdrive( HttpSession* session, const string& authUr
+ loginEmailRes = session->httpPostRequest ( loginEmailLink, loginEmailIs, CONTENT_TYPE )
+ ->getStream( )->str( );
+ }
+- catch ( const CurlException& e )
++ catch ( const CurlException& )
+ {
+ return string( );
+ }
+@@ -113,7 +114,7 @@ string OAuth2Providers::OAuth2Gdrive( HttpSession* session, const string& authUr
+ if ( !parseResponse( loginEmailRes.c_str( ), loginPasswdPost, loginPasswdLink ) )
+ return string( );
+
+- loginPasswdPost += "&Passwd=";
++ loginPasswdPost += "Passwd=";
+ loginPasswdPost += string( password );
+
+ istringstream loginPasswdIs( loginPasswdPost );
+@@ -124,7 +125,7 @@ string OAuth2Providers::OAuth2Gdrive( HttpSession* session, const string& authUr
+ loginPasswdRes = session->httpPostRequest ( loginPasswdLink, loginPasswdIs, CONTENT_TYPE )
+ ->getStream( )->str( );
+ }
+- catch ( const CurlException& e )
++ catch ( const CurlException& )
+ {
+ return string( );
+ }
+@@ -152,7 +153,7 @@ string OAuth2Providers::OAuth2Gdrive( HttpSession* session, const string& authUr
+ }
+
+ loginChallengeLink = "https://accounts.google.com" + loginChallengeLink;
+- loginChallengePost += "Pin=";
++ loginChallengePost += string( PIN_INPUT_NAME ) + "=";
+ loginChallengePost += string( pin );
+
+ istringstream loginChallengeIs( loginChallengePost );
+@@ -163,7 +164,7 @@ string OAuth2Providers::OAuth2Gdrive( HttpSession* session, const string& authUr
+ loginChallengeRes = session->httpPostRequest ( loginChallengeLink, loginChallengeIs, CONTENT_TYPE )
+ ->getStream( )->str( );
+ }
+- catch ( const CurlException& e )
++ catch ( const CurlException& )
+ {
+ return string( );
+ }
+@@ -221,7 +222,7 @@ string OAuth2Providers::OAuth2Alfresco( HttpSession* session, const string& auth
+ {
+ res = session->httpGetRequest( authUrl )->getStream( )->str( );
+ }
+- catch ( const CurlException& e )
++ catch ( const CurlException& )
+ {
+ return string( );
+ }
+@@ -247,7 +248,7 @@ string OAuth2Providers::OAuth2Alfresco( HttpSession* session, const string& auth
+ // Alfresco code is in the redirect link
+ resp = session->httpPostRequest( loginLink, loginIs, CONTENT_TYPE, false );
+ }
+- catch ( const CurlException& e )
++ catch ( const CurlException& )
+ {
+ return string( );
+ }
+@@ -291,6 +292,8 @@ int OAuth2Providers::parseResponse ( const char* response, string& post, string&
+ if ( reader == NULL ) return 0;
+
+ bool readInputField = false;
++ bool bIsRightForm = false;
++ bool bHasPinField = false;
+
+ while ( true )
+ {
+@@ -301,6 +304,12 @@ int OAuth2Providers::parseResponse ( const char* response, string& post, string&
+ // Find the redirect link
+ if ( xmlStrEqual( nodeName, BAD_CAST( "form" ) ) )
+ {
++ // 2FA: Don't add fields form other forms not having pin field
++ if ( bIsRightForm && !bHasPinField )
++ post = string( "" );
++ if ( bIsRightForm && bHasPinField )
++ break;
++
+ xmlChar* action = xmlTextReaderGetAttribute( reader,
+ BAD_CAST( "action" ));
+
+@@ -311,7 +320,7 @@ int OAuth2Providers::parseResponse ( const char* response, string& post, string&
+ bool bChallengePage = ( strncmp( (char*)action,
+ CHALLENGE_PAGE_ACTION,
+ CHALLENGE_PAGE_ACTION_LEN ) == 0 );
+- bool bIsRightForm = ( strncmp( (char*)action,
++ bIsRightForm = ( strncmp( (char*)action,
+ PIN_FORM_ACTION,
+ PIN_FORM_ACTION_LEN ) == 0 );
+ if ( ( xmlStrlen( action ) > 0 )
+@@ -332,6 +341,8 @@ int OAuth2Providers::parseResponse ( const char* response, string& post, string&
+ BAD_CAST( "name" ));
+ xmlChar* value = xmlTextReaderGetAttribute( reader,
+ BAD_CAST( "value" ));
++ if ( name != NULL && strcmp( (char*)name, PIN_INPUT_NAME ) == 0 )
++ bHasPinField = true;
+ if ( ( name != NULL ) && ( value!= NULL ) )
+ {
+ if ( ( xmlStrlen( name ) > 0) && ( xmlStrlen( value ) > 0) )
+
commit 5b6fd648f020a9e84d1b68491ca06aa2e8fb86e2
Author: Michael Stahl <mstahl at redhat.com>
Date: Wed Mar 29 16:43:23 2017 +0200
sw: plain-text ASCII export: filter out all CH_TXT_ATR_*
These control characters are Writer implementation details and should
not be available via public interfaces.
This filter is also used by SwXTextRange::getString().
Change-Id: If656ee3d451dbefe2f7a905e8b63a44cdb787809
(cherry picked from commit ab4f53eaad0c064d9b2ff1c2cb20560f81ade1f7)
Reviewed-on: https://gerrit.libreoffice.org/35862
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
Tested-by: Caolán McNamara <caolanm at redhat.com>
(cherry picked from commit 5254a7d1cbf3f62c6664299752d2788bb4f2a0b4)
diff --git a/comphelper/qa/string/test_string.cxx b/comphelper/qa/string/test_string.cxx
index 636c30587370..b36b7988489f 100644
--- a/comphelper/qa/string/test_string.cxx
+++ b/comphelper/qa/string/test_string.cxx
@@ -43,6 +43,7 @@ public:
void testIsdigitAsciiString();
void testReverseString();
void testSplit();
+ void testRemoveAny();
CPPUNIT_TEST_SUITE(TestString);
CPPUNIT_TEST(testNatural);
@@ -55,6 +56,7 @@ public:
CPPUNIT_TEST(testIsdigitAsciiString);
CPPUNIT_TEST(testReverseString);
CPPUNIT_TEST(testSplit);
+ CPPUNIT_TEST(testRemoveAny);
CPPUNIT_TEST_SUITE_END();
};
@@ -390,6 +392,26 @@ void TestString::testSplit()
CPPUNIT_ASSERT_EQUAL(OUString("F1"), aRet[2]);
}
+void TestString::testRemoveAny()
+{
+ using namespace ::comphelper::string;
+ OUString in("abcAAAbbC");
+ sal_Unicode const test1 [] = { 'a', 0 };
+ CPPUNIT_ASSERT_EQUAL(OUString("bcAAAbbC"), removeAny(in, test1));
+ sal_Unicode const test2 [] = { 0 };
+ CPPUNIT_ASSERT_EQUAL(in, removeAny(in, test2));
+ sal_Unicode const test3 [] = { 'A', 0 };
+ CPPUNIT_ASSERT_EQUAL(OUString("abcbbC"), removeAny(in, test3));
+ sal_Unicode const test4 [] = { 'A', 'a', 0 };
+ CPPUNIT_ASSERT_EQUAL(OUString("bcbbC"), removeAny(in, test4));
+ sal_Unicode const test5 [] = { 'C', 0 };
+ CPPUNIT_ASSERT_EQUAL(OUString("abcAAAbb"), removeAny(in, test5));
+ sal_Unicode const test6 [] = { 'X', 0 };
+ CPPUNIT_ASSERT_EQUAL(in, removeAny(in, test6));
+ sal_Unicode const test7 [] = { 'A', 'B', 'C', 'a', 'b', 'c', 0 };
+ CPPUNIT_ASSERT_EQUAL(OUString(""), removeAny(in, test7));
+}
+
CPPUNIT_TEST_SUITE_REGISTRATION(TestString);
}
diff --git a/comphelper/source/misc/string.cxx b/comphelper/source/misc/string.cxx
index db035eb22967..5ca35f9eb535 100644
--- a/comphelper/source/misc/string.cxx
+++ b/comphelper/source/misc/string.cxx
@@ -420,6 +420,42 @@ sal_Int32 indexOfAny(OUString const& rIn,
return -1;
}
+OUString removeAny(OUString const& rIn,
+ sal_Unicode const*const pChars)
+{
+ OUStringBuffer buf;
+ bool isFound(false);
+ for (sal_Int32 i = 0; i < rIn.getLength(); ++i)
+ {
+ sal_Unicode const c = rIn[i];
+ bool removeC(false);
+ for (sal_Unicode const* pChar = pChars; *pChar; ++pChar)
+ {
+ if (c == *pChar)
+ {
+ removeC = true;
+ break;
+ }
+ }
+ if (removeC)
+ {
+ if (!isFound)
+ {
+ if (i > 0)
+ {
+ buf.append(rIn.copy(0, i));
+ }
+ isFound = true;
+ }
+ }
+ else if (isFound)
+ {
+ buf.append(c);
+ }
+ }
+ return (isFound) ? buf.makeStringAndClear() : rIn;
+}
+
OUString setToken(const OUString& rIn, sal_Int32 nToken, sal_Unicode cTok,
const OUString& rNewToken)
{
diff --git a/include/comphelper/string.hxx b/include/comphelper/string.hxx
index 8aab4f12eddf..7934a6b6d7cf 100644
--- a/include/comphelper/string.hxx
+++ b/include/comphelper/string.hxx
@@ -255,6 +255,15 @@ COMPHELPER_DLLPUBLIC OUString setToken(const OUString& rIn, sal_Int32 nToken, sa
COMPHELPER_DLLPUBLIC sal_Int32 indexOfAny(OUString const& rIn,
sal_Unicode const*const pChars, sal_Int32 const nPos);
+/** Remove any of a list of code units in the string.
+ @param rIn OUString to search
+ @param pChars 0-terminated array of sal_Unicode code units to search for
+
+ @return OUString that has all of the pChars code units removed
+ */
+COMPHELPER_DLLPUBLIC OUString removeAny(OUString const& rIn,
+ sal_Unicode const*const pChars);
+
/** Convert a sequence of strings to a single comma separated string.
Note that no escaping of commas or anything fancy is done.
diff --git a/sw/source/filter/ascii/ascatr.cxx b/sw/source/filter/ascii/ascatr.cxx
index 4c0037a992c7..01c1caf673f7 100644
--- a/sw/source/filter/ascii/ascatr.cxx
+++ b/sw/source/filter/ascii/ascatr.cxx
@@ -206,6 +206,18 @@ static Writer& OutASC_SwTextNode( Writer& rWrt, SwContentNode& rNode )
if ( !bExportSoftHyphens )
aOutStr = aOutStr.replaceAll(OUStringLiteral1(CHAR_SOFTHYPHEN), "");
+ // all INWORD/BREAKWORD should be already removed by OutAttr
+ // but the field-marks are not attributes so filter those
+ static sal_Unicode const forbidden [] = {
+ CH_TXT_ATR_INPUTFIELDSTART,
+ CH_TXT_ATR_INPUTFIELDEND,
+ CH_TXT_ATR_FORMELEMENT,
+ CH_TXT_ATR_FIELDSTART,
+ CH_TXT_ATR_FIELDEND,
+ 0
+ };
+ aOutStr = comphelper::string::removeAny(aOutStr, forbidden);
+
rWrt.Strm().WriteUnicodeOrByteText( aOutStr );
}
nStrPos = nNextAttr;
commit ec52c2f4b7090ced1810b23fd6cc5fb2db4215d2
Author: Patrick Jaap <patj at mail.de>
Date: Wed Mar 29 11:35:25 2017 +0200
tdf#101627 disable shrinking for footer textboxes
the shrinking patch a4dee94afed9ade6ac50237c8d99a6e49d3bebc1
causes problems, if the textboxes are anchored in the
footer. Therefore, disable it in this case.
For details, see comments in bug tracker.
Change-Id: I117a99041ff67c19a9de17803ff7864c62afdb50
Reviewed-on: https://gerrit.libreoffice.org/34517
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Michael Stahl <mstahl at redhat.com>
(cherry picked from commit 80b9b6761e8cb974e0cdc0c7be0eb95f8745d86f)
Reviewed-on: https://gerrit.libreoffice.org/35844
(cherry picked from commit da18188c359dee813fa1d4c7000490f1512c277b)
diff --git a/sw/source/core/objectpositioning/anchoredobjectposition.cxx b/sw/source/core/objectpositioning/anchoredobjectposition.cxx
index 4b300ce8bf3f..c1e7808517c1 100644
--- a/sw/source/core/objectpositioning/anchoredobjectposition.cxx
+++ b/sw/source/core/objectpositioning/anchoredobjectposition.cxx
@@ -486,8 +486,12 @@ SwTwips SwAnchoredObjectPosition::ImplAdjustVertRelPos( const SwTwips nTopOfAnch
nAdjustedRelPosY = aPgAlignArea.Top() - nTopOfAnch;
}
- // tdf#91260 - allow textboxes extending beyond the page bottom
- if ( nAdjustedRelPosY < nProposedRelPosY )
+ // tdf#91260 - allow textboxes extending beyond the page bottom
+ // tdf#101627 - the patch a4dee94afed9ade6ac50237c8d99a6e49d3bebc1
+ // for tdf#91260 causes problems if the textbox
+ // is anchored in the footer, so exclude this case
+ if ( !( GetAnchorFrame().GetUpper() && GetAnchorFrame().GetUpper()->IsFooterFrame() )
+ && nAdjustedRelPosY < nProposedRelPosY )
{
const SwFrameFormat* pFormat = &(GetFrameFormat());
if ( SwTextBoxHelper::isTextBox(&GetObject()) )
commit f89a29c9268b3cf3d8d7beaedb5011b14cd18151
Author: Michael Stahl <mstahl at redhat.com>
Date: Thu Mar 30 23:11:41 2017 +0200
writerfilter: DOCX import: fix handling of w:hideMark vs. w:vMerge
The problem is that Writer's layout can't handle the case where cells
are vertically merged and the last row has a fixed height; the vertically
merged cell will grow up to the height of the other cells in the non-
fixed rows plus the fixed row height, but no larger.
So for now, avoid setting fixed row heights in this case.
(regression from d1278ef4849661b9ae0eb7aaf4d74fbf91ccaf11)
Change-Id: Iac3689e0bb0d5b8a62115ca0fb1f2c553a6e6bbc
(cherry picked from commit c382c998ffdaf80c10a3f078fb4f0a37224d1158)
Reviewed-on: https://gerrit.libreoffice.org/35960
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Miklos Vajna <vmiklos at collabora.co.uk>
(cherry picked from commit 7d7d21cfa53c8e80fd4dd0938579d8377da5a840)
diff --git a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx
index 81220bdfec2d..36f30a36c39c 100644
--- a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx
+++ b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx
@@ -875,8 +875,12 @@ CellPropertyValuesSeq_t DomainMapperTableHandler::endTableGetCellProperties(Tabl
bool lcl_hideMarks(PropertyMapVector1& rCellProperties)
{
for (PropertyMapPtr & p : rCellProperties)
- if (!p->isSet(PROP_CELL_HIDE_MARK))
+ {
+ // if anything is vertically merged, the row must not be set to fixed
+ // as Writer's layout doesn't handle that well
+ if (!p->isSet(PROP_CELL_HIDE_MARK) || p->isSet(PROP_VERTICAL_MERGE))
return false;
+ }
return true;
}
commit e617bf01e3d7593d41f60c4a56a69caddf93c64e
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Mar 31 11:23:04 2017 +0100
ofz#974 check SetBorder bounds like the other maHorizontalBorders users
Change-Id: Iac113433ac2317ddfebc68ed793c481384d56551
Reviewed-on: https://gerrit.libreoffice.org/35965
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Michael Stahl <mstahl at redhat.com>
(cherry picked from commit 17c2f64e03476697d19f224fc9b08aa6cbc6cd03)
diff --git a/svx/source/table/tablelayouter.cxx b/svx/source/table/tablelayouter.cxx
index e90c19999fcf..24f0f17a04f9 100644
--- a/svx/source/table/tablelayouter.cxx
+++ b/svx/source/table/tablelayouter.cxx
@@ -916,36 +916,40 @@ bool TableLayouter::HasPriority( const SvxBorderLine* pThis, const SvxBorderLine
}
}
-
void TableLayouter::SetBorder( sal_Int32 nCol, sal_Int32 nRow, bool bHorizontal, const SvxBorderLine* pLine )
{
- if( pLine == nullptr )
+ if (!pLine)
pLine = &gEmptyBorder;
- SvxBorderLine *pOld = bHorizontal ? maHorizontalBorders[nCol][nRow] : maVerticalBorders[nCol][nRow];
+ BorderLineMap& rMap = bHorizontal ? maHorizontalBorders : maVerticalBorders;
- if( HasPriority( pLine, pOld ) )
+ if( (nCol >= 0) && (nCol < sal::static_int_cast<sal_Int32>(rMap.size())) &&
+ (nRow >= 0) && (nRow < sal::static_int_cast<sal_Int32>(rMap[nCol].size())) )
{
- if( (pOld != nullptr) && (pOld != &gEmptyBorder) )
- delete pOld;
+ SvxBorderLine *pOld = rMap[nCol][nRow];
- SvxBorderLine* pNew = ( pLine != &gEmptyBorder ) ? new SvxBorderLine(*pLine) : &gEmptyBorder;
+ if (HasPriority(pLine, pOld))
+ {
+ if (pOld && pOld != &gEmptyBorder)
+ delete pOld;
- if( bHorizontal )
- maHorizontalBorders[nCol][nRow] = pNew;
- else
- maVerticalBorders[nCol][nRow] = pNew;
+ SvxBorderLine* pNew = (pLine != &gEmptyBorder) ? new SvxBorderLine(*pLine) : &gEmptyBorder;
+
+ rMap[nCol][nRow] = pNew;
+ }
+ }
+ else
+ {
+ OSL_FAIL( "sdr::table::TableLayouter::SetBorder(), invalid border!" );
}
}
-
void TableLayouter::ClearBorderLayout()
{
ClearBorderLayout(maHorizontalBorders);
ClearBorderLayout(maVerticalBorders);
}
-
void TableLayouter::ClearBorderLayout(BorderLineMap& rMap)
{
const sal_Int32 nColCount = rMap.size();
@@ -967,7 +971,6 @@ void TableLayouter::ClearBorderLayout(BorderLineMap& rMap)
}
}
-
void TableLayouter::ResizeBorderLayout()
{
ClearBorderLayout();
commit 5bea1d8b898004b87943203c0b492361df52fd3e
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Sun Mar 26 22:50:18 2017 +0200
handle date autofilter entries correctly, tdf#106214
Change-Id: I8fd2896c8998e79794a0ccaae1c2442caf8b89ac
Reviewed-on: https://gerrit.libreoffice.org/35730
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Markus Mohrhard <markus.mohrhard at googlemail.com>
(cherry picked from commit b3d498755238cb0d9a7a3e33b6070c1e4c0e3482)
Reviewed-on: https://gerrit.libreoffice.org/35733
Reviewed-by: Kohei Yoshida <libreoffice at kohei.us>
(cherry picked from commit 99744cb30435f2158d29967b77d08d0e4f79492c)
diff --git a/sc/source/ui/cctrl/checklistmenu.cxx b/sc/source/ui/cctrl/checklistmenu.cxx
index 226f029c6633..e73c229ff975 100644
--- a/sc/source/ui/cctrl/checklistmenu.cxx
+++ b/sc/source/ui/cctrl/checklistmenu.cxx
@@ -1916,12 +1916,14 @@ void ScCheckListMenuWindow::getResult(ResultType& rResult)
if (aLabel.isEmpty())
aLabel = ScGlobal::GetRscString(STR_EMPTYDATA);
bool bState = maChecks->IsChecked( aLabel, maMembers[i].mpParent );
- OUString sName;
+ ResultEntry aResultEntry;
+ aResultEntry.bValid = bState;
if ( maMembers[i].mbDate )
- sName = maMembers[i].maRealName;
+ aResultEntry.aName = maMembers[i].maRealName;
else
- sName = maMembers[i].maName;
- aResult.insert(ResultType::value_type(sName, bState));
+ aResultEntry.aName = maMembers[i].maName;
+ aResultEntry.bDate = maMembers[i].mbDate;
+ aResult.insert(aResultEntry);
}
}
rResult.swap(aResult);
diff --git a/sc/source/ui/inc/checklistmenu.hxx b/sc/source/ui/inc/checklistmenu.hxx
index 1ee9e7bdc102..d80e20b76d21 100644
--- a/sc/source/ui/inc/checklistmenu.hxx
+++ b/sc/source/ui/inc/checklistmenu.hxx
@@ -293,7 +293,18 @@ struct ScCheckListMember
class ScCheckListMenuWindow : public ScMenuFloatingWindow
{
public:
- typedef std::unordered_map<OUString, bool, OUStringHash> ResultType;
+ struct ResultEntry
+ {
+ OUString aName;
+ bool bValid;
+ bool bDate;
+
+ bool operator<(const ResultEntry& rhs) const
+ {
+ return aName < rhs.aName;
+ }
+ };
+ typedef std::set<ResultEntry> ResultType;
/**
* Extended data that the client code may need to store. Create a
diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx
index f6c328238994..d2b8f97a1d21 100644
--- a/sc/source/ui/view/gridwin.cxx
+++ b/sc/source/ui/view/gridwin.cxx
@@ -643,13 +643,16 @@ class AddItemToEntry : public std::unary_function<OUString, void>
public:
AddItemToEntry(ScQueryEntry::QueryItemsType& rItems, svl::SharedStringPool& rPool) :
mrItems(rItems), mrPool(rPool) {}
- void operator() (const OUString& rSelected)
+ void operator() (const ScCheckListMenuWindow::ResultEntry& rEntry)
{
- ScQueryEntry::Item aNew;
- aNew.maString = mrPool.intern(rSelected);
- aNew.meType = ScQueryEntry::ByString;
- aNew.mfVal = 0.0;
- mrItems.push_back(aNew);
+ if (rEntry.bValid)
+ {
+ ScQueryEntry::Item aNew;
+ aNew.maString = mrPool.intern(rEntry.aName);
+ aNew.meType = rEntry.bDate ? ScQueryEntry::ByDate : ScQueryEntry::ByString;
+ aNew.mfVal = 0.0;
+ mrItems.push_back(aNew);
+ }
}
};
@@ -853,17 +856,10 @@ void ScGridWindow::UpdateAutoFilterFromMenu(AutoFilterMode eMode)
ScCheckListMenuWindow::ResultType aResult;
mpAutoFilterPopup->getResult(aResult);
- std::vector<OUString> aSelected;
- ScCheckListMenuWindow::ResultType::const_iterator itr = aResult.begin(), itrEnd = aResult.end();
- for (; itr != itrEnd; ++itr)
- {
- if (itr->second)
- aSelected.push_back(itr->first);
- }
ScQueryEntry::QueryItemsType& rItems = pEntry->GetQueryItems();
rItems.clear();
- std::for_each(aSelected.begin(), aSelected.end(), AddItemToEntry(rItems, rPool));
+ std::for_each(aResult.begin(), aResult.end(), AddItemToEntry(rItems, rPool));
}
break;
case Top10:
diff --git a/sc/source/ui/view/gridwin2.cxx b/sc/source/ui/view/gridwin2.cxx
index c2e34db084ea..ae9398ecb416 100644
--- a/sc/source/ui/view/gridwin2.cxx
+++ b/sc/source/ui/view/gridwin2.cxx
@@ -554,29 +554,29 @@ void ScGridWindow::UpdateDPFromFieldPopupMenu()
ScCheckListMenuWindow::ResultType aRawResult;
mpDPFieldPopup->getResult(aRawResult);
- ScCheckListMenuWindow::ResultType aResult;
+ std::unordered_map<OUString, bool, OUStringHash> aResult;
ScCheckListMenuWindow::ResultType::const_iterator itr = aRawResult.begin(), itrEnd = aRawResult.end();
for (; itr != itrEnd; ++itr)
{
- MemNameMapType::const_iterator itrNameMap = aMemNameMap.find(itr->first);
+ MemNameMapType::const_iterator itrNameMap = aMemNameMap.find(itr->aName);
if (itrNameMap == aMemNameMap.end())
{
// This is an original member name. Use it as-is.
- OUString aName = itr->first;
+ OUString aName = itr->aName;
if (aName.equals(ScGlobal::GetRscString(STR_EMPTYDATA)))
// Translate the special empty name into an empty string.
aName.clear();
aResult.insert(
- ScCheckListMenuWindow::ResultType::value_type(
- aName, itr->second));
+ std::unordered_map<OUString, bool, OUStringHash>::value_type(
+ aName, itr->bValid));
}
else
{
// This is a layout name. Get the original member name and use it.
aResult.insert(
- ScCheckListMenuWindow::ResultType::value_type(
- itrNameMap->second, itr->second));
+ std::unordered_map<OUString, bool, OUStringHash>::value_type(
+ itrNameMap->second, itr->bValid));
}
}
pDim->UpdateMemberVisibility(aResult);
commit 348eda61d501fb2e414742433ce9ced0247edc33
Author: Michael Stahl <mstahl at redhat.com>
Date: Wed Mar 29 12:03:50 2017 +0200
cli_ure: fix another bad _WIN64 check (related tdf#94265)
Same problem as commit 2aa20cfb7a11dd8d86372af4065a5887a0b752ca
Change-Id: I02160c53870a021c742babf358e0d6172557ef21
(cherry picked from commit cfaba15c589f882cc0bcce5cd07bdf3d30f547f6)
Reviewed-on: https://gerrit.libreoffice.org/35837
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman at redhat.com>
(cherry picked from commit 81bf39616039280fc1f9b18db3ea6dc04ae9fc08)
diff --git a/cli_ure/source/native/native_share.h b/cli_ure/source/native/native_share.h
index 9b3ebe1ac9b9..1be1b3a082b3 100644
--- a/cli_ure/source/native/native_share.h
+++ b/cli_ure/source/native/native_share.h
@@ -91,10 +91,10 @@ inline void to_uno(
reinterpret_cast< void ** >( &ret ),
reinterpret_cast< void * >(
::System::Runtime::InteropServices::GCHandle::op_Explicit( handle )
-#if defined _WIN32
- .ToInt32()
-#elif defined _WIN64
+#if defined _WIN64
.ToInt64()
+#elif defined _WIN32
+ .ToInt32()
#else
#error ERROR: either _WIN64 or _WIN32 must be defined
ERROR: either _WIN64 or _WIN32 must be defined
More information about the Libreoffice-commits
mailing list