[Libreoffice-commits] core.git: xmlsecurity/qa

2016-04-28 Thread Guillaume Smaha
 xmlsecurity/qa/unit/signing/data/tdf96097.ods |binary
 xmlsecurity/qa/unit/signing/data/tdf96097.odt |binary
 xmlsecurity/qa/unit/signing/signing.cxx   |  111 ++
 3 files changed, 111 insertions(+)

New commits:
commit 4d2bb795820ef30f230605194207a3bd50299127
Author: Guillaume Smaha 
Date:   Mon Apr 25 18:39:27 2016 +0200

Unit test for tdf#96097: Can't save/pointer null

Change-Id: I56af30142bba8579ca7f242d12390832051b
Reviewed-on: https://gerrit.libreoffice.org/24372
Tested-by: Jenkins 
Reviewed-by: jan iversen 

diff --git a/xmlsecurity/qa/unit/signing/data/tdf96097.ods 
b/xmlsecurity/qa/unit/signing/data/tdf96097.ods
new file mode 100644
index 000..58d1b2c
Binary files /dev/null and b/xmlsecurity/qa/unit/signing/data/tdf96097.ods 
differ
diff --git a/xmlsecurity/qa/unit/signing/data/tdf96097.odt 
b/xmlsecurity/qa/unit/signing/data/tdf96097.odt
new file mode 100644
index 000..f035651
Binary files /dev/null and b/xmlsecurity/qa/unit/signing/data/tdf96097.odt 
differ
diff --git a/xmlsecurity/qa/unit/signing/signing.cxx 
b/xmlsecurity/qa/unit/signing/signing.cxx
index 83fdd8d8..45308d2 100644
--- a/xmlsecurity/qa/unit/signing/signing.cxx
+++ b/xmlsecurity/qa/unit/signing/signing.cxx
@@ -76,6 +76,8 @@ public:
 void testOOXMLRemove();
 /// Test removing all signatures from a document.
 void testOOXMLRemoveAll();
+void test96097Calc();
+void test96097Doc();
 
 CPPUNIT_TEST_SUITE(SigningTest);
 CPPUNIT_TEST(testDescription);
@@ -88,10 +90,13 @@ public:
 CPPUNIT_TEST(testOOXMLAppend);
 CPPUNIT_TEST(testOOXMLRemove);
 CPPUNIT_TEST(testOOXMLRemoveAll);
+CPPUNIT_TEST(test96097Calc);
+CPPUNIT_TEST(test96097Doc);
 CPPUNIT_TEST_SUITE_END();
 
 private:
 void createDoc(const OUString& rURL = OUString());
+void createCalc(const OUString& rURL = OUString());
 uno::Reference getCertificate(XMLSignatureHelper& 
rSignatureHelper);
 };
 
@@ -125,6 +130,16 @@ void SigningTest::createDoc(const OUString& rURL)
 mxComponent = loadFromDesktop(rURL, "com.sun.star.text.TextDocument");
 }
 
+void SigningTest::createCalc(const OUString& rURL)
+{
+if (mxComponent.is())
+mxComponent->dispose();
+if (rURL.isEmpty())
+mxComponent = loadFromDesktop("private:factory/swriter", 
"com.sun.star.sheet.SpreadsheetDocument");
+else
+mxComponent = loadFromDesktop(rURL, 
"com.sun.star.sheet.SpreadsheetDocument");
+}
+
 uno::Reference 
SigningTest::getCertificate(XMLSignatureHelper& rSignatureHelper)
 {
 uno::Reference xSecurityEnvironment = 
rSignatureHelper.GetSecurityEnvironment();
@@ -364,6 +379,102 @@ void SigningTest::testOOXMLBroken()
 CPPUNIT_ASSERT_EQUAL(static_cast(SignatureState::BROKEN), 
static_cast(pObjectShell->GetDocumentSignatureState()));
 }
 
+void SigningTest::test96097Calc()
+{
+createCalc(m_directories.getURLFromSrc(DATA_DIRECTORY) + "tdf96097.ods");
+SfxBaseModel* pBaseModel = dynamic_cast(mxComponent.get());
+CPPUNIT_ASSERT_MESSAGE("Failed to access document base model", pBaseModel);
+
+SfxObjectShell* pObjectShell = pBaseModel->GetObjectShell();
+CPPUNIT_ASSERT_MESSAGE("Failed to access document shell", pObjectShell);
+
+SignatureState nActual = pObjectShell->GetScriptingSignatureState();
+CPPUNIT_ASSERT_MESSAGE(
+(OString::number(
+ static_cast::type>(nActual))
+ .getStr()),
+(nActual == SignatureState::OK
+ || nActual == SignatureState::NOTVALIDATED
+ || nActual == SignatureState::INVALID));
+
+
+uno::Reference xDocStorable(mxComponent, 
uno::UNO_QUERY_THROW);
+CPPUNIT_ASSERT(xDocStorable.is());
+
+// Save a copy
+utl::TempFile aTempFileSaveCopy;
+aTempFileSaveCopy.EnableKillingFile();
+uno::Sequence descSaveACopy(2);
+descSaveACopy[0].Name = "SaveACopy";
+descSaveACopy[0].Value <<= uno::makeAny(true);
+descSaveACopy[1].Name = "FilterName";
+descSaveACopy[1].Value <<= OUString("calc8");
+xDocStorable->storeToURL(aTempFileSaveCopy.GetURL(), descSaveACopy);
+
+try
+{
+// Save As
+utl::TempFile aTempFileSaveAs;
+aTempFileSaveAs.EnableKillingFile();
+uno::Sequence descSaveAs(1);
+descSaveAs[0].Name = "FilterName";
+descSaveAs[0].Value <<= OUString("calc8");
+xDocStorable->storeAsURL(aTempFileSaveAs.GetURL(), descSaveAs);
+}
+catch(...)
+{
+CPPUNIT_FAIL("Fail to save as the document");
+}
+}
+
+void SigningTest::test96097Doc()
+{
+createDoc(m_directories.getURLFromSrc(DATA_DIRECTORY) + "tdf96097.odt");
+SfxBaseModel* pBaseModel = dynamic_cast(mxComponent.get());
+CPPUNIT_ASSERT(pBaseModel);
+SfxObjectShell* pObjectShell = pBaseModel->GetObjectShell();
+CPPUNIT_ASSERT(pObjectShell);
+
+SignatureState nActual = pObjectShell->GetScriptingSignatureState();
+CPPUNIT_ASSERT_MESSAGE(
+(OString::number(
+ 

[Libreoffice-commits] core.git: bridges/source

2016-04-28 Thread tymyjan
 bridges/source/cpp_uno/msvc_win32_intel/except.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 6dbcebab6d6b82bed03dae2aedf774b7a4e9841e
Author: tymyjan 
Date:   Wed Apr 27 19:06:00 2016 +0200

tdf#97499 Fixed containers parameters clearing #6

Change-Id: I89ad45eacfffd3783687b158a45f3eda0b95dece
Reviewed-on: https://gerrit.libreoffice.org/24433
Tested-by: Jenkins 
Reviewed-by: Stephan Bergmann 

diff --git a/bridges/source/cpp_uno/msvc_win32_intel/except.cxx 
b/bridges/source/cpp_uno/msvc_win32_intel/except.cxx
index ec40be7..f8c4ff6 100644
--- a/bridges/source/cpp_uno/msvc_win32_intel/except.cxx
+++ b/bridges/source/cpp_uno/msvc_win32_intel/except.cxx
@@ -83,7 +83,7 @@ static inline OUString toRTTIname( OUString const & rUNOname 
) throw ()
 // RTTI simulation 
#
 
 
-typedef std::unordered_map< OUString, void *, OUStringHash, equal_to< OUString 
> > t_string2PtrMap;
+typedef std::unordered_map< OUString, void *, OUStringHash > t_string2PtrMap;
 
 class RTTInfos
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: bridges/source

2016-04-28 Thread tymyjan
 bridges/source/cpp_uno/msvc_win32_x86-64/except.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 12694155608762056d5cbf0f89dd1675a7aefb45
Author: tymyjan 
Date:   Wed Apr 27 21:09:28 2016 +0200

tdf#97499 Fixed containers parameters clearing #7

Change-Id: Ieb9ab0f9c011a24ba329cfb063e3d7733dd1afcb
Reviewed-on: https://gerrit.libreoffice.org/24440
Tested-by: Jenkins 
Reviewed-by: Stephan Bergmann 

diff --git a/bridges/source/cpp_uno/msvc_win32_x86-64/except.cxx 
b/bridges/source/cpp_uno/msvc_win32_x86-64/except.cxx
index f16e0d4..9d8056d 100644
--- a/bridges/source/cpp_uno/msvc_win32_x86-64/except.cxx
+++ b/bridges/source/cpp_uno/msvc_win32_x86-64/except.cxx
@@ -309,7 +309,7 @@ static inline OUString toRTTIname(
 
 //RTTI simulation
 
-typedef std::unordered_map< OUString, void *, OUStringHash, equal_to< OUString 
> > t_string2PtrMap;
+typedef std::unordered_map< OUString, void *, OUStringHash > t_string2PtrMap;
 class __type_info_descriptor;
 
 class RTTInfos
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-1' - sw/qa writerfilter/source

2016-04-28 Thread Caolán McNamara
 sw/qa/extras/rtfimport/data/tdf99498.rtf   |3 +++
 sw/qa/extras/rtfimport/rtfimport.cxx   |   11 +++
 writerfilter/source/rtftok/rtfdocumentimpl.cxx |   18 ++
 3 files changed, 28 insertions(+), 4 deletions(-)

New commits:
commit b9dbeb401b1f8f9b89a1ab477a566cbf42967c8a
Author: Caolán McNamara 
Date:   Wed Apr 27 14:50:05 2016 +0100

Resolves: tdf#99498 don't overwrite trwWidth value if set on a table

Reviewed-on: https://gerrit.libreoffice.org/24430
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 
(cherry picked from commit b71f470e370c1819cba99abe5ef654d28bbf8749)

Change-Id: Ia39da999a2de1ca2b8bec5fc7f35d2f9ffe2dd19
Reviewed-on: https://gerrit.libreoffice.org/24434
Tested-by: Jenkins 
Reviewed-by: Miklos Vajna 

diff --git a/sw/qa/extras/rtfimport/data/tdf99498.rtf 
b/sw/qa/extras/rtfimport/data/tdf99498.rtf
new file mode 100644
index 000..61a3066
--- /dev/null
+++ b/sw/qa/extras/rtfimport/data/tdf99498.rtf
@@ -0,0 +1,3 @@
+{\rtf1\ansi\ansicpg1252\deff0{\fonttbl{\f0\froman\fcharset0 Times New 
Roman;}{\f1\froman\fcharset0 
Arial;}}{\colortbl\red0\green0\blue0;\red255\green255\blue255;}{\stylesheet 
{\style\s0 \ql\fi0\li0\ri0\f1\fs24\cf0 Normal;}}
+{\*\generator iText 2.1.7 by 1T3XT}
+\par\par\trowd\trftsWidth3\trwWidth4000\trhdr\trqc\trgaph10\trpaddl0\trpaddr0\trpaddfl3\trpaddfr3\clvertalt\clcbpat1\clftsWidth3\clwWidth0\cellx0\clvertalt\clcbpat1\clftsWidth3\clwWidth0\cellx0\pard\plain\intbl\s0\fi0\li0\ri0\sl280\plain\f1\fs22\cf0
 CELLCONTENTS \cell\pard\plain\intbl\s0\fi0\li0\ri0\sl280\plain\cell \row\pard}
diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx 
b/sw/qa/extras/rtfimport/rtfimport.cxx
index 20f8755..5dfc751 100644
--- a/sw/qa/extras/rtfimport/rtfimport.cxx
+++ b/sw/qa/extras/rtfimport/rtfimport.cxx
@@ -2497,6 +2497,17 @@ DECLARE_RTFIMPORT_TEST(testTdf96308Tabpos, 
"tdf96308-tabpos.rtf")
 CPPUNIT_ASSERT(!aTabStops.hasElements());
 }
 
+DECLARE_RTFIMPORT_TEST(testTdf99498, "tdf99498.rtf")
+{
+uno::Reference xTextTablesSupplier(mxComponent, 
uno::UNO_QUERY);
+uno::Reference 
xTables(xTextTablesSupplier->getTextTables(), uno::UNO_QUERY);
+
+// Table width was a tiny sub one char wide 145twips, it should now be a 
table wide
+// enough to see all the text in the first column without breaking into 
multiple lines
+CPPUNIT_ASSERT_EQUAL(sal_Int32(7056), 
getProperty(xTables->getByIndex(0), "Width"));
+}
+
+
 DECLARE_RTFIMPORT_TEST(testTdf87034, "tdf87034.rtf")
 {
 // This was A1BC34D, i.e. the first "super" text portion was mis-imported,
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx 
b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index bb1991d..26e70ae 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -1374,10 +1374,14 @@ void RTFDocumentImpl::prepareProperties(
 }
 
 // Table width.
-auto pUnitValue = std::make_shared(3);
-lcl_putNestedAttribute(rState.aTableRowSprms, 
NS_ooxml::LN_CT_TblPrBase_tblW, NS_ooxml::LN_CT_TblWidth_type, pUnitValue);
-auto pWValue = std::make_shared(nCurrentCellX);
-lcl_putNestedAttribute(rState.aTableRowSprms, 
NS_ooxml::LN_CT_TblPrBase_tblW, NS_ooxml::LN_CT_TblWidth_w, pWValue);
+RTFValue::Pointer_t const pTableWidthProps = 
rState.aTableRowSprms.find(NS_ooxml::LN_CT_TblPrBase_tblW);
+if (!pTableWidthProps.get())
+{
+auto pUnitValue = std::make_shared(3);
+lcl_putNestedAttribute(rState.aTableRowSprms, 
NS_ooxml::LN_CT_TblPrBase_tblW, NS_ooxml::LN_CT_TblWidth_type, pUnitValue);
+auto pWValue = std::make_shared(nCurrentCellX);
+lcl_putNestedAttribute(rState.aTableRowSprms, 
NS_ooxml::LN_CT_TblPrBase_tblW, NS_ooxml::LN_CT_TblWidth_w, pWValue);
+}
 
 auto pRowValue = std::make_shared(1);
 if (nCells > 0)
@@ -4810,6 +4814,12 @@ RTFError RTFDocumentImpl::dispatchValue(RTFKeyword 
nKeyword, int nParam)
 lcl_putNestedSprm(m_aStates.top().aTableRowSprms, 
NS_ooxml::LN_CT_TblPrBase_tblCellMar, NS_ooxml::LN_CT_TblCellMar_right, 
std::make_shared(aAttributes));
 }
 break;
+case RTF_TRFTSWIDTH:
+lcl_putNestedAttribute(m_aStates.top().aTableRowSprms, 
NS_ooxml::LN_CT_TblPrBase_tblW, NS_ooxml::LN_CT_TblWidth_type, pIntValue);
+break;
+case RTF_TRWWIDTH:
+lcl_putNestedAttribute(m_aStates.top().aTableRowSprms, 
NS_ooxml::LN_CT_TblPrBase_tblW, NS_ooxml::LN_CT_TblWidth_w, pIntValue);
+break;
 default:
 {
 SAL_INFO("writerfilter", "TODO handle value '" << 
lcl_RtfToString(nKeyword) << "'");
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: sw/qa writerfilter/source

2016-04-28 Thread Miklos Vajna
 sw/qa/extras/rtfexport/data/pgndec.rtf |   23 +++
 sw/qa/extras/rtfexport/rtfexport.cxx   |6 ++
 writerfilter/source/dmapper/DomainMapper.cxx   |4 
 writerfilter/source/rtftok/rtfdocumentimpl.cxx |7 ++-
 4 files changed, 39 insertions(+), 1 deletion(-)

New commits:
commit b94d753ac9e3894da055d31bbb7bb20e11b97b5a
Author: Miklos Vajna 
Date:   Sat Apr 23 20:34:57 2016 +0200

Related: tdf#65642 RTF filter: import \pgndec

This as a side effect also implements support for DOCX .

Change-Id: I747c3f610dc13f614b6f962c2a498c987765ebb6
Reviewed-on: https://gerrit.libreoffice.org/24457
Reviewed-by: Miklos Vajna 
Tested-by: Jenkins 

diff --git a/sw/qa/extras/rtfexport/data/pgndec.rtf 
b/sw/qa/extras/rtfexport/data/pgndec.rtf
new file mode 100644
index 000..7f38c69
--- /dev/null
+++ b/sw/qa/extras/rtfexport/data/pgndec.rtf
@@ -0,0 +1,23 @@
+{\rtf1
+\pard\plain \ltrpar\ql 
\li0\ri0\sa200\sl276\slmult1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0
 \rtlch\fcs1 \af31507\afs22\alang1025 \ltrch\fcs0
+{\field\fldedit
+{\*\fldinst
+{ PAGE   \\* MERGEFORMAT }
+}
+{\fldrslt
+{1}
+}
+}
+\sect
+\sectd\pgnrestart\pgnlcrm\pgndec
+{\field\fldedit
+{\*\fldinst
+{\rtlch\fcs1 \af31507 \ltrch\fcs0 \insrsid525329  PAGE   \\* MERGEFORMAT }
+}
+{\fldrslt
+{\rtlch\fcs1 \af31507 \ltrch\fcs0 \lang1024\langfe1024\noproof\insrsid9597790 
1}
+}
+}
+{\rtlch\fcs1 \af31507 \ltrch\fcs0 \insrsid13321744
+\par }
+}
diff --git a/sw/qa/extras/rtfexport/rtfexport.cxx 
b/sw/qa/extras/rtfexport/rtfexport.cxx
index c08a47a..37a7018 100644
--- a/sw/qa/extras/rtfexport/rtfexport.cxx
+++ b/sw/qa/extras/rtfexport/rtfexport.cxx
@@ -1025,6 +1025,12 @@ DECLARE_RTFEXPORT_TEST(testPgnlcrm, "pgnlcrm.rtf")
 CPPUNIT_ASSERT_EQUAL(style::NumberingType::ROMAN_LOWER, 
getProperty(getStyles("PageStyles")->getByName("Converted1"), 
"NumberingType"));
 }
 
+DECLARE_RTFEXPORT_TEST(testPgndec, "pgndec.rtf")
+{
+// The second page's numbering type: this was 
style::NumberingType::ROMAN_LOWER.
+CPPUNIT_ASSERT_EQUAL(style::NumberingType::ARABIC, 
getProperty(getStyles("PageStyles")->getByName("Converted1"), 
"NumberingType"));
+}
+
 DECLARE_RTFEXPORT_TEST(testTdf98806, "tdf98806.rtf")
 {
 uno::Reference xBookmarksSupplier(mxComponent, 
uno::UNO_QUERY);
diff --git a/writerfilter/source/dmapper/DomainMapper.cxx 
b/writerfilter/source/dmapper/DomainMapper.cxx
index 6a9cc8f..acc320a 100644
--- a/writerfilter/source/dmapper/DomainMapper.cxx
+++ b/writerfilter/source/dmapper/DomainMapper.cxx
@@ -989,6 +989,10 @@ void DomainMapper::lcl_attribute(Id nName, Value & val)
 {
 switch (nIntValue)
 {
+case NS_ooxml::LN_Value_ST_NumberFormat_decimal:
+// 1, 2, ...
+
pSectionContext->SetPageNumberType(style::NumberingType::ARABIC);
+break;
 case NS_ooxml::LN_Value_ST_NumberFormat_upperLetter:
 // A, B, ...
 
pSectionContext->SetPageNumberType(style::NumberingType::CHARS_UPPER_LETTER_N);
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx 
b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index 459f0a1..9559e8d 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -3281,7 +3281,6 @@ RTFError RTFDocumentImpl::dispatchFlag(RTFKeyword 
nKeyword)
 
m_aStates.top().aSectionSprms.set(NS_ooxml::LN_EG_SectPrContents_formProt, 
pValue);
 }
 break;
-case RTF_PGNDEC:
 case RTF_PGNBIDIA:
 case RTF_PGNBIDIB:
 // These should be mapped to NS_ooxml::LN_EG_SectPrContents_pgNumType, 
but dmapper has no API for that at the moment.
@@ -3623,6 +3622,12 @@ RTFError RTFDocumentImpl::dispatchFlag(RTFKeyword 
nKeyword)
 lcl_putNestedAttribute(m_aStates.top().aSectionSprms, 
NS_ooxml::LN_EG_SectPrContents_pgNumType, NS_ooxml::LN_CT_PageNumber_fmt, 
pIntValue);
 }
 break;
+case RTF_PGNDEC:
+{
+auto pIntValue = 
std::make_shared(NS_ooxml::LN_Value_ST_NumberFormat_decimal);
+lcl_putNestedAttribute(m_aStates.top().aSectionSprms, 
NS_ooxml::LN_EG_SectPrContents_pgNumType, NS_ooxml::LN_CT_PageNumber_fmt, 
pIntValue);
+}
+break;
 default:
 {
 SAL_INFO("writerfilter", "TODO handle flag '" << 
lcl_RtfToString(nKeyword) << "'");
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: sd/source sd/uiconfig

2016-04-28 Thread Akshay Deep
 sd/source/ui/animations/SlideTransitionPane.cxx  |   65 +--
 sd/source/ui/animations/SlideTransitionPane.hxx  |7 +-
 sd/uiconfig/simpress/ui/slidetransitionspanel.ui |   15 ++---
 3 files changed, 49 insertions(+), 38 deletions(-)

New commits:
commit d3d546a8e15c96a97dbad986e73665201b02a85c
Author: Akshay Deep 
Date:   Thu Mar 3 19:33:53 2016 +0530

tdf#98037 - SIDEBAR: Replacing 'Speed' drop downs with comboboxes

Changed speed dropdown in SlideTransitionPanel to Duration combobox.
Used Custom Widget VclComboBoxNumeric with MetricBox class.
Unit set in seconds.

Change-Id: Id295b0ecbd62c60e434d8c65f74d50cdc39c9ecc
Reviewed-on: https://gerrit.libreoffice.org/22865
Tested-by: Jenkins 
Reviewed-by: Samuel Mehrbrodt 

diff --git a/sd/source/ui/animations/SlideTransitionPane.cxx 
b/sd/source/ui/animations/SlideTransitionPane.cxx
old mode 100644
new mode 100755
index fb6057c..1778f13
--- a/sd/source/ui/animations/SlideTransitionPane.cxx
+++ b/sd/source/ui/animations/SlideTransitionPane.cxx
@@ -408,8 +408,8 @@ SlideTransitionPane::SlideTransitionPane(
 {
 get(mpFT_VARIANT, "variant_label");
 get(mpLB_VARIANT, "variant_list");
-get(mpFT_SPEED, "speed_label");
-get(mpLB_SPEED, "speed_list");
+get(mpFT_duration, "duration_label");
+get(mpCBX_duration, "transition_duration");
 get(mpFT_SOUND, "sound_label");
 get(mpLB_SOUND, "sound_list");
 get(mpCB_LOOP_SOUND, "loop_sound" );
@@ -441,6 +441,11 @@ SlideTransitionPane::SlideTransitionPane(
 VALUESET_APPEND, /* show legend */ true );
 mpVS_TRANSITION_ICONS->RecalculateItemSizes();
 
+mpCBX_duration->InsertValue(100, FUNIT_CUSTOM);
+mpCBX_duration->InsertValue(200, FUNIT_CUSTOM);
+mpCBX_duration->InsertValue(300, FUNIT_CUSTOM);
+mpCBX_duration->AdaptDropDownLineCountToMaximum();
+
 // set defaults
 mpCB_AUTO_PREVIEW->Check();  // automatic preview on
 
@@ -454,7 +459,8 @@ SlideTransitionPane::SlideTransitionPane(
 mpVS_TRANSITION_ICONS->SetSelectHdl( LINK( this, SlideTransitionPane, 
TransitionSelected ));
 
 mpLB_VARIANT->SetSelectHdl( LINK( this, SlideTransitionPane, 
VariantListBoxSelected ));
-mpLB_SPEED->SetSelectHdl( LINK( this, SlideTransitionPane, 
SpeedListBoxSelected ));
+mpCBX_duration->SetModifyHdl(LINK( this, SlideTransitionPane, 
DurationModifiedHdl));
+mpCBX_duration->SetLoseFocusHdl(LINK( this, SlideTransitionPane, 
DurationLoseFocusHdl));
 mpLB_SOUND->SetSelectHdl( LINK( this, SlideTransitionPane, 
SoundListBoxSelected ));
 mpCB_LOOP_SOUND->SetClickHdl( LINK( this, SlideTransitionPane, 
LoopSoundBoxChecked ));
 
@@ -483,8 +489,8 @@ void SlideTransitionPane::dispose()
 mpVS_TRANSITION_ICONS.disposeAndClear();
 mpFT_VARIANT.clear();
 mpLB_VARIANT.clear();
-mpFT_SPEED.clear();
-mpLB_SPEED.clear();
+mpFT_duration.clear();
+mpCBX_duration.clear();
 mpFT_SOUND.clear();
 mpLB_SOUND.clear();
 mpCB_LOOP_SOUND.clear();
@@ -506,7 +512,7 @@ void SlideTransitionPane::DataChanged (const 
DataChangedEvent& rEvent)
 void SlideTransitionPane::UpdateLook()
 {
 
SetBackground(::sfx2::sidebar::Theme::GetWallpaper(::sfx2::sidebar::Theme::Paint_PanelBackground));
-mpFT_SPEED->SetBackground(Wallpaper());
+mpFT_duration->SetBackground(Wallpaper());
 mpFT_SOUND->SetBackground(Wallpaper());
 }
 
@@ -593,12 +599,14 @@ void SlideTransitionPane::updateControls()
 }
 
 if( aEffect.mbDurationAmbiguous )
-mpLB_SPEED->SetNoSelection();
+{
+mpCBX_duration->SetText("");
+mpCBX_duration->SetNoSelection();
+}
 else
-mpLB_SPEED->SelectEntryPos(
-(aEffect.mfDuration > 2.0 )
-? 0 : (aEffect.mfDuration < 2.0)
-? 2 : 1 );   // else FADE_SPEED_FAST
+{
+mpCBX_duration->SetValue( (aEffect.mfDuration)*100.0 );
+}
 
 if( aEffect.mbSoundAmbiguous )
 {
@@ -617,7 +625,6 @@ void SlideTransitionPane::updateControls()
 tSoundListType::size_type nPos = 0;
 if( lcl_findSoundInList( maSoundList, aEffect.maSound, nPos ))
 {
-// skip first three entries
 mpLB_SOUND->SelectEntryPos( nPos + 3 );
 maCurrentSoundFile = aEffect.maSound;
 }
@@ -661,7 +668,7 @@ void SlideTransitionPane::updateControlState()
 {
 mpVS_TRANSITION_ICONS->Enable( mbHasSelection );
 mpLB_VARIANT->Enable( mbHasSelection && mpLB_VARIANT->GetEntryCount() > 0 
);
-mpLB_SPEED->Enable( mbHasSelection );
+mpCBX_duration->Enable( mbHasSelection );
 mpLB_SOUND->Enable( mbHasSelection );
 mpCB_LOOP_SOUND->Enable( mbHasSelection && 
(mpLB_SOUND->GetSelectEntryPos() > 2));
 mpRB_ADVANCE_ON_MOUSE->Enable( mbHasSelection );
@@ -801,22 +808,17 @@ impl::TransitionEffect 
SlideTransitionPane::getTransitionEffectFromControls() co
 }
 }
 aResult.mbEffectAmbiguous = false;

[Libreoffice-commits] core.git: sw/qa

2016-04-28 Thread Noel Grandin
 sw/qa/extras/ww8export/ww8export.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 7d6308dad9f4a079d57719a6e3a9c4cebb47d051
Author: Noel Grandin 
Date:   Thu Apr 28 09:42:41 2016 +0200

loplugin:stringconstant

Change-Id: I780775ed5fa516d10c787ac2e11a034a7fc7da9c

diff --git a/sw/qa/extras/ww8export/ww8export.cxx 
b/sw/qa/extras/ww8export/ww8export.cxx
index 0d59e31..24023a4 100644
--- a/sw/qa/extras/ww8export/ww8export.cxx
+++ b/sw/qa/extras/ww8export/ww8export.cxx
@@ -707,7 +707,7 @@ DECLARE_WW8EXPORT_TEST(testTdf99474, "tdf99474.odt")
 for(int j = 0 ; j< aPropertyValues.getLength() ; ++j)
 {
 auto aProp = aPropertyValues[j];
-if (aProp.Name == OUString("CharStyleName")) {
+if (aProp.Name == "CharStyleName") {
 charStyleName = aProp.Value.get();
 break;
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: 2 commits - canvas/source chart2/source compilerplugins/clang connectivity/source dbaccess/source editeng/source filter/source helpcompiler/source hwpfilter/source i18n

2016-04-28 Thread Noel Grandin
 canvas/source/vcl/canvasbitmaphelper.cxx|6 
 canvas/source/vcl/canvashelper.cxx  |6 
 chart2/source/controller/sidebar/ChartAreaPanel.cxx |   12 
-
 chart2/source/inc/CloneHelper.hxx   |   12 
-
 chart2/source/model/main/Axis.cxx   |4 
 chart2/source/model/main/BaseCoordinateSystem.cxx   |4 
 chart2/source/model/main/ChartModel.cxx |   10 
 chart2/source/model/main/DataSeries.cxx |4 
 chart2/source/model/main/Diagram.cxx|8 
 chart2/source/model/main/Title.cxx  |2 
 chart2/source/model/template/ChartType.cxx  |2 
 chart2/source/tools/DataSourceHelper.cxx|4 
 chart2/source/tools/ErrorBar.cxx|2 
 chart2/source/tools/ImplOPropertySet.cxx|2 
 chart2/source/tools/RegressionCurveModel.cxx|2 
 compilerplugins/clang/stylepolice.cxx   |   69 
+-
 connectivity/source/commontools/dbconversion.cxx|   46 
++--
 connectivity/source/drivers/file/FPreparedStatement.cxx |6 
 connectivity/source/drivers/file/FResultSet.cxx |8 
 connectivity/source/drivers/file/FStatement.cxx |8 
 connectivity/source/drivers/jdbc/PreparedStatement.cxx  |4 
 connectivity/source/drivers/jdbc/ResultSet.cxx  |4 
 connectivity/source/drivers/mork/MPreparedStatement.cxx |6 
 connectivity/source/drivers/mork/MQueryHelper.cxx   |   26 
+-
 connectivity/source/drivers/mork/MResultSet.cxx |   10 
 connectivity/source/drivers/mork/MStatement.cxx |   10 
 dbaccess/source/ui/dlg/adminpages.cxx   |8 
 dbaccess/source/ui/querydesign/querycontroller.cxx  |4 
 editeng/source/editeng/eehtml.cxx   |5 
 filter/source/flash/swffilter.cxx   |   12 
-
 helpcompiler/source/HelpCompiler.cxx|4 
 helpcompiler/source/HelpLinker.cxx  |   19 
-
 hwpfilter/source/hinfo.cxx  |   12 
-
 i18npool/source/breakiterator/breakiteratorImpl.cxx |   10 
 i18npool/source/breakiterator/breakiterator_unicode.cxx |4 
 i18npool/source/breakiterator/xdictionary.cxx   |   18 
-
 i18npool/source/calendar/calendarImpl.cxx   |4 
 i18npool/source/characterclassification/characterclassificationImpl.cxx |8 
 i18npool/source/collator/collatorImpl.cxx   |8 
 i18npool/source/inputchecker/inputsequencechecker.cxx   |8 
 i18npool/source/localedata/localedata.cxx   |   37 
+--
 i18npool/source/nativenumber/nativenumbersupplier.cxx   |4 
 i18nutil/source/utility/oneToOneMapping.cxx |8 
 idl/source/objects/object.cxx   |8 
 idl/source/prj/parser.cxx   |6 
 linguistic/source/dicimp.cxx|4 
 linguistic/source/dlistimp.cxx  |6 
 linguistic/source/iprcache.cxx  |8 
 linguistic/source/misc.cxx  |4 
 lotuswordpro/source/filter/lwpdrawobj.cxx   |   18 
-
 lotuswordpro/source/filter/lwplayout.cxx|6 
 lotuswordpro/source/filter/lwprowlayout.cxx |4 
 lotuswordpro/source/filter/lwpsortopt.cxx   |4 
 lotuswordpro/source/filter/xfilter/xfliststyle.cxx  |8 
 oox/source/drawingml/fillpropertiesgroupcontext.cxx |6 
 oox/source/ole/olehelper.cxx|4 
 sc/qa/extras/macros-test.cxx|   18 
-
 sc/qa/extras/recordchanges-test.cxx |   12 
-
 sc/qa/extras/scannotationobj.cxx|   10 
 sc/qa/extras/sccondformats.cxx  |8 
 sc/qa/unit/subsequent_export-test.cxx   |   16 
-
 sc/source/core/too

[Libreoffice-commits] core.git: avmedia/source cui/source extensions/source formula/source sc/source sd/source starmath/source svtools/source svx/source sw/source

2016-04-28 Thread Muhammet Kara
 avmedia/source/framework/mediacontrol.cxx |1 +
 cui/source/dialogs/linkdlg.cxx|3 ++-
 extensions/source/bibliography/bibcont.cxx|3 ++-
 formula/source/ui/dlg/funcutl.cxx |2 ++
 sc/source/ui/docshell/autostyl.cxx|2 ++
 sc/source/ui/miscdlgs/acredlin.cxx|2 ++
 sc/source/ui/miscdlgs/conflictsdlg.cxx|1 +
 sd/source/ui/dlg/brkdlg.cxx   |1 +
 sd/source/ui/framework/module/ShellStackGuard.cxx |2 +-
 starmath/source/edit.cxx  |4 +++-
 svtools/source/misc/filechangedchecker.cxx|2 +-
 svx/source/dialog/_contdlg.cxx|2 ++
 svx/source/dialog/svxbmpnumvalueset.cxx   |1 +
 svx/source/sdr/overlay/overlaymanagerbuffered.cxx |1 +
 svx/source/sidebar/PanelLayout.cxx|1 +
 sw/source/core/doc/DocumentTimerManager.cxx   |3 ++-
 sw/source/core/docnode/threadmanager.cxx  |2 +-
 17 files changed, 26 insertions(+), 7 deletions(-)

New commits:
commit 376c337d46acf8819bf032251bfc7d5eb31db198
Author: Muhammet Kara 
Date:   Tue Apr 26 10:20:41 2016 +0300

tdf#97087 Give comprehensible, unique names to idles

Timers and idles should have programmer comprehensible, unique names

Change-Id: Id0f2c0a77cd28c3ec5473e8432569739b58d2101
Reviewed-on: https://gerrit.libreoffice.org/24388
Tested-by: Jenkins 
Reviewed-by: Michael Meeks 
Tested-by: Michael Meeks 

diff --git a/avmedia/source/framework/mediacontrol.cxx 
b/avmedia/source/framework/mediacontrol.cxx
index 78ef5fb..cf04846 100644
--- a/avmedia/source/framework/mediacontrol.cxx
+++ b/avmedia/source/framework/mediacontrol.cxx
@@ -60,6 +60,7 @@ namespace avmedia
 MediaControl::MediaControl( vcl::Window* pParent, MediaControlStyle 
eControlStyle ) :
 Control( pParent ),
 maImageList( SvtMiscOptions().AreCurrentSymbolsLarge() ? AVMEDIA_RESID( 
AVMEDIA_IMGLST_L ) : AVMEDIA_RESID( AVMEDIA_IMGLST ) ),
+maIdle( "avmedia MediaControl Idle" ),
 maItem( 0, AVMediaSetMask::ALL ),
 maPlayToolBox( VclPtr::Create(this, WB_3DLOOK) ),
 maTimeSlider( VclPtr::Create(this, WB_HORZ | WB_DRAG | WB_3DLOOK | 
WB_SLIDERSET) ),
diff --git a/cui/source/dialogs/linkdlg.cxx b/cui/source/dialogs/linkdlg.cxx
index b5a840f..1d4e1fb 100644
--- a/cui/source/dialogs/linkdlg.cxx
+++ b/cui/source/dialogs/linkdlg.cxx
@@ -95,7 +95,8 @@ SvBaseLinksDlg::SvBaseLinksDlg( vcl::Window * pParent, 
LinkManager* pMgr, bool b
 aStrCloselinkmsgMulti( CUI_RES( STR_CLOSELINKMSG_MULTI ) ),
 aStrWaitinglink( CUI_RES( STR_WAITINGLINK ) ),
 pLinkMgr( nullptr ),
-bHtmlMode(bHtml)
+bHtmlMode(bHtml),
+aUpdateIdle("cui SvBaseLinksDlg UpdateIdle")
 {
 get(m_pTbLinks, "TB_LINKS");
 Size aSize(LogicToPixel(Size(257, 87), MAP_APPFONT));
diff --git a/extensions/source/bibliography/bibcont.cxx 
b/extensions/source/bibliography/bibcont.cxx
index 5b27a57..212b601 100644
--- a/extensions/source/bibliography/bibcont.cxx
+++ b/extensions/source/bibliography/bibcont.cxx
@@ -121,7 +121,8 @@ bool BibWindowContainer::HandleShortCutKey( const KeyEvent& 
rKeyEvent )
 BibBookContainer::BibBookContainer(vcl::Window* pParent, WinBits nStyle):
 BibSplitWindow(pParent,nStyle),
 pTopWin(nullptr),
-pBottomWin(nullptr)
+pBottomWin(nullptr),
+aIdle("extensions BibBookContainer Split Idle")
 {
 pBibMod = OpenBibModul();
 aIdle.SetIdleHdl(LINK( this, BibBookContainer, SplitHdl));
diff --git a/formula/source/ui/dlg/funcutl.cxx 
b/formula/source/ui/dlg/funcutl.cxx
index 2d49d98..9052d7c 100644
--- a/formula/source/ui/dlg/funcutl.cxx
+++ b/formula/source/ui/dlg/funcutl.cxx
@@ -429,6 +429,7 @@ void EditBox::UpdateOldSel()
 
 RefEdit::RefEdit( vcl::Window* _pParent, vcl::Window* pShrinkModeLabel, 
WinBits nStyle )
 : Edit( _pParent, nStyle )
+, aIdle("formula RefEdit Idle")
 , pAnyRefDlg( nullptr )
 , pLabelWidget(pShrinkModeLabel)
 {
@@ -439,6 +440,7 @@ RefEdit::RefEdit( vcl::Window* _pParent, vcl::Window* 
pShrinkModeLabel, WinBits
 RefEdit::RefEdit( vcl::Window* _pParent,IControlReferenceHandler* pParent,
 vcl::Window* pShrinkModeLabel, const ResId& rResId )
 : Edit( _pParent, rResId )
+, aIdle("formula RefEdit Idle")
 , pAnyRefDlg( pParent )
 , pLabelWidget(pShrinkModeLabel)
 {
diff --git a/sc/source/ui/docshell/autostyl.cxx 
b/sc/source/ui/docshell/autostyl.cxx
index 1e09961..463b88b 100644
--- a/sc/source/ui/docshell/autostyl.cxx
+++ b/sc/source/ui/docshell/autostyl.cxx
@@ -59,6 +59,8 @@ struct FindNonZeroTimeout : public 
::std::unary_function
 
 ScAutoStyleList::ScAutoStyleList(ScDocShell* pShell)
 : pDocSh(pShell)
+, aTimer("ScAutoStyleList Timer")
+, aInitIdle("ScAutoStyleList InitIdle")
 , nTimerStart(0)
 {
 aTimer.SetTimeoutHdl( LINK( this, ScAutoStyleList, TimerHdl ) );
diff --git a/sc/source/ui/miscdlgs/acredlin.cxx 
b/sc/so

GSoC and accessibility for blind people

2016-04-28 Thread Alex ARNAUD
Dear LibreOffice community, since the release of version 4.3 they are 
new bugs introduced in each version that break accessibility for blind 
and low vision people.


At this time, there are about 40 bugs 
 opened for 
only accessibility with some of them opened in 2011. They are some other 
feature and bug not currently reported because lack of time and huge 
amount of bug accumulated over the years.
For example this bug about LibreOffice calc 
 blocks usage 
of it for blind user on Linux environment.


Could we imagine to have some people that works on accessibility of 
LibreOffice at GSoC ? At Hypra  and 
we've some people aware of the subject (VStuart, Sophie, ...) we could 
help to test, for feedbacks and use cases about accessibility.


Best regards.

--
Alex ARNAUD

___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice


[Libreoffice-commits] core.git: sw/qa sw/source

2016-04-28 Thread Oliver Specht
 sw/qa/extras/ww8import/data/tdf74328.doc |binary
 sw/qa/extras/ww8import/ww8import.cxx |   14 ++
 sw/source/filter/ww8/ww8par6.cxx |4 ++--
 3 files changed, 16 insertions(+), 2 deletions(-)

New commits:
commit 5f63e19ddffdf3eaa2351968550498fdae35475d
Author: Oliver Specht 
Date:   Wed Apr 27 16:37:48 2016 +0200

tdf#74328: loading section page no. as 16 bit unsigned

The sprm sprmSPgnStart97 contains a 16 bit unsigned value. Test included.

Change-Id: I300e9a94c13666cf8e71d3613b8f1171c7314cdd
Reviewed-on: https://gerrit.libreoffice.org/24431
Tested-by: Jenkins 
Reviewed-by: Oliver Specht 

diff --git a/sw/qa/extras/ww8import/data/tdf74328.doc 
b/sw/qa/extras/ww8import/data/tdf74328.doc
new file mode 100755
index 000..a829785
Binary files /dev/null and b/sw/qa/extras/ww8import/data/tdf74328.doc differ
diff --git a/sw/qa/extras/ww8import/ww8import.cxx 
b/sw/qa/extras/ww8import/ww8import.cxx
index 8727a00..b2e0f0d 100644
--- a/sw/qa/extras/ww8import/ww8import.cxx
+++ b/sw/qa/extras/ww8import/ww8import.cxx
@@ -553,6 +553,20 @@ DECLARE_WW8IMPORT_TEST(testTdf99120, "tdf99120.doc")
 CPPUNIT_ASSERT_EQUAL(OUString("Section 2, even."),  
parseDump("/root/page[4]/header/txt/text()"));
 }
 
+DECLARE_WW8IMPORT_TEST(testTdf74328, "tdf74328.doc")
+{
+/*
+reading page numbers at sections > 255, in this case 256
+*/
+uno::Reference textDocument(mxComponent, 
uno::UNO_QUERY);
+uno::Reference 
xTextCursor(textDocument->getText()->createTextCursor( ), uno::UNO_QUERY);
+uno::Reference xProps(xTextCursor, uno::UNO_QUERY);
+uno::Any aOffset = xProps->getPropertyValue("PageNumberOffset");
+sal_Int16 nOffset = 0;
+aOffset >>= nOffset;
+CPPUNIT_ASSERT_EQUAL(sal_Int16(256), nOffset);
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/filter/ww8/ww8par6.cxx b/sw/source/filter/ww8/ww8par6.cxx
index c271da4..4b24086 100644
--- a/sw/source/filter/ww8/ww8par6.cxx
+++ b/sw/source/filter/ww8/ww8par6.cxx
@@ -997,7 +997,7 @@ void wwSectionManager::CreateSep(const long nTextPos, bool 
/*bMustHaveBreak*/)
 /*sprmSDxaRight*/   0xB022,
 /*sprmSDzaGutter*/  0xB025,
 /*sprmSFPgnRestart*/0x3011,
-/*sprmSPgnStart*/   0x501C,
+/*sprmSPgnStart97*/ 0x501C,
/*sprmSDmBinFirst*/ 0x5007,
 /*sprmSDmBinOther*/ 0x5008
 };
@@ -1035,7 +1035,7 @@ void wwSectionManager::CreateSep(const long nTextPos, 
bool /*bMustHaveBreak*/)
 // Page Number Restarts - sprmSFPgnRestart
 aNewSection.maSep.fPgnRestart = ReadBSprm(pSep, pIds[6], 0);
 
-aNewSection.maSep.pgnStart = ReadBSprm( pSep, pIds[7], 0 );
+aNewSection.maSep.pgnStart = ReadUSprm( pSep, pIds[7], 0 );
 
 if (eVer >= ww::eWW6)
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: vcl/inc vcl/source

2016-04-28 Thread Caolán McNamara
 vcl/inc/printdlg.hxx   |1 -
 vcl/source/window/printdlg.cxx |2 --
 2 files changed, 3 deletions(-)

New commits:
commit 02c5ab35077e994af1318b0b35ec06332849934b
Author: Caolán McNamara 
Date:   Thu Apr 28 10:53:37 2016 +0100

FixedLine copyspacer was removed from .ui but referenced in .cxx

since

commit 4e6fd4f4b5e82f6d15d181934adbe7d23dde617a
Author: Adolfo Jayme Barrientos 
Date:   Wed Apr 27 13:48:34 2016 -0500

Print dialog: minor spacing tweaks

Change-Id: I58ea5ec681746b36d6eb1899b7fd9a42adb29dae

Change-Id: I79eccb80108c1ceea52deae6c3116e8325356aed

diff --git a/vcl/inc/printdlg.hxx b/vcl/inc/printdlg.hxx
index 410257f..be76411 100644
--- a/vcl/inc/printdlg.hxx
+++ b/vcl/inc/printdlg.hxx
@@ -143,7 +143,6 @@ namespace vcl
 
 VclPtr  mpSetupButton;
 
-VclPtr   mpCopySpacer;
 VclPtrmpCopyCountField;
 VclPtrmpCollateBox;
 VclPtr  mpCollateImage;
diff --git a/vcl/source/window/printdlg.cxx b/vcl/source/window/printdlg.cxx
index 53d8ea7..c03d76f 100644
--- a/vcl/source/window/printdlg.cxx
+++ b/vcl/source/window/printdlg.cxx
@@ -488,7 +488,6 @@ PrintDialog::JobTabPage::JobTabPage( VclBuilder* pUIBuilder 
)
 pUIBuilder->get(mpLocationTxt, "location");
 pUIBuilder->get(mpCommentTxt, "comment");
 pUIBuilder->get(mpSetupButton, "setup");
-pUIBuilder->get(mpCopySpacer, "copyspacer");
 pUIBuilder->get(mpCopyCountField, "copycount");
 pUIBuilder->get(mpCollateBox, "collate");
 pUIBuilder->get(mpCollateImage, "collateimage");
@@ -1191,7 +1190,6 @@ void PrintDialog::setupOptionalUI()
 // print range not shown (currently math only) -> hide spacer line and 
reverse order
 if (!pPageRange || !pPageRange->IsVisible())
 {
-maJobPage.mpCopySpacer->Show( false );
 maJobPage.mpReverseOrderBox->Show( false );
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: include/oox

2016-04-28 Thread Jorenz Paragas
 include/oox/core/binarycodec.hxx  |2 +-
 include/oox/core/contexthandler.hxx   |6 +++---
 include/oox/core/contexthandler2.hxx  |2 +-
 include/oox/core/fastparser.hxx   |2 +-
 include/oox/core/fasttokenhandler.hxx |4 ++--
 include/oox/core/filterbase.hxx   |6 +++---
 include/oox/core/filterdetect.hxx |6 +++---
 include/oox/core/fragmenthandler.hxx  |6 +++---
 include/oox/core/fragmenthandler2.hxx |2 +-
 include/oox/core/relationshandler.hxx |2 +-
 include/oox/core/xmlfilterbase.hxx|2 +-
 include/oox/crypto/DocumentDecryption.hxx |4 ++--
 include/oox/crypto/DocumentEncryption.hxx |2 +-
 13 files changed, 23 insertions(+), 23 deletions(-)

New commits:
commit 29c4f7bd5863e34c449062aca6f8aee5ec7510a2
Author: Jorenz Paragas 
Date:   Wed Apr 27 18:51:39 2016 -0700

tdf#42949: prefer including Reference.hxx over Reference.h...

...and so on for Any.hxx and Sequence.hxx.

This commit follows up on two of my previous commits, which are
6a4a15c87c03feffb90cc416ce22d2819e41442d and
474eca1f9b42749665bbf69f6dc62c66ea4ad7fd.

Many non-static inline functions that are declared in Reference.h and
similar files are not defined in the .h file, but their definitions
are in the corresponding .hxx files instead. Thus, let's prefer
including the .hxx files over the .h one so that we don't include
inline functions without their definitions.

In practice, the corresponding .hxx file is included transitively
from many other places, but it's better not to rely on that.

Change-Id: I3bada39eb879ae736c0360f435b16cd5a61adba8
Reviewed-on: https://gerrit.libreoffice.org/24456
Tested-by: Jenkins 
Reviewed-by: Stephan Bergmann 

diff --git a/include/oox/core/binarycodec.hxx b/include/oox/core/binarycodec.hxx
index 56cea81..6afcead 100644
--- a/include/oox/core/binarycodec.hxx
+++ b/include/oox/core/binarycodec.hxx
@@ -20,7 +20,7 @@
 #ifndef INCLUDED_OOX_CORE_BINARYCODEC_HXX
 #define INCLUDED_OOX_CORE_BINARYCODEC_HXX
 
-#include 
+#include 
 #include 
 #include 
 #include 
diff --git a/include/oox/core/contexthandler.hxx 
b/include/oox/core/contexthandler.hxx
index 38f723e..72973dd 100644
--- a/include/oox/core/contexthandler.hxx
+++ b/include/oox/core/contexthandler.hxx
@@ -23,10 +23,10 @@
 #include 
 #include 
 
-#include 
-#include 
+#include 
+#include 
 #include 
-#include 
+#include 
 #include 
 #include 
 #include 
diff --git a/include/oox/core/contexthandler2.hxx 
b/include/oox/core/contexthandler2.hxx
index cca43cb..d172522 100644
--- a/include/oox/core/contexthandler2.hxx
+++ b/include/oox/core/contexthandler2.hxx
@@ -25,7 +25,7 @@
 #include 
 #include 
 
-#include 
+#include 
 #include 
 #include 
 #include 
diff --git a/include/oox/core/fastparser.hxx b/include/oox/core/fastparser.hxx
index f8fdad7..0b48a74 100644
--- a/include/oox/core/fastparser.hxx
+++ b/include/oox/core/fastparser.hxx
@@ -22,7 +22,7 @@
 
 #include 
 #include 
-#include 
+#include 
 #include 
 #include 
 #include 
diff --git a/include/oox/core/fasttokenhandler.hxx 
b/include/oox/core/fasttokenhandler.hxx
index 02e2be7..59d484f 100644
--- a/include/oox/core/fasttokenhandler.hxx
+++ b/include/oox/core/fasttokenhandler.hxx
@@ -23,8 +23,8 @@
 #include 
 
 #include 
-#include 
-#include 
+#include 
+#include 
 #include 
 #include 
 #include 
diff --git a/include/oox/core/filterbase.hxx b/include/oox/core/filterbase.hxx
index 02f10a1..f225c9a 100644
--- a/include/oox/core/filterbase.hxx
+++ b/include/oox/core/filterbase.hxx
@@ -29,11 +29,11 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 #include 
-#include 
+#include 
 #include 
-#include 
+#include 
 #include 
 #include 
 #include 
diff --git a/include/oox/core/filterdetect.hxx 
b/include/oox/core/filterdetect.hxx
index 6a1902d..30dd7fd 100644
--- a/include/oox/core/filterdetect.hxx
+++ b/include/oox/core/filterdetect.hxx
@@ -25,10 +25,10 @@
 
 #include 
 #include 
-#include 
-#include 
+#include 
+#include 
 #include 
-#include 
+#include 
 #include 
 #include 
 #include 
diff --git a/include/oox/core/fragmenthandler.hxx 
b/include/oox/core/fragmenthandler.hxx
index 7afdb79..3dd37ae 100644
--- a/include/oox/core/fragmenthandler.hxx
+++ b/include/oox/core/fragmenthandler.hxx
@@ -22,10 +22,10 @@
 
 #include 
 
-#include 
-#include 
+#include 
+#include 
 #include 
-#include 
+#include 
 #include 
 #include 
 #include 
diff --git a/include/oox/core/fragmenthandler2.hxx 
b/include/oox/core/fragmenthandler2.hxx
index 7e52948..0d2264a 100644
--- a/include/oox/core/fragmenthandler2.hxx
+++ b/include/oox/core/fragmenthandler2.hxx
@@ -23,7 +23,7 @@
 #include 
 #include 
 
-#include 
+#include 
 #include 
 #include 
 #include 
diff --git a/include/oox/core/relationshandler.hxx 
b/include/oox/core/relationshandler.hxx
index 325de5a..46fe887 100644
--- a/include/oox/core/relationshandler.hxx
+++ b/include/oox/cor

[Libreoffice-commits] online.git: loolwsd/test

2016-04-28 Thread Jan Holesovsky
 loolwsd/test/httpwstest.cpp |   78 
 1 file changed, 44 insertions(+), 34 deletions(-)

New commits:
commit 7d2aaa8910b2a75264f15660925df52ea693e468
Author: Jan Holesovsky 
Date:   Thu Apr 28 12:35:56 2016 +0200

Log the exact test file that has been used.

diff --git a/loolwsd/test/httpwstest.cpp b/loolwsd/test/httpwstest.cpp
index 542fbf8..2a01ea4 100644
--- a/loolwsd/test/httpwstest.cpp
+++ b/loolwsd/test/httpwstest.cpp
@@ -169,6 +169,15 @@ public:
 void tearDown()
 {
 }
+
+protected:
+void getDocumentPathAndURL(const char* document, std::string& 
documentPath, std::string& documentURL)
+{
+documentPath = Util::getTempFilePath(TDOC, document);
+documentURL = "file://" + 
Poco::Path(documentPath).makeAbsolute().toString();
+
+std::cerr << "Test file: " << documentPath << std::endl;
+}
 };
 
 int HTTPWSTest::_initialLoolKitCount = 0;
@@ -221,8 +230,8 @@ void HTTPWSTest::testHandShake()
 int flags;
 char buffer[1024];
 // Load a document and get its status.
-const std::string documentPath = Util::getTempFilePath(TDOC, 
"hello.odt");
-const std::string documentURL = "file://" + 
Poco::Path(documentPath).makeAbsolute().toString();
+std::string documentPath, documentURL;
+getDocumentPathAndURL("hello.odt", documentPath, documentURL);
 
 Poco::Net::HTTPResponse response;
 Poco::Net::HTTPRequest request(Poco::Net::HTTPRequest::HTTP_GET, 
documentURL);
@@ -298,8 +307,8 @@ void HTTPWSTest::testCloseAfterClose()
 char buffer[READ_BUFFER_SIZE];
 
 // Load a document and get its status.
-const std::string documentPath = Util::getTempFilePath(TDOC, 
"hello.odt");
-const std::string documentURL = "file://" + 
Poco::Path(documentPath).makeAbsolute().toString();
+std::string documentPath, documentURL;
+getDocumentPathAndURL("hello.odt", documentPath, documentURL);
 
 Poco::Net::HTTPRequest request(Poco::Net::HTTPRequest::HTTP_GET, 
documentURL);
 Poco::Net::WebSocket socket = *connectLOKit(request, _response);
@@ -379,8 +388,8 @@ void HTTPWSTest::loadDoc(const std::string& documentURL)
 
 void HTTPWSTest::testLoad()
 {
-const std::string documentPath = Util::getTempFilePath(TDOC, "hello.odt");
-const std::string documentURL = "file://" + 
Poco::Path(documentPath).makeAbsolute().toString();
+std::string documentPath, documentURL;
+getDocumentPathAndURL("hello.odt", documentPath, documentURL);
 loadDoc(documentURL);
 Util::removeFile(documentPath);
 }
@@ -390,8 +399,8 @@ void HTTPWSTest::testBadLoad()
 try
 {
 // Load a document and get its status.
-const std::string documentPath = Util::getTempFilePath(TDOC, 
"hello.odt");
-const std::string documentURL = "file://" + 
Poco::Path(documentPath).makeAbsolute().toString();
+std::string documentPath, documentURL;
+getDocumentPathAndURL("hello.odt", documentPath, documentURL);
 
 Poco::Net::HTTPRequest request(Poco::Net::HTTPRequest::HTTP_GET, 
documentURL);
 Poco::Net::WebSocket socket = *connectLOKit(request, _response);
@@ -434,8 +443,8 @@ void HTTPWSTest::testBadLoad()
 
 void HTTPWSTest::testReload()
 {
-const std::string documentPath = Util::getTempFilePath(TDOC, "hello.odt");
-const std::string documentURL = "file://" + 
Poco::Path(documentPath).makeAbsolute().toString();
+std::string documentPath, documentURL;
+getDocumentPathAndURL("hello.odt", documentPath, documentURL);
 for (auto i = 0; i < 3; ++i)
 {
 loadDoc(documentURL);
@@ -446,8 +455,8 @@ void HTTPWSTest::testReload()
 
 void HTTPWSTest::testSaveOnDisconnect()
 {
-const std::string documentPath = Util::getTempFilePath(TDOC, "hello.odt");
-const std::string documentURL = "file://" + 
Poco::Path(documentPath).makeAbsolute().toString();
+std::string documentPath, documentURL;
+getDocumentPathAndURL("hello.odt", documentPath, documentURL);
 
 try
 {
@@ -519,8 +528,8 @@ void HTTPWSTest::testSaveOnDisconnect()
 
 void HTTPWSTest::testReloadWhileDisconnecting()
 {
-const std::string documentPath = Util::getTempFilePath(TDOC, "hello.odt");
-const std::string documentURL = "file://" + 
Poco::Path(documentPath).makeAbsolute().toString();
+std::string documentPath, documentURL;
+getDocumentPathAndURL("hello.odt", documentPath, documentURL);
 
 int kitcount = -1;
 try
@@ -605,8 +614,8 @@ void HTTPWSTest::testExcelLoad()
 try
 {
 // Load a document and make it empty.
-const std::string documentPath = Util::getTempFilePath(TDOC, 
"timeline.xlsx");
-const std::string documentURL = "file://" + 
Poco::Path(documentPath).makeAbsolute().toString();
+std::string documentPath, documentURL;
+getDocumentPathAndURL("timeline.xlsx", documentPath, documentURL);
 
 Poco::Net::HTTPRequest 

[Libreoffice-commits] core.git: framework/qa

2016-04-28 Thread Michael Stahl
 framework/qa/complex/XTitle/CheckXTitle.java |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit e2b37bfb8a991e0ed2cfd230f7f34aa36f411430
Author: Michael Stahl 
Date:   Thu Apr 28 13:10:34 2016 +0200

framework: CheckXTitle still sometimes fails on WNT...

... when dispatching the .uno:CloseWin.

Change-Id: Iaf0651ea7e05bd8a6629d5af6e62f5918ef241ce

diff --git a/framework/qa/complex/XTitle/CheckXTitle.java 
b/framework/qa/complex/XTitle/CheckXTitle.java
index adb16da..e798732 100644
--- a/framework/qa/complex/XTitle/CheckXTitle.java
+++ b/framework/qa/complex/XTitle/CheckXTitle.java
@@ -203,6 +203,8 @@ public class CheckXTitle
 prepareQueryAndDispatch( xDisProv, UNO_URL_FOR_CLOSING_PRINT_PREVIEW );
 utils.waitForEventIdle(m_xMSF);
 
+Thread.sleep(250); // FIXME why is this needed?
+
 // close document
 xDisProv = UnoRuntime.queryInterface( XDispatchProvider.class, 
xModel.getCurrentController() );
 try{
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


Mark Page license statement

2016-04-28 Thread Aptitude Testing Team

   All of my past & future contributions to LibreOffice may be
   licensed under the MPLv2/LGPLv3+ dual license.

User name and IRC name: rombust
Git commit email: romb...@users.noreply.github.com



___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice


[Libreoffice-commits] core.git: vcl/source vcl/unx

2016-04-28 Thread Miklos Vajna
 vcl/source/opengl/OpenGLContext.cxx |8 
 vcl/unx/gtk3/gtk3gtkinst.cxx|4 ++--
 2 files changed, 6 insertions(+), 6 deletions(-)

New commits:
commit 2465cb26763b2ed8de65f35bce791fb55fe0e746
Author: Miklos Vajna 
Date:   Thu Apr 28 14:04:44 2016 +0200

vcl: fix loplugin:stylepolice

Change-Id: I40455e04a5f69dc0956ccb01c48d8a40245a4506

diff --git a/vcl/source/opengl/OpenGLContext.cxx 
b/vcl/source/opengl/OpenGLContext.cxx
index 3da890a..2b1e6be 100644
--- a/vcl/source/opengl/OpenGLContext.cxx
+++ b/vcl/source/opengl/OpenGLContext.cxx
@@ -790,8 +790,8 @@ bool OpenGLContext::ImplInit()
 m_aGLWin.GLExtensions = glGetString( GL_EXTENSIONS );
 SAL_INFO("vcl.opengl", "available GL  extensions: " << 
m_aGLWin.GLExtensions);
 
-XWindowAttributes xWinAttr;
-if( !XGetWindowAttributes( m_aGLWin.dpy, m_aGLWin.win, &xWinAttr ) )
+XWindowAttributes aWinAttr;
+if( !XGetWindowAttributes( m_aGLWin.dpy, m_aGLWin.win, &aWinAttr ) )
 {
 SAL_WARN("vcl.opengl", "Failed to get window attributes on " << 
m_aGLWin.win);
 m_aGLWin.Width = 0;
@@ -799,8 +799,8 @@ bool OpenGLContext::ImplInit()
 }
 else
 {
-m_aGLWin.Width = xWinAttr.width;
-m_aGLWin.Height = xWinAttr.height;
+m_aGLWin.Width = aWinAttr.width;
+m_aGLWin.Height = aWinAttr.height;
 }
 
 if( m_aGLWin.HasGLXExtension("GLX_SGI_swap_control" ) )
diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx
index 9c33c40..768f4b1 100644
--- a/vcl/unx/gtk3/gtk3gtkinst.cxx
+++ b/vcl/unx/gtk3/gtk3gtkinst.cxx
@@ -590,7 +590,7 @@ void VclGtkClipboard::setContents(
 m_aContents = xTrans;
 m_aOwner = xClipboardOwner;
 
-std::list< Reference< datatransfer::clipboard::XClipboardListener > > 
xListeners( m_aListeners );
+std::list< Reference< datatransfer::clipboard::XClipboardListener > > 
aListeners( m_aListeners );
 datatransfer::clipboard::ClipboardEvent aEv;
 
 if (m_aContents.is())
@@ -624,7 +624,7 @@ void VclGtkClipboard::setContents(
 if( xOldOwner.is() && xOldOwner != xClipboardOwner )
 xOldOwner->lostOwnership( this, xOldContents );
 for( std::list< Reference< datatransfer::clipboard::XClipboardListener > 
>::iterator it =
- xListeners.begin(); it != xListeners.end() ; ++it )
+ aListeners.begin(); it != aListeners.end() ; ++it )
 {
 (*it)->changedContents( aEv );
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: compilerplugins/clang svx/source

2016-04-28 Thread Noel Grandin
 compilerplugins/clang/stylepolice.cxx |1 +
 svx/source/svdraw/svdtrans.cxx|   20 ++--
 svx/source/svdraw/svdxcgv.cxx |   10 +-
 svx/source/unodraw/unoshcol.cxx   |4 ++--
 4 files changed, 18 insertions(+), 17 deletions(-)

New commits:
commit 26d73dbf53831cf4d5aec1f4db32bedb2c1e06be
Author: Noel Grandin 
Date:   Thu Apr 28 14:05:08 2016 +0200

loplugin:stylepolice

Change-Id: I151e4d94f1f5dc84ef3f91218686ca9d1b9bc36f

diff --git a/compilerplugins/clang/stylepolice.cxx 
b/compilerplugins/clang/stylepolice.cxx
index c6f0e16..d2e3af7 100644
--- a/compilerplugins/clang/stylepolice.cxx
+++ b/compilerplugins/clang/stylepolice.cxx
@@ -175,6 +175,7 @@ bool StylePolice::VisitVarDecl(const VarDecl * varDecl)
 && !startswith(typeName, "vcl::DeleteUnoReferenceOnDeinit")
 // there are lots of coordinate/position vars that start with "x"
 && !qt->isArithmeticType()
+&& !startswith(typeName, "float [")
 )
 {
 report(
diff --git a/svx/source/svdraw/svdtrans.cxx b/svx/source/svdraw/svdtrans.cxx
index 414de97..5ba0648 100644
--- a/svx/source/svdraw/svdtrans.cxx
+++ b/svx/source/svdraw/svdtrans.cxx
@@ -34,26 +34,26 @@ void MoveXPoly(XPolygon& rPoly, const Size& S)
 
 void ResizeRect(Rectangle& rRect, const Point& rRef, const Fraction& rxFact, 
const Fraction& ryFact)
 {
-Fraction xFact(rxFact);
-Fraction yFact(ryFact);
+Fraction aXFact(rxFact);
+Fraction aYFact(ryFact);
 
-if (!xFact.IsValid()) {
+if (!aXFact.IsValid()) {
 SAL_WARN( "svx.svdraw", "invalid fraction xFract, using Fraction(1,1)" 
);
-xFact = Fraction(1,1);
+aXFact = Fraction(1,1);
 long nWdt = rRect.Right() - rRect.Left();
 if (nWdt == 0) rRect.Right()++;
 }
-rRect.Left()  = rRef.X() + svx::Round( (rRect.Left()  - rRef.X()) * 
double(xFact) );
-rRect.Right() = rRef.X() + svx::Round( (rRect.Right() - rRef.X()) * 
double(xFact) );
+rRect.Left()  = rRef.X() + svx::Round( (rRect.Left()  - rRef.X()) * 
double(aXFact) );
+rRect.Right() = rRef.X() + svx::Round( (rRect.Right() - rRef.X()) * 
double(aXFact) );
 
-if (!yFact.IsValid()) {
+if (!aYFact.IsValid()) {
 SAL_WARN( "svx.svdraw", "invalid fraction yFract, using Fraction(1,1)" 
);
-yFact = Fraction(1,1);
+aYFact = Fraction(1,1);
 long nHgt = rRect.Bottom() - rRect.Top();
 if (nHgt == 0) rRect.Bottom()++;
 }
-rRect.Top()= rRef.Y() + svx::Round( (rRect.Top()- rRef.Y()) * 
double(yFact) );
-rRect.Bottom() = rRef.Y() + svx::Round( (rRect.Bottom() - rRef.Y()) * 
double(yFact) );
+rRect.Top()= rRef.Y() + svx::Round( (rRect.Top()- rRef.Y()) * 
double(aYFact) );
+rRect.Bottom() = rRef.Y() + svx::Round( (rRect.Bottom() - rRef.Y()) * 
double(aYFact) );
 
 rRect.Justify();
 }
diff --git a/svx/source/svdraw/svdxcgv.cxx b/svx/source/svdraw/svdxcgv.cxx
index 96aa08b..8270f34 100644
--- a/svx/source/svdraw/svdxcgv.cxx
+++ b/svx/source/svdraw/svdxcgv.cxx
@@ -266,13 +266,13 @@ bool SdrExchangeView::Paste(
 MapUnit eSrcUnit=pSrcMod->GetScaleUnit();
 MapUnit eDstUnit=mpModel->GetScaleUnit();
 bool bResize=eSrcUnit!=eDstUnit;
-Fraction xResize,yResize;
+Fraction aXResize,aYResize;
 Point aPt0;
 if (bResize)
 {
 FrPair aResize(GetMapFactor(eSrcUnit,eDstUnit));
-xResize=aResize.X();
-yResize=aResize.Y();
+aXResize=aResize.X();
+aYResize=aResize.Y();
 }
 SdrObjList*  pDstLst=pLst;
 sal_uInt16 nPg,nPgAnz=pSrcMod->GetPageCount();
@@ -284,7 +284,7 @@ bool SdrExchangeView::Paste(
 Rectangle aR=pSrcPg->GetAllObjSnapRect();
 
 if (bResize)
-ResizeRect(aR,aPt0,xResize,yResize);
+ResizeRect(aR,aPt0,aXResize,aYResize);
 Point aDist(aPos-aR.Center());
 Size  aSiz(aDist.X(),aDist.Y());
 size_t nCloneErrCnt = 0;
@@ -306,7 +306,7 @@ bool SdrExchangeView::Paste(
 if(bResize)
 {
 pNeuObj->GetModel()->SetPasteResize(true);
-pNeuObj->NbcResize(aPt0,xResize,yResize);
+pNeuObj->NbcResize(aPt0,aXResize,aYResize);
 pNeuObj->GetModel()->SetPasteResize(false);
 }
 
diff --git a/svx/source/unodraw/unoshcol.cxx b/svx/source/unodraw/unoshcol.cxx
index f95bff0..d657b7f 100644
--- a/svx/source/unodraw/unoshcol.cxx
+++ b/svx/source/unodraw/unoshcol.cxx
@@ -230,10 +230,10 @@ uno::Any SAL_CALL SvxShapeCollection::getByIndex( 
sal_Int32 Index )
 if( Index < 0 || Index >= getCount() )
 throw lang::IndexOutOfBoundsException();
 
-std::vector< Reference< uno::XInterface> > xElements( 
maShapeContainer.getElements() );
+std::vector< Reference< uno::XInterface> > aElements( 
maShapeContainer.getElements() );
 
 
-return uno::makeAny( Reference< drawing::XShape>(static_cast< 
drawing::XShape*

[Libreoffice-commits] core.git: Branch 'feature/fixes20' - 3 commits - include/vcl vcl/inc vcl/opengl vcl/source

2016-04-28 Thread Tomaž Vajngerl
 include/vcl/opengl/OpenGLContext.hxx |8 ++
 vcl/inc/opengl/RenderState.hxx   |  122 +++
 vcl/inc/opengl/TextureState.hxx  |   76 +
 vcl/opengl/gdiimpl.cxx   |   84 +++-
 vcl/opengl/program.cxx   |   26 +++
 vcl/opengl/salbmp.cxx|   14 +++-
 vcl/opengl/scale.cxx |3 
 vcl/opengl/texture.cxx   |   60 -
 vcl/opengl/x11/gdiimpl.cxx   |5 -
 vcl/source/opengl/OpenGLContext.cxx  |3 
 10 files changed, 308 insertions(+), 93 deletions(-)

New commits:
commit 2a1a72da11961a0cad6a72938dcd2bb52af6c78f
Author: Tomaž Vajngerl 
Date:   Thu Apr 28 20:01:28 2016 +0900

opengl: track the state of stencil test

Change-Id: Id3e15e91316df740f04a42ed8c95b77d83240b5a

diff --git a/vcl/inc/opengl/RenderState.hxx b/vcl/inc/opengl/RenderState.hxx
index 7b3db7be..b1b0b18 100644
--- a/vcl/inc/opengl/RenderState.hxx
+++ b/vcl/inc/opengl/RenderState.hxx
@@ -69,10 +69,44 @@ public:
 }
 };
 
+class StencilState
+{
+bool mbTest;
+public:
+
+StencilState()
+: mbTest(false)
+{
+glDisable(GL_STENCIL_TEST);
+CHECK_GL_ERROR();
+}
+
+void enable()
+{
+if (!mbTest)
+{
+glEnable(GL_STENCIL_TEST);
+CHECK_GL_ERROR();
+mbTest = true;
+}
+}
+
+void disable()
+{
+if (mbTest)
+{
+glDisable(GL_STENCIL_TEST);
+CHECK_GL_ERROR();
+mbTest = false;
+}
+}
+};
+
 class RenderState
 {
 TextureState maTexture;
 ScissorState maScissor;
+StencilState maStencil;
 
 public:
 RenderState()
@@ -80,6 +114,7 @@ public:
 
 TextureState& texture() { return maTexture; }
 ScissorState& scissor() { return maScissor; }
+StencilState& stencil() { return maStencil; }
 };
 
 #endif // INCLUDED_VCL_INC_OPENGL_RENDER_STATE_H
diff --git a/vcl/opengl/gdiimpl.cxx b/vcl/opengl/gdiimpl.cxx
index 6f54ad0..3eb72d4 100644
--- a/vcl/opengl/gdiimpl.cxx
+++ b/vcl/opengl/gdiimpl.cxx
@@ -232,11 +232,6 @@ void OpenGLSalGraphicsImpl::PostDraw()
 CHECK_GL_ERROR();
 }
 
-if( mbUseStencil )
-{
-glDisable( GL_STENCIL_TEST );
-CHECK_GL_ERROR();
-}
 if( mpProgram )
 {
 mpProgram->Clean();
@@ -269,6 +264,7 @@ void OpenGLSalGraphicsImpl::freeResources()
 mpContext->makeCurrent();
 FlushDeferredDrawing();
 mpContext->state()->scissor().disable();
+mpContext->state()->stencil().disable();
 mpContext->ReleaseFramebuffer( maOffscreenTex );
 }
 ReleaseContext();
@@ -276,7 +272,7 @@ void OpenGLSalGraphicsImpl::freeResources()
 
 void OpenGLSalGraphicsImpl::ImplSetClipBit( const vcl::Region& rClip, GLuint 
nMask )
 {
-glEnable( GL_STENCIL_TEST );
+mpContext->state()->stencil().enable();
 
 VCL_GL_INFO( "Adding complex clip / stencil" );
 GLuint nStencil = maOffscreenTex.StencilId();
@@ -315,8 +311,8 @@ void OpenGLSalGraphicsImpl::ImplSetClipBit( const 
vcl::Region& rClip, GLuint nMa
 CHECK_GL_ERROR();
 glStencilMask( 0x00 );
 CHECK_GL_ERROR();
-glDisable( GL_STENCIL_TEST );
-CHECK_GL_ERROR();
+
+mpContext->state()->stencil().disable();
 }
 
 void OpenGLSalGraphicsImpl::ImplInitClipRegion()
@@ -346,8 +342,11 @@ void OpenGLSalGraphicsImpl::ImplInitClipRegion()
 {
 glStencilFunc( GL_EQUAL, 1, 0x1 );
 CHECK_GL_ERROR();
-glEnable( GL_STENCIL_TEST );
-CHECK_GL_ERROR();
+mpContext->state()->stencil().enable();
+}
+else
+{
+mpContext->state()->stencil().disable();
 }
 }
 
@@ -1501,11 +1500,7 @@ void OpenGLSalGraphicsImpl::DrawTransformedTexture(
 // so if we do not disable the scissor test, the texture produced
 // by the first downscaling is clipped to the current window size.
 mpContext->state()->scissor().disable();
-CHECK_GL_ERROR();
-
-// Maybe it can give problems too.
-glDisable(GL_STENCIL_TEST);
-CHECK_GL_ERROR();
+mpContext->state()->stencil().disable();
 
 // the square root of the whole inverted scale ratio
 double ixscalesqrt = std::floor(std::sqrt(ixscale));
@@ -1529,10 +1524,7 @@ void OpenGLSalGraphicsImpl::DrawTransformedTexture(
 mpContext->state()->scissor().enable();
 
 if (mbUseStencil)
-{
-glEnable(GL_STENCIL_TEST);
-CHECK_GL_ERROR();
-}
+mpContext->state()->stencil().enable();
 }
 }
 
@@ -2488,6 +2480,7 @@ void OpenGLSalGraphicsImpl::flush()
 FlushDeferredDrawing();
 
 mpContext->state()->scissor().disable();
+mpContext->state()->stencil().disable();
 
 if( IsOffscreen() )
 return;
@@ -2506,6 +2499,7 @@ void OpenGLSalGraphics

[Libreoffice-commits] online.git: loleaflet/src

2016-04-28 Thread Pranav Kant
 loleaflet/src/core/Socket.js |   11 +--
 1 file changed, 9 insertions(+), 2 deletions(-)

New commits:
commit 3a42330b05f081aae652dc97b7f04864456a6a76
Author: Pranav Kant 
Date:   Thu Apr 28 17:54:40 2016 +0530

bccu#1755: Fix 'Cancel' button on password dialog

Change-Id: Icbfd129fa839ac7af868cc2d857fc280ae1ff681

diff --git a/loleaflet/src/core/Socket.js b/loleaflet/src/core/Socket.js
index 5412d3a..606e137 100644
--- a/loleaflet/src/core/Socket.js
+++ b/loleaflet/src/core/Socket.js
@@ -152,8 +152,15 @@ L.Socket = L.Class.extend({
message: msg,
input: '',
callback: L.bind(function(data) {
-   this._map._docPassword = 
data.password;
-   this.initialize(this._map);
+   if (data) {
+   this._map._docPassword 
= data.password;
+   
this.initialize(this._map);
+   } else if (passwordType === 
'to-modify') {
+   this._map._docPassword 
= '';
+   
this.initialize(this._map);
+   } else {
+   this._map.hideBusy();
+   }
}, this)
});
return;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: loleaflet/Makefile

2016-04-28 Thread Andras Timar
 loleaflet/Makefile |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit c00f3535fa620eb59f865ecccd867d91cfcfe353
Author: Andras Timar 
Date:   Thu Apr 28 14:48:49 2016 +0200

silence po2json.py

diff --git a/loleaflet/Makefile b/loleaflet/Makefile
index f6a9f07..6e3af48 100644
--- a/loleaflet/Makefile
+++ b/loleaflet/Makefile
@@ -19,9 +19,9 @@ dist: all
rm -rf loleaflet-$(VERSION)
mkdir loleaflet-$(VERSION)
cp -ar dist loleaflet-$(VERSION)
-   util/po2json.py po/*.po
+   util/po2json.py --quiet po/*.po
mv po/*.json loleaflet-$(VERSION)/dist/l10n
-   util/po2json.py po/styles/*.po
+   util/po2json.py --quiet po/styles/*.po
mkdir -p loleaflet-$(VERSION)/dist/l10n/styles/
mv po/styles/*.json loleaflet-$(VERSION)/dist/l10n/styles/
tar cfz loleaflet-$(VERSION).tar.gz loleaflet-$(VERSION)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: configure.ac

2016-04-28 Thread Stephan Bergmann
 configure.ac |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 786f29a9edf81cc85c62459b3ea2fd91646d4e56
Author: Stephan Bergmann 
Date:   Thu Apr 28 15:00:48 2016 +0200

Use COMPILER_PLUGINS_CXX during configure

Change-Id: I600a6b96a64fc82cde72200b78f60001a2dba82a

diff --git a/configure.ac b/configure.ac
index ae441cb..d331b42 100644
--- a/configure.ac
+++ b/configure.ac
@@ -6668,7 +6668,7 @@ if test "$COM_IS_CLANG" = "TRUE"; then
 save_CXX=$CXX
 # compiler plugins must be built with "native" bitness of clang
 # because they link against clang libraries
-CXX=`echo $CXX | sed -e s/-m64// -e s/-m32//`
+CXX=${COMPILER_PLUGINS_CXX-$(echo $CXX | sed -e s/-m64// -e s/-m32//)}
 CPPFLAGS="$CPPFLAGS $CXXFLAGS_CXX11 -I$CLANGDIR/include 
-I$CLANGDIR/tools/clang/include -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS 
-D__STDC_LIMIT_MACROS"
 AC_CHECK_HEADER(clang/AST/RecursiveASTVisitor.h,
 [COMPILER_PLUGINS=TRUE],
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: compilerplugins/clang

2016-04-28 Thread Noel Grandin
 compilerplugins/clang/store/stylepolice.cxx |  196 
 compilerplugins/clang/stylepolice.cxx   |  196 
 2 files changed, 196 insertions(+), 196 deletions(-)

New commits:
commit 2e2781d0541dcbf3104973068905a55752c358e5
Author: Noel Grandin 
Date:   Thu Apr 28 15:38:46 2016 +0200

move stylepolice back to store

recent updates did not meet with universal approval

Change-Id: Ic059729797049361c7a8a4ae000cd39a5993f6af

diff --git a/compilerplugins/clang/stylepolice.cxx 
b/compilerplugins/clang/store/stylepolice.cxx
similarity index 100%
rename from compilerplugins/clang/stylepolice.cxx
rename to compilerplugins/clang/store/stylepolice.cxx
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[ANN] LibreOffice 5.1.3 RC1 available

2016-04-28 Thread Christian Lohmaier
Dear Community,

The Document Foundation is pleased to announce the first release
candidate of LibreOffice 5.1.3. The upcoming 5.1.3 will be the third
bugfix release of our fresh 5.1 line. Please be aware that LibreOffice 5.1.3
RC1 has not been flagged as ready for production use yet, however feel
free to give it a try instead of 5.0.5 or 5.1.2.

A work-in-progress list of new features in LibreOffice 5.1 can be
found at https://wiki.documentfoundation.org/ReleaseNotes/5.1

The release is available for Windows, Linux and Mac OS X from our QA
builds download page at

  http://www.libreoffice.org/download/pre-releases/

Windows builds are also provided in 64bit version.

Developers and QA might also be interested in the symbol server for
windows debug information (see
https://wiki.documentfoundation.org/How_to_get_a_backtrace_with_WinDbg
for
details)

Should you find bugs, please report them to our Bugzilla:

  https://bugs.documentfoundation.org

A good way to assess the release candidate quality is to run some
specific manual tests on it, our TCM wiki page has more details:

 
http://wiki.documentfoundation.org/QA/Testing/Regression_Tests#Full_Regression_Test

For other ways to get involved with this exciting project - you can
e.g. contribute code:

  http://www.libreoffice.org/community/developers/

translate LibreOffice to your language:

  http://wiki.documentfoundation.org/LibreOffice_Localization_Guide

or help with funding our operations:

  http://donate.libreoffice.org/

A list of known issues and fixed bugs compared to 5.1.2 rc2 is
available from our wiki:

  http://wiki.documentfoundation.org/Releases/5.1.3/RC1

Let us close again with a BIG Thank You! to all of you having
contributed to the LibreOffice project - this release would not have
been possible without your help.

On behalf of the Community,

Christian
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice


Handling the sidbar with API and macro's

2016-04-28 Thread SOS

hallo,

Any news on if and how we can handle the sidebar using the API and Macro's ?

Thanks for any hints

Fernand

___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice


Minutes of ESC call [2016-04-28]

2016-04-28 Thread Jan Holesovsky
* Present:
+ Armin, Stephan, Christian, Sophie, Norbert, Kendy, Olivier, Stefan W., 
Miklos, Caolan, jani 
  Michael S, Lionel, Eike, Thorsten, Bjoern (lurking on pad only)

* Completed Action Items:
+ build a proposal & reach-out for updated ESC composition (Michael)
+ look binding auto-CC update to adding keywords (JanI)
 + easyHacks (JanI), and ux-advice (UX list)
+ poke again at the lcov problem on tb31 ? (Bjoern)
 [ solved by dtardon (apparently) ]
+ poke at hack-fest candidate list (Bjoern)
 + see below: GUARDEC, Karlsruhe and Froscon, Bonn are possible, other 
suggestions welcome

* Pending Action Items:
+ build a plan for publishing the HTML documentation (Olivier, Kendy)
 [ updated the VM (Olivier) ]
+ investigate clobberring glew instead of lots of #ifdefs: (Marco, Oliver)
 [ Working on getting this up-stream ]
+ tweak UI and get LiveConnect API key / build case for board (Christian)
 [ pending ]
+ ask QA to re-test http://tdf.io/mmregressions (Robinson)
 [ testing underway ]
+ attempt to re-build a recent gstreamer 1.0 / core spec file
  on our CentOS6 base (tdf#94508) (Christian)
 [ pending ]
+ script XML / l10n string translation changes (Christian)
 [ have a partial script - but - waiting for pootle migration to
   finish -> next week. ]
 
* Release Engineering update (Christian)
+ 5.0.6 RC2 - due for tagging next Tues -April 26th
+ still patches needing tripple review
 
https://gerrit.libreoffice.org/#/q/status:open+project:core+branch:libreoffice-5-0
 → don't forget to also cherry-pick for libreoffice-5-0-6 branch
+ all patches with positive review integrated,
+ now being pushed to the mirrors
+ thank you for help with reviews! :-) (Cloph)
+ 5.1.3 RC2
+ next Tuesday
+ 5.2 Alpha 1
+ 24th May - feature freeze
+ getting close!
+ built from master, a Most Pressing bug there - OpenGL detection, 
cause unclear yet
+ the next Alpha: end of May - branchoff + feature freeze
+ Android & iOS Remote
+ expect Viewer update after Alpha a tagging
+ Aleksandar working on theming for Android remote.
+ pending
+ Cloph fixed some pieces there too
 
* ESC composition
+ Slightly nominal position:
+ https://wiki.documentfoundation.org/Development/ESC
+ Move valued previous contributors to 'Luminaries'
+ Muthu affiliation -> 'Other'
+ Eilidh -> ditto.
+ Add new members:
+ add Bubli & Armin -> CIB ?
+ JanI + Olivier -> TDF ...
+ Maxim Monistarsky (subject to his ack)
+ Markus Mohrhard (subject to his ack)
+ No private concerns expressed to Michael.
 
* Documentation (Olivier)
+ Chapter 4 of Getting Started 5.1 book delivered for revision
+ starting Chapter 5 - Calc now
+ Updated http://vm173.documentfoundation.org with tweaks in XSLT
+ it has now an index per module to ease access to a keyword
+ just hit ctrl+F in the browser to find a keyword
+ use browser navigation buttons to go back and forth.
+ use browser bookmark feature
+ l10n version of this rendering under work
+ Challenge: pass $lang, $system and $module to a XSLT in the URL.
+ will need some thin JavaScript there I fear (Kendy)
+ would be good to detect, but overriding necessary too for 
debugging
  or when displaying help for another platform (Norbert)
+ will need simplify the xslt, designed for old browsers, now some
  features are more easily accessible
 
+ pootle migration - completed ? how is it ?
+ hard work, thanks for making it possible (Sophie)
+ migration finished, works well, thank you Alex (Sophie)
+ dictionaries maintenance
 + cross-application (LibreOffice, Firefox and others), discussions
   ongoing, Sophie will report (Sophie)
 
* GSoC 2016 (JanI / Thorsten)
+ community bonding period until May, 22nd
+ still need back-up mentors for some tasks
+ please encourage your students to bond - get familiar with the project,
  Easy Hacks, etc. (Thorsten)
+ it is not a "sitting and waiting time" (Thorsten)
+ patches most appreciated, encourage your students to send them (Kendy)
 
* UX Update (Kendy/Bubli)
+ no meeting the last Friday
+ patches coming in
 
* Crashtest update (Caolan)
+ 1 import failure, 1 export failure, 0 coverity (Miklos just filled in the 
numbers)
 
* Hackfests (Bjoern)
+ next hackfests:
+ Ankara, Turkey
+ April 30th - May 1st.
+ https://wiki.documentfoundation.org/Hackfest/Ankara2016
+ plan do an overview talk on Friday with Markus & any interest 
(Michael)
+ next weekend - should be fun !

[Libreoffice-commits] online.git: 4 commits - loolwsd/test

2016-04-28 Thread Jan Holesovsky
 loolwsd/test/Makefile.am |2 
 loolwsd/test/httpgettest.cpp |  184 
 loolwsd/test/httpposttest.cpp|  243 ---
 loolwsd/test/httptestutils.hpp   |   64 ---
 loolwsd/test/integration-http-server.cpp |  273 +++
 5 files changed, 274 insertions(+), 492 deletions(-)

New commits:
commit 407b41afb9508c805849ac72a638dc412c25d63f
Author: Jan Holesovsky 
Date:   Thu Apr 28 18:35:22 2016 +0200

Decrease verbosity of this the http server test.

And also check that we've had a hit in loleaflet.html.

diff --git a/loolwsd/test/integration-http-server.cpp 
b/loolwsd/test/integration-http-server.cpp
index e619df9..f4e7557 100644
--- a/loolwsd/test/integration-http-server.cpp
+++ b/loolwsd/test/integration-http-server.cpp
@@ -166,28 +166,28 @@ namespace {
 void assertHTTPFilesExist(const Poco::URI& uri, Poco::RegularExpression& expr, 
const std::string& html, const std::string& mimetype = std::string())
 {
 Poco::RegularExpression::MatchVec matches;
+bool found = false;
 
 for (int offset = 0; expr.match(html, offset, matches) > 0; offset = 
static_cast(matches[0].offset + matches[0].length))
 {
+found = true;
CPPUNIT_ASSERT_EQUAL(2, (int)matches.size());
Poco::URI uriScript(html.substr(matches[1].offset, matches[1].length));
if (uriScript.getHost().empty())
{
std::string scriptString(uriScript.toString());
 
-   // ignore the branding bits, they do not have to be there
+   // ignore the branding bits, it's not an error when they are not
+// present
if (scriptString.find("/branding.") != std::string::npos)
-   {
-   std::cout << "skipping test for... " << scriptString << 
std::endl;
continue;
-   }
 
 #if ENABLE_SSL
Poco::Net::HTTPSClientSession sessionScript(uri.getHost(), 
uri.getPort());
 #else
Poco::Net::HTTPClientSession sessionScript(uri.getHost(), 
uri.getPort());
 #endif
-   std::cout << "checking... " << scriptString;
+
Poco::Net::HTTPRequest 
requestScript(Poco::Net::HTTPRequest::HTTP_GET, scriptString);
sessionScript.sendRequest(requestScript);
 
@@ -197,14 +197,10 @@ void assertHTTPFilesExist(const Poco::URI& uri, 
Poco::RegularExpression& expr, c
 
if (!mimetype.empty())
CPPUNIT_ASSERT_EQUAL(mimetype, responseScript.getContentType());
-
-   std::cout << " OK" << std::endl;
-   }
-   else
-   {
-   std::cout << "skip " << uriScript.toString() << std::endl;
}
 }
+
+CPPUNIT_ASSERT_MESSAGE("No match found", found);
 }
 
 }
commit 28b7aee356625338f99e3aad34ae81c517df4239
Author: Jan Holesovsky 
Date:   Thu Apr 28 18:17:37 2016 +0200

No need for a standalone httptestutils.hpp any more.

diff --git a/loolwsd/test/httptestutils.hpp b/loolwsd/test/httptestutils.hpp
deleted file mode 100644
index c6fa398..000
--- a/loolwsd/test/httptestutils.hpp
+++ /dev/null
@@ -1,64 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; 
fill-column: 100 -*- */
-/*
- * 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/.
- */
-
-#ifndef TEST_HTTPTESTUTILS_HPP
-#define TEST_HTTPTESTUTILS_HPP
-
-namespace httptest
-{
-
-inline void assertHTTPFilesExist(const Poco::URI& uri, 
Poco::RegularExpression& expr, const std::string& html, const std::string& 
mimetype = std::string())
-{
-Poco::RegularExpression::MatchVec matches;
-
-for (int offset = 0; expr.match(html, offset, matches) > 0; offset = 
static_cast(matches[0].offset + matches[0].length))
-{
-   CPPUNIT_ASSERT_EQUAL(2, (int)matches.size());
-   Poco::URI uriScript(html.substr(matches[1].offset, matches[1].length));
-   if (uriScript.getHost().empty())
-   {
-   std::string scriptString(uriScript.toString());
-
-   // ignore the branding bits, they do not have to be there
-   if (scriptString.find("/branding.") != std::string::npos)
-   {
-   std::cout << "skipping test for... " << scriptString << 
std::endl;
-   continue;
-   }
-
-#if ENABLE_SSL
-   Poco::Net::HTTPSClientSession sessionScript(uri.getHost(), 
uri.getPort());
-#else
-   Poco::Net::HTTPClientSession sessionScript(uri.getHost(), 
uri.getPort());
-#endif
-   std::cout << "checking... " << scriptString;
-   Poco::Net::HTTPRequest 
requestScript(Poco::Net::HTTPRequest::HTTP_GET, scriptString);
-   sessionScript.sendRequest(requestScript);
-
-   Poco::Net::HTTPResponse responseScript;
-   sessionScript.receiveResponse(responseScrip

[Libreoffice-commits] online.git: loolwsd/test

2016-04-28 Thread Henry Castro
 loolwsd/test/httpwstest.cpp |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 49e6eb287b15333bba8fb93edb1f2acb419ba019
Author: Henry Castro 
Date:   Thu Apr 28 14:01:28 2016 -0400

loolwsd: test: fix wrong file name

diff --git a/loolwsd/test/httpwstest.cpp b/loolwsd/test/httpwstest.cpp
index 2a01ea4..5755a8d 100644
--- a/loolwsd/test/httpwstest.cpp
+++ b/loolwsd/test/httpwstest.cpp
@@ -1071,7 +1071,7 @@ void HTTPWSTest::testClientPartCalc()
 {
 // Load a document
 std::string documentPath, documentURL;
-getDocumentPathAndURL("setclientpart.odp", documentPath, documentURL);
+getDocumentPathAndURL("setclientpart.ods", documentPath, documentURL);
 
 Poco::Net::HTTPRequest request(Poco::Net::HTTPRequest::HTTP_GET, 
documentURL);
 Poco::Net::WebSocket socket = *connectLOKit(request, _response);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: sw/source

2016-04-28 Thread Jochen Nitschke
 sw/source/ui/dbui/dbinsdlg.cxx |   71 +++--
 1 file changed, 33 insertions(+), 38 deletions(-)

New commits:
commit f8eb7f9c7db6c3dd460868d00758733318cdc266
Author: Jochen Nitschke 
Date:   Thu Apr 28 01:35:05 2016 +0200

use initialization list

use anonymous union to make initialization and
access easier
prevent overwriting type and use scoped enum

Change-Id: I76037ec666c5740096849b0c58fd9a187ada1d54
Reviewed-on: https://gerrit.libreoffice.org/24455
Tested-by: Jenkins 
Reviewed-by: jan iversen 
Tested-by: jan iversen 
Reviewed-by: Noel Grandin 

diff --git a/sw/source/ui/dbui/dbinsdlg.cxx b/sw/source/ui/dbui/dbinsdlg.cxx
index 3fe8b9a..af78932 100644
--- a/sw/source/ui/dbui/dbinsdlg.cxx
+++ b/sw/source/ui/dbui/dbinsdlg.cxx
@@ -110,49 +110,44 @@ const char cDBFieldEnd= '>';
 // Helper structure for adding database rows as fields or text
 struct DB_Column
 {
-enum ColType { DB_FILLTEXT, DB_COL_FIELD, DB_COL_TEXT, DB_SPLITPARA } 
eColType;
+const enum class Type { FILLTEXT, COL_FIELD, COL_TEXT, SPLITPARA } 
eColType;
 
 union {
 OUString* pText;
 SwField* pField;
 sal_uLong nFormat;
-} DB_ColumnData;
+};
 const SwInsDBColumn* pColInfo;
 
-DB_Column()
-{
-pColInfo = nullptr;
-DB_ColumnData.pText = nullptr;
-eColType = DB_SPLITPARA;
-}
+DB_Column() : eColType(Type::SPLITPARA),
+  pText(nullptr),
+  pColInfo(nullptr)
+{}
 
 explicit DB_Column( const OUString& rText )
-{
-pColInfo = nullptr;
-DB_ColumnData.pText = new OUString( rText );
-eColType = DB_FILLTEXT;
-}
+: eColType(Type::FILLTEXT),
+  pText(new OUString(rText)),
+  pColInfo(nullptr)
+{}
 
-DB_Column( const SwInsDBColumn& rInfo, sal_uLong nFormat )
-{
-pColInfo = &rInfo;
-DB_ColumnData.nFormat = nFormat;
-eColType = DB_COL_TEXT;
-}
+DB_Column( const SwInsDBColumn& rInfo, sal_uLong nFormat_ )
+: eColType(Type::COL_TEXT),
+  nFormat(nFormat_),
+  pColInfo(&rInfo)
+{}
 
 DB_Column( const SwInsDBColumn& rInfo, SwDBField& rField )
-{
-pColInfo = &rInfo;
-DB_ColumnData.pField = &rField;
-eColType = DB_COL_FIELD;
-}
+: eColType(Type::COL_FIELD),
+  pField(&rField),
+  pColInfo(&rInfo)
+{}
 
 ~DB_Column()
 {
-if( DB_COL_FIELD == eColType )
-delete DB_ColumnData.pField;
-else if( DB_FILLTEXT == eColType )
-delete DB_ColumnData.pText;
+if( Type::COL_FIELD == eColType )
+delete pField;
+else if( Type::FILLTEXT == eColType )
+delete pText;
 }
 };
 
@@ -936,7 +931,7 @@ bool SwInsertDBColAutoPilot::SplitTextToColArr( const 
OUString& rText,
 static_cast(rSh.InsertFieldType( 
aFieldType )),
 nFormat ) );
 if( nSubType )
-pNew->DB_ColumnData.pField->SetSubType( nSubType );
+pNew->pField->SetSubType( nSubType );
 }
 else
 pNew = new DB_Column( rFndCol, nFormat );
@@ -1281,11 +1276,11 @@ void SwInsertDBColAutoPilot::DataToDoc( const 
Sequence& rSelection,
 OUString sIns;
 switch( pDBCol->eColType )
 {
-case DB_Column::DB_FILLTEXT:
-sIns =  *pDBCol->DB_ColumnData.pText;
+case DB_Column::Type::FILLTEXT:
+sIns =  *pDBCol->pText;
 break;
 
-case DB_Column::DB_SPLITPARA:
+case DB_Column::Type::SPLITPARA:
 rSh.SplitNode();
 // when the template is not the same as the follow 
template,
 // the selected has to be set newly
@@ -1293,10 +1288,10 @@ void SwInsertDBColAutoPilot::DataToDoc( const 
Sequence& rSelection,
 rSh.SetTextFormatColl( pColl );
 break;
 
-case DB_Column::DB_COL_FIELD:
+case DB_Column::Type::COL_FIELD:
 {
 std::unique_ptr 
pField(static_cast(
-pDBCol->DB_ColumnData.pField->CopyField()));
+pDBCol->pField->CopyField()));
 double nValue = DBL_MAX;
 
 Reference< XPropertySet > xColumnProps;
@@ -1330,7 +1325,7 @@ void SwInsertDBColAutoPilot::DataToDoc( const 
Sequence& rSelection,

[Libreoffice-commits] core.git: i18npool/source

2016-04-28 Thread Miklos Vajna
 i18npool/source/localedata/localedata.cxx |   38 +++---
 1 file changed, 19 insertions(+), 19 deletions(-)

New commits:
commit 1d4974ba066174fb1e000d5e0a2c41a4f7feaf18
Author: Miklos Vajna 
Date:   Thu Apr 28 21:25:39 2016 +0200

i18npool: fix Android build

Change-Id: If7321acf4cb8542709cd3f2b418af97586862d46

diff --git a/i18npool/source/localedata/localedata.cxx 
b/i18npool/source/localedata/localedata.cxx
index bfb59aa..06da7af 100644
--- a/i18npool/source/localedata/localedata.cxx
+++ b/i18npool/source/localedata/localedata.cxx
@@ -543,43 +543,43 @@ oslGenericFunction SAL_CALL 
lcl_LookupTableHelper::getFunctionSymbolByName(
 (void) pOutCachedItem;
 
 if( strcmp(pFunction, "getAllCalendars") == 0 )
-return aLibTable[i].getAllCalendars;
+return i.getAllCalendars;
 else if( strcmp(pFunction, "getAllCurrencies") == 0 )
-return aLibTable[i].getAllCurrencies;
+return i.getAllCurrencies;
 else if( strcmp(pFunction, "getAllFormats0") == 0 )
-return aLibTable[i].getAllFormats0;
+return i.getAllFormats0;
 else if( strcmp(pFunction, "getBreakIteratorRules") == 0 )
-return aLibTable[i].getBreakIteratorRules;
+return i.getBreakIteratorRules;
 else if( strcmp(pFunction, "getCollationOptions") == 0 )
-return aLibTable[i].getCollationOptions;
+return i.getCollationOptions;
 else if( strcmp(pFunction, "getCollatorImplementation") == 0 )
-return aLibTable[i].getCollatorImplementation;
+return i.getCollatorImplementation;
 else if( strcmp(pFunction, "getContinuousNumberingLevels") == 0 )
-return aLibTable[i].getContinuousNumberingLevels;
+return i.getContinuousNumberingLevels;
 else if( strcmp(pFunction, "getDateAcceptancePatterns") == 0 )
-return aLibTable[i].getDateAcceptancePatterns;
+return i.getDateAcceptancePatterns;
 else if( strcmp(pFunction, "getFollowPageWords") == 0 )
-return aLibTable[i].getFollowPageWords;
+return i.getFollowPageWords;
 else if( strcmp(pFunction, "getForbiddenCharacters") == 0 )
-return aLibTable[i].getForbiddenCharacters;
+return i.getForbiddenCharacters;
 else if( strcmp(pFunction, "getIndexAlgorithm") == 0 )
-return aLibTable[i].getIndexAlgorithm;
+return i.getIndexAlgorithm;
 else if( strcmp(pFunction, "getLCInfo") == 0 )
-return aLibTable[i].getLCInfo;
+return i.getLCInfo;
 else if( strcmp(pFunction, "getLocaleItem") == 0 )
-return aLibTable[i].getLocaleItem;
+return i.getLocaleItem;
 else if( strcmp(pFunction, "getOutlineNumberingLevels") == 0 )
-return aLibTable[i].getOutlineNumberingLevels;
+return i.getOutlineNumberingLevels;
 else if( strcmp(pFunction, "getReservedWords") == 0 )
-return aLibTable[i].getReservedWords;
+return i.getReservedWords;
 else if( strcmp(pFunction, "getSearchOptions") == 0 )
-return aLibTable[i].getSearchOptions;
+return i.getSearchOptions;
 else if( strcmp(pFunction, "getTransliterations") == 0 )
-return aLibTable[i].getTransliterations;
+return i.getTransliterations;
 else if( strcmp(pFunction, "getUnicodeScripts") == 0 )
-return aLibTable[i].getUnicodeScripts;
+return i.getUnicodeScripts;
 else if( strcmp(pFunction, "getAllFormats1") == 0 )
-return aLibTable[i].getAllFormats1;
+return i.getAllFormats1;
 #endif
 }
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: 3 commits - sc/inc sc/source

2016-04-28 Thread Eike Rathke
 sc/inc/document.hxx |   83 
 sc/source/core/data/document10.cxx  |  356 ++
 sc/source/core/data/formulacell.cxx |  372 
 3 files changed, 444 insertions(+), 367 deletions(-)

New commits:
commit 37b071c9330d28f08d5a9f7bf11e577040925684
Author: Eike Rathke 
Date:   Thu Apr 28 22:42:14 2016 +0200

move to ScDocument::CopyAdjustRangeName() and namespace

Change-Id: I1ec3c8cc1b8d3cb899d49192295b14ffac02849a

diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx
index bb46e2d..a38279f 100644
--- a/sc/inc/document.hxx
+++ b/sc/inc/document.hxx
@@ -600,6 +600,40 @@ public:
 SCTAB nGlobalRefTab, SCTAB nLocalRefTab, SCTAB nOldTokenTab, SCTAB 
nOldTokenTabReplacement,
 bool bSameDoc, int nRecursion ) const;
 
+/** If necessary (name references sheet rOldPos.Tab()) copy and adjust
+named expression/range from sheet-local to sheet-local, or global to
+sheet-local if bGlobalNamesToLocal==true.
+
+Also copies nested names and adjusts the ocName tokens of the calling 
name.
+
+@param  rSheet
+On entry, the original sheet of the named expression/range, <0 
global.
+On return TRUE, the new sheet. Else unchanged.
+
+@param  rIndex
+On entry, the original index of the named expression/range.
+On return TRUE, the new index, or 0 if a new copied name 
couldn't be inserted. Else unchanged.
+
+@param  rpRangeData
+On entry, the pointer to the original named expression/range.
+On return TRUE, the pointer to the new copied name, or nullptr 
if hit shappened.
+
+@param  rNewPos
+New position of formula cell if called for that, else new base
+position of a to be created new name adjusted for Tab.
+rNewPos.nTab MUST point to the new sheet copied to.
+
+@param  rOldPos
+Old position of formula cell if called for that, else base
+position of the existing name adjusted for Tab.
+rOldPos.nTab MUST point to the old sheet copied from.
+
+@return TRUE if copied and caller may need to evaluate rpRangeData and 
rSheet and rIndex.
+FALSE if nothing to be done.
+ */
+bool CopyAdjustRangeName( SCTAB& rSheet, sal_uInt16& rIndex, ScRangeData*& 
rpRangeData, ScDocument& rNewDoc,
+const ScAddress& rNewPos, const ScAddress& rOldPos, const bool 
bGlobalNamesToLocal) const;
+
 /**
  * Call this immediately before updating all named ranges.
  */
diff --git a/sc/source/core/data/document10.cxx 
b/sc/source/core/data/document10.cxx
index 80375b8..f7ed6e8 100644
--- a/sc/source/core/data/document10.cxx
+++ b/sc/source/core/data/document10.cxx
@@ -513,4 +513,296 @@ bool ScDocument::FindRangeNamesReferencingSheet( 
sc::UpdatedRangeNames& rIndexes
 return bRef;
 }
 
+namespace {
+
+enum MightReferenceSheet
+{
+UNKNOWN,
+NONE,
+CODE,
+NAME
+};
+
+MightReferenceSheet mightRangeNameReferenceSheet( ScRangeData* pData, SCTAB 
nRefTab)
+{
+ScTokenArray* pCode = pData->GetCode();
+if (!pCode)
+return MightReferenceSheet::NONE;
+
+for (const formula::FormulaToken* p = pCode->First(); p; p = pCode->Next())
+{
+if (p->GetOpCode() == ocName)
+return MightReferenceSheet::NAME;
+}
+
+return pCode->ReferencesSheet( nRefTab, pData->GetPos().Tab()) ?
+MightReferenceSheet::CODE : MightReferenceSheet::NONE;
+}
+
+ScRangeData* copyRangeName( const ScRangeData* pOldRangeData, ScDocument& 
rNewDoc, const ScDocument* pOldDoc,
+const ScAddress& rNewPos, const ScAddress& rOldPos, bool 
bGlobalNamesToLocal,
+SCTAB nOldSheet, const SCTAB nNewSheet, bool bSameDoc)
+{
+ScAddress aRangePos( pOldRangeData->GetPos());
+if (nNewSheet >= 0)
+aRangePos.SetTab( nNewSheet);
+ScRangeData* pRangeData = new ScRangeData(*pOldRangeData, &rNewDoc, 
&aRangePos);
+pRangeData->SetIndex(0);// needed for insert to assign a new index
+ScTokenArray* pRangeNameToken = pRangeData->GetCode();
+if (bSameDoc && nNewSheet >= 0)
+{
+if (bGlobalNamesToLocal && nOldSheet < 0)
+{
+nOldSheet = rOldPos.Tab();
+if (rNewPos.Tab() <= nOldSheet)
+// Sheet was inserted before and references already updated.
+++nOldSheet;
+}
+pRangeNameToken->AdjustSheetLocalNameReferences( nOldSheet, nNewSheet);
+}
+if (!bSameDoc)
+{
+pRangeNameToken->ReadjustAbsolute3DReferences(pOldDoc, &rNewDoc, 
pRangeData->GetPos(), true);
+pRangeNameToken->AdjustAbsoluteRefs(pOldDoc, rOldPos, rNewPos, true);
+}
+
+bool bInserted;
+if (nNewSheet < 0)
+bInserted = rNewDoc.GetRangeName()->insert(pRangeData);
+else
+bInserted = rNewDoc.Get

[Libreoffice-commits] online.git: loolwsd/test

2016-04-28 Thread Ashod Nakashian
 loolwsd/test/httpwstest.cpp |   97 +++-
 1 file changed, 69 insertions(+), 28 deletions(-)

New commits:
commit cf54d0d87e9acd38e5541959105bdfec1493d875
Author: Ashod Nakashian 
Date:   Tue Apr 26 23:46:09 2016 -0400

loolwsd: test helpers and more code sharing

Change-Id: I87e4ad23f9c2761a7a2acab4139b458696e07e64
Reviewed-on: https://gerrit.libreoffice.org/24468
Reviewed-by: Ashod Nakashian 
Tested-by: Ashod Nakashian 

diff --git a/loolwsd/test/httpwstest.cpp b/loolwsd/test/httpwstest.cpp
index 5755a8d..31350a2 100644
--- a/loolwsd/test/httpwstest.cpp
+++ b/loolwsd/test/httpwstest.cpp
@@ -119,6 +119,10 @@ class HTTPWSTest : public CPPUNIT_NS::TestFixture
 std::string& response,
 const bool isLine);
 
+static
+void SocketProcessor(const std::shared_ptr& socket,
+ std::function handler);
+
 void checkTiles(Poco::Net::WebSocket& socket,
 const std::string& type);
 
@@ -137,6 +141,8 @@ class HTTPWSTest : public CPPUNIT_NS::TestFixture
 connectLOKit(Poco::Net::HTTPRequest& request,
  Poco::Net::HTTPResponse& response);
 
+std::shared_ptr loadDocAndGetSocket(const 
std::string& documentURL);
+
 public:
 HTTPWSTest()
 #if ENABLE_SSL
@@ -347,38 +353,28 @@ void HTTPWSTest::loadDoc(const std::string& documentURL)
 try
 {
 // Load a document and get its status.
-Poco::Net::HTTPRequest request(Poco::Net::HTTPRequest::HTTP_GET, 
documentURL);
-Poco::Net::WebSocket socket = *connectLOKit(request, _response);
-
-sendTextFrame(socket, "load url=" + documentURL);
-sendTextFrame(socket, "status");
-CPPUNIT_ASSERT_MESSAGE("cannot load the document " + documentURL, 
isDocumentLoaded(socket));
+auto socket = loadDocAndGetSocket(documentURL);
 
 std::string status;
-int flags;
-int n;
-do
-{
-char buffer[READ_BUFFER_SIZE];
-n = socket.receiveFrame(buffer, sizeof(buffer), flags);
-std::cout << "Got " << n << " bytes, flags: " << std::hex << flags 
<< std::dec << std::endl;
-if (n > 0 && (flags & Poco::Net::WebSocket::FRAME_OP_BITMASK) != 
Poco::Net::WebSocket::FRAME_OP_CLOSE)
-{
-std::cout << "Received message: " << 
LOOLProtocol::getAbbreviatedMessage(buffer, n) << std::endl;
-const std::string line = LOOLProtocol::getFirstLine(buffer, n);
-const std::string prefix = "status: ";
-if (line.find(prefix) == 0)
+std::string editlock;
+SocketProcessor(socket, [&](const std::string& msg)
 {
-status = line.substr(prefix.length());
-// Might be too strict, consider something flexible 
instread.
-CPPUNIT_ASSERT_EQUAL(std::string("type=text parts=1 
current=0 width=12808 height=16408"), status);
-break;
-}
-}
-}
-while (n > 0 && (flags & Poco::Net::WebSocket::FRAME_OP_BITMASK) != 
Poco::Net::WebSocket::FRAME_OP_CLOSE);
+const std::string prefix = "status: ";
+if (msg.find(prefix) == 0)
+{
+status = msg.substr(prefix.length());
+return false;
+}
 
-socket.shutdown();
+return true;
+});
+
+// Might be too strict, consider something flexible instread.
+CPPUNIT_ASSERT_EQUAL(std::string("type=text parts=1 current=0 
width=12808 height=16408"), status);
+// First session always gets the lock.
+CPPUNIT_ASSERT_EQUAL(std::string("editlock: 1"), editlock);
+
+socket->shutdown();
 }
 catch (const Poco::Exception& exc)
 {
@@ -1560,6 +1556,51 @@ HTTPWSTest::connectLOKit(Poco::Net::HTTPRequest& request,
 return ws;
 }
 
+std::shared_ptr HTTPWSTest::loadDocAndGetSocket(const 
std::string& documentURL)
+{
+try
+{
+// Load a document and get its status.
+Poco::Net::HTTPRequest request(Poco::Net::HTTPRequest::HTTP_GET, 
documentURL);
+auto socket = connectLOKit(request, _response);
+
+sendTextFrame(*socket, "load url=" + documentURL);
+sendTextFrame(*socket, "status");
+CPPUNIT_ASSERT_MESSAGE("cannot load the document " + documentURL, 
isDocumentLoaded(*socket));
+
+return socket;
+}
+catch (const Poco::Exception& exc)
+{
+CPPUNIT_FAIL(exc.displayText());
+}
+
+// Really couldn't reach here, but the compiler doesn't know any better.
+return nullptr;
+}
+
+
+void HTTPWSTest::SocketProcessor(const std::shared_ptr& 
socket, std::function handler)
+{
+int flags;
+int n;
+do
+{
+char buffer[READ_BUFFER_SIZE];
+n = socket->receiveFr

[Libreoffice-commits] online.git: loolwsd/LOOLProtocol.cpp

2016-04-28 Thread Ashod Nakashian
 loolwsd/LOOLProtocol.cpp |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 466ffc25dba5a893de8faaaecebd600b950027a0
Author: Ashod Nakashian 
Date:   Wed Apr 27 20:30:20 2016 -0400

Use [] around messages as they are more readable than ''

Change-Id: Id172bb03e8fa9dd148612d756d4a74fc501ea95c
Reviewed-on: https://gerrit.libreoffice.org/24469
Reviewed-by: Ashod Nakashian 
Tested-by: Ashod Nakashian 

diff --git a/loolwsd/LOOLProtocol.cpp b/loolwsd/LOOLProtocol.cpp
index 9420be8..a11d6d0 100644
--- a/loolwsd/LOOLProtocol.cpp
+++ b/loolwsd/LOOLProtocol.cpp
@@ -192,10 +192,10 @@ namespace LOOLProtocol
 // If first line is less than the length (minus newline), add eclipes.
 if (firstLine.size() < static_cast(length) - 1)
 {
-return std::string('\'' + firstLine + "'...");
+return std::string('[' + firstLine + "]...");
 }
 
-return std::string('\'' + firstLine + '\'');
+return std::string('[' + firstLine + ']');
 }
 };
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: loolwsd/ChildProcessSession.cpp loolwsd/ChildProcessSession.hpp loolwsd/LOOLKit.cpp

2016-04-28 Thread Ashod Nakashian
 loolwsd/ChildProcessSession.cpp |   29 -
 loolwsd/ChildProcessSession.hpp |4 ++--
 loolwsd/LOOLKit.cpp |   19 +++
 3 files changed, 33 insertions(+), 19 deletions(-)

New commits:
commit 7ff5be1f701f44dbec70bbbaeac50b9ba654b074
Author: Ashod Nakashian 
Date:   Wed Apr 27 20:42:45 2016 -0400

loolwsd: document rendering options should be set once

When loading a document first we set the rendering
options. Beyond that, the document is shared and
we shouldn't change the rendering options.

Change-Id: I0d2ac6fc43553b8395111ba2b8a3cc2796d2f0a4
Reviewed-on: https://gerrit.libreoffice.org/24470
Reviewed-by: Ashod Nakashian 
Tested-by: Ashod Nakashian 

diff --git a/loolwsd/ChildProcessSession.cpp b/loolwsd/ChildProcessSession.cpp
index 45ac69d..d727cfd 100644
--- a/loolwsd/ChildProcessSession.cpp
+++ b/loolwsd/ChildProcessSession.cpp
@@ -277,7 +277,7 @@ ChildProcessSession::ChildProcessSession(const std::string& 
id,
  std::shared_ptr ws,
  LibreOfficeKitDocument * 
loKitDocument,
  const std::string& jailId,
- 
std::function onLoad,
+ 
std::function onLoad,
  std::function onUnload) :
 LOOLSession(id, Kind::ToMaster, ws),
 _loKitDocument(loKitDocument),
@@ -554,30 +554,33 @@ bool ChildProcessSession::loadDocument(const char * 
/*buffer*/, int /*length*/,
 std::string timestamp;
 parseDocOptions(tokens, part, timestamp);
 
+std::string renderingOptions;
+if (!_docOptions.empty())
+{
+Parser parser;
+Poco::Dynamic::Var var = parser.parse(_docOptions);
+Object::Ptr object = var.extract();
+renderingOptions = object->get("rendering").toString();
+}
+
 assert(!_docURL.empty());
 assert(!_jailedFilePath.empty());
 
-_loKitDocument = _onLoad(getId(), _jailedFilePath, _docPassword, 
_isDocPasswordProvided);
-
+_loKitDocument = _onLoad(getId(), _jailedFilePath, _docPassword, 
renderingOptions, _isDocPasswordProvided);
 if (!_loKitDocument)
+{
+Log::error("Failed to get LoKitDocument instance.");
 return false;
+}
 
 std::unique_lock lock(Mutex);
 
 if (_multiView)
-_viewId = _loKitDocument->pClass->getView(_loKitDocument);
-
-std::string renderingOptions;
-if (!_docOptions.empty())
 {
-Parser parser;
-Poco::Dynamic::Var var = parser.parse(_docOptions);
-Object::Ptr object = var.extract();
-renderingOptions = object->get("rendering").toString();
+_viewId = _loKitDocument->pClass->getView(_loKitDocument);
+_loKitDocument->pClass->initializeForRendering(_loKitDocument, 
(renderingOptions.empty() ? nullptr : renderingOptions.c_str()));
 }
 
-_loKitDocument->pClass->initializeForRendering(_loKitDocument, 
(renderingOptions.empty() ? nullptr : renderingOptions.c_str()));
-
 if (_docType != "text" && part != -1)
 {
 _loKitDocument->pClass->setPart(_loKitDocument, part);
diff --git a/loolwsd/ChildProcessSession.hpp b/loolwsd/ChildProcessSession.hpp
index 39b6d51..b614195 100644
--- a/loolwsd/ChildProcessSession.hpp
+++ b/loolwsd/ChildProcessSession.hpp
@@ -38,7 +38,7 @@ public:
 std::shared_ptr ws,
 LibreOfficeKitDocument * loKitDocument,
 const std::string& jailId,
-std::function onLoad,
+std::function onLoad,
 std::function onUnload);
 virtual ~ChildProcessSession();
 
@@ -100,7 +100,7 @@ private:
 /// View ID, returned by createView() or 0 by default.
 int _viewId;
 std::map _lastDocStates;
-std::function _onLoad;
+std::function _onLoad;
 std::function _onUnload;
 
 std::unique_ptr _callbackWorker;
diff --git a/loolwsd/LOOLKit.cpp b/loolwsd/LOOLKit.cpp
index 5af4248..624eb98 100644
--- a/loolwsd/LOOLKit.cpp
+++ b/loolwsd/LOOLKit.cpp
@@ -464,7 +464,8 @@ public:
 ws->setReceiveTimeout(0);
 
 auto session = std::make_shared(sessionId, 
ws, _loKitDocument, _jailId,
-   [this](const std::string& id, const std::string& 
uri, const std::string& docPassword, bool isDocPasswordProvided) { return 
onLoad(id, uri, docPassword, isDocPasswordProvided); },
+   [this](const std::string& id, const std::string& 
uri, const std::string& docPassword,
+  const std::string& renderingOptions, bool 
isDocPasswordProvided) { return onLoad(id, uri, docPassword, renderingOptions, 
isDocPasswordProvided); },
[this](const std::string& id) { onUnload(id); });
 
 auto thread = std::make_shared(session,

[Libreoffice-commits] online.git: loolwsd/ChildProcessSession.cpp loolwsd/ChildProcessSession.hpp loolwsd/LOOLKit.cpp loolwsd/LOOLSession.cpp loolwsd/LOOLSession.hpp loolwsd/MasterProcessSession.cpp

2016-04-28 Thread Ashod Nakashian
 loolwsd/ChildProcessSession.cpp  |   12 ++--
 loolwsd/ChildProcessSession.hpp  |   10 ++
 loolwsd/LOOLKit.cpp  |   30 +++---
 loolwsd/LOOLSession.cpp  |4 ++--
 loolwsd/LOOLSession.hpp  |2 +-
 loolwsd/MasterProcessSession.cpp |2 +-
 6 files changed, 31 insertions(+), 29 deletions(-)

New commits:
commit 1dd88e68ea6e39c5785b61001e2388a886bfeb7b
Author: Ashod Nakashian 
Date:   Wed Apr 27 20:51:54 2016 -0400

loolwsd: shortened some long identifiers

Change-Id: I87809f5ad2a6d8f546cf3abaf646672d2d8168dc
Reviewed-on: https://gerrit.libreoffice.org/24471
Reviewed-by: Ashod Nakashian 
Tested-by: Ashod Nakashian 

diff --git a/loolwsd/ChildProcessSession.cpp b/loolwsd/ChildProcessSession.cpp
index d727cfd..cc7b603 100644
--- a/loolwsd/ChildProcessSession.cpp
+++ b/loolwsd/ChildProcessSession.cpp
@@ -277,8 +277,8 @@ ChildProcessSession::ChildProcessSession(const std::string& 
id,
  std::shared_ptr ws,
  LibreOfficeKitDocument * 
loKitDocument,
  const std::string& jailId,
- 
std::function onLoad,
- std::function onUnload) :
+ OnLoadCallback onLoad,
+ OnUnloadCallback onUnload) :
 LOOLSession(id, Kind::ToMaster, ws),
 _loKitDocument(loKitDocument),
 _multiView(std::getenv("LOK_VIEW_CALLBACK")),
@@ -554,19 +554,19 @@ bool ChildProcessSession::loadDocument(const char * 
/*buffer*/, int /*length*/,
 std::string timestamp;
 parseDocOptions(tokens, part, timestamp);
 
-std::string renderingOptions;
+std::string renderOpts;
 if (!_docOptions.empty())
 {
 Parser parser;
 Poco::Dynamic::Var var = parser.parse(_docOptions);
 Object::Ptr object = var.extract();
-renderingOptions = object->get("rendering").toString();
+renderOpts = object->get("rendering").toString();
 }
 
 assert(!_docURL.empty());
 assert(!_jailedFilePath.empty());
 
-_loKitDocument = _onLoad(getId(), _jailedFilePath, _docPassword, 
renderingOptions, _isDocPasswordProvided);
+_loKitDocument = _onLoad(getId(), _jailedFilePath, _docPassword, 
renderOpts, _haveDocPassword);
 if (!_loKitDocument)
 {
 Log::error("Failed to get LoKitDocument instance.");
@@ -578,7 +578,7 @@ bool ChildProcessSession::loadDocument(const char * 
/*buffer*/, int /*length*/,
 if (_multiView)
 {
 _viewId = _loKitDocument->pClass->getView(_loKitDocument);
-_loKitDocument->pClass->initializeForRendering(_loKitDocument, 
(renderingOptions.empty() ? nullptr : renderingOptions.c_str()));
+_loKitDocument->pClass->initializeForRendering(_loKitDocument, 
(renderOpts.empty() ? nullptr : renderOpts.c_str()));
 }
 
 if (_docType != "text" && part != -1)
diff --git a/loolwsd/ChildProcessSession.hpp b/loolwsd/ChildProcessSession.hpp
index b614195..77710fe 100644
--- a/loolwsd/ChildProcessSession.hpp
+++ b/loolwsd/ChildProcessSession.hpp
@@ -23,6 +23,8 @@
 #include "LOOLSession.hpp"
 
 class CallbackWorker;
+typedef std::function OnLoadCallback;
+typedef std::function OnUnloadCallback;
 
 class ChildProcessSession final : public LOOLSession
 {
@@ -38,8 +40,8 @@ public:
 std::shared_ptr ws,
 LibreOfficeKitDocument * loKitDocument,
 const std::string& jailId,
-std::function onLoad,
-std::function onUnload);
+OnLoadCallback onLoad,
+OnUnloadCallback onUnload);
 virtual ~ChildProcessSession();
 
 virtual bool getStatus(const char *buffer, int length) override;
@@ -100,8 +102,8 @@ private:
 /// View ID, returned by createView() or 0 by default.
 int _viewId;
 std::map _lastDocStates;
-std::function _onLoad;
-std::function _onUnload;
+OnLoadCallback _onLoad;
+OnUnloadCallback _onUnload;
 
 std::unique_ptr _callbackWorker;
 Poco::Thread _callbackThread;
diff --git a/loolwsd/LOOLKit.cpp b/loolwsd/LOOLKit.cpp
index 624eb98..cb3446a 100644
--- a/loolwsd/LOOLKit.cpp
+++ b/loolwsd/LOOLKit.cpp
@@ -360,7 +360,7 @@ public:
 _url(url),
 _loKitDocument(nullptr),
 _docPassword(""),
-_isDocPasswordProvided(false),
+_haveDocPassword(false),
 _isDocPasswordProtected(false),
 _docPasswordType(PasswordType::ToView),
 _isLoading(0),
@@ -465,7 +465,7 @@ public:
 
 auto session = std::make_shared(sessionId, 
ws, _loKitDocument, _jailId,
[this](const std::string& id, const std::string& 
uri, const std::string& docPassword,
-  const std::string& renderingOptio

[Libreoffice-commits] online.git: loolwsd/DocumentBroker.cpp

2016-04-28 Thread Ashod Nakashian
 loolwsd/DocumentBroker.cpp |5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

New commits:
commit 2efaa6e06b212740abcb89ce26ad9ab8d585d204
Author: Ashod Nakashian 
Date:   Wed Apr 27 20:52:32 2016 -0400

loolwsd: save documents when timestamp is within 10 seconds

Due to filesystem timestamp precision and other factors
we assume a timestamp match within 10 seconds to mean
the document has been recently saved and store it.

A document has to have an older than 10 seconds
modified timestamp compared to our last timestamp
to be deemed unchanged in the interim and skipped
from storing again.

Change-Id: I39b4bf64b221ba30dc7b818a330e779a2d0ecbd4
Reviewed-on: https://gerrit.libreoffice.org/24472
Reviewed-by: Ashod Nakashian 
Tested-by: Ashod Nakashian 

diff --git a/loolwsd/DocumentBroker.cpp b/loolwsd/DocumentBroker.cpp
index 69728cb..ac1ed91 100644
--- a/loolwsd/DocumentBroker.cpp
+++ b/loolwsd/DocumentBroker.cpp
@@ -152,8 +152,11 @@ bool DocumentBroker::save()
 std::unique_lock lock(_saveMutex);
 
 const auto uri = _uriPublic.toString();
+
+// If the file hasn't been modified within the past 10 seconds, skip 
saving.
 const auto newFileModifiedTime = 
Poco::File(_storage->getLocalRootPath()).getLastModified();
-if (newFileModifiedTime == _lastFileModifiedTime)
+const auto elapsed = newFileModifiedTime - _lastFileModifiedTime;
+if (std::abs(elapsed) > 10 * 1000 * 1000)
 {
 // Nothing to do.
 Log::debug("Skipping unnecessary saving to URI [" + uri + "].");
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: loolwsd/ChildProcessSession.cpp loolwsd/MasterProcessSession.cpp

2016-04-28 Thread Ashod Nakashian
 loolwsd/ChildProcessSession.cpp  |1 +
 loolwsd/MasterProcessSession.cpp |   11 +--
 2 files changed, 6 insertions(+), 6 deletions(-)

New commits:
commit e2cf1a5b52f261394f7989122e79356a69128de9
Author: Ashod Nakashian 
Date:   Thu Apr 28 07:31:55 2016 -0400

loolwsd: always send status before other messages

Except for loading progress messages (statusindicator).

Change-Id: I42f79167c3ff953fc4e283854468cd7e8bd54bc3
Reviewed-on: https://gerrit.libreoffice.org/24474
Reviewed-by: Ashod Nakashian 
Tested-by: Ashod Nakashian 

diff --git a/loolwsd/ChildProcessSession.cpp b/loolwsd/ChildProcessSession.cpp
index cc7b603..f159ca8 100644
--- a/loolwsd/ChildProcessSession.cpp
+++ b/loolwsd/ChildProcessSession.cpp
@@ -587,6 +587,7 @@ bool ChildProcessSession::loadDocument(const char * 
/*buffer*/, int /*length*/,
 }
 
 // Respond by the document status, which has no arguments.
+Log::debug("Sending status after load.");
 if (!getStatus(nullptr, 0))
 return false;
 
diff --git a/loolwsd/MasterProcessSession.cpp b/loolwsd/MasterProcessSession.cpp
index f8e321f..c1fa22d 100644
--- a/loolwsd/MasterProcessSession.cpp
+++ b/loolwsd/MasterProcessSession.cpp
@@ -202,7 +202,10 @@ bool MasterProcessSession::_handleInput(const char 
*buffer, int length)
 {
 _docBroker->tileCache().saveTextFile(std::string(buffer, 
length), "status.txt");
 
-// let clients know if they hold the edit lock
+// Forward the status response to the client.
+forwardToPeer(buffer, length);
+
+// And let clients know if they hold the edit lock.
 std::string message = "editlock: ";
 message += std::to_string(peer->isEditLocked());
 Log::debug("Forwarding [" + message + "] in response to 
status.");
@@ -397,13 +400,9 @@ bool MasterProcessSession::loadDocument(const char* 
/*buffer*/, int /*length*/,
 bool MasterProcessSession::getStatus(const char *buffer, int length)
 {
 const std::string status = 
_docBroker->tileCache().getTextFile("status.txt");
-if (status.size() > 0)
+if (!status.empty())
 {
 sendTextFrame(status);
-// let clients know if they hold the edit lock
-std::string message = "editlock: ";
-message += std::to_string(isEditLocked());
-sendTextFrame(message);
 return true;
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: loolwsd/test

2016-04-28 Thread Ashod Nakashian
 loolwsd/test/httpwstest.cpp |   39 ---
 1 file changed, 24 insertions(+), 15 deletions(-)

New commits:
commit f44660aa99f8f325aa4e8b58e299d7b210906556
Author: Ashod Nakashian 
Date:   Thu Apr 28 07:27:17 2016 -0400

loolwsd: unittest cleanups

Change-Id: Ib9b915c7ca2df03afba7f4e1fb37b8fff846a474
Reviewed-on: https://gerrit.libreoffice.org/24473
Reviewed-by: Ashod Nakashian 
Tested-by: Ashod Nakashian 

diff --git a/loolwsd/test/httpwstest.cpp b/loolwsd/test/httpwstest.cpp
index 31350a2..9f9d9b0 100644
--- a/loolwsd/test/httpwstest.cpp
+++ b/loolwsd/test/httpwstest.cpp
@@ -120,7 +120,8 @@ class HTTPWSTest : public CPPUNIT_NS::TestFixture
 const bool isLine);
 
 static
-void SocketProcessor(const std::shared_ptr& socket,
+void SocketProcessor(std::string name,
+ const std::shared_ptr& socket,
  std::function handler);
 
 void checkTiles(Poco::Net::WebSocket& socket,
@@ -357,7 +358,7 @@ void HTTPWSTest::loadDoc(const std::string& documentURL)
 
 std::string status;
 std::string editlock;
-SocketProcessor(socket, [&](const std::string& msg)
+SocketProcessor("", socket, [&](const std::string& msg)
 {
 const std::string prefix = "status: ";
 if (msg.find(prefix) == 0)
@@ -467,6 +468,8 @@ void HTTPWSTest::testSaveOnDisconnect()
 sendTextFrame(socket, "uno .uno:Delete");
 sendTextFrame(socket, "paste mimetype=text/plain;charset=utf-8\naaa 
bbb ccc");
 
+std::cerr << "Closing connection after pasting." << std::endl;
+
 // Shutdown abruptly.
 socket.shutdown();
 }
@@ -477,7 +480,7 @@ void HTTPWSTest::testSaveOnDisconnect()
 
 // Allow time to save and destroy before we connect again.
 sleep(5);
-std::cout << "Loading again." << std::endl;
+std::cerr << "Loading again." << std::endl;
 try
 {
 // Load the same document and check that the last changes (pasted 
text) is saved.
@@ -1509,7 +1512,6 @@ HTTPWSTest::connectLOKit(Poco::Net::HTTPRequest& request,
 int retries = 3;
 bool ready = false;
 char buffer[READ_BUFFER_SIZE];
-const std::string success("ready");
 std::shared_ptr ws;
 
 do
@@ -1519,6 +1521,7 @@ HTTPWSTest::connectLOKit(Poco::Net::HTTPRequest& request,
 #else
 Poco::Net::HTTPClientSession session(_uri.getHost(), _uri.getPort());
 #endif
+std::cerr << "Connecting... ";
 ws = std::make_shared(session, request, 
response);
 
 do
@@ -1530,7 +1533,7 @@ HTTPWSTest::connectLOKit(Poco::Net::HTTPRequest& request,
 {
 const std::string message = 
LOOLProtocol::getFirstLine(buffer, received);
 std::cerr << message << std::endl;
-if (message.find(success) != std::string::npos)
+if (message.find("ready") != std::string::npos)
 {
 ready = true;
 break;
@@ -1539,11 +1542,7 @@ HTTPWSTest::connectLOKit(Poco::Net::HTTPRequest& request,
 }
 catch (const Poco::TimeoutException& exc)
 {
-std::cout << exc.displayText();
-}
-catch(...)
-{
-throw;
+std::cout << exc.displayText() << std::endl;
 }
 }
 while (received > 0 && (flags & 
Poco::Net::WebSocket::FRAME_OP_BITMASK) != 
Poco::Net::WebSocket::FRAME_OP_CLOSE);
@@ -1562,10 +1561,10 @@ std::shared_ptr 
HTTPWSTest::loadDocAndGetSocket(const std:
 {
 // Load a document and get its status.
 Poco::Net::HTTPRequest request(Poco::Net::HTTPRequest::HTTP_GET, 
documentURL);
-auto socket = connectLOKit(request, _response);
+Poco::Net::HTTPResponse response;
+auto socket = connectLOKit(request, response);
 
 sendTextFrame(*socket, "load url=" + documentURL);
-sendTextFrame(*socket, "status");
 CPPUNIT_ASSERT_MESSAGE("cannot load the document " + documentURL, 
isDocumentLoaded(*socket));
 
 return socket;
@@ -1580,23 +1579,33 @@ std::shared_ptr 
HTTPWSTest::loadDocAndGetSocket(const std:
 }
 
 
-void HTTPWSTest::SocketProcessor(const std::shared_ptr& 
socket, std::function handler)
+void HTTPWSTest::SocketProcessor(std::string name,
+ const std::shared_ptr& 
socket,
+ std::function 
handler)
 {
+if (!name.empty())
+{
+name += ' ';
+}
+
 int flags;
 int n;
 do
 {
 char buffer[READ_BUFFER_SIZE];
 n = socket->receiveFrame(buffer, sizeof(buffer), flags);
-std::cout << "Got " << n << " bytes, flags: " << std::hex << flags << 
std::dec << std::endl;
 if (n > 0 && (flags & Poco::Net::WebSocket::FRAME_OP_BITMASK) != 
Poc

[Libreoffice-commits] online.git: loolwsd/Makefile.am loolwsd/test

2016-04-28 Thread Ashod Nakashian
 loolwsd/Makefile.am |2 
 loolwsd/test/Makefile.am|2 
 loolwsd/test/httpwstest.cpp |  122 
 3 files changed, 124 insertions(+), 2 deletions(-)

New commits:
commit 575e09307675c68f95ccea17dacfe04894601606
Author: Ashod Nakashian 
Date:   Thu Apr 28 17:02:45 2016 -0400

loolwsd: editlock and takeedit tests

Change-Id: Ie2458aed1da0624f1769b6b75f134cb0fed0db75
Reviewed-on: https://gerrit.libreoffice.org/24475
Reviewed-by: Ashod Nakashian 
Tested-by: Ashod Nakashian 

diff --git a/loolwsd/Makefile.am b/loolwsd/Makefile.am
index 8c34c85..5ba1681 100644
--- a/loolwsd/Makefile.am
+++ b/loolwsd/Makefile.am
@@ -49,7 +49,7 @@ loolwsd_SOURCES = Admin.cpp \
 
 noinst_PROGRAMS = connect \
   lokitclient \
- loolforkit-nocaps
+  loolforkit-nocaps
 
 connect_SOURCES = Connect.cpp \
   Log.cpp \
diff --git a/loolwsd/test/Makefile.am b/loolwsd/test/Makefile.am
index 4a7663b..7c26f38 100644
--- a/loolwsd/test/Makefile.am
+++ b/loolwsd/test/Makefile.am
@@ -10,7 +10,7 @@ noinst_LTLIBRARIES = \
 unit-admin.la
 
 MAGIC_TO_FORCE_SHLIB_CREATION = -rpath /dummy
-AM_LDFLAGS = -module $(MAGIC_TO_FORCE_SHLIB_CREATION)
+AM_LDFLAGS = -pthread -module $(MAGIC_TO_FORCE_SHLIB_CREATION)
 AM_CPPFLAGS = -pthread -I$(top_srcdir)
 
 test_CPPFLAGS = -DTDOC=\"$(top_srcdir)/test/data\"
diff --git a/loolwsd/test/httpwstest.cpp b/loolwsd/test/httpwstest.cpp
index 9f9d9b0..c594c0d 100644
--- a/loolwsd/test/httpwstest.cpp
+++ b/loolwsd/test/httpwstest.cpp
@@ -10,6 +10,9 @@
 #include "config.h"
 
 #include 
+#include 
+#include 
+#include 
 #include 
 
 #include 
@@ -71,6 +74,7 @@ class HTTPWSTest : public CPPUNIT_NS::TestFixture
 CPPUNIT_TEST(testPasswordProtectedDocumentWithCorrectPassword);
 CPPUNIT_TEST(testPasswordProtectedDocumentWithCorrectPasswordAgain);
 CPPUNIT_TEST(testInsertDelete);
+CPPUNIT_TEST(testEditLock);
 CPPUNIT_TEST(testClientPartImpress);
 CPPUNIT_TEST(testClientPartCalc);
 #if ENABLE_DEBUG
@@ -104,6 +108,7 @@ class HTTPWSTest : public CPPUNIT_NS::TestFixture
 void testClientPartCalc();
 void testSimultaneousTilesRenderedJustOnce();
 void testNoExtraLoolKitsLeft();
+void testEditLock();
 
 void loadDoc(const std::string& documentURL);
 
@@ -1130,6 +1135,123 @@ void HTTPWSTest::testSimultaneousTilesRenderedJustOnce()
 socket2.shutdown();
 }
 
+void HTTPWSTest::testEditLock()
+{
+const std::string documentPath = Util::getTempFilePath(TDOC, "hello.odt");
+const std::string documentURL = "file://" + 
Poco::Path(documentPath).makeAbsolute().toString();
+
+std::mutex mutex;
+std::condition_variable cv;
+volatile bool second_client_died = false;
+
+// The first client loads the document and checks that it has the lock.
+// It then waits until the lock is taken away.
+std::thread first_client([&]()
+{
+try
+{
+std::cerr << "First client loading." << std::endl;
+auto socket = loadDocAndGetSocket(documentURL);
+std::string editlock1;
+SocketProcessor("First", socket, [&](const std::string& msg)
+{
+if (msg.find("editlock") == 0)
+{
+if (editlock1.empty())
+{
+std::cerr << "First client has the lock." 
<< std::endl;
+
CPPUNIT_ASSERT_EQUAL(std::string("editlock: 1"), msg);
+editlock1 = msg;
+
+// Initial condition met, connect second 
client.
+std::cerr << "Starting second client." << 
std::endl;
+cv.notify_one();
+}
+else if (editlock1 == "editlock: 1")
+{
+if (second_client_died)
+{
+// We had lost the lock to the second 
client,
+// but we should get it back once they 
die.
+std::cerr << "First client is given 
the lock." << std::endl;
+
CPPUNIT_ASSERT_EQUAL(std::string("editlock: 1"), msg);
+return false; // Done!
+}
+else
+{
+// Normal broadcast when the second 
client joins.
+std::cerr << "First client still has 
the lock." << std::endl;
+}
+  

[Libreoffice-commits] online.git: loolwsd/test

2016-04-28 Thread Ashod Nakashian
 loolwsd/test/helpers.hpp|  283 ++
 loolwsd/test/httpwstest.cpp |  294 +++-
 2 files changed, 307 insertions(+), 270 deletions(-)

New commits:
commit c164096c539775e15e96ddcc4f11ff3cb19d60e6
Author: Ashod Nakashian 
Date:   Thu Apr 28 21:41:00 2016 -0400

loolwsd: factored out common test helpers

Change-Id: Iad2794f1b458f04bdd1fb9d3f965afd91adbade8
Reviewed-on: https://gerrit.libreoffice.org/24477
Reviewed-by: Ashod Nakashian 
Tested-by: Ashod Nakashian 

diff --git a/loolwsd/test/helpers.hpp b/loolwsd/test/helpers.hpp
new file mode 100644
index 000..24ba1ac
--- /dev/null
+++ b/loolwsd/test/helpers.hpp
@@ -0,0 +1,283 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; 
fill-column: 100 -*- */
+/*
+ * 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/.
+ */
+
+#include "config.h"
+
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+#include 
+
+/// Common helper testing functions.
+/// Avoid the temptation to reuse from LOOL code!
+/// These are supposed to be testing the latter.
+namespace helpers
+{
+static
+void getDocumentPathAndURL(const char* document, std::string& documentPath, 
std::string& documentURL)
+{
+documentPath = Util::getTempFilePath(TDOC, document);
+documentURL = "file://" + 
Poco::Path(documentPath).makeAbsolute().toString();
+
+std::cerr << "Test file: " << documentPath << std::endl;
+}
+
+static
+void sendTextFrame(Poco::Net::WebSocket& socket, const std::string& string)
+{
+socket.sendFrame(string.data(), string.size());
+}
+
+static
+bool isDocumentLoaded(Poco::Net::WebSocket& ws)
+{
+bool isLoaded = false;
+try
+{
+int flags;
+int bytes;
+int retries = 30;
+const Poco::Timespan waitTime(100);
+
+ws.setReceiveTimeout(0);
+std::cout << "==> isDocumentLoaded\n";
+do
+{
+char buffer[READ_BUFFER_SIZE];
+
+if (ws.poll(waitTime, Poco::Net::Socket::SELECT_READ))
+{
+bytes = ws.receiveFrame(buffer, sizeof(buffer), flags);
+std::cout << "Got " << bytes << " bytes, flags: " << std::hex 
<< flags << std::dec << '\n';
+if (bytes > 0 && (flags & 
Poco::Net::WebSocket::FRAME_OP_BITMASK) != Poco::Net::WebSocket::FRAME_OP_CLOSE)
+{
+std::cout << "Received message: " << 
LOOLProtocol::getAbbreviatedMessage(buffer, bytes) << '\n';
+const std::string line = 
LOOLProtocol::getFirstLine(buffer, bytes);
+const std::string prefixIndicator = 
"statusindicatorfinish:";
+const std::string prefixStatus = "status:";
+if (line.find(prefixIndicator) == 0 || 
line.find(prefixStatus) == 0)
+{
+isLoaded = true;
+break;
+}
+}
+retries = 10;
+}
+else
+{
+std::cout << "Timeout\n";
+--retries;
+}
+}
+while (retries > 0 && (flags & Poco::Net::WebSocket::FRAME_OP_BITMASK) 
!= Poco::Net::WebSocket::FRAME_OP_CLOSE);
+}
+catch (const Poco::Net::WebSocketException& exc)
+{
+std::cout << exc.message();
+}
+
+return isLoaded;
+}
+
+
+// Connecting to a Kit process is managed by document broker, that it does 
several
+// jobs to establish the bridge connection between the Client and Kit process,
+// The result, it is mostly time outs to get messages in the unit test and it 
could fail.
+// connectLOKit ensures the websocket is connected to a kit process.
+static
+std::shared_ptr
+connectLOKit(Poco::URI uri,
+ Poco::Net::HTTPRequest& request,
+ Poco::Net::HTTPResponse& response)
+{
+int flags;
+int received = 0;
+int retries = 3;
+bool ready = false;
+char buffer[READ_BUFFER_SIZE];
+std::shared_ptr ws;
+
+do
+{
+#if ENABLE_SSL
+Poco::Net::HTTPSClientSession session(uri.getHost(), uri.getPort());
+#else
+Poco::Net::HTTPClientSession session(uri.getHost(), uri.getPort());
+#endif
+std::cerr << "Connecting... ";
+ws = std::make_shared(session, request, 
response);
+
+do
+{
+try
+{
+received = ws->receiveFrame(buffer, sizeof(buffer), flags);
+   

[Libreoffice-commits] online.git: loolwsd/test

2016-04-28 Thread Ashod Nakashian
 loolwsd/test/countloolkits.hpp   |   76 ++-
 loolwsd/test/httpwstest.cpp  |   64 ++
 loolwsd/test/integration-http-server.cpp |4 -
 3 files changed, 82 insertions(+), 62 deletions(-)

New commits:
commit 40d694d9ef089988296e01ed4c011642d445491b
Author: Ashod Nakashian 
Date:   Thu Apr 28 22:01:05 2016 -0400

loolwsd: moved loolkit process counting to own file and minimized wait

Change-Id: Ib7950fe7d97ca3484aadb1d7a7492ad1a88e375a
Reviewed-on: https://gerrit.libreoffice.org/24478
Reviewed-by: Ashod Nakashian 
Tested-by: Ashod Nakashian 

diff --git a/loolwsd/test/countloolkits.hpp b/loolwsd/test/countloolkits.hpp
index 1fb1ba5..2490f22 100644
--- a/loolwsd/test/countloolkits.hpp
+++ b/loolwsd/test/countloolkits.hpp
@@ -10,7 +10,81 @@
 #ifndef INCLUDED_COUNTLOOLKITPROCESSES_HPP
 #define INCLUDED_COUNTLOOLKITPROCESSES_HPP
 
-extern int countLoolKitProcesses();
+#include 
+#include 
+
+/// Counts the number of LoolKit process instances without wiating.
+static
+int getLoolKitProcessCount()
+{
+int result = 0;
+for (auto i = Poco::DirectoryIterator(std::string("/proc")); i != 
Poco::DirectoryIterator(); ++i)
+{
+try
+{
+Poco::Path procEntry = i.path();
+const std::string& fileName = procEntry.getFileName();
+int pid;
+std::size_t endPos = 0;
+try
+{
+pid = std::stoi(fileName, &endPos);
+}
+catch (const std::invalid_argument&)
+{
+pid = 0;
+}
+if (pid > 1 && endPos == fileName.length())
+{
+Poco::FileInputStream stat(procEntry.toString() + "/stat");
+std::string statString;
+Poco::StreamCopier::copyToString(stat, statString);
+Poco::StringTokenizer tokens(statString, " ");
+if (tokens.count() > 3 && tokens[1] == "(loolkit)")
+{
+switch (tokens[2].c_str()[0])
+{
+case 'x':
+case 'X': // Kinds of dead-ness.
+case 'Z': // zombies
+break; // ignore
+default:
+result++;
+break;
+}
+// std::cout << "Process:" << pid << ", '" << tokens[1] << 
"'" << " state: " << tokens[2] << std::endl;
+}
+}
+}
+catch (const Poco::Exception&)
+{
+}
+}
+
+// std::cout << "Number of loolkit processes: " << result << std::endl;
+return result;
+}
+
+static
+int countLoolKitProcesses(const int expected, const int timeoutMs = 
POLL_TIMEOUT_MS * 5)
+{
+const size_t repeat = (timeoutMs + POLL_TIMEOUT_MS - 1) / POLL_TIMEOUT_MS;
+auto count = getLoolKitProcessCount();
+for (size_t i = 0; i < repeat; ++i)
+{
+if (count == expected)
+{
+return count;
+}
+
+// Give polls in the lool processes time to time out etc
+Poco::Thread::sleep(POLL_TIMEOUT_MS);
+
+count = getLoolKitProcessCount();
+}
+
+return count;
+}
 
 #endif
 
diff --git a/loolwsd/test/httpwstest.cpp b/loolwsd/test/httpwstest.cpp
index f57d710..9994f92 100644
--- a/loolwsd/test/httpwstest.cpp
+++ b/loolwsd/test/httpwstest.cpp
@@ -15,7 +15,6 @@
 #include 
 #include 
 
-#include 
 #include 
 #include 
 #include 
@@ -160,6 +159,7 @@ public:
 
 void tearDown()
 {
+testNoExtraLoolKitsLeft();
 }
 };
 
@@ -167,7 +167,7 @@ int HTTPWSTest::_initialLoolKitCount = 0;
 
 void HTTPWSTest::testCountHowManyLoolkits()
 {
-_initialLoolKitCount = countLoolKitProcesses();
+_initialLoolKitCount = getLoolKitProcessCount();
 CPPUNIT_ASSERT(_initialLoolKitCount > 0);
 }
 
@@ -520,7 +520,7 @@ void HTTPWSTest::testReloadWhileDisconnecting()
 sendTextFrame(socket, "uno .uno:Delete");
 sendTextFrame(socket, "paste mimetype=text/plain;charset=utf-8\naaa 
bbb ccc");
 
-kitcount = countLoolKitProcesses();
+kitcount = getLoolKitProcessCount();
 
 // Shutdown abruptly.
 socket.shutdown();
@@ -542,7 +542,7 @@ void HTTPWSTest::testReloadWhileDisconnecting()
 CPPUNIT_ASSERT_MESSAGE("cannot load the document " + documentURL, 
isDocumentLoaded(socket));
 
 // Should have no new instances.
-CPPUNIT_ASSERT_EQUAL(kitcount, countLoolKitProcesses());
+CPPUNIT_ASSERT_EQUAL(kitcount, getLoolKitProcessCount());
 
 // Check if the document contains the pasted text.
 sendTextFrame(socket, "uno .uno:SelectAll");
@@ -1225,7 +1225,7 @@ void HTTPWSTest::testEditLock()
 
 void HTTPWSTest::testNoExtraLoolKitsLeft()
 {
-int countNow = countLoolKitProcesses();
+const auto countNow = countLoolKitProcesses(_initialLoolKitCount);
 
 

[Libreoffice-commits] online.git: loolwsd/test

2016-04-28 Thread Ashod Nakashian
 loolwsd/test/helpers.hpp |   22 --
 1 file changed, 16 insertions(+), 6 deletions(-)

New commits:
commit 7f17561f7aae52148f2778e71e10fd67df7f6376
Author: Ashod Nakashian 
Date:   Thu Apr 28 22:43:59 2016 -0400

loolwsd: test SocketProcessor supports timeout

Change-Id: I1cf277c67840f35a0f79884c9b1c644b0769b5fd
Reviewed-on: https://gerrit.libreoffice.org/24479
Reviewed-by: Ashod Nakashian 
Tested-by: Ashod Nakashian 

diff --git a/loolwsd/test/helpers.hpp b/loolwsd/test/helpers.hpp
index 24ba1ac..3933f38 100644
--- a/loolwsd/test/helpers.hpp
+++ b/loolwsd/test/helpers.hpp
@@ -47,7 +47,7 @@
 /// These are supposed to be testing the latter.
 namespace helpers
 {
-static
+inline
 void getDocumentPathAndURL(const char* document, std::string& documentPath, 
std::string& documentURL)
 {
 documentPath = Util::getTempFilePath(TDOC, document);
@@ -246,25 +246,35 @@ std::shared_ptr 
loadDocAndGetSocket(const Poco::URI& uri,
 return nullptr;
 }
 
-static
+inline
 void SocketProcessor(std::string name,
  const std::shared_ptr& socket,
- std::function handler)
+ std::function handler,
+ const size_t timeoutMs = 1)
 {
 if (!name.empty())
 {
 name += ' ';
 }
 
+socket->setReceiveTimeout(0);
+
+const Poco::Timespan waitTime(timeoutMs * 1000);
 int flags;
 int n;
+char buffer[READ_BUFFER_SIZE];
 do
 {
-char buffer[READ_BUFFER_SIZE];
+if (!socket->poll(waitTime, Poco::Net::Socket::SELECT_READ))
+{
+std::cerr << "Timeout." << std::endl;
+break;
+}
+
 n = socket->receiveFrame(buffer, sizeof(buffer), flags);
 if (n > 0 && (flags & Poco::Net::WebSocket::FRAME_OP_BITMASK) != 
Poco::Net::WebSocket::FRAME_OP_CLOSE)
 {
-std::cout << name + "Got " << n << " bytes: " << 
LOOLProtocol::getAbbreviatedMessage(buffer, n) << std::endl;
+std::cout << name << "Got " << n << " bytes: " << 
LOOLProtocol::getAbbreviatedMessage(buffer, n) << std::endl;
 if (!handler(std::string(buffer, n)))
 {
 break;
@@ -272,7 +282,7 @@ void SocketProcessor(std::string name,
 }
 else
 {
-std::cerr << name + "Got " << n << " bytes, flags: " << std::hex 
<< flags << std::dec << std::endl;
+std::cerr << name << "Got " << n << " bytes, flags: " << std::hex 
<< flags << std::dec << std::endl;
 }
 }
 while (n > 0 && (flags & Poco::Net::WebSocket::FRAME_OP_BITMASK) != 
Poco::Net::WebSocket::FRAME_OP_CLOSE);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: loolwsd/test

2016-04-28 Thread Ashod Nakashian
 loolwsd/test/helpers.hpp |   34 ++
 1 file changed, 22 insertions(+), 12 deletions(-)

New commits:
commit c6380f5820a85968d3d29023ae64c9b918cda27d
Author: Ashod Nakashian 
Date:   Thu Apr 28 22:44:40 2016 -0400

loolwsd: test logging cleanup

Change-Id: Ie2fa40eab6fec4cfe9819d75f1c35efd835b11b7
Reviewed-on: https://gerrit.libreoffice.org/24480
Reviewed-by: Ashod Nakashian 
Tested-by: Ashod Nakashian 

diff --git a/loolwsd/test/helpers.hpp b/loolwsd/test/helpers.hpp
index 3933f38..b7dae3d 100644
--- a/loolwsd/test/helpers.hpp
+++ b/loolwsd/test/helpers.hpp
@@ -56,15 +56,20 @@ void getDocumentPathAndURL(const char* document, 
std::string& documentPath, std:
 std::cerr << "Test file: " << documentPath << std::endl;
 }
 
-static
+inline
 void sendTextFrame(Poco::Net::WebSocket& socket, const std::string& string)
 {
 socket.sendFrame(string.data(), string.size());
 }
 
-static
-bool isDocumentLoaded(Poco::Net::WebSocket& ws)
+inline
+bool isDocumentLoaded(Poco::Net::WebSocket& ws, std::string name = "")
 {
+if (!name.empty())
+{
+name += ' ';
+}
+
 bool isLoaded = false;
 try
 {
@@ -74,7 +79,6 @@ bool isDocumentLoaded(Poco::Net::WebSocket& ws)
 const Poco::Timespan waitTime(100);
 
 ws.setReceiveTimeout(0);
-std::cout << "==> isDocumentLoaded\n";
 do
 {
 char buffer[READ_BUFFER_SIZE];
@@ -82,10 +86,9 @@ bool isDocumentLoaded(Poco::Net::WebSocket& ws)
 if (ws.poll(waitTime, Poco::Net::Socket::SELECT_READ))
 {
 bytes = ws.receiveFrame(buffer, sizeof(buffer), flags);
-std::cout << "Got " << bytes << " bytes, flags: " << std::hex 
<< flags << std::dec << '\n';
 if (bytes > 0 && (flags & 
Poco::Net::WebSocket::FRAME_OP_BITMASK) != Poco::Net::WebSocket::FRAME_OP_CLOSE)
 {
-std::cout << "Received message: " << 
LOOLProtocol::getAbbreviatedMessage(buffer, bytes) << '\n';
+std::cout << name << "Got " << bytes << " bytes: " << 
LOOLProtocol::getAbbreviatedMessage(buffer, bytes) << std::endl;
 const std::string line = 
LOOLProtocol::getFirstLine(buffer, bytes);
 const std::string prefixIndicator = 
"statusindicatorfinish:";
 const std::string prefixStatus = "status:";
@@ -95,6 +98,11 @@ bool isDocumentLoaded(Poco::Net::WebSocket& ws)
 break;
 }
 }
+else
+{
+std::cerr << name << "Got " << bytes << " bytes, flags: " 
<< std::hex << flags << std::dec << std::endl;
+}
+
 retries = 10;
 }
 else
@@ -118,7 +126,7 @@ bool isDocumentLoaded(Poco::Net::WebSocket& ws)
 // jobs to establish the bridge connection between the Client and Kit process,
 // The result, it is mostly time outs to get messages in the unit test and it 
could fail.
 // connectLOKit ensures the websocket is connected to a kit process.
-static
+inline
 std::shared_ptr
 connectLOKit(Poco::URI uri,
  Poco::Net::HTTPRequest& request,
@@ -172,7 +180,7 @@ connectLOKit(Poco::URI uri,
 return ws;
 }
 
-static
+inline
 void getResponseMessage(Poco::Net::WebSocket& ws, const std::string& prefix, 
std::string& response, const bool isLine)
 {
 try
@@ -184,7 +192,6 @@ void getResponseMessage(Poco::Net::WebSocket& ws, const 
std::string& prefix, std
 
 response.clear();
 ws.setReceiveTimeout(0);
-std::cout << "==> getResponseMessage(" << prefix << ")\n";
 do
 {
 char buffer[READ_BUFFER_SIZE];
@@ -192,10 +199,9 @@ void getResponseMessage(Poco::Net::WebSocket& ws, const 
std::string& prefix, std
 if (ws.poll(waitTime, Poco::Net::Socket::SELECT_READ))
 {
 bytes = ws.receiveFrame(buffer, sizeof(buffer), flags);
-std::cout << "Got " << bytes << " bytes, flags: " << std::hex 
<< flags << std::dec << '\n';
 if (bytes > 0 && (flags & 
Poco::Net::WebSocket::FRAME_OP_BITMASK) != Poco::Net::WebSocket::FRAME_OP_CLOSE)
 {
-std::cout << "Received message: " << 
LOOLProtocol::getAbbreviatedMessage(buffer, bytes) << '\n';
+std::cout << "Got " << bytes << " bytes: " << 
LOOLProtocol::getAbbreviatedMessage(buffer, bytes) << std::endl;
 const std::string message = isLine ?
 
LOOLProtocol::getFirstLine(buffer, bytes) :
 std::string(buffer, bytes);
@@ -206,6 +212,10 @@ void getResponseMessage(Poco::Net::WebSocket& ws, const 
std::string& prefix, std
 break;
 }
 }
+else
+{
+std:

[Libreoffice-commits] online.git: loolwsd/test

2016-04-28 Thread Ashod Nakashian
 loolwsd/test/httpcrashtest.cpp |  133 +
 1 file changed, 5 insertions(+), 128 deletions(-)

New commits:
commit 472f959bec565734a8270100dfac22197c67ee8f
Author: Ashod Nakashian 
Date:   Thu Apr 28 22:47:09 2016 -0400

loolwsd: more sharing of common test code

Change-Id: Id49118eb38633127327fc16e5f49137255e78425
Reviewed-on: https://gerrit.libreoffice.org/24481
Reviewed-by: Ashod Nakashian 
Tested-by: Ashod Nakashian 

diff --git a/loolwsd/test/httpcrashtest.cpp b/loolwsd/test/httpcrashtest.cpp
index 68f8ccc..7615677 100644
--- a/loolwsd/test/httpcrashtest.cpp
+++ b/loolwsd/test/httpcrashtest.cpp
@@ -42,6 +42,9 @@
 #include 
 #include 
 #include 
+#include "helpers.hpp"
+
+using namespace helpers;
 
 /// Tests the HTTP WebSocket API of loolwsd. The server has to be started 
manually before running this test.
 class HTTPCrashTest : public CPPUNIT_NS::TestFixture
@@ -62,16 +65,6 @@ class HTTPCrashTest : public CPPUNIT_NS::TestFixture
 static
 void killLoKitProcesses();
 
-static
-void sendTextFrame(Poco::Net::WebSocket& socket, const std::string& 
string);
-
-static
-bool isDocumentLoaded(Poco::Net::WebSocket& socket);
-
-std::shared_ptr
-connectLOKit(Poco::Net::HTTPRequest& request,
- Poco::Net::HTTPResponse& response);
-
 public:
 HTTPCrashTest()
 #if ENABLE_SSL
@@ -118,7 +111,7 @@ void HTTPCrashTest::testBarren()
 const std::string documentURL = "file://" + 
Poco::Path(documentPath).makeAbsolute().toString();
 
 Poco::Net::HTTPRequest request(Poco::Net::HTTPRequest::HTTP_GET, 
documentURL);
-Poco::Net::WebSocket socket = *connectLOKit(request, _response);
+Poco::Net::WebSocket socket = *connectLOKit(_uri, request, _response);
 
 sendTextFrame(socket, "load url=" + documentURL);
 sendTextFrame(socket, "status");
@@ -172,7 +165,7 @@ void HTTPCrashTest::testCrashKit()
 const std::string documentURL = "file://" + 
Poco::Path(documentPath).makeAbsolute().toString();
 
 Poco::Net::HTTPRequest request(Poco::Net::HTTPRequest::HTTP_GET, 
documentURL);
-Poco::Net::WebSocket socket = *connectLOKit(request, _response);
+Poco::Net::WebSocket socket = *connectLOKit(_uri, request, _response);
 
 sendTextFrame(socket, "load url=" + documentURL);
 sendTextFrame(socket, "status");
@@ -243,122 +236,6 @@ void HTTPCrashTest::killLoKitProcesses()
 }
 }
 
-void HTTPCrashTest::sendTextFrame(Poco::Net::WebSocket& socket, const 
std::string& string)
-{
-socket.sendFrame(string.data(), string.size());
-}
-
-bool HTTPCrashTest::isDocumentLoaded(Poco::Net::WebSocket& ws)
-{
-bool isLoaded = false;
-try
-{
-int flags;
-int bytes;
-int retries = 30;
-const Poco::Timespan waitTime(100);
-
-ws.setReceiveTimeout(0);
-std::cout << "==> isDocumentLoaded\n";
-do
-{
-char buffer[READ_BUFFER_SIZE];
-
-if (ws.poll(waitTime, Poco::Net::Socket::SELECT_READ))
-{
-bytes = ws.receiveFrame(buffer, sizeof(buffer), flags);
-std::cout << "Got " << bytes << " bytes, flags: " << std::hex 
<< flags << std::dec << '\n';
-if (bytes > 0 && (flags & 
Poco::Net::WebSocket::FRAME_OP_BITMASK) != Poco::Net::WebSocket::FRAME_OP_CLOSE)
-{
-std::cout << "Received message: " << 
LOOLProtocol::getAbbreviatedMessage(buffer, bytes) << '\n';
-const std::string line = 
LOOLProtocol::getFirstLine(buffer, bytes);
-const std::string prefixIndicator = 
"statusindicatorfinish:";
-const std::string prefixStatus = "status:";
-if (line.find(prefixIndicator) == 0 || 
line.find(prefixStatus) == 0)
-{
-isLoaded = true;
-break;
-}
-}
-retries = 10;
-}
-else
-{
-std::cout << "Timeout\n";
---retries;
-}
-}
-while (retries > 0 && (flags & Poco::Net::WebSocket::FRAME_OP_BITMASK) 
!= Poco::Net::WebSocket::FRAME_OP_CLOSE);
-}
-catch (const Poco::Net::WebSocketException& exc)
-{
-std::cout << exc.message();
-}
-
-return isLoaded;
-}
-
-// Connecting to a Kit process is managed by document broker, that it does 
several
-// jobs to establish the bridge connection between the Client and Kit process,
-// The result, it is mostly time outs to get messages in the unit test and it 
could fail.
-// connectLOKit ensures the websocket is connected to a kit process.
-
-std::shared_ptr
-HTTPCrashTest::connectLOKit(Poco::Net::HTTPRequest& request,
-Poco::Net::HTTPResponse& response)
-{
-int flags;
-int received = 0;
-int retries = 3;

[Libreoffice-commits] online.git: loolwsd/LOOLWSD.cpp

2016-04-28 Thread Ashod Nakashian
 loolwsd/LOOLWSD.cpp |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit afa3e7c4ed6d1d23f182d18882d2b20fd7f8eabe
Author: Ashod Nakashian 
Date:   Thu Apr 28 23:32:33 2016 -0400

loolwsd: log error on failure, not success

Change-Id: Iac417c3779f3879697d056b5e402e91902bfd168
Reviewed-on: https://gerrit.libreoffice.org/24483
Reviewed-by: Ashod Nakashian 
Tested-by: Ashod Nakashian 

diff --git a/loolwsd/LOOLWSD.cpp b/loolwsd/LOOLWSD.cpp
index 395770f..5de9afc 100644
--- a/loolwsd/LOOLWSD.cpp
+++ b/loolwsd/LOOLWSD.cpp
@@ -607,7 +607,7 @@ private:
 // Use auto-save to save only when there are modifications 
since last save.
 // We also need to wait until the save notification reaches us
 // and Storage persists the document.
-if (docBroker->autoSave(true, COMMAND_TIMEOUT_MS))
+if (!docBroker->autoSave(true, COMMAND_TIMEOUT_MS))
 {
 Log::error("Auto-save before closing failed.");
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: loolwsd/test

2016-04-28 Thread Ashod Nakashian
 loolwsd/test/httpwstest.cpp |   16 
 1 file changed, 8 insertions(+), 8 deletions(-)

New commits:
commit 42a88e2362e78509d2ad7341b1d5f48086138430
Author: Ashod Nakashian 
Date:   Thu Apr 28 22:48:19 2016 -0400

loolwsd: fix load test regression

Change-Id: Icadd22306f61338698aedb1b6b5d4e02246d9a4e
Reviewed-on: https://gerrit.libreoffice.org/24482
Reviewed-by: Ashod Nakashian 
Tested-by: Ashod Nakashian 

diff --git a/loolwsd/test/httpwstest.cpp b/loolwsd/test/httpwstest.cpp
index 9994f92..e052b99 100644
--- a/loolwsd/test/httpwstest.cpp
+++ b/loolwsd/test/httpwstest.cpp
@@ -332,25 +332,25 @@ void HTTPWSTest::loadDoc(const std::string& documentURL)
 // Load a document and get its status.
 auto socket = loadDocAndGetSocket(_uri, documentURL);
 
-std::string status;
-std::string editlock;
 SocketProcessor("", socket, [&](const std::string& msg)
 {
 const std::string prefix = "status: ";
 if (msg.find(prefix) == 0)
 {
-status = msg.substr(prefix.length());
+const auto status = msg.substr(prefix.length());
+// Might be too strict, consider something flexible 
instread.
+CPPUNIT_ASSERT_EQUAL(std::string("type=text parts=1 
current=0 width=12808 height=16408"), status);
+}
+else if (msg.find("editlock") == 0)
+{
+// First session always gets the lock.
+CPPUNIT_ASSERT_EQUAL(std::string("editlock: 1"), msg);
 return false;
 }
 
 return true;
 });
 
-// Might be too strict, consider something flexible instread.
-CPPUNIT_ASSERT_EQUAL(std::string("type=text parts=1 current=0 
width=12808 height=16408"), status);
-// First session always gets the lock.
-CPPUNIT_ASSERT_EQUAL(std::string("editlock: 1"), editlock);
-
 socket->shutdown();
 }
 catch (const Poco::Exception& exc)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: loolwsd/test

2016-04-28 Thread Ashod Nakashian
 loolwsd/test/httpwstest.cpp |   10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

New commits:
commit 0e4c624f0b8dda80e1a0c4f848a35de8826d453e
Author: Ashod Nakashian 
Date:   Thu Apr 28 23:33:24 2016 -0400

loolwsd: minor improvement to test assertions

Change-Id: I40da725919ae775d039217c258ecd28a743b5bc1
Reviewed-on: https://gerrit.libreoffice.org/24484
Reviewed-by: Ashod Nakashian 
Tested-by: Ashod Nakashian 

diff --git a/loolwsd/test/httpwstest.cpp b/loolwsd/test/httpwstest.cpp
index e052b99..1880ab6 100644
--- a/loolwsd/test/httpwstest.cpp
+++ b/loolwsd/test/httpwstest.cpp
@@ -232,27 +232,27 @@ void HTTPWSTest::testHandShake()
 socket.setReceiveTimeout(0);
 bytes = socket.receiveFrame(buffer, sizeof(buffer), flags);
 CPPUNIT_ASSERT_EQUAL(std::string(payload), std::string(buffer, bytes));
-CPPUNIT_ASSERT(flags == Poco::Net::WebSocket::FRAME_TEXT);
+
CPPUNIT_ASSERT_EQUAL(static_cast(Poco::Net::WebSocket::FRAME_TEXT), flags);
 
 bytes = socket.receiveFrame(buffer, sizeof(buffer), flags);
 if (!std::strstr(buffer, fail))
 {
 payload = "statusindicator: connect";
 CPPUNIT_ASSERT_EQUAL(payload, std::string(buffer, bytes));
-CPPUNIT_ASSERT(flags == Poco::Net::WebSocket::FRAME_TEXT);
+
CPPUNIT_ASSERT_EQUAL(static_cast(Poco::Net::WebSocket::FRAME_TEXT), flags);
 
 bytes = socket.receiveFrame(buffer, sizeof(buffer), flags);
 if (!std::strstr(buffer, fail))
 {
 payload = "statusindicator: ready";
 CPPUNIT_ASSERT_EQUAL(payload, std::string(buffer, bytes));
-CPPUNIT_ASSERT(flags == Poco::Net::WebSocket::FRAME_TEXT);
+
CPPUNIT_ASSERT_EQUAL(static_cast(Poco::Net::WebSocket::FRAME_TEXT), flags);
 }
 else
 {
 // check error message
 CPPUNIT_ASSERT(std::strstr(buffer, 
SERVICE_UNAVALABLE_INTERNAL_ERROR) != nullptr);
-CPPUNIT_ASSERT(flags == Poco::Net::WebSocket::FRAME_TEXT);
+
CPPUNIT_ASSERT_EQUAL(static_cast(Poco::Net::WebSocket::FRAME_TEXT), flags);
 
 // close frame message
 bytes = socket.receiveFrame(buffer, sizeof(buffer), flags);
@@ -264,7 +264,7 @@ void HTTPWSTest::testHandShake()
 {
 // check error message
 CPPUNIT_ASSERT(std::strstr(buffer, 
SERVICE_UNAVALABLE_INTERNAL_ERROR) != nullptr);
-CPPUNIT_ASSERT(flags == Poco::Net::WebSocket::FRAME_TEXT);
+
CPPUNIT_ASSERT_EQUAL(static_cast(Poco::Net::WebSocket::FRAME_TEXT), flags);
 
 // close frame message
 bytes = socket.receiveFrame(buffer, sizeof(buffer), flags);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-1' - officecfg/registry

2016-04-28 Thread Guillaume Smaha
 officecfg/registry/data/org/openoffice/Office/Common.xcu |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 6ca35a05e8f5f41482535ecab307dc393dacc5cc
Author: Guillaume Smaha 
Date:   Wed Apr 27 14:51:05 2016 +0200

Specify Alfresco 5 in the list, it also compatible

Change-Id: I29d32253259c296e2e5fedcff241573479b2d4a3
Reviewed-on: https://gerrit.libreoffice.org/24426
Reviewed-by: Samuel Mehrbrodt 
Tested-by: Samuel Mehrbrodt 
(cherry picked from commit 2c47053e7edd062e6a7abd3ff889b756018ff7c3)
Reviewed-on: https://gerrit.libreoffice.org/24462
Tested-by: Jenkins 

diff --git a/officecfg/registry/data/org/openoffice/Office/Common.xcu 
b/officecfg/registry/data/org/openoffice/Office/Common.xcu
index 7cf3e97..074c475 100644
--- a/officecfg/registry/data/org/openoffice/Office/Common.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/Common.xcu
@@ -583,7 +583,7 @@
 OneDrive
 Alfresco Cloud
 
-Alfresco 4
+Alfresco 4/5
 IBM FileNet P8
 Lotus Live Files
 Lotus Quickr Domino
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: sw/uiconfig

2016-04-28 Thread Stanislav Horacek
 sw/uiconfig/swriter/ui/mmresultemaildialog.ui |2 +-
 sw/uiconfig/swriter/ui/mmresultprintdialog.ui |2 +-
 sw/uiconfig/swriter/ui/mmresultsavedialog.ui  |2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

New commits:
commit 16777b6bb0267c2b0602f1007a1e1fecac81329b
Author: Stanislav Horacek 
Date:   Thu Apr 28 22:37:53 2016 +0200

mark numbers in mail merge dialogs as untranslatable

Change-Id: I4dd5d8914e637ee3e8c89752e2daf563222cc494
Reviewed-on: https://gerrit.libreoffice.org/24467
Tested-by: Jenkins 
Reviewed-by: Samuel Mehrbrodt 

diff --git a/sw/uiconfig/swriter/ui/mmresultemaildialog.ui 
b/sw/uiconfig/swriter/ui/mmresultemaildialog.ui
index 9717550..61494df 100644
--- a/sw/uiconfig/swriter/ui/mmresultemaildialog.ui
+++ b/sw/uiconfig/swriter/ui/mmresultemaildialog.ui
@@ -370,7 +370,7 @@
   
 True
 True
-1
+1
 
   
 
diff --git a/sw/uiconfig/swriter/ui/mmresultprintdialog.ui 
b/sw/uiconfig/swriter/ui/mmresultprintdialog.ui
index 7168b67..a19a207 100644
--- a/sw/uiconfig/swriter/ui/mmresultprintdialog.ui
+++ b/sw/uiconfig/swriter/ui/mmresultprintdialog.ui
@@ -230,7 +230,7 @@
   
 True
 True
-1
+1
 1
 
   
diff --git a/sw/uiconfig/swriter/ui/mmresultsavedialog.ui 
b/sw/uiconfig/swriter/ui/mmresultsavedialog.ui
index 639be9f..db75e48 100644
--- a/sw/uiconfig/swriter/ui/mmresultsavedialog.ui
+++ b/sw/uiconfig/swriter/ui/mmresultsavedialog.ui
@@ -163,7 +163,7 @@
   
 True
 True
-1
+1
 
   
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: sw/qa sw/source writerfilter/source

2016-04-28 Thread Oliver Specht
 sw/qa/extras/ooxmlexport/data/protectedform.docx  |binary
 sw/qa/extras/ooxmlexport/ooxmlexport.cxx  |   10 ++
 sw/source/filter/ww8/docxexport.cxx   |6 ++
 sw/source/filter/ww8/wrtw8sty.cxx |5 -
 writerfilter/source/dmapper/DomainMapper_Impl.cxx |3 ++-
 writerfilter/source/dmapper/SettingsTable.cxx |   10 ++
 writerfilter/source/dmapper/SettingsTable.hxx |1 +
 7 files changed, 33 insertions(+), 2 deletions(-)

New commits:
commit 523a3d18e98cd51aa8bf76cf76314a22ddc2b2cf
Author: Oliver Specht 
Date:   Mon Apr 25 13:25:39 2016 +0200

tdf#99434: import/export documentProtection-forms from .docx incl. test

the setting  disables editing of 
content
outside of form controls.

Change-Id: I0d11373d9010778ed5798598020e453cde06fa0f
Reviewed-on: https://gerrit.libreoffice.org/24365
Tested-by: Jenkins 
Reviewed-by: Oliver Specht 

diff --git a/sw/qa/extras/ooxmlexport/data/protectedform.docx 
b/sw/qa/extras/ooxmlexport/data/protectedform.docx
new file mode 100755
index 000..a67d880
Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/protectedform.docx 
differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
index f4174d61..fcfcfbd 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
@@ -793,6 +793,16 @@ DECLARE_OOXMLEXPORT_TEST(testTdf91594, "tdf91594.docx")
 CPPUNIT_ASSERT_EQUAL(OUString("Wingdings"), getProperty(xRun, 
"CharFontNameAsian"));
 CPPUNIT_ASSERT_EQUAL(OUString("Wingdings"), getProperty(xRun, 
"CharFontNameComplex"));
 }
+DECLARE_OOXMLEXPORT_TEST(testTDF99434, "protectedform.docx")
+{
+css::uno::Reference 
m_xTextFactory(mxComponent, uno::UNO_QUERY);
+uno::Reference< beans::XPropertySet > 
xSettings(m_xTextFactory->createInstance("com.sun.star.document.Settings"), 
uno::UNO_QUERY);
+uno::Any aProtect = xSettings->getPropertyValue("ProtectForm");
+bool bProt = false;
+aProtect >>= bProt;
+CPPUNIT_ASSERT(bProt);
+}
+
 
 CPPUNIT_PLUGIN_IMPLEMENT();
 
diff --git a/sw/source/filter/ww8/docxexport.cxx 
b/sw/source/filter/ww8/docxexport.cxx
index b23506e..6ae3f99 100644
--- a/sw/source/filter/ww8/docxexport.cxx
+++ b/sw/source/filter/ww8/docxexport.cxx
@@ -855,6 +855,12 @@ void DocxExport::WriteSettings()
 pFS->singleElementNS( XML_w, XML_defaultTabStop, FSNS( XML_w, XML_val 
),
 OString::number( m_aSettings.defaultTabStop).getStr(), FSEND );
 
+// Protect form
+if( m_pDoc->getIDocumentSettingAccess().get( 
DocumentSettingId::PROTECT_FORM ))
+{
+pFS->singleElementNS( XML_w, XML_documentProtection, FSNS(XML_w, 
XML_edit), "forms", FSNS(XML_w, XML_enforcement), "1",  FSEND );
+}
+
 // Automatic hyphenation: it's a global setting in Word, it's a paragraph 
setting in Writer.
 // Use the setting from the default style.
 SwTextFormatColl* pColl = 
m_pDoc->getIDocumentStylePoolAccess().GetTextCollFromPool(RES_POOLCOLL_STANDARD,
 /*bRegardLanguage=*/false);
diff --git a/sw/source/filter/ww8/wrtw8sty.cxx 
b/sw/source/filter/ww8/wrtw8sty.cxx
index 19abee1..632ed2e 100644
--- a/sw/source/filter/ww8/wrtw8sty.cxx
+++ b/sw/source/filter/ww8/wrtw8sty.cxx
@@ -69,6 +69,7 @@
 #include "ww8attributeoutput.hxx"
 #include "docxattributeoutput.hxx"
 #include "rtfattributeoutput.hxx"
+#include 
 
 #include 
 
@@ -1527,7 +1528,9 @@ void MSWordExportBase::SectionProperties( const 
WW8_SepInfo& rSepInfo, WW8_PdAtt
 AttrOutput().SectFootnoteEndnotePr();
 
 // forms
-AttrOutput().SectionFormProtection( rSepInfo.IsProtected() );
+bool formProtection = m_pDoc->getIDocumentSettingAccess().get( 
DocumentSettingId::PROTECT_FORM );
+formProtection |= rSepInfo.IsProtected();
+AttrOutput().SectionFormProtection( formProtection );
 
 // line numbers
 const SwLineNumberInfo& rLnNumInfo = m_pDoc->GetLineNumberInfo();
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx 
b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index e3cadff..59526fd 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -5028,10 +5028,11 @@ void DomainMapper_Impl::ApplySettingsTable()
 if( m_pSettingsTable->GetEmbedSystemFonts())
 xSettings->setPropertyValue( getPropertyName( 
PROP_EMBED_SYSTEM_FONTS ), uno::makeAny(true) );
 xSettings->setPropertyValue("AddParaTableSpacing", 
uno::makeAny(m_pSettingsTable->GetDoNotUseHTMLParagraphAutoSpacing()));
-
 // Web Layout.
 if (m_pSettingsTable->GetView() == 
NS_ooxml::LN_Value_doc_ST_View_web)
 xSettings->setPropertyValue("InBrowseMode", 
uno::makeAny(true));
+if( m_pSettingsTable->GetProtectForm() )
+xSettings->setPropertyValue("ProtectForm", uno::makeAny( true 
));
 }
 catch(const uno:

[Libreoffice-commits] core.git: solenv/gbuild

2016-04-28 Thread Oliver Specht
 solenv/gbuild/extensions/pre_MergedLibsList.mk |3 +++
 1 file changed, 3 insertions(+)

New commits:
commit 3393e04edd0f4f6baf5faeda2ed761332f45d9e5
Author: Oliver Specht 
Date:   Wed Mar 23 08:28:23 2016 +0100

add additional modules to merged lib

acc, expwrap and store are loaded at startup anyway

Change-Id: I28020962238be3fe73a1b1dbba59a45c7d3c1e1d
Reviewed-on: https://gerrit.libreoffice.org/23459
Tested-by: Jenkins 
Reviewed-by: Oliver Specht 

diff --git a/solenv/gbuild/extensions/pre_MergedLibsList.mk 
b/solenv/gbuild/extensions/pre_MergedLibsList.mk
index cd2a0df..307351d 100644
--- a/solenv/gbuild/extensions/pre_MergedLibsList.mk
+++ b/solenv/gbuild/extensions/pre_MergedLibsList.mk
@@ -10,6 +10,7 @@
 
 # we link all object files from these libraries into one, merged library
 MERGE_LIBRARY_LIST := \
+   acc \
avmedia \
basegfx \
canvastools \
@@ -23,6 +24,7 @@ MERGE_LIBRARY_LIST := \
$(if $(USING_X11),desktop_detector) \
drawinglayer \
editeng \
+   expwrap \
filterconfig \
fsstorage \
fwe \
@@ -43,6 +45,7 @@ MERGE_LIBRARY_LIST := \
sofficeapp \
sot \
$(if $(ENABLE_HEADLESS),,spl) \
+   store \
svl \
svt \
svx \
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


Re: Mark Page license statement

2016-04-28 Thread jan iversen
WELCOME
Thanks for your license statement.

I have added you to our wiki:
https://wiki.documentfoundation.org/Development/Developers

If you want help to get started or have any questions, then please contact me. 
I am here to help you (and others) in getting their first patch submitted.

LibreOffice is a very big program and getting it built, setting up gerrit, and 
getting the first patch right can be a bit challenging, therefore do not 
hesitate to email me if you want help.

We have made a step by step guide to help you get started:
https://wiki.documentfoundation.org/Development/GetInvolved/DeveloperStepByStep

rgds
Jan Iversen.

Ps. we "talked" on IRC, looking forward to see your patches.


> On 28 Apr 2016, at 12:24, Aptitude Testing Team  
> wrote:
> 
> 
>   All of my past & future contributions to LibreOffice may be
>   licensed under the MPLv2/LGPLv3+ dual license.
> 
> User name and IRC name: rombust
> Git commit email: romb...@users.noreply.github.com
> 
> 
> 
> ___
> LibreOffice mailing list
> LibreOffice@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/libreoffice

___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice


[Libreoffice-commits] core.git: solenv/gbuild

2016-04-28 Thread Oliver Specht
 solenv/gbuild/extensions/pre_MergedLibsList.mk |3 ---
 1 file changed, 3 deletions(-)

New commits:
commit df90b5a1c9b602e524d0f92c7066c912f611b03b
Author: Oliver Specht 
Date:   Thu Apr 28 20:04:55 2016 +0200

Revert "add additional modules to merged lib"

Breaks tinderbox build in cppumaker

This reverts commit 3393e04edd0f4f6baf5faeda2ed761332f45d9e5.

diff --git a/solenv/gbuild/extensions/pre_MergedLibsList.mk 
b/solenv/gbuild/extensions/pre_MergedLibsList.mk
index 307351d..cd2a0df 100644
--- a/solenv/gbuild/extensions/pre_MergedLibsList.mk
+++ b/solenv/gbuild/extensions/pre_MergedLibsList.mk
@@ -10,7 +10,6 @@
 
 # we link all object files from these libraries into one, merged library
 MERGE_LIBRARY_LIST := \
-   acc \
avmedia \
basegfx \
canvastools \
@@ -24,7 +23,6 @@ MERGE_LIBRARY_LIST := \
$(if $(USING_X11),desktop_detector) \
drawinglayer \
editeng \
-   expwrap \
filterconfig \
fsstorage \
fwe \
@@ -45,7 +43,6 @@ MERGE_LIBRARY_LIST := \
sofficeapp \
sot \
$(if $(ENABLE_HEADLESS),,spl) \
-   store \
svl \
svt \
svx \
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: svtools/source

2016-04-28 Thread Douglas Mencken
 svtools/source/graphic/descriptor.cxx |   56 ++
 1 file changed, 31 insertions(+), 25 deletions(-)

New commits:
commit 1206e599538f331139d80809ccd0ef07a04ec2e8
Author: Douglas Mencken 
Date:   Sat Mar 26 18:21:57 2016 -0400

libsvtlo: convert set of #define to enum class

Change-Id: Iade24fc589e5325bf6fb1a2e5f2d609ddb3f5ec5
Reviewed-on: https://gerrit.libreoffice.org/23544
Tested-by: Jenkins 
Reviewed-by: Julien Nabet 

diff --git a/svtools/source/graphic/descriptor.cxx 
b/svtools/source/graphic/descriptor.cxx
index a911317..1703fde 100644
--- a/svtools/source/graphic/descriptor.cxx
+++ b/svtools/source/graphic/descriptor.cxx
@@ -35,14 +35,19 @@
 #include 
 #include 
 
-#define UNOGRAPHIC_GRAPHICTYPE  1
-#define UNOGRAPHIC_MIMETYPE 2
-#define UNOGRAPHIC_SIZEPIXEL3
-#define UNOGRAPHIC_SIZE100THMM  4
-#define UNOGRAPHIC_BITSPERPIXEL 5
-#define UNOGRAPHIC_TRANSPARENT  6
-#define UNOGRAPHIC_ALPHA7
-#define UNOGRAPHIC_ANIMATED 8
+
+enum class UnoGraphicProperty
+{
+  GraphicType = 1
+, MimeType = 2
+, SizePixel = 3
+, Size100thMM = 4
+, BitsPerPixel = 5
+, Transparent = 6
+, Alpha = 7
+, Animated = 8
+};
+
 
 using namespace ::com::sun::star;
 
@@ -259,14 +264,14 @@ uno::Sequence< sal_Int8 > SAL_CALL 
GraphicDescriptor::getImplementationId()
 
 static ::comphelper::PropertyMapEntry const aEntries[] =
 {
-{ OUString("GraphicType"), UNOGRAPHIC_GRAPHICTYPE, 
cppu::UnoType::get(), beans::PropertyAttribute::READONLY, 0 },
-{ OUString("MimeType"), UNOGRAPHIC_MIMETYPE, 
cppu::UnoType::get(), beans::PropertyAttribute::READONLY, 0 },
-{ OUString("SizePixel"), UNOGRAPHIC_SIZEPIXEL, 
cppu::UnoType::get(), beans::PropertyAttribute::READONLY, 0 },
-{ OUString("Size100thMM"), UNOGRAPHIC_SIZE100THMM, 
cppu::UnoType::get(), beans::PropertyAttribute::READONLY, 0 },
-{ OUString("BitsPerPixel"), UNOGRAPHIC_BITSPERPIXEL, 
cppu::UnoType::get(), beans::PropertyAttribute::READONLY, 0 },
-{ OUString("Transparent"), UNOGRAPHIC_TRANSPARENT, 
cppu::UnoType::get(), beans::PropertyAttribute::READONLY, 0 },
-{ OUString("Alpha"), UNOGRAPHIC_ALPHA, cppu::UnoType::get(), 
beans::PropertyAttribute::READONLY, 0 },
-{ OUString("Animated"), UNOGRAPHIC_ANIMATED, 
cppu::UnoType::get(), beans::PropertyAttribute::READONLY, 0 },
+{ OUString( "GraphicType" ), static_cast< sal_Int32 >( 
UnoGraphicProperty::GraphicType ), cppu::UnoType< sal_Int8 >::get(), 
beans::PropertyAttribute::READONLY, 0 },
+{ OUString( "MimeType" ), static_cast< sal_Int32 >( 
UnoGraphicProperty::MimeType ), cppu::UnoType< OUString >::get(), 
beans::PropertyAttribute::READONLY, 0 },
+{ OUString( "SizePixel" ), static_cast< sal_Int32 >( 
UnoGraphicProperty::SizePixel ), cppu::UnoType< awt::Size >::get(), 
beans::PropertyAttribute::READONLY, 0 },
+{ OUString( "Size100thMM" ), static_cast< sal_Int32 >( 
UnoGraphicProperty::Size100thMM ), cppu::UnoType< awt::Size >::get(), 
beans::PropertyAttribute::READONLY, 0 },
+{ OUString( "BitsPerPixel" ), static_cast< sal_Int32 >( 
UnoGraphicProperty::BitsPerPixel ), cppu::UnoType< sal_uInt8 >::get(), 
beans::PropertyAttribute::READONLY, 0 },
+{ OUString( "Transparent" ), static_cast< sal_Int32 >( 
UnoGraphicProperty::Transparent ), cppu::UnoType< sal_Bool >::get(), 
beans::PropertyAttribute::READONLY, 0 },
+{ OUString( "Alpha" ), static_cast< sal_Int32 >( 
UnoGraphicProperty::Alpha ), cppu::UnoType< sal_Bool >::get(), 
beans::PropertyAttribute::READONLY, 0 },
+{ OUString( "Animated" ), static_cast< sal_Int32 >( 
UnoGraphicProperty::Animated ), cppu::UnoType< sal_Bool >::get(), 
beans::PropertyAttribute::READONLY, 0 },
 { OUString(), 0, css::uno::Type(), 0, 0 }
 };
 
@@ -294,9 +299,10 @@ void GraphicDescriptor::_getPropertyValues( const 
comphelper::PropertyMapEntry**
 
 while( *ppEntries )
 {
-switch( (*ppEntries)->mnHandle )
+UnoGraphicProperty theProperty = static_cast< UnoGraphicProperty >( 
(*ppEntries)->mnHandle );
+switch( theProperty )
 {
-case UNOGRAPHIC_GRAPHICTYPE:
+case UnoGraphicProperty::GraphicType:
 {
 const GraphicType eType( mpGraphic ? mpGraphic->GetType() : 
meType );
 
@@ -306,7 +312,7 @@ void GraphicDescriptor::_getPropertyValues( const 
comphelper::PropertyMapEntry**
 }
 break;
 
-case UNOGRAPHIC_MIMETYPE:
+case UnoGraphicProperty::MimeType:
 {
 OUString aMimeType;
 
@@ -351,7 +357,7 @@ void GraphicDescriptor::_getPropertyValues( const 
comphelper::PropertyMapEntry**
 }
 break;
 
-case UNOGRAPHIC_SIZEPIXEL:
+case UnoGraphicProperty::SizePixel:
 {
 awt::Size aAWTSize( 0, 0 );
 
@@ -370,7 +376,7 @@ void GraphicDescriptor::_getProperty