[Libreoffice-commits] core.git: Branch 'libreoffice-5-2' - basic/source
basic/source/runtime/stdobj.cxx |1 + 1 file changed, 1 insertion(+) New commits: commit 74817e67441204416a4e6db0440d35c85a2fca84 Author: Laurent Balland-Poirier <laurent.balland-poir...@laposte.net> Date: Sat Oct 1 15:00:26 2016 +0200 tdf#102872 TAB function is missing its argument Commit 98f0e0eda50690bd01842c806bd13e3bc5af2966 introduced TAB function but its declaration in basic/source/runtime/stdobj.cxx is missing its argument So it used TAN function as argument Change-Id: Id4461ca805f9c7034b0440de46b845f29f57e3b0 Reviewed-on: https://gerrit.libreoffice.org/29452 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Caolán McNamara <caol...@redhat.com> Tested-by: Caolán McNamara <caol...@redhat.com> diff --git a/basic/source/runtime/stdobj.cxx b/basic/source/runtime/stdobj.cxx index cc2484b..115252c 100644 --- a/basic/source/runtime/stdobj.cxx +++ b/basic/source/runtime/stdobj.cxx @@ -604,6 +604,7 @@ static Methods aMethods[] = { { "Expression", SbxVARIANT, 0,nullptr,0 }, { "Value",SbxVARIANT, 0,nullptr,0 }, { "Tab",SbxSTRING,1 | FUNCTION_, RTLNAME(Tab),0 }, + { "Count",SbxLONG, 0,nullptr,0 }, { "Tan",SbxDOUBLE,1 | FUNCTION_, RTLNAME(Tan),0 }, { "number", SbxDOUBLE, 0,nullptr,0 }, { "Time", SbxVARIANT, LFUNCTION_,RTLNAME(Time),0}, ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: basic/source
basic/source/runtime/stdobj.cxx |1 + 1 file changed, 1 insertion(+) New commits: commit db29cdcc70ba792ed54e0957929b4524816b1fb3 Author: Laurent Balland-Poirier <laurent.balland-poir...@laposte.net> Date: Sat Oct 1 15:00:26 2016 +0200 tdf#102872 TAB function is missing its argument Commit 98f0e0eda50690bd01842c806bd13e3bc5af2966 introduced TAB function but its declaration in basic/source/runtime/stdobj.cxx is missing its argument So it used TAN function as argument Change-Id: Id4461ca805f9c7034b0440de46b845f29f57e3b0 Reviewed-on: https://gerrit.libreoffice.org/29437 Reviewed-by: Julien Nabet <serval2...@yahoo.fr> Tested-by: Julien Nabet <serval2...@yahoo.fr> Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Caolán McNamara <caol...@redhat.com> Tested-by: Caolán McNamara <caol...@redhat.com> diff --git a/basic/source/runtime/stdobj.cxx b/basic/source/runtime/stdobj.cxx index cc2484b..115252c 100644 --- a/basic/source/runtime/stdobj.cxx +++ b/basic/source/runtime/stdobj.cxx @@ -604,6 +604,7 @@ static Methods aMethods[] = { { "Expression", SbxVARIANT, 0,nullptr,0 }, { "Value",SbxVARIANT, 0,nullptr,0 }, { "Tab",SbxSTRING,1 | FUNCTION_, RTLNAME(Tab),0 }, + { "Count",SbxLONG, 0,nullptr,0 }, { "Tan",SbxDOUBLE,1 | FUNCTION_, RTLNAME(Tan),0 }, { "number", SbxDOUBLE, 0,nullptr,0 }, { "Time", SbxVARIANT, LFUNCTION_,RTLNAME(Time),0}, ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: svl/source
svl/source/numbers/zformat.cxx | 307 - 1 file changed, 277 insertions(+), 30 deletions(-) New commits: commit aa4e560822787d62de0bcca52036242ce1160b45 Author: Laurent Balland-Poirier <laurent.balland-poir...@laposte.net> Date: Sat Sep 10 12:23:41 2016 +0200 tdf#36038 Import extended LCID from Excel Extended LCID were only supported for Thai. This commit import also for some other numerals and calendars. Change-Id: Id92a0ee2a32c5722e9674fe0ac5ff7028c84bca6 Reviewed-on: https://gerrit.libreoffice.org/28809 Reviewed-by: Eike Rathke <er...@redhat.com> Tested-by: Eike Rathke <er...@redhat.com> diff --git a/svl/source/numbers/zformat.cxx b/svl/source/numbers/zformat.cxx index e2caebf..a37987e 100644 --- a/svl/source/numbers/zformat.cxx +++ b/svl/source/numbers/zformat.cxx @@ -538,43 +538,290 @@ static bool lcl_SvNumberformat_IsBracketedPrefix( short nSymbolType ) return false; } - -OUString SvNumberformat::ImpObtainCalendarAndNumerals( OUStringBuffer & rString, sal_Int32 & nPos, - LanguageType & nLang, const LocaleType & aTmpLocale ) +/** Import extended LCID from Excel + */ +OUString SvNumberformat::ImpObtainCalendarAndNumerals( OUStringBuffer& rString, sal_Int32& nPos, + LanguageType& nLang, const LocaleType& aTmpLocale ) { OUString sCalendar; -/* TODO: this could be enhanced to allow other possible locale dependent +sal_uInt16 nNatNum = 0; +LanguageType nLocaleLang = MsLangId::getRealLanguage( maLocale.meLanguage ); +LanguageType nTmpLocaleLang = MsLangId::getRealLanguage( aTmpLocale.meLanguage ); +/* NOTE: enhancement to allow other possible locale dependent * calendars and numerals. BUT only if our locale data allows it! For LCID * numerals and calendars see - * http://office.microsoft.com/en-us/excel/HA010346351033.aspx */ -if (MsLangId::getRealLanguage( aTmpLocale.meLanguage) == LANGUAGE_THAI) -{ -// Numeral shape code "D" = Thai digits. -if (aTmpLocale.mnNumeralShape == 0xD) -{ -rString.insert( nPos, "[NatNum1]"); -} -// Calendar type code "07" = Thai Buddhist calendar, insert this after -// all prefixes have been consumed as it is actually a format modifier -// and not a prefix. -if (aTmpLocale.mnCalendarType == 0x07) -{ -// Currently calendars are tied to the locale of the entire number -// format, e.g. [~buddhist] in en_US doesn't work. -// => Having different locales in sub formats does not work! -/* TODO: calendars could be tied to a sub format's NatNum info - * instead, or even better be available for any locale. Needs a - * different implementation of GetCal() and locale data calendars. - * */ -// If this is not Thai yet, make it so. -if (MsLangId::getRealLanguage( maLocale.meLanguage) != LANGUAGE_THAI) -{ -maLocale = aTmpLocale; -nLang = maLocale.meLanguage = LANGUAGE_THAI; + * http://office.microsoft.com/en-us/excel/HA010346351033.aspx + * Calendar is inserted after + * all prefixes have been consumed as it is actually a format modifier + * and not a prefix. + * Currently calendars are tied to the locale of the entire number + * format, e.g. [~buddhist] in en_US doesn't work. + * => Having different locales in sub formats does not work! + * */ +/* TODO: calendars could be tied to a sub format's NatNum info + * instead, or even better be available for any locale. Needs a + * different implementation of GetCal() and locale data calendars. + * */ +switch ( aTmpLocale.mnCalendarType & 0x7F ) +{ +case 0x03 : // Gengou calendar +sCalendar = "[~gengou]"; +// Only Japanese language support Gengou calendar +if ( nLocaleLang != LANGUAGE_JAPANESE ) +{ +nLang = maLocale.meLanguage = LANGUAGE_JAPANESE; +} +break; +case 0x05 : // unknown calendar +break; +case 0x06 : // Hijri calendar +case 0x17 : // same? +sCalendar = "[~hijri]"; +// Only Arabic or Farsi languages support Hijri calendar +if ( ( ( nLocaleLang & LANGUAGE_MASK_PRIMARY ) != LANGUAGE_ARABIC_PRIMARY_ONLY ) + && nLocaleLang != LANGUAGE_FARSI ) +{ +if ( ( ( nTmpLocaleLang & LANGUAGE_MASK_PRIMARY ) == LANGUAGE_ARABIC_PRIMARY_ONLY ) + || nTmpLocaleLang == LANGUAGE_FARSI ) +{ +nLang = maLocale.meLanguage = aTmpL
[Libreoffice-commits] core.git: svl/source
svl/source/numbers/zformat.cxx | 193 + 1 file changed, 158 insertions(+), 35 deletions(-) New commits: commit e991b421905e78f020d6ece280dd17bfce4e31e0 Author: Laurent Balland-Poirier <laurent.balland-poir...@laposte.net> Date: Sun Sep 4 12:42:57 2016 +0200 tdf#36038 Export to Excel extended LCID Number format: extend export to Excel of long LCID for other languages and calendars than only Thai and Buddhist Change-Id: I826347302d14caa5b4463d28cd25f2c36ebfef5d Reviewed-on: https://gerrit.libreoffice.org/28666 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Eike Rathke <er...@redhat.com> diff --git a/svl/source/numbers/zformat.cxx b/svl/source/numbers/zformat.cxx index f4b7834..e2caebf 100644 --- a/svl/source/numbers/zformat.cxx +++ b/svl/source/numbers/zformat.cxx @@ -4641,22 +4641,35 @@ static void lcl_SvNumberformat_AddLimitStringImpl( OUString& rStr, } } -void lcl_insertLCID( OUStringBuffer& aFormatStr, const OUString& rLCIDString, sal_Int32 nPosInsertLCID ) +void lcl_insertLCID( OUStringBuffer& rFormatStr, sal_uInt32 nLCID, sal_Int32 nPosInsertLCID ) { -OUStringBuffer aLCIDString; -if ( !rLCIDString.isEmpty() ) -{ -aLCIDString = "[$-" + rLCIDString + "]"; -} +if ( nLCID == 0 ) +return; +OUStringBuffer aLCIDString = OUString::number( nLCID , 16 ).toAsciiUpperCase(); // Search for only last DBNum which is the last element before insertion position if ( nPosInsertLCID >= 8 -&& rLCIDString.getLength() > 4 -&& aFormatStr.indexOf( "[DBNum", nPosInsertLCID-8) == nPosInsertLCID-8 ) +&& aLCIDString.getLength() > 4 +&& rFormatStr.indexOf( "[DBNum", nPosInsertLCID-8) == nPosInsertLCID-8 ) { // remove DBNumX code if long LCID nPosInsertLCID -= 8; -aFormatStr.remove( nPosInsertLCID, 8 ); +rFormatStr.remove( nPosInsertLCID, 8 ); } -aFormatStr.insert( nPosInsertLCID, aLCIDString.toString() ); +aLCIDString.insert( 0, "[$-" ); +aLCIDString.append( "]" ); +rFormatStr.insert( nPosInsertLCID, aLCIDString.toString() ); +} + +/** Increment nAlphabetID for CJK numerals + * +1 for financial numerals [NatNum2] + * +2 for Arabic fullwidth numerals [NatNum3] + * */ +void lcl_incrementAlphabetWithNatNum ( sal_uInt32& nAlphabetID, sal_uInt32 nNatNum ) +{ +if ( nNatNum == 2) // financial +nAlphabetID += 1; +else if ( nNatNum == 3) +nAlphabetID += 2; +nAlphabetID = nAlphabetID << 24; } OUString SvNumberformat::GetMappedFormatstring( const NfKeywordTable& rKeywords, @@ -4717,7 +4730,6 @@ OUString SvNumberformat::GetMappedFormatstring( const NfKeywordTable& rKeywords, nSem++; } OUString aPrefix; -bool bLCIDInserted = false; if ( !bDefaults ) { @@ -4781,6 +4793,7 @@ OUString SvNumberformat::GetMappedFormatstring( const NfKeywordTable& rKeywords, aStr.append( aPrefix ); } sal_Int32 nPosInsertLCID = aStr.getLength(); +sal_uInt32 nCalendarID = 0x000; // Excel ID of calendar used in sub-format see tdf#36038 if ( nAnz ) { const short* pType = NumFor[n].Info().nTypeArray; @@ -4838,21 +4851,25 @@ OUString SvNumberformat::GetMappedFormatstring( const NfKeywordTable& rKeywords, } break; case NF_SYMBOLTYPE_CALDEL : -if ( pStr[j+1] == "buddhist" ) +if ( pStr[j+1] == "gengou" ) { -if ( aNatNum.IsSet() && aNatNum.GetNatNum() == 1 && - MsLangId::getRealLanguage( aNatNum.GetLang() ) == - LANGUAGE_THAI ) -{ -lcl_insertLCID( aStr, "D07041E", nPosInsertLCID ); // date in Thai digit, Buddhist era -} -else -{ -lcl_insertLCID( aStr, "107041E", nPosInsertLCID ); // date in Arabic digit, Buddhist era -} -j = j+2; -bLCIDInserted = true; +nCalendarID = 0x003; +} +else if ( pStr[j+1] == "hijri" ) +{ +nCalendarID = 0x006; } +else if ( pStr[j+1] == "buddhist" ) +{ +nCalendarID = 0x007; +
[Libreoffice-commits] core.git: sc/qa
sc/qa/unit/data/ods/tdf102370_ExponentWithoutSign.ods |binary sc/qa/unit/subsequent_export-test.cxx | 27 +- 2 files changed, 26 insertions(+), 1 deletion(-) New commits: commit b0901f9f0843c2d85da6742780d9aef296f62c60 Author: Laurent Balland-Poirier <laurent.balland-poir...@laposte.net> Date: Sat Oct 22 23:51:14 2016 +0200 tdf#102370 QA test exponent without sign during export to Excel Change-Id: I0adf7d97f297a8fe1003c8e4cb9a08c9070ed92e Reviewed-on: https://gerrit.libreoffice.org/30170 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Eike Rathke <er...@redhat.com> diff --git a/sc/qa/unit/data/ods/tdf102370_ExponentWithoutSign.ods b/sc/qa/unit/data/ods/tdf102370_ExponentWithoutSign.ods new file mode 100644 index 000..ab3fbd7 Binary files /dev/null and b/sc/qa/unit/data/ods/tdf102370_ExponentWithoutSign.ods differ diff --git a/sc/qa/unit/subsequent_export-test.cxx b/sc/qa/unit/subsequent_export-test.cxx index 9a47f47..b9bbc30 100644 --- a/sc/qa/unit/subsequent_export-test.cxx +++ b/sc/qa/unit/subsequent_export-test.cxx @@ -61,6 +61,7 @@ #include #include #include +#include #include #include @@ -179,6 +180,7 @@ public: void testTdf88657(); void testEscapeCharInNumberFormatXLSX(); void testNatNumInNumberFormatXLSX(); +void testExponentWithoutSignFormatXLSX(); void testHiddenRepeatedRowsODS(); void testHyperlinkTargetFrameODS(); @@ -264,6 +266,7 @@ public: CPPUNIT_TEST(testTdf88657); CPPUNIT_TEST(testEscapeCharInNumberFormatXLSX); CPPUNIT_TEST(testNatNumInNumberFormatXLSX); +CPPUNIT_TEST(testExponentWithoutSignFormatXLSX); CPPUNIT_TEST(testHiddenRepeatedRowsODS); CPPUNIT_TEST(testHyperlinkTargetFrameODS); @@ -3698,6 +3701,28 @@ void ScExportTest::testNatNumInNumberFormatXLSX() xDocSh->DoClose(); } +void ScExportTest::testExponentWithoutSignFormatXLSX() +{ +ScDocShellRef xDocSh = loadDoc("tdf102370_ExponentWithoutSign.", FORMAT_ODS); +CPPUNIT_ASSERT( xDocSh.Is() ); +xDocSh = saveAndReload( &(*xDocSh), FORMAT_XLSX); +CPPUNIT_ASSERT( xDocSh.Is() ); + +xDocSh = saveAndReload( &(*xDocSh), FORMAT_ODS); +CPPUNIT_ASSERT(xDocSh.Is()); + +ScDocument& rDoc = xDocSh->GetDocument(); +sal_uInt32 nNumberFormat; +rDoc.GetNumberFormat(0, 0, 0, nNumberFormat); +const SvNumberformat* pNumberFormat = rDoc.GetFormatTable()->GetEntry(nNumberFormat); +const OUString& rFormatStr = pNumberFormat->GetFormatstring(); +const OUString aExpectedFormatStr = "0.00E0"; + +CPPUNIT_ASSERT_EQUAL_MESSAGE("Number format lost exponent without sign during Excel export", aExpectedFormatStr, rFormatStr); + +xDocSh->DoClose(); +} + void ScExportTest::testHiddenRepeatedRowsODS() { ScDocShellRef xDocSh = loadDoc("empty.", FORMAT_ODS); @@ -3708,7 +3733,7 @@ void ScExportTest::testHiddenRepeatedRowsODS() rDoc.SetRowHidden(0, 20, 0, true); } -xDocSh = saveAndReload( &(*xDocSh), FORMAT_ODS); // Convert [NatNum5] to [DBNum2] in Chinese +xDocSh = saveAndReload( &(*xDocSh), FORMAT_ODS); ScDocument& rDoc = xDocSh->GetDocument(); SCROW nFirstRow = 0; SCROW nLastRow = 0; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: svl/qa
svl/qa/unit/svl.cxx |5 + 1 file changed, 5 insertions(+) New commits: commit 2e84e730a89de683c97bbcab89cd2dbf5a7a9b6d Author: Laurent Balland-Poirier <laurent.balland-poir...@laposte.net> Date: Sat Oct 22 22:07:30 2016 +0200 tdf#102507 Add qa test of left aligned denominator New behavior of format # ?/??? gives for 3.5 3 1/2 instead of 3 1/ 2 Change-Id: I87f4a71fb13d8424017d557213bb4d279de28af5 Reviewed-on: https://gerrit.libreoffice.org/30167 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Eike Rathke <er...@redhat.com> diff --git a/svl/qa/unit/svl.cxx b/svl/qa/unit/svl.cxx index 48b5b44..b8c3fc3 100644 --- a/svl/qa/unit/svl.cxx +++ b/svl/qa/unit/svl.cxx @@ -1178,6 +1178,11 @@ void Test::testUserDefinedNumberFormats() sExpected = "-575 540/697"; checkPreviewString(aFormatter, sCode, -575.774749601315, eLang, sExpected); } +{ // tdf#102507: left alignment of denominator +sCode = "# ?/???"; +sExpected = "3 1/2 "; +checkPreviewString(aFormatter, sCode, 3.5, eLang, sExpected); +} { // tdf#100594: forced denominator sCode = "# ?/100"; sExpected = " 6/100"; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: sc/qa
sc/qa/unit/data/ods/tdf36038_ExtendedLCID.ods |binary sc/qa/unit/subsequent_export-test.cxx | 43 ++ 2 files changed, 43 insertions(+) New commits: commit 8d811eda74a6b2b249a44a9217328e8d2788ec3c Author: Laurent Balland-Poirier <laurent.balland-poir...@laposte.net> Date: Sun Oct 23 11:46:19 2016 +0200 tdf#36038 QA test export/import extended LCID to Excel Change-Id: I5c8a19f62f030913f7e6dcbc0274f5d0aa197056 Reviewed-on: https://gerrit.libreoffice.org/30175 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Eike Rathke <er...@redhat.com> diff --git a/sc/qa/unit/data/ods/tdf36038_ExtendedLCID.ods b/sc/qa/unit/data/ods/tdf36038_ExtendedLCID.ods new file mode 100644 index 000..3abb946 Binary files /dev/null and b/sc/qa/unit/data/ods/tdf36038_ExtendedLCID.ods differ diff --git a/sc/qa/unit/subsequent_export-test.cxx b/sc/qa/unit/subsequent_export-test.cxx index b9bbc30..1a99a64 100644 --- a/sc/qa/unit/subsequent_export-test.cxx +++ b/sc/qa/unit/subsequent_export-test.cxx @@ -181,6 +181,7 @@ public: void testEscapeCharInNumberFormatXLSX(); void testNatNumInNumberFormatXLSX(); void testExponentWithoutSignFormatXLSX(); +void testExtendedLCID(); void testHiddenRepeatedRowsODS(); void testHyperlinkTargetFrameODS(); @@ -267,6 +268,7 @@ public: CPPUNIT_TEST(testEscapeCharInNumberFormatXLSX); CPPUNIT_TEST(testNatNumInNumberFormatXLSX); CPPUNIT_TEST(testExponentWithoutSignFormatXLSX); +CPPUNIT_TEST(testExtendedLCID); CPPUNIT_TEST(testHiddenRepeatedRowsODS); CPPUNIT_TEST(testHyperlinkTargetFrameODS); @@ -3723,6 +3725,47 @@ void ScExportTest::testExponentWithoutSignFormatXLSX() xDocSh->DoClose(); } +void ScExportTest::testExtendedLCID() +{ +ScDocShellRef xDocSh = loadDoc("tdf36038_ExtendedLCID.", FORMAT_ODS); +CPPUNIT_ASSERT( xDocSh.Is() ); +xDocSh = saveAndReload( &(*xDocSh), FORMAT_XLSX); +CPPUNIT_ASSERT( xDocSh.Is() ); + +xmlDocPtr pDoc = XPathHelper::parseExport(*xDocSh, m_xSFactory, "xl/styles.xml", FORMAT_XLSX); +CPPUNIT_ASSERT(pDoc); +// Check export +assertXPath(pDoc, "/x:styleSheet/x:numFmts/x:numFmt[2]", "formatCode", "[$-107041E]DD\\-MM\\-"); +assertXPath(pDoc, "/x:styleSheet/x:numFmts/x:numFmt[3]", "formatCode", "[$-D07041E]DD\\-MM\\-"); +assertXPath(pDoc, "/x:styleSheet/x:numFmts/x:numFmt[4]", "formatCode", "[$-1030411]DD\\-MM\\-EE"); +assertXPath(pDoc, "/x:styleSheet/x:numFmts/x:numFmt[5]", "formatCode", "[$-1B030411]DD\\-MM\\-EE"); +assertXPath(pDoc, "/x:styleSheet/x:numFmts/x:numFmt[6]", "formatCode", "[$-108040D]DD\\-MM\\-"); +//assertXPath(pDoc, "/x:styleSheet/x:numFmts/x:numFmt[7]", "formatCode", "[$-108040D]DD\\-MM\\-"); +assertXPath(pDoc, "/x:styleSheet/x:numFmts/x:numFmt[7]", "formatCode", "[$-1060401]DD\\-MM\\-"); +assertXPath(pDoc, "/x:styleSheet/x:numFmts/x:numFmt[8]", "formatCode", "[$-2060401]DD\\-MM\\-"); + +// Check import +ScDocument& rDoc = xDocSh->GetDocument(); +SvNumberFormatter* pNumFormatter = rDoc.GetFormatTable(); +sal_uInt32 nNumberFormat; +const OUString aLang[4] = { "[$-41E]", "[$-411]", "[$-40D]", "[$-401]" }; +const OUString aCalendar[4] = { "[~buddhist]DD-MM-", "[~gengou]DD-MM-EE", "[~jewish]DD-MM-", "[~hijri]DD-MM-" }; +for ( sal_Int16 nCol = 1; nCol <= 2; nCol++ ) +{ +for ( sal_Int16 nRow = 1; nRow <= 4; nRow++ ) +{ +rDoc.GetNumberFormat(nCol, nRow, 0, nNumberFormat); +const SvNumberformat* pNumberFormat = pNumFormatter->GetEntry(nNumberFormat); +const OUString& rFormatStr = pNumberFormat->GetFormatstring(); +const OUString aExpectedFormatStr = aLang[nRow-1] + ( (nCol==2 && nRow!=3) ? OUString("[NatNum1]") : OUString("") ) + aCalendar[nRow-1]; + +CPPUNIT_ASSERT_EQUAL_MESSAGE("Number format lost extended LCID during Excel export", aExpectedFormatStr, rFormatStr); +} +} + +xDocSh->DoClose(); +} + void ScExportTest::testHiddenRepeatedRowsODS() { ScDocShellRef xDocSh = loadDoc("empty.", FORMAT_ODS); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-2' - sfx2/classification sfx2/Package_classification.mk
sfx2/Package_classification.mk|3 + sfx2/classification/example_ca-ES.xml | 71 sfx2/classification/example_fr-FR.xml | 84 ++ sfx2/classification/example_nl-NL.xml | 71 4 files changed, 229 insertions(+) New commits: commit 5bbad83f5a4144181a46c68784a3ff3e3f368c2d Author: Laurent Balland-Poirier <laurent.balland-poir...@laposte.net> Date: Fri Nov 11 13:37:09 2016 +0100 tdf#100352 Backport ca-ES, fr-FR and nl-NL classification files Change-Id: I561ff1906c1ddfde5d66d31270633fc4de94589b Reviewed-on: https://gerrit.libreoffice.org/30775 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Caolán McNamara <caol...@redhat.com> Tested-by: Caolán McNamara <caol...@redhat.com> diff --git a/sfx2/Package_classification.mk b/sfx2/Package_classification.mk index 4ed779c..71684f4 100644 --- a/sfx2/Package_classification.mk +++ b/sfx2/Package_classification.mk @@ -11,7 +11,10 @@ $(eval $(call gb_Package_Package,sfx2_classification,$(SRCDIR)/sfx2)) $(eval $(call gb_Package_add_files,sfx2_classification,$(LIBO_SHARE_FOLDER)/classification,\ classification/example.xml \ + classification/example_ca-ES.xml \ + classification/example_fr-FR.xml \ classification/example_hu-HU.xml \ + classification/example_nl-NL.xml \ classification/example_pt-BR.xml \ classification/example_sl-SI.xml \ )) diff --git a/sfx2/classification/example_ca-ES.xml b/sfx2/classification/example_ca-ES.xml new file mode 100644 index 000..f62d647 --- /dev/null +++ b/sfx2/classification/example_ca-ES.xml @@ -0,0 +1,71 @@ + + +Autoritat de polÃtiques TSCP de exemple +PolÃtica TSCP de exemple + +urn:example:tscp:1 + + + + + +UK-Cabinet +0 + + + + + +Document: Header +Classificació: afers generals + + + +UK-Cabinet +1 + + + + + +Document: Header +Classificació: confidencial + + +Document: Footer +Aquest contingut és de carà cter confidencial. No el distribuïu externament sense autorització. + + +Document: Watermark +Confidencial + + + +UK-Cabinet +2 + + + + + +Document: Header +Classificació: només dâús intern + + +Document: Footer +Aquest contingut és només dâús intern. No el distribuïu externament. + + +Document: Watermark +Ãs intern + + + +UK-Cabinet +3 + + + + + diff --git a/sfx2/classification/example_fr-FR.xml b/sfx2/classification/example_fr-FR.xml new file mode 100644 index 000..4e0ab99 --- /dev/null +++ b/sfx2/classification/example_fr-FR.xml @@ -0,0 +1,84 @@ + + + +Exemple d'autorité TSCP + +Exemple de stratégie TSCP + +urn:example:tscp:1 + + + + + + +UK-Cabinet +0 + + + + + + +Document: Header + +Classification : professionnel + + + +UK-Cabinet +1 + + + + + + +Document: Header + +Classification : confidentiel + + +Document: Footer + +Ce contenu est marqué confidentiel. Ne le communiquez pas à l'extérieur sans un accord de l'entreprise. + + +Document: Watermark + +Confidentiel + + + +UK-Cabinet +2 + + + + + + +Document: Header + +Classification : exclusivement en interne + + +Document: Footer + +Ce contenu e
[Libreoffice-commits] core.git: helpcontent2
helpcontent2 |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit c895cb32fa8d1cf7fa82cebbde9d8259e68e66f6 Author: Laurent Balland-Poirier <laurent.balland-poir...@laposte.net> Date: Sun Oct 23 17:28:52 2016 +0200 Updated core Project: help 576f344764a89a1533d39d1424d3bd4176af1aae tdf#36038 Help for Extended LCID Change-Id: Icc2f31b88bcc37dd0d90226de2513531673c8707 Reviewed-on: https://gerrit.libreoffice.org/30180 Reviewed-by: jan iversen <j...@documentfoundation.org> Tested-by: jan iversen <j...@documentfoundation.org> diff --git a/helpcontent2 b/helpcontent2 index b429143..576f344 16 --- a/helpcontent2 +++ b/helpcontent2 @@ -1 +1 @@ -Subproject commit b429143c2cbedbc28b9b8c9cc07cd76cd69b68c6 +Subproject commit 576f344764a89a1533d39d1424d3bd4176af1aae ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] help.git: source/text
source/text/shared/01/05020301.xhp | 682 +++-- 1 file changed, 654 insertions(+), 28 deletions(-) New commits: commit 576f344764a89a1533d39d1424d3bd4176af1aae Author: Laurent Balland-Poirier <laurent.balland-poir...@laposte.net> Date: Sun Oct 23 17:28:52 2016 +0200 tdf#36038 Help for Extended LCID Change-Id: Icc2f31b88bcc37dd0d90226de2513531673c8707 Reviewed-on: https://gerrit.libreoffice.org/30180 Reviewed-by: jan iversen <j...@documentfoundation.org> Tested-by: jan iversen <j...@documentfoundation.org> diff --git a/source/text/shared/01/05020301.xhp b/source/text/shared/01/05020301.xhp index df8c1f5..54e2654 100644 --- a/source/text/shared/01/05020301.xhp +++ b/source/text/shared/01/05020301.xhp @@ -41,6 +41,8 @@ scientific notation, formats engineering notation, formats fraction, formats + native numeral + LCID, extended mw made "time formats" a two level entry and deleted 2x "formats;" @@ -269,7 +271,7 @@ To display numbers as percentages, add the percent sign (%) to the number format. Scientific Notation -Scientific notation lets you write very large numbers or very small fractions in a compact form. For example, in scientific notation, 65 is written as 6.5 x 10^5, and 0.65 as 6.5 x 10^-5. Translators: use the decimal delimiter of your language (period or comma) for all number format codes in Calc.In %PRODUCTNAME, these numbers are written as 6.5E+5 and 6.5E-5, respectively. To create a number format that displays numbers using scientific notation, enter a # or 0, and then one of the following codes E-, E+, e- or e+. If sign is omitted after E or e, it won't appear for positive value of exponent. To get engineering notation, enter 3 digits (0 or #) in the integer part.For instance: ###.##E+00 +Scientific notation lets you write very large numbers or very small fractions in a compact form. For example, in scientific notation, 65 is written as 6.5 x 10^5, and 0.65 as 6.5 x 10^-5. Translators: use the decimal delimiter of your language (period or comma) for all number format codes in Calc.In %PRODUCTNAME, these numbers are written as 6.5E+5 and 6.5E-5, respectively. To create a number format that displays numbers using scientific notation, enter a # or 0, and then one of the following codes E-, E+, e- or e+. If sign is omitted after E or e, it won't appear for positive value of exponent. To get engineering notation, enter 3 digits (0 or #) in the integer part. For instance: ###.##E+00 Fraction Representation To represent a value as a fraction, format consists of two or three parts: integer optional part, numerator and denominator. Integer and numerator are separated by a blank or any quoted text. Numerator and denominator are separated by a slash character. Each part can consist of a combination of #, ? and 0 as placeholders. @@ -716,9 +718,10 @@ Entering Dates To enter a date in a cell, use the Gregorian calendar format. For example, in an English locale, enter 1/2/2002 for Jan 2, 2002. -All date formats are dependent on the locale that is set in %PRODUCTNAME - Preferences +All date formats are dependent on the locale that is set in %PRODUCTNAME - Preferences Tools - Options - Language settings - Languages. For example, if your locale is set to 'Japanese', then the Gengou calendar is used. The default date format in %PRODUCTNAME uses the Gregorian Calendar. To specify a calendar format that is independent of the locale, add a modifier in front of the date format. For example, to display a date using the Jewish calendar format in a non-Hebrew locale, enter: [~jewish]DD/MM/. +The specified calendar is exported to MS-Excel using extended LCID. Extended LCID can also be used in the format string. It will be converted to a calendar modifier if it is supported. See Extended LCID section below. @@ -787,7 +790,7 @@ -If you perform a calculation that involves one or more cells using a date format, the result is formatted according to the following mappings: +If you perform a calculation that involves one or more cells using a date format, the result is formatted according to the following mappings: @@ -885,7 +888,7 @@ -The DateTime format displays the date and time that an entry was made to a cell with this format. +The DateTime format displays the date and time that an entry was made to a cell with this format. @@ -985,16 +988,16 @@ If a time is entered in the form 02:03.45 or 01:02:03.45 or 25:01:02, the following formats are assigned if no other time format has been specified: MM:SS.00 or [HH]:MM:SS.00 or [HH]:MM:SSTranslators: use the decimal delimiter of your language (period or comma) for all number format codes in Calc. Displaying Numbers Using Native Characters + +NatNum modifiers To display numbers using native number characters, use a [NatNum1
[Libreoffice-commits] core.git: basic/qa
basic/qa/basic_coverage/test_array_methods.vb | 38 +++ basic/qa/basic_coverage/test_conversion_methods.vb | 59 +++ basic/qa/basic_coverage/test_datetime_methods.vb | 77 +++ basic/qa/basic_coverage/test_logic_methods.vb | 56 ++ basic/qa/basic_coverage/test_math_methods.vb | 73 ++ basic/qa/basic_coverage/test_string_methods.vb | 107 + basic/qa/basic_coverage/test_system_methods.vb | 29 + 7 files changed, 439 insertions(+) New commits: commit 8a50ea54546a51fc7a2a28174031e7351dbed10e Author: Laurent Balland-Poirier <laurent.balland-poir...@laposte.net> Date: Sat Oct 22 21:54:37 2016 +0200 tdf#102872 Add qa unit test for BASIC methods Add test if several methods still works Change-Id: I8d26e5e3555dbbc0f07152138e1bc0cd65d90998 Reviewed-on: https://gerrit.libreoffice.org/30166 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: jan iversen <j...@documentfoundation.org> Tested-by: jan iversen <j...@documentfoundation.org> Reviewed-by: Laurent BP <laurent.balland-poir...@laposte.net> diff --git a/basic/qa/basic_coverage/test_array_methods.vb b/basic/qa/basic_coverage/test_array_methods.vb new file mode 100644 index 000..093867a --- /dev/null +++ b/basic/qa/basic_coverage/test_array_methods.vb @@ -0,0 +1,38 @@ +' +' 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/. +' + +Function doUnitTest as Integer +dim aVector as Variant +' ARRAY +aVector = Array( Date(), Time(), "Hello", -3.14) +If (aVector(2) <> "Hello") Then +doUnitTest = 0 +' LBOUND +Else If ( LBound( aVector() ) <> 0 ) Then +doUnitTest = 0 +' TYPELEN +Else If ( TypeLen(aVector(2)) <> 5 ) Then +doUnitTest = 0 +' TYPENAME +Else If ( TypeName(aVector(2)) <> "String" ) Then +doUnitTest = 0 +' UBOUND +Else If ( UBound( aVector() ) <> 3 ) Then +doUnitTest = 0 +' VARTYPE +Else If ( VarType(aVector(2)) <> 8 ) Then +doUnitTest = 0 +Else +doUnitTest = 1 +End If +End If +End If +End If +End If +End If +End Function diff --git a/basic/qa/basic_coverage/test_conversion_methods.vb b/basic/qa/basic_coverage/test_conversion_methods.vb new file mode 100644 index 000..7790cbc --- /dev/null +++ b/basic/qa/basic_coverage/test_conversion_methods.vb @@ -0,0 +1,59 @@ +' +' 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/. +' + +Function doUnitTest as Integer +Randomize 42 +dim aVector as Variant +aVector = Array( Date(), Time(), "Hello", -3.14) +' CBOOL +If (CBool(3) <> True) Then +doUnitTest = 0 +' CBYTE +Else If (CByte("3") <> 3) Then +doUnitTest = 0 +' CCUR +Else If (CCur("100") <> 100) Then +doUnitTest = 0 +' CDATE +Else If (CDate(100) <> 100) Then +doUnitTest = 0 +' CDEC +'Else If (CDec("100") <> 100) Then +'doUnitTest = 0 +' CDBL +Else If (CDbl("100") <> 100) Then +doUnitTest = 0 +' CINT +Else If (CInt("100") <> 100) Then +doUnitTest = 0 +' CLNG +Else If (CLng("100") <> 100) Then +doUnitTest = 0 +' CSNG +Else If (CSng("100") <> 100) Then +doUnitTest = 0 +' CSTR +Else If (CStr(100) <> "100") Then +doUnitTest = 0 +' VAL +Else If ( Val("4") <> 4 ) Then +doUnitTest = 0 +Else +doUnitTest = 1 +End If +End If +End If +End If +End If +End If +End If +End If +End If +End If +'End If +End Function diff --git a/basic/qa/basic_coverage/test_datetime_methods.vb b/basic/qa/basic_coverage/test_datetime_methods.vb new file mode 100644 index 000..679e129 --- /dev/null +++ b/basic/qa/basic_coverage/test_datetime_methods.vb @@ -0,0 +1,77 @@ +' +' 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/. +' + +Function doUnitTest as Integer +dim aVector as Variant +aVector = Array( Date(), Time(), "Hello", -3.14) +' CDateFromUnoDate +' CDateTomUnoDate +' CDateFromUnoTi
[Libreoffice-commits] core.git: sfx2/classification
sfx2/classification/example_fr-FR.xml |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit f2bc1a61f6df66848ecb073a97b6b22fa469ef4d Author: Laurent Balland-Poirier <laurent.balland-poir...@laposte.net> Date: Sun Oct 23 18:08:02 2016 +0200 tdf#100352 Classification: Update French translation Change-Id: Ie5efebfe4df73adca51638c85ba52e7901eac139 Reviewed-on: https://gerrit.libreoffice.org/30182 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Adolfo Jayme Barrientos <fit...@ubuntu.com> diff --git a/sfx2/classification/example_fr-FR.xml b/sfx2/classification/example_fr-FR.xml index eb551ac..4e0ab99 100644 --- a/sfx2/classification/example_fr-FR.xml +++ b/sfx2/classification/example_fr-FR.xml @@ -3,7 +3,7 @@ Exemple d'autorité TSCP -Exemple de police TSCP +Exemple de stratégie TSCP urn:example:tscp:1 ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: sfx2/classification sfx2/Package_classification.mk
sfx2/Package_classification.mk|1 sfx2/classification/example_fr-FR.xml | 84 ++ 2 files changed, 85 insertions(+) New commits: commit 74c1355c99b3c5edb9673cc1bf1438f10e68d658 Author: Laurent Balland-Poirier <laurent.balland-poir...@laposte.net> Date: Sun Oct 16 11:10:49 2016 +0200 tdf#100352 Provide French classification file Change-Id: I1dea9c22054dde4a52241d544fb02c0ad84b0872 Reviewed-on: https://gerrit.libreoffice.org/29915 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Adolfo Jayme Barrientos <fit...@ubuntu.com> diff --git a/sfx2/Package_classification.mk b/sfx2/Package_classification.mk index e50eb14..71684f4 100644 --- a/sfx2/Package_classification.mk +++ b/sfx2/Package_classification.mk @@ -12,6 +12,7 @@ $(eval $(call gb_Package_Package,sfx2_classification,$(SRCDIR)/sfx2)) $(eval $(call gb_Package_add_files,sfx2_classification,$(LIBO_SHARE_FOLDER)/classification,\ classification/example.xml \ classification/example_ca-ES.xml \ + classification/example_fr-FR.xml \ classification/example_hu-HU.xml \ classification/example_nl-NL.xml \ classification/example_pt-BR.xml \ diff --git a/sfx2/classification/example_fr-FR.xml b/sfx2/classification/example_fr-FR.xml new file mode 100644 index 000..eb551ac --- /dev/null +++ b/sfx2/classification/example_fr-FR.xml @@ -0,0 +1,84 @@ + + + +Exemple d'autorité TSCP + +Exemple de police TSCP + +urn:example:tscp:1 + + + + + + +UK-Cabinet +0 + + + + + + +Document: Header + +Classification : professionnel + + + +UK-Cabinet +1 + + + + + + +Document: Header + +Classification : confidentiel + + +Document: Footer + +Ce contenu est marqué confidentiel. Ne le communiquez pas à l'extérieur sans un accord de l'entreprise. + + +Document: Watermark + +Confidentiel + + + +UK-Cabinet +2 + + + + + + +Document: Header + +Classification : exclusivement en interne + + +Document: Footer + +Ce contenu est marqué pour un usage interne exclusivement. Il ne doit pas être communiqué à l'extérieur de l'entreprise. + + +Document: Watermark + +Interne exclusivement + + + +UK-Cabinet +3 + + + + + ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: nlpsolver/src
nlpsolver/src/com/sun/star/comp/Calc/NLPSolver/dialogs/EvolutionarySolverStatusUno.java |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 0412d863d144344b4c6c04b22209c0c57f1d6fb8 Author: Laurent Balland-Poirier <laurent.balland-poir...@laposte.net> Date: Wed Nov 30 21:50:06 2016 +0100 tdf#104268 NLPSolver: Improve display of solution Format "%.2f" is not optimal for large or small values. Format "%g" should be prefered. Change-Id: I92899d80564b9000b1f3e049221c456f8e1176a9 Reviewed-on: https://gerrit.libreoffice.org/31445 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> Tested-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/nlpsolver/src/com/sun/star/comp/Calc/NLPSolver/dialogs/EvolutionarySolverStatusUno.java b/nlpsolver/src/com/sun/star/comp/Calc/NLPSolver/dialogs/EvolutionarySolverStatusUno.java index da8dbb2..e3695a0 100644 --- a/nlpsolver/src/com/sun/star/comp/Calc/NLPSolver/dialogs/EvolutionarySolverStatusUno.java +++ b/nlpsolver/src/com/sun/star/comp/Calc/NLPSolver/dialogs/EvolutionarySolverStatusUno.java @@ -177,7 +177,7 @@ public class EvolutionarySolverStatusUno extends BaseDialog } public void setBestSolution(double solution, boolean feasible) { -lblSolutionValue.setLabel(String.format("%.2f", solution)); +lblSolutionValue.setLabel(String.format("%g", solution)); if (feasible) lblSolutionValue.setTextColor(defaultTextColor); else ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: basic/qa
/test_weekday_method.vb | 18 ++ basic/qa/basic_coverage/test_year_method.vb | 18 ++ 112 files changed, 1698 insertions(+), 363 deletions(-) New commits: commit 060c2b9b1b0d3c9cf27f1b289a620cfa82b5b060 Author: Laurent Balland-Poirier <laurent.balland-poir...@laposte.net> Date: Fri Dec 30 21:10:26 2016 +0100 QA Basic: split tests of methods in different files Following resolution of "Missing TAN method" [1] as discussed on dev list [2] a large majority of methods are now tested with (almost) one method per file Missing methods: - colors failed: RED, GREEN, BLUE - file methods: DIR, CHDRIVE, EOF,... - financial methods calling Calc functions: IPmt, IRR,... - not totaly implemented methods (?): ROUND, WAITUNTIL... [1] https://bugs.documentfoundation.org/show_bug.cgi?id=102872 [2] http://nabble.documentfoundation.org/QA-test-for-BASIC-functions-tt4202257.html Change-Id: I2b2824b5b18a2cfbbee2bbc5369e9e2b9e5c930b Reviewed-on: https://gerrit.libreoffice.org/32519 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Miklos Vajna <vmik...@collabora.co.uk> diff --git a/basic/qa/basic_coverage/test_abs_method.vb b/basic/qa/basic_coverage/test_abs_method.vb new file mode 100644 index 000..b79b9bc --- /dev/null +++ b/basic/qa/basic_coverage/test_abs_method.vb @@ -0,0 +1,17 @@ +' 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/. +' + +Function doUnitTest as Integer +' ABS +If (Abs(-3.5) <> 3.5) Then +doUnitTest = 0 +ElseIf (Abs(3.5) <> 3.5) Then +doUnitTest = 0 +Else +doUnitTest = 1 +End If +End Function diff --git a/basic/qa/basic_coverage/test_array_method.vb b/basic/qa/basic_coverage/test_array_method.vb new file mode 100644 index 000..42f10a2 --- /dev/null +++ b/basic/qa/basic_coverage/test_array_method.vb @@ -0,0 +1,20 @@ +' +' 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/. +' + +Function doUnitTest as Integer +dim aVector as Variant +' ARRAY +aVector = Array( "Hello", -3.14) +If (aVector(0) <> "Hello") Then +doUnitTest = 0 +ElseIf ( aVector(1) <> -3.14 ) Then +doUnitTest = 0 +Else +doUnitTest = 1 +End If +End Function diff --git a/basic/qa/basic_coverage/test_array_methods.vb b/basic/qa/basic_coverage/test_array_methods.vb deleted file mode 100644 index 53b2c87..000 --- a/basic/qa/basic_coverage/test_array_methods.vb +++ /dev/null @@ -1,33 +0,0 @@ -' -' 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/. -' - -Function doUnitTest as Integer -dim aVector as Variant -' ARRAY -aVector = Array( Date(), Time(), "Hello", -3.14) -If (aVector(2) <> "Hello") Then -doUnitTest = 0 -' LBOUND -ElseIf ( LBound( aVector() ) <> 0 ) Then -doUnitTest = 0 -' TYPELEN -ElseIf ( TypeLen(aVector(2)) <> 5 ) Then -doUnitTest = 0 -' TYPENAME -ElseIf ( TypeName(aVector(2)) <> "String" ) Then -doUnitTest = 0 -' UBOUND already tested -'ElseIf ( UBound( aVector() ) <> 3 ) Then -'doUnitTest = 0 -' VARTYPE -ElseIf ( VarType(aVector(2)) <> 8 ) Then -doUnitTest = 0 -Else -doUnitTest = 1 -End If -End Function diff --git a/basic/qa/basic_coverage/test_asc_method.vb b/basic/qa/basic_coverage/test_asc_method.vb new file mode 100644 index 000..48b8893 --- /dev/null +++ b/basic/qa/basic_coverage/test_asc_method.vb @@ -0,0 +1,15 @@ +' 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/. +' + +Function doUnitTest as Integer +' ASC +If (Asc("â¬a") <> 8364) Then +doUnitTest = 0 +Else +doUnitTest = 1 +End If +End Function diff --git a/basic/qa/basic_coverage/test_atn_method.vb b/basic/qa/basic_coverage/test_atn_method.vb new file mode 100644 index 000..7717141 --- /dev/null +++ b/basic/qa/basic_coverage/test_atn_method.vb @@ -0,0 +1,15 @@ +' This file is part of the LibreOffice project. +' +' T
[Libreoffice-commits] core.git: basic/qa
basic/qa/basic_coverage/test_array_methods.vb | 19 +--- basic/qa/basic_coverage/test_conversion_methods.vb | 36 +++- basic/qa/basic_coverage/test_datetime_methods.vb | 43 +++--- basic/qa/basic_coverage/test_logic_methods.vb | 24 + basic/qa/basic_coverage/test_math_methods.vb |6 - basic/qa/basic_coverage/test_string_methods.vb | 90 +++-- basic/qa/basic_coverage/test_system_methods.vb | 12 +- 7 files changed, 84 insertions(+), 146 deletions(-) New commits: commit 40578897d39c4eb0b528cff04ce82f5becbecc3f Author: Laurent Balland-Poirier <laurent.balland-poir...@laposte.net> Date: Sun Dec 11 13:43:07 2016 +0100 basic: cleanup test_*_methods cleanup remove duplicate test with other tests Change-Id: I4c82ad9f226f25080199ac0dc3815492fc4c265a Reviewed-on: https://gerrit.libreoffice.org/31860 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Arnaud Versini <arnaud.vers...@libreoffice.org> diff --git a/basic/qa/basic_coverage/test_array_methods.vb b/basic/qa/basic_coverage/test_array_methods.vb index 093867a..53b2c87 100644 --- a/basic/qa/basic_coverage/test_array_methods.vb +++ b/basic/qa/basic_coverage/test_array_methods.vb @@ -13,26 +13,21 @@ Function doUnitTest as Integer If (aVector(2) <> "Hello") Then doUnitTest = 0 ' LBOUND -Else If ( LBound( aVector() ) <> 0 ) Then +ElseIf ( LBound( aVector() ) <> 0 ) Then doUnitTest = 0 ' TYPELEN -Else If ( TypeLen(aVector(2)) <> 5 ) Then +ElseIf ( TypeLen(aVector(2)) <> 5 ) Then doUnitTest = 0 ' TYPENAME -Else If ( TypeName(aVector(2)) <> "String" ) Then -doUnitTest = 0 -' UBOUND -Else If ( UBound( aVector() ) <> 3 ) Then +ElseIf ( TypeName(aVector(2)) <> "String" ) Then doUnitTest = 0 +' UBOUND already tested +'ElseIf ( UBound( aVector() ) <> 3 ) Then +'doUnitTest = 0 ' VARTYPE -Else If ( VarType(aVector(2)) <> 8 ) Then +ElseIf ( VarType(aVector(2)) <> 8 ) Then doUnitTest = 0 Else doUnitTest = 1 End If -End If -End If -End If -End If -End If End Function diff --git a/basic/qa/basic_coverage/test_conversion_methods.vb b/basic/qa/basic_coverage/test_conversion_methods.vb index 7790cbc..6d441e0 100644 --- a/basic/qa/basic_coverage/test_conversion_methods.vb +++ b/basic/qa/basic_coverage/test_conversion_methods.vb @@ -14,46 +14,36 @@ Function doUnitTest as Integer If (CBool(3) <> True) Then doUnitTest = 0 ' CBYTE -Else If (CByte("3") <> 3) Then +ElseIf (CByte("3") <> 3) Then doUnitTest = 0 ' CCUR -Else If (CCur("100") <> 100) Then +ElseIf (CCur("100") <> 100) Then doUnitTest = 0 ' CDATE -Else If (CDate(100) <> 100) Then +ElseIf (CDate(100) <> 100) Then doUnitTest = 0 -' CDEC -'Else If (CDec("100") <> 100) Then +' CDEC already tested +'ElseIf (CDec("100") <> 100) Then 'doUnitTest = 0 ' CDBL -Else If (CDbl("100") <> 100) Then +ElseIf (CDbl("100") <> 100) Then doUnitTest = 0 ' CINT -Else If (CInt("100") <> 100) Then -doUnitTest = 0 -' CLNG -Else If (CLng("100") <> 100) Then +ElseIf (CInt("100") <> 100) Then doUnitTest = 0 +' CLNG already tested +'ElseIf (CLng("100") <> 100) Then + ' doUnitTest = 0 ' CSNG -Else If (CSng("100") <> 100) Then +ElseIf (CSng("100") <> 100) Then doUnitTest = 0 ' CSTR -Else If (CStr(100) <> "100") Then +ElseIf (CStr(100) <> "100") Then doUnitTest = 0 ' VAL -Else If ( Val("4") <> 4 ) Then +ElseIf ( Val("4") <> 4 ) Then doUnitTest = 0 Else doUnitTest = 1 End If -End If -End If -End If -End If -End If -End If -End If -End If -End If -'End If End Function diff --git a/basic/qa/basic_coverage/test_datetime_methods.vb b/basic/qa/basic_coverage/test_datetime_methods.vb index 679e129..0ef990c 100644 --- a/basic/qa/basic_coverage/test_datetime_methods.vb +++ b/basic/qa/basic_coverage/test_datetime_methods.vb @@ -19,59 +19,46 @@ Function doUnitTest as Integer If ( CDateToIso( CDateFromIso("20161016") ) <> "20161016" ) Then doUnitTest = 0 ' DATE DATEDIFF DATEADD -Else If ( DateDiff( "d", aVector(0), DateAdd("d", 1, aVector(0)) ) <> 1 ) Then +ElseIf ( DateDiff( "d",
[Libreoffice-commits] core.git: Branch 'libreoffice-5-3' - nlpsolver/src
nlpsolver/src/com/sun/star/comp/Calc/NLPSolver/dialogs/EvolutionarySolverStatusUno.java |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit d9ff86c9cf90925d0344b9572c651301847ca78c Author: Laurent Balland-Poirier <laurent.balland-poir...@laposte.net> Date: Wed Nov 30 21:50:06 2016 +0100 tdf#104268 NLPSolver: Improve display of solution Format "%.2f" is not optimal for large or small values. Format "%g" should be prefered. Change-Id: I92899d80564b9000b1f3e049221c456f8e1176a9 Reviewed-on: https://gerrit.libreoffice.org/31445 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> Tested-by: Noel Grandin <noel.gran...@collabora.co.uk> (cherry picked from commit 0412d863d144344b4c6c04b22209c0c57f1d6fb8) Reviewed-on: https://gerrit.libreoffice.org/31939 Reviewed-by: Christian Lohmaier <lohmaier+libreoff...@googlemail.com> diff --git a/nlpsolver/src/com/sun/star/comp/Calc/NLPSolver/dialogs/EvolutionarySolverStatusUno.java b/nlpsolver/src/com/sun/star/comp/Calc/NLPSolver/dialogs/EvolutionarySolverStatusUno.java index da8dbb2..e3695a0 100644 --- a/nlpsolver/src/com/sun/star/comp/Calc/NLPSolver/dialogs/EvolutionarySolverStatusUno.java +++ b/nlpsolver/src/com/sun/star/comp/Calc/NLPSolver/dialogs/EvolutionarySolverStatusUno.java @@ -177,7 +177,7 @@ public class EvolutionarySolverStatusUno extends BaseDialog } public void setBestSolution(double solution, boolean feasible) { -lblSolutionValue.setLabel(String.format("%.2f", solution)); +lblSolutionValue.setLabel(String.format("%g", solution)); if (feasible) lblSolutionValue.setTextColor(defaultTextColor); else ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-5.3' - 14 commits - filter/source hwpfilter/source include/vcl jvmfwk/inc jvmfwk/plugins lotuswordpro/source sc/source svl/source sw/source
filter/source/graphicfilter/itiff/itiff.cxx | 65 hwpfilter/source/drawing.h |4 - hwpfilter/source/hgzip.cxx |8 +- hwpfilter/source/hgzip.h|2 hwpfilter/source/hiodev.cxx | 48 +++--- hwpfilter/source/hiodev.h | 22 +++--- include/vcl/menu.hxx|1 jvmfwk/inc/vendorbase.hxx |2 jvmfwk/inc/vendorplugin.hxx |1 jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx |6 + jvmfwk/plugins/sunmajor/pluginlib/vendorbase.cxx| 26 +++- lotuswordpro/source/filter/lwpgrfobj.cxx|8 ++ lotuswordpro/source/filter/lwpobjstrm.cxx |9 ++ lotuswordpro/source/filter/lwpobjstrm.hxx |1 sc/source/core/data/grouptokenconverter.cxx |4 + sc/source/core/tool/interpr4.cxx|6 + sc/source/filter/oox/condformatcontext.cxx |4 - sc/source/ui/view/cellsh1.cxx |1 svl/source/numbers/zformat.cxx | 13 +++- svl/source/numbers/zforscan.cxx | 33 +- sw/source/uibase/dbui/dbmgr.cxx |7 +- vcl/source/window/menu.cxx | 11 ++- vcl/unx/gtk/gtksalmenu.cxx | 28 +++- vcl/unx/gtk3/gtk3gtkframe.cxx |2 24 files changed, 213 insertions(+), 99 deletions(-) New commits: commit 2f8b1a85a9803b94b57b5671beb70d8252f5c532 Author: Laurent Balland-Poirier <laurent.balland-poir...@laposte.net> Date: Sun Mar 12 23:33:24 2017 +0100 Following tdf#106190 Treat blank after fraction bar To consider that denominator is found (bDenom=true) there must be some digits found after fraction bar Dummy format # ?/ ? can now work again (even with blank as thousands delimiter). However such format can not be saved (except in XLS) Change-Id: I657e97e09a6ae4c08a29ad6d0b586c85a9968e3d Reviewed-on: https://gerrit.libreoffice.org/35111 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Eike Rathke <er...@redhat.com> (cherry picked from commit 4e1448d43e08d3f0a6ff67e75346e9559ad2af09) Reviewed-on: https://gerrit.libreoffice.org/35196 (cherry picked from commit f1a108f4dfd3d82dd39a9606f54a25a076ac516d) diff --git a/svl/source/numbers/zformat.cxx b/svl/source/numbers/zformat.cxx index be19e338d2a1..ac622bf4cc45 100644 --- a/svl/source/numbers/zformat.cxx +++ b/svl/source/numbers/zformat.cxx @@ -2212,7 +2212,8 @@ OUString lcl_GetDenominatorString(const ImpSvNumberformatInfo , sal_uInt16 { if( rInfo.nTypeArray[i] == NF_SYMBOLTYPE_FRAC ) { -for( i++; i < nAnz; i++ ) +while ( ( ++i < nAnz ) && rInfo.nTypeArray[i] == NF_SYMBOLTYPE_STRING ); +for( ; i < nAnz; i++ ) { if( rInfo.nTypeArray[i] == NF_SYMBOLTYPE_FRAC_FDIV || rInfo.nTypeArray[i] == NF_SYMBOLTYPE_DIGIT ) aDenominatorString.append( rInfo.sStrArray[i] ); diff --git a/svl/source/numbers/zforscan.cxx b/svl/source/numbers/zforscan.cxx index 1cceda79d3ad..363a6219137e 100644 --- a/svl/source/numbers/zforscan.cxx +++ b/svl/source/numbers/zforscan.cxx @@ -1670,7 +1670,7 @@ sal_Int32 ImpSvNumberformatScan::FinalScan( OUString& rString ) } else if ( sStrArray[i][0] == ' ' ) nTypeArray[i] = NF_SYMBOLTYPE_FRACBLANK; -else if ( bFrac ) +else if ( bFrac && ( nCounter > 0 ) ) bDenomin = true; // following elements are no more part of denominator } else if (nTypeArray[i] == NF_KEY_THAI_T) @@ -1714,7 +1714,7 @@ sal_Int32 ImpSvNumberformatScan::FinalScan( OUString& rString ) } else { -if ( bFrac ) +if ( bFrac && ( nCounter > 0 ) ) bDenomin = true;// next content should be treated as outside denominator nTypeArray[i] = NF_SYMBOLTYPE_STRING; } @@ -1834,7 +1834,7 @@ sal_Int32 ImpSvNumberformatScan::FinalScan( OUString& rString ) else { nTypeArray[i] = NF_SYMBOLTYPE_STRING; -if ( bFrac ) +if ( bFrac && (nCounter > 0) ) bDenomin = true; // end of denominator } } @@ -2002,7 +2002,7 @@ sal_Int32 ImpSvNumberformatScan::Fin
[Libreoffice-commits] core.git: sc/qa
sc/qa/unit/ucalc.cxx | 15 +-- 1 file changed, 9 insertions(+), 6 deletions(-) New commits: commit 152e9869f8c32fb2c353bfae22db214eba342507 Author: Laurent Balland-Poirier <laurent.balland-poir...@laposte.net> Date: Sun Mar 12 15:17:30 2017 +0100 tdf#106253 Test Precision as shown for thousand separators Change-Id: I2e07667884d072a875b7bf5e5c7cf4c3e5d98332 Reviewed-on: https://gerrit.libreoffice.org/35098 Reviewed-by: Eike Rathke <er...@redhat.com> Tested-by: Jenkins <c...@libreoffice.org> diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx index 86aa877..13d163e 100644 --- a/sc/qa/unit/ucalc.cxx +++ b/sc/qa/unit/ucalc.cxx @@ -6780,14 +6780,17 @@ void Test::testPrecisionAsShown() checkPrecisionAsShown( aCode, fValue, fExpectedRoundVal ); checkPrecisionAsShown( aCode, -fValue, -fExpectedRoundVal ); } -{ // thousand rounding bogus tdf#106253 +{ // thousand rounding tdf#106253 aCode = "0,,"; fValue = 4.0e9 / 7.0; -fExpectedRoundVal = 571e6; // actual is 571428571 -//checkPrecisionAsShown( aCode, fValue, fExpectedRoundVal ); -fValue = -4.0e8 / 7.0; -fExpectedRoundVal = -57e6; // actual is 57142857 -//checkPrecisionAsShown( aCode, fValue, fExpectedRoundVal ); +fExpectedRoundVal = 571e6; +checkPrecisionAsShown( aCode, fValue, fExpectedRoundVal ); +checkPrecisionAsShown( aCode, -fValue, -fExpectedRoundVal ); +aCode = "\"k\"[$$-409]* #,;[RED]-\"k\"[$$-409]* #,"; +fValue = 4.0e8 / 7.0; +fExpectedRoundVal = 57.143e6; +checkPrecisionAsShown( aCode, fValue, fExpectedRoundVal ); +checkPrecisionAsShown( aCode, -fValue, -fExpectedRoundVal ); } { // percent rounding aCode = "0.00%"; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: include/svl sc/source
include/svl/zformat.hxx |6 ++ sc/source/core/data/documen4.cxx |6 ++ 2 files changed, 12 insertions(+) New commits: commit 60d7644a46970e6eaee882e0c5d65692da206c24 Author: Laurent Balland-Poirier <laurent.balland-poir...@laposte.net> Date: Sun Mar 12 14:11:36 2017 +0100 tdf#106253 Precision as shown for thousand dividor Info().nThousand contains number of thousands dividors after which digits are not displayed, i.e. 12345 is displayed as 12 with format 0, (in en_US) Change-Id: Ifa5540f2efd8ab006a07eade53f7aa0d31a19eac Reviewed-on: https://gerrit.libreoffice.org/35097 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Eike Rathke <er...@redhat.com> diff --git a/include/svl/zformat.hxx b/include/svl/zformat.hxx index 1dd05d2..2f382d8 100644 --- a/include/svl/zformat.hxx +++ b/include/svl/zformat.hxx @@ -226,6 +226,12 @@ public: sal_uInt16 GetFormatIntegerDigits( sal_uInt16 nIx = 0 ) const { return NumFor[nIx].Info().nCntPre; } +/** Count of hidden integer digits with thousands dividor: + * formats like "0," to show only thousands + */ +sal_uInt16 GetThousandDivisorPrecision( sal_uInt16 nIx = 0 ) const +{ return NumFor[nIx].Info().nThousand * 3; } + //! Read/write access on a special sal_uInt16 component, may only be used on the //! standard format 0, 1, ... and only by the number formatter! struct FormatterPrivateAccess { friend SvNumberFormatter; private: FormatterPrivateAccess() {} }; diff --git a/sc/source/core/data/documen4.cxx b/sc/source/core/data/documen4.cxx index 6bb280b..1cdc777 100644 --- a/sc/source/core/data/documen4.cxx +++ b/sc/source/core/data/documen4.cxx @@ -692,6 +692,12 @@ double ScDocument::RoundValueAsShown( double fVal, sal_uInt32 nFormat ) const { return pFormat->GetRoundFractionValue( fVal ); } +case css::util::NumberFormat::NUMBER: +case css::util::NumberFormat::CURRENCY: +{ // tdf#106253 Thousands dividors for format "0," +nPrecision -= pFormat->GetThousandDivisorPrecision( nIdx ); +break; +} } } else ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-3' - svl/source
svl/source/numbers/zformat.cxx |3 ++- svl/source/numbers/zforscan.cxx | 10 +- 2 files changed, 7 insertions(+), 6 deletions(-) New commits: commit f1a108f4dfd3d82dd39a9606f54a25a076ac516d Author: Laurent Balland-Poirier <laurent.balland-poir...@laposte.net> Date: Sun Mar 12 23:33:24 2017 +0100 Following tdf#106190 Treat blank after fraction bar To consider that denominator is found (bDenom=true) there must be some digits found after fraction bar Dummy format # ?/ ? can now work again (even with blank as thousands delimiter). However such format can not be saved (except in XLS) Change-Id: I657e97e09a6ae4c08a29ad6d0b586c85a9968e3d Reviewed-on: https://gerrit.libreoffice.org/35111 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Eike Rathke <er...@redhat.com> (cherry picked from commit 4e1448d43e08d3f0a6ff67e75346e9559ad2af09) Reviewed-on: https://gerrit.libreoffice.org/35196 diff --git a/svl/source/numbers/zformat.cxx b/svl/source/numbers/zformat.cxx index be19e33..ac622bf 100644 --- a/svl/source/numbers/zformat.cxx +++ b/svl/source/numbers/zformat.cxx @@ -2212,7 +2212,8 @@ OUString lcl_GetDenominatorString(const ImpSvNumberformatInfo , sal_uInt16 { if( rInfo.nTypeArray[i] == NF_SYMBOLTYPE_FRAC ) { -for( i++; i < nAnz; i++ ) +while ( ( ++i < nAnz ) && rInfo.nTypeArray[i] == NF_SYMBOLTYPE_STRING ); +for( ; i < nAnz; i++ ) { if( rInfo.nTypeArray[i] == NF_SYMBOLTYPE_FRAC_FDIV || rInfo.nTypeArray[i] == NF_SYMBOLTYPE_DIGIT ) aDenominatorString.append( rInfo.sStrArray[i] ); diff --git a/svl/source/numbers/zforscan.cxx b/svl/source/numbers/zforscan.cxx index 1cceda7..363a621 100644 --- a/svl/source/numbers/zforscan.cxx +++ b/svl/source/numbers/zforscan.cxx @@ -1670,7 +1670,7 @@ sal_Int32 ImpSvNumberformatScan::FinalScan( OUString& rString ) } else if ( sStrArray[i][0] == ' ' ) nTypeArray[i] = NF_SYMBOLTYPE_FRACBLANK; -else if ( bFrac ) +else if ( bFrac && ( nCounter > 0 ) ) bDenomin = true; // following elements are no more part of denominator } else if (nTypeArray[i] == NF_KEY_THAI_T) @@ -1714,7 +1714,7 @@ sal_Int32 ImpSvNumberformatScan::FinalScan( OUString& rString ) } else { -if ( bFrac ) +if ( bFrac && ( nCounter > 0 ) ) bDenomin = true;// next content should be treated as outside denominator nTypeArray[i] = NF_SYMBOLTYPE_STRING; } @@ -1834,7 +1834,7 @@ sal_Int32 ImpSvNumberformatScan::FinalScan( OUString& rString ) else { nTypeArray[i] = NF_SYMBOLTYPE_STRING; -if ( bFrac ) +if ( bFrac && (nCounter > 0) ) bDenomin = true; // end of denominator } } @@ -2002,7 +2002,7 @@ sal_Int32 ImpSvNumberformatScan::FinalScan( OUString& rString ) nCntPre = nCounter; nCounter = 0; } -if ( bFrac ) +if ( bFrac && (nCounter > 0) ) bDenomin = true; // next content is not part of denominator nTypeArray[i] = NF_SYMBOLTYPE_STRING; nPos = nPos + sStrArray[i].getLength(); @@ -2010,7 +2010,7 @@ sal_Int32 ImpSvNumberformatScan::FinalScan( OUString& rString ) else { nTypeArray[i] = NF_SYMBOLTYPE_STRING; -if ( bFrac ) +if ( bFrac && (nCounter > 0) ) bDenomin = true; // next content is not part of denominator nPos = nPos + rStr.getLength(); i++; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: include/svl svl/source
include/svl/zformat.hxx|3 ++- svl/source/numbers/zformat.cxx | 29 +++-- 2 files changed, 13 insertions(+), 19 deletions(-) New commits: commit 2fd110a78d03510d031c4c6cf6ad380d82899df8 Author: Laurent Balland-Poirier <laurent.balland-poir...@laposte.net> Date: Thu Mar 16 23:45:13 2017 +0100 tdf#106190 Fix (again) left alignment of denominator Instead of moving spaces from left to right, like it was done previously, this patch insert spaces directly on right when in denominator This avoid complex calculation when user enter such (stupid) format: # ?/ ??? or # ?/" hello world "??? In SvNumberformat::ImpNumberFill, for NF_SYMBOLTYPE_FRAC_FDIV you need at least to move in sBuf, to insert text at the expected place for (stupid) format like # ?/ 100 or # ?/" hello world "100 All these formats works, but are stored in ODF with text after fraction Change-Id: I296e60643e93242b8006848a643135219ad4ad0c Reviewed-on: https://gerrit.libreoffice.org/35320 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Eike Rathke <er...@redhat.com> diff --git a/include/svl/zformat.hxx b/include/svl/zformat.hxx index 9bee5ca38370..d5086d7a7fc2 100644 --- a/include/svl/zformat.hxx +++ b/include/svl/zformat.hxx @@ -571,7 +571,8 @@ private: sal_Int32& k, sal_uInt16& j, sal_uInt16 nIx, -short eSymbolType ); +short eSymbolType, +bool bInsertRightBlank = false ); // Helper function to fill in the integer part and the group (AKA thousand) separators SVL_DLLPRIVATE bool ImpNumberFillWithThousands( OUStringBuffer& sStr, diff --git a/svl/source/numbers/zformat.cxx b/svl/source/numbers/zformat.cxx index 3b85e192adfa..505e3c06df9a 100644 --- a/svl/source/numbers/zformat.cxx +++ b/svl/source/numbers/zformat.cxx @@ -2211,7 +2211,8 @@ OUString lcl_GetDenominatorString(const ImpSvNumberformatInfo , sal_uInt16 { if( rInfo.nTypeArray[i] == NF_SYMBOLTYPE_FRAC ) { -while ( ( ++i < nAnz ) && rInfo.nTypeArray[i] == NF_SYMBOLTYPE_STRING ); +while ( ( ++i < nAnz ) && rInfo.nTypeArray[i] != NF_SYMBOLTYPE_FRAC_FDIV + && rInfo.nTypeArray[i] != NF_SYMBOLTYPE_DIGIT ); for( ; i < nAnz; i++ ) { if( rInfo.nTypeArray[i] == NF_SYMBOLTYPE_FRAC_FDIV || rInfo.nTypeArray[i] == NF_SYMBOLTYPE_DIGIT ) @@ -2835,21 +2836,7 @@ bool SvNumberformat::ImpGetFractionOutput(double fNumber, sal_uInt16 j = nAnz-1; // Last symbol -> backwards sal_Int32 k; // Denominator -bRes |= ImpNumberFill(sDiv, fNumber, k, j, nIx, NF_SYMBOLTYPE_FRAC); -if ( !bHideFraction && sDenominatorFormat.getLength() > 0 ) -{ -// Guard against a (theoretical?) endless loop of blanks only. -sal_Int32 n = sDiv.getLength(); -sal_Int32 nDenominatorLen = sDenominatorFormat.getLength(); -while ( n-- > 0 && sDiv[0] == ' ' ) // left align denominator -{ -if (sDiv.getLength() <= nDenominatorLen) -sDiv.append(" "); -else -sDiv.insert( nDenominatorLen, " " ); -sDiv.remove( 0, 1 ); -} -} +bRes |= ImpNumberFill(sDiv, fNumber, k, j, nIx, NF_SYMBOLTYPE_FRAC, true); bool bCont = true; if (rInfo.nTypeArray[j] == NF_SYMBOLTYPE_FRAC) @@ -4504,7 +4491,8 @@ bool SvNumberformat::ImpNumberFill( OUStringBuffer& sBuff, // number string sal_Int32& k, // position within string sal_uInt16& j, // symbol index within format code sal_uInt16 nIx,// subformat index -short eSymbolType )// type of stop condition +short eSymbolType, // type of stop condition +bool bInsertRightBlank)// insert blank on right for denominator (default = false) { bool bRes = false; bool bStop = false; @@ -4556,6 +4544,7 @@ bool SvNumberformat::ImpNumberFill( OUStringBuffer& sBuff, // number string case NF_SYMBOLTYPE_DIGIT: { bFoundNumber = true; +sal_uInt16 nPosInsertBlank = bInsertRightBlank ? k : 0; // left alignment of denominator const OUString& rStr = rInfo.sStrArray[j]; const sal_Unicode* p1 = rStr.getStr(); const sal_Unicode* p = p1 + rStr.getLength(); @@ -4573,7 +4562,7 @@ bool SvNumberformat::ImpNumberFill( OUStringBuffer& sBuff, // number s
[Libreoffice-commits] core.git: Branch 'libreoffice-5-3' - include/svl svl/source
include/svl/zformat.hxx|3 ++- svl/source/numbers/zformat.cxx | 29 +++-- 2 files changed, 13 insertions(+), 19 deletions(-) New commits: commit 693c929c1a475e6b4bd737e50d09d6f390700812 Author: Laurent Balland-Poirier <laurent.balland-poir...@laposte.net> Date: Thu Mar 16 23:45:13 2017 +0100 tdf#106190 Fix (again) left alignment of denominator Instead of moving spaces from left to right, like it was done previously, this patch insert spaces directly on right when in denominator This avoid complex calculation when user enter such (stupid) format: # ?/ ??? or # ?/" hello world "??? In SvNumberformat::ImpNumberFill, for NF_SYMBOLTYPE_FRAC_FDIV you need at least to move in sBuf, to insert text at the expected place for (stupid) format like # ?/ 100 or # ?/" hello world "100 All these formats works, but are stored in ODF with text after fraction Change-Id: I296e60643e93242b8006848a643135219ad4ad0c Reviewed-on: https://gerrit.libreoffice.org/35320 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Eike Rathke <er...@redhat.com> (cherry picked from commit 2fd110a78d03510d031c4c6cf6ad380d82899df8) Reviewed-on: https://gerrit.libreoffice.org/36232 diff --git a/include/svl/zformat.hxx b/include/svl/zformat.hxx index ce632ae04920..ceba6a4993ca 100644 --- a/include/svl/zformat.hxx +++ b/include/svl/zformat.hxx @@ -553,7 +553,8 @@ private: sal_Int32& k, sal_uInt16& j, sal_uInt16 nIx, -short eSymbolType ); +short eSymbolType, +bool bInsertRightBlank = false ); // Helper function to fill in the integer part and the group (AKA thousand) separators SVL_DLLPRIVATE bool ImpNumberFillWithThousands( OUStringBuffer& sStr, diff --git a/svl/source/numbers/zformat.cxx b/svl/source/numbers/zformat.cxx index ac622bf4cc45..2c018f662784 100644 --- a/svl/source/numbers/zformat.cxx +++ b/svl/source/numbers/zformat.cxx @@ -2212,7 +2212,8 @@ OUString lcl_GetDenominatorString(const ImpSvNumberformatInfo , sal_uInt16 { if( rInfo.nTypeArray[i] == NF_SYMBOLTYPE_FRAC ) { -while ( ( ++i < nAnz ) && rInfo.nTypeArray[i] == NF_SYMBOLTYPE_STRING ); +while ( ( ++i < nAnz ) && rInfo.nTypeArray[i] != NF_SYMBOLTYPE_FRAC_FDIV + && rInfo.nTypeArray[i] != NF_SYMBOLTYPE_DIGIT ); for( ; i < nAnz; i++ ) { if( rInfo.nTypeArray[i] == NF_SYMBOLTYPE_FRAC_FDIV || rInfo.nTypeArray[i] == NF_SYMBOLTYPE_DIGIT ) @@ -2815,21 +2816,7 @@ bool SvNumberformat::ImpGetFractionOutput(double fNumber, sal_uInt16 j = nAnz-1; // Last symbol -> backwards sal_Int32 k; // Denominator -bRes |= ImpNumberFill(sDiv, fNumber, k, j, nIx, NF_SYMBOLTYPE_FRAC); -if ( !bHideFraction && sDenominatorFormat.getLength() > 0 ) -{ -// Guard against a (theoretical?) endless loop of blanks only. -sal_Int32 n = sDiv.getLength(); -sal_Int32 nDenominatorLen = sDenominatorFormat.getLength(); -while ( n-- > 0 && sDiv[0] == ' ' ) // left align denominator -{ -if (sDiv.getLength() <= nDenominatorLen) -sDiv.append(" "); -else -sDiv.insert( nDenominatorLen, " " ); -sDiv.remove( 0, 1 ); -} -} +bRes |= ImpNumberFill(sDiv, fNumber, k, j, nIx, NF_SYMBOLTYPE_FRAC, true); bool bCont = true; if (rInfo.nTypeArray[j] == NF_SYMBOLTYPE_FRAC) @@ -4484,7 +4471,8 @@ bool SvNumberformat::ImpNumberFill( OUStringBuffer& sBuff, // number string sal_Int32& k, // position within string sal_uInt16& j, // symbol index within format code sal_uInt16 nIx,// subformat index -short eSymbolType )// type of stop condition +short eSymbolType, // type of stop condition +bool bInsertRightBlank)// insert blank on right for denominator (default = false) { bool bRes = false; bool bStop = false; @@ -4536,6 +4524,7 @@ bool SvNumberformat::ImpNumberFill( OUStringBuffer& sBuff, // number string case NF_SYMBOLTYPE_DIGIT: { bFoundNumber = true; +sal_uInt16 nPosInsertBlank = bInsertRightBlank ? k : 0; // left alignment of denominator const OUString& rStr = rInfo.sStrArray[j]; const sal_Unicode* p1 = rStr.getStr(); const sal_Unicode* p = p1 + rStr.getL
[Libreoffice-commits] core.git: Branch 'libreoffice-5-3' - include/svl sc/source svl/source
include/svl/zforlist.hxx |3 include/svl/zformat.hxx | 19 + sc/source/core/data/documen4.cxx |4 + svl/source/numbers/zforlist.cxx |9 ++ svl/source/numbers/zformat.cxx | 147 ++- 5 files changed, 119 insertions(+), 63 deletions(-) New commits: commit 9f70f8761a8cc180171022ffcffc0094c4957057 Author: Laurent Balland-Poirier <laurent.balland-poir...@laposte.net> Date: Wed Feb 15 23:27:34 2017 +0100 tdf#105657 Treat "Precision as shown" for fractions For Option "Precision as shown", fraction must specificly be treated ImpGetFractionElements retrieves values of each part of fraction (integer, numerator, denominator) independently from its exact representation Update: avoid include of zformat.hxx in document4.cxx Change-Id: Ia3ea2322f3d311c04ef71f3260730c7154c3dc15 Reviewed-on: https://gerrit.libreoffice.org/34331 Reviewed-by: Eike Rathke <er...@redhat.com> Tested-by: Eike Rathke <er...@redhat.com> (cherry picked from commit 5706b29974c1c3ab0ba5a23685accf2fbebc3e06) Reviewed-on: https://gerrit.libreoffice.org/36365 Tested-by: Jenkins <c...@libreoffice.org> diff --git a/include/svl/zforlist.hxx b/include/svl/zforlist.hxx index ab7dd90f1426..36e468726a64 100644 --- a/include/svl/zforlist.hxx +++ b/include/svl/zforlist.hxx @@ -531,6 +531,9 @@ public: sal_uInt16& nPrecision, sal_uInt16& nAnzLeading, LanguageType eLnge = LANGUAGE_DONTKNOW ); +/// Get round value with fraction representation +double GetRoundFractionValue( sal_uInt32 nFormat, double fValue ) const; + /// Check if format code string may be deleted by user bool IsUserDefined( const OUString& sStr, LanguageType eLnge = LANGUAGE_DONTKNOW ); diff --git a/include/svl/zformat.hxx b/include/svl/zformat.hxx index ceba6a4993ca..f798d4090638 100644 --- a/include/svl/zformat.hxx +++ b/include/svl/zformat.hxx @@ -212,6 +212,9 @@ public: sal_uInt16& nPrecision, sal_uInt16& nAnzLeading) const; +/// Get index of subformat (0..3) according to conditions and fNumber value +sal_uInt16 GetSubformatIndex( double fNumber ) const; + /// Count of decimal precision sal_uInt16 GetFormatPrecision() const { return NumFor[0].Info().nCntPost; } @@ -242,6 +245,9 @@ public: OUString GetDenominatorString( sal_uInt16 nNumFor ) const; OUString GetNumeratorString( sal_uInt16 nNumFor ) const; OUString GetIntegerFractionDelimiterString( sal_uInt16 nNumFor ) const; +/// Round fNumber to its fraction representation +double GetRoundFractionValue ( double fNumber ) const; + /** If the count of string elements (substrings, ignoring [modifiers] and so on) in a subformat code nNumFor (0..3) is equal to the given number. Used by ImpSvNumberInputScan::IsNumberFormatMain() to detect a matched @@ -580,6 +586,19 @@ private: sal_uInt16 nIx, bool bInteger ); +/** Calculate each element of fraction: + * integer part, numerator part, denominator part + * @param fNumber value to be represented as fraction. Will contain absolute fractional part + * @param nIx subformat number 0..3 + * @param fIntPart integral part of fraction + * @param nFrac numerator of fraction + * @param nDic denominator of fraction + */ +SVL_DLLPRIVATE void ImpGetFractionElements( double& fNumber, +sal_uInt16 nIx, +double& fIntPart, +sal_uInt64& nFrac, +sal_uInt64& nDiv ) const; SVL_DLLPRIVATE bool ImpGetFractionOutput(double fNumber, sal_uInt16 nIx, OUStringBuffer& OutString); diff --git a/sc/source/core/data/documen4.cxx b/sc/source/core/data/documen4.cxx index c503b2fa6137..09b7c543e7e8 100644 --- a/sc/source/core/data/documen4.cxx +++ b/sc/source/core/data/documen4.cxx @@ -672,6 +672,10 @@ double ScDocument::RoundValueAsShown( double fVal, sal_uInt32 nFormat ) const nPrecision = sal::static_int_cast( nPrecision - (short)floor( log10( -fVal ) ) ); break; } +case css::util::NumberFormat::FRACTION: // get value of fraction representation +{ +return GetFormatTable()->GetRoundFractionValue( nFormat, fVal ); +} } } else diff --git a/svl/source/numbers/zforlist.cxx b/svl/source/numbers/zforlist.cxx index c2617a534
[Libreoffice-commits] core.git: Branch 'libreoffice-5-3' - 2 commits - include/svl sc/qa sc/source
include/svl/zformat.hxx |3 sc/qa/unit/ucalc.cxx | 156 +++ sc/qa/unit/ucalc.hxx |4 + sc/source/core/data/documen4.cxx | 20 - 4 files changed, 179 insertions(+), 4 deletions(-) New commits: commit 3c68b6520e743e8ed9afa908a461f766952e030f Author: Laurent Balland-Poirier <laurent.balland-poir...@laposte.net> Date: Fri Mar 3 21:51:26 2017 +0100 tdf#106252 Engineering notation for Precision as shown with more tests Reviewed-on: https://gerrit.libreoffice.org/35089 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Eike Rathke <er...@redhat.com> (cherry picked from commit 5f2db66ad0de6fbbae309850516e17eaa17934cb) Change-Id: Ifc77b847af4eaaa3c85e904e46c2663b6d768241 Reviewed-on: https://gerrit.libreoffice.org/36369 Reviewed-by: Eike Rathke <er...@redhat.com> Tested-by: Jenkins <c...@libreoffice.org> diff --git a/include/svl/zformat.hxx b/include/svl/zformat.hxx index 34525acad43e..4d108815d9a7 100644 --- a/include/svl/zformat.hxx +++ b/include/svl/zformat.hxx @@ -223,7 +223,8 @@ public: { return NumFor[nIx].Info().nCntPost; } /// Count of integer digits -sal_uInt16 GetFormatIntegerDigits() const { return NumFor[0].Info().nCntPre; } +sal_uInt16 GetFormatIntegerDigits( sal_uInt16 nIx = 0 ) const +{ return NumFor[nIx].Info().nCntPre; } //! Read/write access on a special sal_uInt16 component, may only be used on the //! standard format 0, 5000, ... and only by the number formatter! diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx index dbdd549b3ba6..ea44ff7d4f3d 100644 --- a/sc/qa/unit/ucalc.cxx +++ b/sc/qa/unit/ucalc.cxx @@ -6434,12 +6434,14 @@ void Test::testPrecisionAsShown() aCode = "0.00"; fValue = 1.0/3.0; fExpectedRoundVal = 0.33; -checkPrecisionAsShown( aCode, fValue, fExpectedRoundVal ); -fValue = -10.001; -fExpectedRoundVal = -10.0; -checkPrecisionAsShown( aCode, fValue, fExpectedRoundVal ); +checkPrecisionAsShown( aCode, fValue, fExpectedRoundVal ); +checkPrecisionAsShown( aCode, -fValue, -fExpectedRoundVal ); +fValue = 10.001; +fExpectedRoundVal = 10.0; +checkPrecisionAsShown( aCode, fValue, fExpectedRoundVal ); +checkPrecisionAsShown( aCode, -fValue, -fExpectedRoundVal ); } -{ // thousand rounding buguous tdf#106253 +{ // thousand rounding bogus tdf#106253 aCode = "0,,"; fValue = 4.0e9 / 7.0; fExpectedRoundVal = 571e6; // actual is 571428571 @@ -6452,54 +6454,105 @@ void Test::testPrecisionAsShown() aCode = "0.00%"; fValue = 4.0 / 7.0; fExpectedRoundVal = 0.5714; -checkPrecisionAsShown( aCode, fValue, fExpectedRoundVal ); -fValue = -4.0 / 7.0; -fExpectedRoundVal = -0.5714; -checkPrecisionAsShown( aCode, fValue, fExpectedRoundVal ); +checkPrecisionAsShown( aCode, fValue, fExpectedRoundVal ); +checkPrecisionAsShown( aCode, -fValue, -fExpectedRoundVal ); +fValue = 40.0 / 7.0; +fExpectedRoundVal = 5.7143; +checkPrecisionAsShown( aCode, fValue, fExpectedRoundVal ); +checkPrecisionAsShown( aCode, -fValue, -fExpectedRoundVal ); } { // scientific rounding aCode = "0.00E0"; fValue = 40.0 / 7.0; fExpectedRoundVal = 57100.0; -checkPrecisionAsShown( aCode, fValue, fExpectedRoundVal ); +checkPrecisionAsShown( aCode, fValue, fExpectedRoundVal ); +checkPrecisionAsShown( aCode, -fValue, -fExpectedRoundVal ); fValue = 4.0 / 7.0; fExpectedRoundVal = 5.71e-5; -checkPrecisionAsShown( aCode, fValue, fExpectedRoundVal ); -// engineering rounding bugous!!! tdf#106252 +checkPrecisionAsShown( aCode, fValue, fExpectedRoundVal ); +checkPrecisionAsShown( aCode, -fValue, -fExpectedRoundVal ); +// engineering rounding tdf#106252 aCode = "##0.000E0"; fValue = 40.0 / 7.0; -fExpectedRoundVal = 57143.0; // actual is 57140 -//checkPrecisionAsShown( aCode, fValue, fExpectedRoundVal ); +fExpectedRoundVal = 57.143e3; +checkPrecisionAsShown( aCode, fValue, fExpectedRoundVal ); +checkPrecisionAsShown( aCode, -fValue, -fExpectedRoundVal ); +fValue = 400.0 / 7.0; +fExpectedRoundVal = 571.429e3; +checkPrecisionAsShown( aCode, fValue, fExpectedRoundVal ); +checkPrecisionAsShown( aCode, -fValue, -fExpectedRoundVal ); +fValue = 4000.0 / 7.0; +fExpectedRoundVal = 5.714e6; +checkPrecisionAsShown( aCode, fValue, fExpectedRoundVal ); +checkPrecisionAsShown( aCode, -fValue, -fExpectedRoundVal ); fValue
[Libreoffice-commits] core.git: Branch 'libreoffice-5-3' - include/svl sc/source svl/source
include/svl/zforlist.hxx |3 +++ include/svl/zformat.hxx |3 ++- sc/source/core/data/documen4.cxx |2 +- svl/source/numbers/zforlist.cxx | 12 4 files changed, 18 insertions(+), 2 deletions(-) New commits: commit 09478b2211bbc9ec34d8de8452e30cf1254a250c Author: Laurent Balland-Poirier <laurent.balland-poir...@laposte.net> Date: Thu Feb 16 22:15:37 2017 +0100 tdf#106052 Treat SubFormat for "Precision as shown" Get precision from the correct subformat Change-Id: I458e5b3d1fb515864f19499ac9ac529e1d68a267 Reviewed-on: https://gerrit.libreoffice.org/34505 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Eike Rathke <er...@redhat.com> (cherry picked from commit e7f769bc67d3f132b477b3c253f8065243b9b8ac) Reviewed-on: https://gerrit.libreoffice.org/36367 diff --git a/include/svl/zforlist.hxx b/include/svl/zforlist.hxx index 36e468726a64..f03a79e0aa45 100644 --- a/include/svl/zforlist.hxx +++ b/include/svl/zforlist.hxx @@ -517,6 +517,9 @@ public: /// Count of decimals sal_uInt16 GetFormatPrecision( sal_uInt32 nFormat ) const; +/// Count of decimals with correct subformat according to fValue +sal_uInt16 GetFormatPrecision( sal_uInt32 nFormat, double fValue ) const; + /// Count of integer digits sal_uInt16 GetFormatIntegerDigits( sal_uInt32 nFormat ) const; diff --git a/include/svl/zformat.hxx b/include/svl/zformat.hxx index dbfa04858c28..34525acad43e 100644 --- a/include/svl/zformat.hxx +++ b/include/svl/zformat.hxx @@ -219,7 +219,8 @@ public: sal_uInt16 GetSubformatIndex( double fNumber ) const; /// Count of decimal precision -sal_uInt16 GetFormatPrecision() const { return NumFor[0].Info().nCntPost; } +sal_uInt16 GetFormatPrecision( sal_uInt16 nIx = 0 ) const +{ return NumFor[nIx].Info().nCntPost; } /// Count of integer digits sal_uInt16 GetFormatIntegerDigits() const { return NumFor[0].Info().nCntPre; } diff --git a/sc/source/core/data/documen4.cxx b/sc/source/core/data/documen4.cxx index fed6c0d043f0..6a1110b6cd80 100644 --- a/sc/source/core/data/documen4.cxx +++ b/sc/source/core/data/documen4.cxx @@ -660,7 +660,7 @@ double ScDocument::RoundValueAsShown( double fVal, sal_uInt32 nFormat ) const short nPrecision; if ((nFormat % SV_COUNTRY_LANGUAGE_OFFSET) != 0) { -nPrecision = (short)pFormat->GetFormatPrecision(); +nPrecision = (short)GetFormatTable()->GetFormatPrecision( nFormat, fVal ); switch ( nType ) { case css::util::NumberFormat::PERCENT: // 0.41% == 0.0041 diff --git a/svl/source/numbers/zforlist.cxx b/svl/source/numbers/zforlist.cxx index 659e1b5b340d..108babe2da50 100644 --- a/svl/source/numbers/zforlist.cxx +++ b/svl/source/numbers/zforlist.cxx @@ -1981,6 +1981,18 @@ sal_uInt16 SvNumberFormatter::GetFormatPrecision( sal_uInt32 nFormat ) const return pFormatScanner->GetStandardPrec(); } +sal_uInt16 SvNumberFormatter::GetFormatPrecision( sal_uInt32 nFormat, double fValue ) const +{ +const SvNumberformat* pFormat = GetFormatEntry( nFormat ); +if ( pFormat ) +{ +sal_uInt16 nIx = pFormat->GetSubformatIndex( fValue ); +return pFormat->GetFormatPrecision( nIx ); +} +else +return pFormatScanner->GetStandardPrec(); +} + sal_uInt16 SvNumberFormatter::GetFormatIntegerDigits( sal_uInt32 nFormat ) const { const SvNumberformat* pFormat = GetFormatEntry( nFormat ); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: svl/qa
svl/qa/unit/svl.cxx | 40 +++- 1 file changed, 39 insertions(+), 1 deletion(-) New commits: commit bac6141665049e53c01715a88d46ca04d678ddf0 Author: Laurent Balland-Poirier <laurent.balland-poir...@laposte.net> Date: Fri Mar 17 19:44:10 2017 +0100 tdf#106190 Tests of fraction formats Improve error message if test fails Add more formats to test Need https://gerrit.libreoffice.org/35320/ Change-Id: I89f5071e12ff87cdf1c03912922918390531e972 Reviewed-on: https://gerrit.libreoffice.org/35377 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Eike Rathke <er...@redhat.com> diff --git a/svl/qa/unit/svl.cxx b/svl/qa/unit/svl.cxx index 8ac1dd722acc..99a1626f37cd 100644 --- a/svl/qa/unit/svl.cxx +++ b/svl/qa/unit/svl.cxx @@ -399,7 +399,16 @@ void Test::checkPreviewString(SvNumberFormatter& aFormatter, Color* pColor = nullptr; Color** ppColor = if (!aFormatter.GetPreviewString(sCode, fPreviewNumber, sStr, ppColor, eLang)) -CPPUNIT_FAIL("GetPreviewString() failed"); +{ +rtl::OString aMessage = "GetPreviewString( \""; +aMessage += rtl::OUStringToOString( sCode, RTL_TEXTENCODING_ASCII_US ); +aMessage += "\", "; +aMessage += rtl::OString::number( fPreviewNumber ); +aMessage += ", sStr, ppColor, "; +aMessage += rtl::OString::number( eLang ); +aMessage += " ) failed"; +CPPUNIT_FAIL( aMessage.getStr() ); +} CPPUNIT_ASSERT_EQUAL(sExpected, sStr); } @@ -1204,10 +1213,39 @@ void Test::testUserDefinedNumberFormats() sExpected = "before 1.2inside3E+0middle4 after"; checkPreviewString(aFormatter, sCode, 12345.667, eLang, sExpected); } +{ // tdf#106190: text after fraction bar +sCode = "?/ ?"; +sExpected = "11/ 9"; +checkPreviewString(aFormatter, sCode, 1.2345667, eLang, sExpected); +sCode = "?/ 12"; +sExpected = "15/ 12"; +checkPreviewString(aFormatter, sCode, 1.2345667, eLang, sExpected); +sCode = "# ?/\" divisor \"?"; +sExpected = "1 2/ divisor 9"; +checkPreviewString(aFormatter, sCode, 1.2345667, eLang, sExpected); +sCode = "# ?/\"divided by \"?"; +sExpected = "1 2/divided by 9"; +checkPreviewString(aFormatter, sCode, 1.2345667, eLang, sExpected); +sCode = "?/\" \"12"; +sExpected = "15/ 12"; +checkPreviewString(aFormatter, sCode, 1.2345667, eLang, sExpected); +sCode = "?/\\ 12"; +sExpected = "15/ 12"; +checkPreviewString(aFormatter, sCode, 1.2345667, eLang, sExpected); +sCode = "# ?/ ???"; +sExpected = "3 1/ 2 "; +checkPreviewString(aFormatter, sCode, 3.5, eLang, sExpected); +} { // Display 1.96 as 2 and not 1 1/1 sCode = "# ?/?"; sExpected = "2"; checkPreviewString(aFormatter, sCode, 1.96, eLang, sExpected); +sCode = "# ?/ ?"; +sExpected = "2 "; +checkPreviewString(aFormatter, sCode, 1.96, eLang, sExpected); +sCode = "# #/#"; +sExpected = "2"; +checkPreviewString(aFormatter, sCode, 1.96, eLang, sExpected); } { // tdf#79399 tdf#101462 Native Number Formats sCode = "[NatNum5][$-0404]General\\ "; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-3' - include/svl sc/source
include/svl/zformat.hxx |6 ++ sc/source/core/data/documen4.cxx |6 ++ 2 files changed, 12 insertions(+) New commits: commit 506b228992ccb5a12486e2a8607ee3c81e3467a1 Author: Laurent Balland-Poirier <laurent.balland-poir...@laposte.net> Date: Sun Mar 12 14:11:36 2017 +0100 tdf#106253 Precision as shown for thousand dividor Info().nThousand contains number of thousands dividors after which digits are not displayed, i.e. 12345 is displayed as 12 with format 0, (in en_US) Change-Id: Ifa5540f2efd8ab006a07eade53f7aa0d31a19eac Reviewed-on: https://gerrit.libreoffice.org/35097 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Eike Rathke <er...@redhat.com> (cherry picked from commit 60d7644a46970e6eaee882e0c5d65692da206c24) Reviewed-on: https://gerrit.libreoffice.org/35204 diff --git a/include/svl/zformat.hxx b/include/svl/zformat.hxx index 4d108815d9a7..ebd652c5e2ec 100644 --- a/include/svl/zformat.hxx +++ b/include/svl/zformat.hxx @@ -226,6 +226,12 @@ public: sal_uInt16 GetFormatIntegerDigits( sal_uInt16 nIx = 0 ) const { return NumFor[nIx].Info().nCntPre; } +/** Count of hidden integer digits with thousands dividor: + * formats like "0," to show only thousands + */ +sal_uInt16 GetThousandDivisorPrecision( sal_uInt16 nIx = 0 ) const +{ return NumFor[nIx].Info().nThousand * 3; } + //! Read/write access on a special sal_uInt16 component, may only be used on the //! standard format 0, 5000, ... and only by the number formatter! sal_uInt16 GetLastInsertKey() const diff --git a/sc/source/core/data/documen4.cxx b/sc/source/core/data/documen4.cxx index 6bb280b20d91..1cdc777fcd91 100644 --- a/sc/source/core/data/documen4.cxx +++ b/sc/source/core/data/documen4.cxx @@ -692,6 +692,12 @@ double ScDocument::RoundValueAsShown( double fVal, sal_uInt32 nFormat ) const { return pFormat->GetRoundFractionValue( fVal ); } +case css::util::NumberFormat::NUMBER: +case css::util::NumberFormat::CURRENCY: +{ // tdf#106253 Thousands dividors for format "0," +nPrecision -= pFormat->GetThousandDivisorPrecision( nIdx ); +break; +} } } else ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: extras/source
extras/source/templates/presnt/Alizarin.otp |binary extras/source/templates/presnt/BrightBlue.otp |binary extras/source/templates/presnt/DNA.otp |binary extras/source/templates/presnt/Focus.otp|binary extras/source/templates/presnt/Impress.otp |binary extras/source/templates/presnt/Inspiration.otp |binary extras/source/templates/presnt/LushGreen.otp|binary extras/source/templates/presnt/Metropolis.otp |binary extras/source/templates/presnt/Midnightblue.otp |binary extras/source/templates/presnt/Pencil.otp |binary extras/source/templates/presnt/Sunset.otp |binary extras/source/templates/presnt/Vintage.otp |binary extras/source/templates/presnt/Vivid.otp|binary 13 files changed New commits: commit 59cf94fac8e53d7f098eb2fbdf59d3a6aff254ce Author: Laurent Balland-Poirier <laurent.balland-poir...@laposte.net> Date: Thu Apr 20 21:28:01 2017 +0200 tdf#107027 Remove language specific tags in templates For all templates: Modify XML code to: Remove Configuration2 directory Remove lang specific tags in: - settings.xml - styles.xml Remove printer and grid parameters Alizarin.otp Change names of master slides Remove hard coded texts tdf#104087 BrightBlue.otp DNA.otp Remove hard coded texts Focus.otp Remove hard coded texts Change text "Your logo here" to "Logo" to be less lang specific Impress.otp Inspiration.otp LushGreen.otp Metropolis.otp Remove hard coded texts Midnightblue.otp Remove Outline frame on page 3 Pencil.otp Remove hard coded texts Resize title to not overlap picture Sunset.otp Remove hard coded texts Set title in bold Resize outline text zone to fit in page Vintage.otp Vivid.otp Remove texts in Notes page Remove hard coded texts Change-Id: If16c6c65e6650c1b6600e6324c0f931009023074 Reviewed-on: https://gerrit.libreoffice.org/36752 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Adolfo Jayme Barrientos <fit...@ubuntu.com> Tested-by: Adolfo Jayme Barrientos <fit...@ubuntu.com> diff --git a/extras/source/templates/presnt/Alizarin.otp b/extras/source/templates/presnt/Alizarin.otp index dcd05bbd2320..8a8252d5a0f0 100644 Binary files a/extras/source/templates/presnt/Alizarin.otp and b/extras/source/templates/presnt/Alizarin.otp differ diff --git a/extras/source/templates/presnt/BrightBlue.otp b/extras/source/templates/presnt/BrightBlue.otp index 542fb259908a..f9f7a4536407 100644 Binary files a/extras/source/templates/presnt/BrightBlue.otp and b/extras/source/templates/presnt/BrightBlue.otp differ diff --git a/extras/source/templates/presnt/DNA.otp b/extras/source/templates/presnt/DNA.otp index eb400b47120d..7640e9e1c2a2 100644 Binary files a/extras/source/templates/presnt/DNA.otp and b/extras/source/templates/presnt/DNA.otp differ diff --git a/extras/source/templates/presnt/Focus.otp b/extras/source/templates/presnt/Focus.otp index 18b3ecae210f..d99618e841f8 100644 Binary files a/extras/source/templates/presnt/Focus.otp and b/extras/source/templates/presnt/Focus.otp differ diff --git a/extras/source/templates/presnt/Impress.otp b/extras/source/templates/presnt/Impress.otp index ddf9a7eeb2be..9a33dcb7627c 100644 Binary files a/extras/source/templates/presnt/Impress.otp and b/extras/source/templates/presnt/Impress.otp differ diff --git a/extras/source/templates/presnt/Inspiration.otp b/extras/source/templates/presnt/Inspiration.otp index 18a30cfa7c68..18ec2148c61a 100644 Binary files a/extras/source/templates/presnt/Inspiration.otp and b/extras/source/templates/presnt/Inspiration.otp differ diff --git a/extras/source/templates/presnt/LushGreen.otp b/extras/source/templates/presnt/LushGreen.otp index 040e3bf8bd78..e2d6638e97dd 100644 Binary files a/extras/source/templates/presnt/LushGreen.otp and b/extras/source/templates/presnt/LushGreen.otp differ diff --git a/extras/source/templates/presnt/Metropolis.otp b/extras/source/templates/presnt/Metropolis.otp index 2af7d8a0ab75..f176ad79e9e9 100644 Binary files a/extras/source/templates/presnt/Metropolis.otp and b/extras/source/templates/presnt/Metropolis.otp differ diff --git a/extras/source/templates/presnt/Midnightblue.otp b/extras/source/templates/presnt/Midnightblue.otp index 981704cf26e4..962bafa3f6f6 100644 Binary files a/extras/source/templates/presnt/Midnightblue.otp and b/extras/source/templates/presnt/Midnightblue.otp differ diff --git a/extras/source/templates/presnt/Pencil.otp b/extras/source/templates/presnt/Pencil.otp index 549714bef5e1..fa12e50deaa5 100644 Binary files a/extras/source/templates/presnt/Pencil.otp and b/extras/source/templates/presnt/Pencil.otp differ diff --git a/extras/source/templates/presnt/Sunset.otp b/extras/source/te
[Libreoffice-commits] core.git: Branch 'libreoffice-5-3' - extras/source
extras/source/templates/presnt/Alizarin.otp |binary extras/source/templates/presnt/BrightBlue.otp |binary extras/source/templates/presnt/DNA.otp |binary extras/source/templates/presnt/Focus.otp|binary extras/source/templates/presnt/Impress.otp |binary extras/source/templates/presnt/Inspiration.otp |binary extras/source/templates/presnt/LushGreen.otp|binary extras/source/templates/presnt/Metropolis.otp |binary extras/source/templates/presnt/Midnightblue.otp |binary extras/source/templates/presnt/Pencil.otp |binary extras/source/templates/presnt/Sunset.otp |binary extras/source/templates/presnt/Vintage.otp |binary extras/source/templates/presnt/Vivid.otp|binary 13 files changed New commits: commit 37b91d3f3a332ae7540c556751d39836b1f3d622 Author: Laurent Balland-Poirier <laurent.balland-poir...@laposte.net> Date: Thu Apr 20 21:28:01 2017 +0200 tdf#107027 Remove language specific tags in templates For all templates: Modify XML code to: Remove Configuration2 directory Remove lang specific tags in: - settings.xml - styles.xml Remove printer and grid parameters Alizarin.otp Change names of master slides Remove hard coded texts tdf#104087 BrightBlue.otp DNA.otp Remove hard coded texts Focus.otp Remove hard coded texts Change text "Your logo here" to "Logo" to be less lang specific Impress.otp Inspiration.otp LushGreen.otp Metropolis.otp Remove hard coded texts Midnightblue.otp Remove Outline frame on page 3 Pencil.otp Remove hard coded texts Resize title to not overlap picture Sunset.otp Remove hard coded texts Set title in bold Resize outline text zone to fit in page Vintage.otp Vivid.otp Remove texts in Notes page Remove hard coded texts Change-Id: If16c6c65e6650c1b6600e6324c0f931009023074 Reviewed-on: https://gerrit.libreoffice.org/36752 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Adolfo Jayme Barrientos <fit...@ubuntu.com> Tested-by: Adolfo Jayme Barrientos <fit...@ubuntu.com> (cherry picked from commit 59cf94fac8e53d7f098eb2fbdf59d3a6aff254ce) Reviewed-on: https://gerrit.libreoffice.org/36773 diff --git a/extras/source/templates/presnt/Alizarin.otp b/extras/source/templates/presnt/Alizarin.otp index dcd05bbd2320..8a8252d5a0f0 100644 Binary files a/extras/source/templates/presnt/Alizarin.otp and b/extras/source/templates/presnt/Alizarin.otp differ diff --git a/extras/source/templates/presnt/BrightBlue.otp b/extras/source/templates/presnt/BrightBlue.otp index 542fb259908a..f9f7a4536407 100644 Binary files a/extras/source/templates/presnt/BrightBlue.otp and b/extras/source/templates/presnt/BrightBlue.otp differ diff --git a/extras/source/templates/presnt/DNA.otp b/extras/source/templates/presnt/DNA.otp index eb400b47120d..7640e9e1c2a2 100644 Binary files a/extras/source/templates/presnt/DNA.otp and b/extras/source/templates/presnt/DNA.otp differ diff --git a/extras/source/templates/presnt/Focus.otp b/extras/source/templates/presnt/Focus.otp index 18b3ecae210f..d99618e841f8 100644 Binary files a/extras/source/templates/presnt/Focus.otp and b/extras/source/templates/presnt/Focus.otp differ diff --git a/extras/source/templates/presnt/Impress.otp b/extras/source/templates/presnt/Impress.otp index ddf9a7eeb2be..9a33dcb7627c 100644 Binary files a/extras/source/templates/presnt/Impress.otp and b/extras/source/templates/presnt/Impress.otp differ diff --git a/extras/source/templates/presnt/Inspiration.otp b/extras/source/templates/presnt/Inspiration.otp index 18a30cfa7c68..18ec2148c61a 100644 Binary files a/extras/source/templates/presnt/Inspiration.otp and b/extras/source/templates/presnt/Inspiration.otp differ diff --git a/extras/source/templates/presnt/LushGreen.otp b/extras/source/templates/presnt/LushGreen.otp index 040e3bf8bd78..e2d6638e97dd 100644 Binary files a/extras/source/templates/presnt/LushGreen.otp and b/extras/source/templates/presnt/LushGreen.otp differ diff --git a/extras/source/templates/presnt/Metropolis.otp b/extras/source/templates/presnt/Metropolis.otp index 2af7d8a0ab75..f176ad79e9e9 100644 Binary files a/extras/source/templates/presnt/Metropolis.otp and b/extras/source/templates/presnt/Metropolis.otp differ diff --git a/extras/source/templates/presnt/Midnightblue.otp b/extras/source/templates/presnt/Midnightblue.otp index 981704cf26e4..962bafa3f6f6 100644 Binary files a/extras/source/templates/presnt/Midnightblue.otp and b/extras/source/templates/presnt/Midnightblue.otp differ diff --git a/extras/source/templates/presnt/Pencil.otp b/extras/source/templates/presnt/Pencil.otp index 549714bef5e1..fa12e50deaa5 100644 Binary files a/extras/source/templates/presnt/Pencil.otp and b/extr
[Libreoffice-commits] core.git: svl/source
svl/source/numbers/zformat.cxx |4 +-- svl/source/numbers/zforscan.cxx | 43 +--- svl/source/numbers/zforscan.hxx |1 3 files changed, 35 insertions(+), 13 deletions(-) New commits: commit b2738c6f67cb650ac32228f3cd20b9dfe4b41c9c Author: Laurent Balland-Poirier <laurent.balland-poir...@laposte.net> Date: Sun Feb 26 19:40:30 2017 +0100 tdf#106190 fix left alignment of denominator The bug was introduced with left aligment of denominator. Non feasable denominators were not tested and create infinite loop while inserting and removing the same space. This patch detects - if denominator starts just after fraction bar. Otherwise, format is faulty. - if a non digit is detected in the denominator, next part of format is treated as text This patch is changing behavior of some formats: "# ?/foo??" is treated as faulty format while it was considered as valid "# ?/??E?" is treated with 2 digits in denominator and "E?" at the end, while it was considered as faulty Change-Id: I0379a398dff79b6e21a44776c0d4356d066cdeab Reviewed-on: https://gerrit.libreoffice.org/34659 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Eike Rathke <er...@redhat.com> diff --git a/svl/source/numbers/zformat.cxx b/svl/source/numbers/zformat.cxx index 5d5349e..1de8ffc 100644 --- a/svl/source/numbers/zformat.cxx +++ b/svl/source/numbers/zformat.cxx @@ -2836,9 +2836,9 @@ bool SvNumberformat::ImpGetFractionOutput(double fNumber, sal_Int32 k; // Denominator bRes |= ImpNumberFill(sDiv, fNumber, k, j, nIx, NF_SYMBOLTYPE_FRAC); -if ( !bHideFraction ) +if ( !bHideFraction && sDenominatorFormat.getLength() > 0 ) { -while ( sDiv[0] == ' ' ) +while ( sDiv[0] == ' ' ) // left align denominator { sDiv.insert( sDenominatorFormat.getLength(), " " ); sDiv.remove( 0, 1 ); diff --git a/svl/source/numbers/zforscan.cxx b/svl/source/numbers/zforscan.cxx index 6b20938..485ec405 100644 --- a/svl/source/numbers/zforscan.cxx +++ b/svl/source/numbers/zforscan.cxx @@ -1079,6 +1079,7 @@ void ImpSvNumberformatScan::Reset() nCntExp = 0; bFrac = false; bBlank = false; +bDenomin = false; nNatNumModifier = 0; } @@ -1666,6 +1667,8 @@ sal_Int32 ImpSvNumberformatScan::FinalScan( OUString& rString ) } else if ( sStrArray[i][0] == ' ' ) nTypeArray[i] = NF_SYMBOLTYPE_FRACBLANK; +else if ( bFrac ) +bDenomin = true; // following elements are no more part of denominator } else if (nTypeArray[i] == NF_KEY_THAI_T) { @@ -1673,7 +1676,7 @@ sal_Int32 ImpSvNumberformatScan::FinalScan( OUString& rString ) sStrArray[i] = sKeyword[nTypeArray[i]]; } else if (sStrArray[i][0] >= '0' && - sStrArray[i][0] <= '9') + sStrArray[i][0] <= '9' && !bDenomin) // denominator was not yet found { OUString sDiv; sal_uInt16 j = i; @@ -1702,10 +1705,14 @@ sal_Int32 ImpSvNumberformatScan::FinalScan( OUString& rString ) { nCntPre++; } +if ( bFrac ) +bDenomin = true; // next content should be treated as outside denominator } } else { +if ( bFrac ) +bDenomin = true;// next content should be treated as outside denominator nTypeArray[i] = NF_SYMBOLTYPE_STRING; } nPos = nPos + sStrArray[i].getLength(); @@ -1741,19 +1748,27 @@ sal_Int32 ImpSvNumberformatScan::FinalScan( OUString& rString ) { return nPos;// Error } -nTypeArray[i] = NF_SYMBOLTYPE_DIGIT; -nPos = nPos + rStr.getLength(); -i++; -nCounter++; -while (i < nAnzStrings && - (sStrArray[i][0] == '#' || -sStrArray[i][0] == '0' || -sStrArray[i][0] == '?')) +if ( !bDenomin ) { nTypeArray[i] = NF_SYMBOLTYPE_DIGIT; -nPos = nPos + sStrArray[i].getLength(); -nCounter++; +nPos = nPos + rStr.getLength(); i++; +
[Libreoffice-commits] core.git: sc/qa
sc/qa/unit/ucalc.cxx | 103 +++ sc/qa/unit/ucalc.hxx |4 + 2 files changed, 107 insertions(+) New commits: commit 7496f7d3cae8a932dc43ede8a30a99289366a264 Author: Laurent Balland-Poirier <laurent.balland-poir...@laposte.net> Date: Wed Mar 1 08:56:58 2017 +0100 Tests for "Precision as shown" following tdf#105657 tdf#106052 I was unabled to add these test svl/qa/unit/svl.cxx because they required ScDocument::RoundValueAsShown() Found that other formats are not supported by "Precision as shown" option: - engineering tdf#106252 - thousand tdf#106253 Change-Id: Iaf98c404cabec0f5c69f94f2bf863351487fe9d7 Reviewed-on: https://gerrit.libreoffice.org/34750 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Eike Rathke <er...@redhat.com> diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx index cf0e984..9e52977 100644 --- a/sc/qa/unit/ucalc.cxx +++ b/sc/qa/unit/ucalc.cxx @@ -6660,6 +6660,109 @@ void Test::setCalcAsShown(ScDocument* pDoc, bool bCalcAsShown) pDoc->SetDocOptions(aOpt); } +void Test::checkPrecisionAsShown( OUString& rCode, double fValue, double fExpectedRoundVal ) +{ +SvNumberFormatter* pFormatter = m_pDoc->GetFormatTable(); +sal_uInt32 nFormat = pFormatter->GetEntryKey( rCode ); +if ( nFormat == NUMBERFORMAT_ENTRY_NOT_FOUND ) +{ +sal_Int32 nCheckPos = 0; +short nType; +pFormatter->PutEntry( rCode, nCheckPos, nType, nFormat ); +CPPUNIT_ASSERT_EQUAL( nCheckPos, sal_Int32(0) ); +} +double fRoundValue = m_pDoc->RoundValueAsShown( fValue, nFormat ); +rtl::OString aMessage = "Format \""; +aMessage += rtl::OUStringToOString( rCode, RTL_TEXTENCODING_ASCII_US ); +aMessage += "\" is not correctly rounded"; +CPPUNIT_ASSERT_EQUAL_MESSAGE( aMessage.getStr(), fExpectedRoundVal, fRoundValue ); +} + +void Test::testPrecisionAsShown() +{ +m_pDoc->InsertTab(0, "Test"); + +// Turn on "precision as shown" option. +setCalcAsShown( m_pDoc, true); + +OUString aCode; +double fValue, fExpectedRoundVal; +{ // decimal rounding +aCode = "0.00"; +fValue = 1.0/3.0; +fExpectedRoundVal = 0.33; +checkPrecisionAsShown( aCode, fValue, fExpectedRoundVal ); +fValue = -10.001; +fExpectedRoundVal = -10.0; +checkPrecisionAsShown( aCode, fValue, fExpectedRoundVal ); +} +{ // thousand rounding buguous tdf#106253 +aCode = "0,,"; +fValue = 4.0e9 / 7.0; +fExpectedRoundVal = 571e6; // actual is 571428571 +//checkPrecisionAsShown( aCode, fValue, fExpectedRoundVal ); +fValue = -4.0e8 / 7.0; +fExpectedRoundVal = -57e6; // actual is 57142857 +//checkPrecisionAsShown( aCode, fValue, fExpectedRoundVal ); +} +{ // percent rounding +aCode = "0.00%"; +fValue = 4.0 / 7.0; +fExpectedRoundVal = 0.5714; +checkPrecisionAsShown( aCode, fValue, fExpectedRoundVal ); +fValue = -4.0 / 7.0; +fExpectedRoundVal = -0.5714; +checkPrecisionAsShown( aCode, fValue, fExpectedRoundVal ); +} +{ // scientific rounding +aCode = "0.00E0"; +fValue = 40.0 / 7.0; +fExpectedRoundVal = 57100.0; +checkPrecisionAsShown( aCode, fValue, fExpectedRoundVal ); +fValue = 4.0 / 7.0; +fExpectedRoundVal = 5.71e-5; +checkPrecisionAsShown( aCode, fValue, fExpectedRoundVal ); +// engineering rounding bugous!!! tdf#106252 +aCode = "##0.000E0"; +fValue = 40.0 / 7.0; +fExpectedRoundVal = 57143.0; // actual is 57140 +//checkPrecisionAsShown( aCode, fValue, fExpectedRoundVal ); +fValue = 4.0 / 7.0; +fExpectedRoundVal = 5.7143e-5; // actual is 5.714e-05 +//checkPrecisionAsShown( aCode, fValue, fExpectedRoundVal ); +} +{ // fraction rounding tdf#105657 +aCode = "# ?/?"; +fValue = 0.35; +fExpectedRoundVal = 1.0/3.0; +checkPrecisionAsShown( aCode, fValue, fExpectedRoundVal ); +fValue = -0.35; +fExpectedRoundVal = -1.0/3.0; +checkPrecisionAsShown( aCode, fValue, fExpectedRoundVal ); +} +{ // exact fraction +aCode = "# ?/??"; +fValue = 0.35; +fExpectedRoundVal = 0.35; +checkPrecisionAsShown( aCode, fValue, fExpectedRoundVal ); +fValue = -0.35; +fExpectedRoundVal = -0.35; +checkPrecisionAsShown( aCode, fValue, fExpectedRoundVal ); +} +{ // several sub-formats tdf#106052 +aCode = "0.00;-0.000"; +fValue = 1.0/3.0; +fExpectedRoundVal = 0.33; +checkPrecisionAsShown( aCode, fValue, fExpect
[Libreoffice-commits] core.git: svl/source
svl/source/numbers/zformat.cxx |3 ++- svl/source/numbers/zforscan.cxx | 10 +- 2 files changed, 7 insertions(+), 6 deletions(-) New commits: commit 4e1448d43e08d3f0a6ff67e75346e9559ad2af09 Author: Laurent Balland-Poirier <laurent.balland-poir...@laposte.net> Date: Sun Mar 12 23:33:24 2017 +0100 Following tdf#106190 Treat blank after fraction bar To consider that denominator is found (bDenom=true) there must be some digits found after fraction bar Dummy format # ?/ ? can now work again (even with blank as thousands delimiter). However such format can not be saved (except in XLS) Change-Id: I657e97e09a6ae4c08a29ad6d0b586c85a9968e3d Reviewed-on: https://gerrit.libreoffice.org/35111 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Eike Rathke <er...@redhat.com> diff --git a/svl/source/numbers/zformat.cxx b/svl/source/numbers/zformat.cxx index 4bd1a9e..2d1f874 100644 --- a/svl/source/numbers/zformat.cxx +++ b/svl/source/numbers/zformat.cxx @@ -2212,7 +2212,8 @@ OUString lcl_GetDenominatorString(const ImpSvNumberformatInfo , sal_uInt16 { if( rInfo.nTypeArray[i] == NF_SYMBOLTYPE_FRAC ) { -for( i++; i < nAnz; i++ ) +while ( ( ++i < nAnz ) && rInfo.nTypeArray[i] == NF_SYMBOLTYPE_STRING ); +for( ; i < nAnz; i++ ) { if( rInfo.nTypeArray[i] == NF_SYMBOLTYPE_FRAC_FDIV || rInfo.nTypeArray[i] == NF_SYMBOLTYPE_DIGIT ) aDenominatorString.append( rInfo.sStrArray[i] ); diff --git a/svl/source/numbers/zforscan.cxx b/svl/source/numbers/zforscan.cxx index 5644c2b..788cd42 100644 --- a/svl/source/numbers/zforscan.cxx +++ b/svl/source/numbers/zforscan.cxx @@ -1670,7 +1670,7 @@ sal_Int32 ImpSvNumberformatScan::FinalScan( OUString& rString ) } else if ( sStrArray[i][0] == ' ' ) nTypeArray[i] = NF_SYMBOLTYPE_FRACBLANK; -else if ( bFrac ) +else if ( bFrac && ( nCounter > 0 ) ) bDenomin = true; // following elements are no more part of denominator } else if (nTypeArray[i] == NF_KEY_THAI_T) @@ -1714,7 +1714,7 @@ sal_Int32 ImpSvNumberformatScan::FinalScan( OUString& rString ) } else { -if ( bFrac ) +if ( bFrac && ( nCounter > 0 ) ) bDenomin = true;// next content should be treated as outside denominator nTypeArray[i] = NF_SYMBOLTYPE_STRING; } @@ -1834,7 +1834,7 @@ sal_Int32 ImpSvNumberformatScan::FinalScan( OUString& rString ) else { nTypeArray[i] = NF_SYMBOLTYPE_STRING; -if ( bFrac ) +if ( bFrac && (nCounter > 0) ) bDenomin = true; // end of denominator } } @@ -2002,7 +2002,7 @@ sal_Int32 ImpSvNumberformatScan::FinalScan( OUString& rString ) nCntPre = nCounter; nCounter = 0; } -if ( bFrac ) +if ( bFrac && (nCounter > 0) ) bDenomin = true; // next content is not part of denominator nTypeArray[i] = NF_SYMBOLTYPE_STRING; nPos = nPos + sStrArray[i].getLength(); @@ -2010,7 +2010,7 @@ sal_Int32 ImpSvNumberformatScan::FinalScan( OUString& rString ) else { nTypeArray[i] = NF_SYMBOLTYPE_STRING; -if ( bFrac ) +if ( bFrac && (nCounter > 0) ) bDenomin = true; // next content is not part of denominator nPos = nPos + rStr.getLength(); i++; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: include/svl sc/qa sc/source
include/svl/zformat.hxx |3 - sc/qa/unit/ucalc.cxx | 103 +-- sc/source/core/data/documen4.cxx | 20 ++- 3 files changed, 97 insertions(+), 29 deletions(-) New commits: commit 5f2db66ad0de6fbbae309850516e17eaa17934cb Author: Laurent Balland-Poirier <laurent.balland-poir...@laposte.net> Date: Fri Mar 3 21:51:26 2017 +0100 tdf#106252 Engineering notation for Precision as shown with more tests Change-Id: Ifc77b847af4eaaa3c85e904e46c2663b6d768241 Reviewed-on: https://gerrit.libreoffice.org/35089 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Eike Rathke <er...@redhat.com> diff --git a/include/svl/zformat.hxx b/include/svl/zformat.hxx index 85250ac..1dd05d2 100644 --- a/include/svl/zformat.hxx +++ b/include/svl/zformat.hxx @@ -223,7 +223,8 @@ public: { return NumFor[nIx].Info().nCntPost; } /// Count of integer digits -sal_uInt16 GetFormatIntegerDigits() const { return NumFor[0].Info().nCntPre; } +sal_uInt16 GetFormatIntegerDigits( sal_uInt16 nIx = 0 ) const +{ return NumFor[nIx].Info().nCntPre; } //! Read/write access on a special sal_uInt16 component, may only be used on the //! standard format 0, 1, ... and only by the number formatter! diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx index 9a51d92..86aa877 100644 --- a/sc/qa/unit/ucalc.cxx +++ b/sc/qa/unit/ucalc.cxx @@ -6773,10 +6773,12 @@ void Test::testPrecisionAsShown() aCode = "0.00"; fValue = 1.0/3.0; fExpectedRoundVal = 0.33; -checkPrecisionAsShown( aCode, fValue, fExpectedRoundVal ); -fValue = -10.001; -fExpectedRoundVal = -10.0; -checkPrecisionAsShown( aCode, fValue, fExpectedRoundVal ); +checkPrecisionAsShown( aCode, fValue, fExpectedRoundVal ); +checkPrecisionAsShown( aCode, -fValue, -fExpectedRoundVal ); +fValue = 10.001; +fExpectedRoundVal = 10.0; +checkPrecisionAsShown( aCode, fValue, fExpectedRoundVal ); +checkPrecisionAsShown( aCode, -fValue, -fExpectedRoundVal ); } { // thousand rounding bogus tdf#106253 aCode = "0,,"; @@ -6791,54 +6793,105 @@ void Test::testPrecisionAsShown() aCode = "0.00%"; fValue = 4.0 / 7.0; fExpectedRoundVal = 0.5714; -checkPrecisionAsShown( aCode, fValue, fExpectedRoundVal ); -fValue = -4.0 / 7.0; -fExpectedRoundVal = -0.5714; -checkPrecisionAsShown( aCode, fValue, fExpectedRoundVal ); +checkPrecisionAsShown( aCode, fValue, fExpectedRoundVal ); +checkPrecisionAsShown( aCode, -fValue, -fExpectedRoundVal ); +fValue = 40.0 / 7.0; +fExpectedRoundVal = 5.7143; +checkPrecisionAsShown( aCode, fValue, fExpectedRoundVal ); +checkPrecisionAsShown( aCode, -fValue, -fExpectedRoundVal ); } { // scientific rounding aCode = "0.00E0"; fValue = 40.0 / 7.0; fExpectedRoundVal = 57100.0; -checkPrecisionAsShown( aCode, fValue, fExpectedRoundVal ); +checkPrecisionAsShown( aCode, fValue, fExpectedRoundVal ); +checkPrecisionAsShown( aCode, -fValue, -fExpectedRoundVal ); fValue = 4.0 / 7.0; fExpectedRoundVal = 5.71e-5; -checkPrecisionAsShown( aCode, fValue, fExpectedRoundVal ); -// engineering rounding bogus!!! tdf#106252 +checkPrecisionAsShown( aCode, fValue, fExpectedRoundVal ); +checkPrecisionAsShown( aCode, -fValue, -fExpectedRoundVal ); +// engineering rounding tdf#106252 aCode = "##0.000E0"; fValue = 40.0 / 7.0; -fExpectedRoundVal = 57143.0; // actual is 57140 -//checkPrecisionAsShown( aCode, fValue, fExpectedRoundVal ); +fExpectedRoundVal = 57.143e3; +checkPrecisionAsShown( aCode, fValue, fExpectedRoundVal ); +checkPrecisionAsShown( aCode, -fValue, -fExpectedRoundVal ); +fValue = 400.0 / 7.0; +fExpectedRoundVal = 571.429e3; +checkPrecisionAsShown( aCode, fValue, fExpectedRoundVal ); +checkPrecisionAsShown( aCode, -fValue, -fExpectedRoundVal ); +fValue = 4000.0 / 7.0; +fExpectedRoundVal = 5.714e6; +checkPrecisionAsShown( aCode, fValue, fExpectedRoundVal ); +checkPrecisionAsShown( aCode, -fValue, -fExpectedRoundVal ); fValue = 4.0 / 7.0; -fExpectedRoundVal = 5.7143e-5; // actual is 5.714e-05 -//checkPrecisionAsShown( aCode, fValue, fExpectedRoundVal ); +fExpectedRoundVal = 57.143e-6; +checkPrecisionAsShown( aCode, fValue, fExpectedRoundVal ); +checkPrecisionAsShown( aCode, -fValue, -fExpectedRoundVal ); +fValue = 4.0 / 7000.0; +fExpectedRoundVal = 571.429e-6; +checkPrecisionAsShown( aCode, fValue,
[Libreoffice-commits] core.git: svl/source
svl/source/numbers/zforscan.cxx |2 +- svl/source/numbers/zforscan.hxx |1 - 2 files changed, 1 insertion(+), 2 deletions(-) New commits: commit 90cf564324ed9421f52742a0955bacab9407a872 Author: Laurent Balland-Poirier <laurent.balland-poir...@laposte.net> Date: Mon Mar 6 06:47:32 2017 +0100 tdf#106190 Move meber variable to local Update b2738c6f67cb650ac32228f3cd20b9dfe4b41c9c Change-Id: I8417dcf948e72376c7e67bee78df56c3021b55de Reviewed-on: https://gerrit.libreoffice.org/34913 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Eike Rathke <er...@redhat.com> diff --git a/svl/source/numbers/zforscan.cxx b/svl/source/numbers/zforscan.cxx index 485ec405..7dbbb99 100644 --- a/svl/source/numbers/zforscan.cxx +++ b/svl/source/numbers/zforscan.cxx @@ -1079,7 +1079,6 @@ void ImpSvNumberformatScan::Reset() nCntExp = 0; bFrac = false; bBlank = false; -bDenomin = false; nNatNumModifier = 0; } @@ -1562,6 +1561,7 @@ sal_Int32 ImpSvNumberformatScan::FinalScan( OUString& rString ) bDecSep = false; // reset in case already used in TypeCheck bool bThaiT = false; // Thai T NatNum modifier present bool bTimePart = false; +bool bDenomin = false; // Set when reading end of denominator switch (eScannedType) { diff --git a/svl/source/numbers/zforscan.hxx b/svl/source/numbers/zforscan.hxx index 62a6629..30fc838 100644 --- a/svl/source/numbers/zforscan.hxx +++ b/svl/source/numbers/zforscan.hxx @@ -174,7 +174,6 @@ private: // Private section bool bExp; // Set when reading E bool bFrac; // Set when reading / bool bBlank;// Set when reading ' ' (Fraction) -bool bDenomin; // Set when reading end of denominator bool bDecSep; // Set on first , mutable bool bKeywordsNeedInit; // Locale dependent keywords need to be initialized mutable bool bCompatCurNeedInit;// Locale dependent compatibility currency need to be initialized ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-3' - svl/source
svl/source/numbers/zforscan.cxx |2 +- svl/source/numbers/zforscan.hxx |1 - 2 files changed, 1 insertion(+), 2 deletions(-) New commits: commit 439c820e873b6f6c1c9ce189d05ea7426c102b46 Author: Laurent Balland-Poirier <laurent.balland-poir...@laposte.net> Date: Mon Mar 6 06:47:32 2017 +0100 tdf#106190 Move meber variable to local Update b2738c6f67cb650ac32228f3cd20b9dfe4b41c9c Change-Id: I8417dcf948e72376c7e67bee78df56c3021b55de Reviewed-on: https://gerrit.libreoffice.org/34913 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Eike Rathke <er...@redhat.com> (cherry picked from commit 90cf564324ed9421f52742a0955bacab9407a872) Reviewed-on: https://gerrit.libreoffice.org/34921 diff --git a/svl/source/numbers/zforscan.cxx b/svl/source/numbers/zforscan.cxx index 5529dcc..34137cb 100644 --- a/svl/source/numbers/zforscan.cxx +++ b/svl/source/numbers/zforscan.cxx @@ -1079,7 +1079,6 @@ void ImpSvNumberformatScan::Reset() nCntExp = 0; bFrac = false; bBlank = false; -bDenomin = false; nNatNumModifier = 0; } @@ -1562,6 +1561,7 @@ sal_Int32 ImpSvNumberformatScan::FinalScan( OUString& rString ) bDecSep = false; // reset in case already used in TypeCheck bool bThaiT = false; // Thai T NatNum modifier present bool bTimePart = false; +bool bDenomin = false; // Set when reading end of denominator switch (eScannedType) { diff --git a/svl/source/numbers/zforscan.hxx b/svl/source/numbers/zforscan.hxx index e0cec64..001abe6 100644 --- a/svl/source/numbers/zforscan.hxx +++ b/svl/source/numbers/zforscan.hxx @@ -174,7 +174,6 @@ private: // Private section bool bExp; // Set when reading E bool bFrac; // Set when reading / bool bBlank;// Set when reading ' ' (Fraction) -bool bDenomin; // Set when reading end of denominator bool bDecSep; // Set on first , mutable bool bKeywordsNeedInit; // Locale dependent keywords need to be initialized mutable bool bCompatCurNeedInit;// Locale dependent compatibility currency need to be initialized ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-3-1' - svl/source
svl/source/numbers/zformat.cxx |4 +-- svl/source/numbers/zforscan.cxx | 43 +--- svl/source/numbers/zforscan.hxx |1 3 files changed, 35 insertions(+), 13 deletions(-) New commits: commit 8eb29021352dd7d92f3fa225e18a85cd780e04db Author: Laurent Balland-Poirier <laurent.balland-poir...@laposte.net> Date: Sun Feb 26 19:40:30 2017 +0100 tdf#106190 fix left alignment of denominator The bug was introduced with left aligment of denominator. Non feasable denominators were not tested and create infinite loop while inserting and removing the same space. This patch detects - if denominator starts just after fraction bar. Otherwise, format is faulty. - if a non digit is detected in the denominator, next part of format is treated as text This patch is changing behavior of some formats: "# ?/foo??" is treated as faulty format while it was considered as valid "# ?/??E?" is treated with 2 digits in denominator and "E?" at the end, while it was considered as faulty Change-Id: I0379a398dff79b6e21a44776c0d4356d066cdeab Reviewed-on: https://gerrit.libreoffice.org/34659 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Eike Rathke <er...@redhat.com> (cherry picked from commit b2738c6f67cb650ac32228f3cd20b9dfe4b41c9c) Reviewed-on: https://gerrit.libreoffice.org/34826 Reviewed-by: Michael Stahl <mst...@redhat.com> Reviewed-by: Christian Lohmaier <lohmaier+libreoff...@googlemail.com> Tested-by: Christian Lohmaier <lohmaier+libreoff...@googlemail.com> diff --git a/svl/source/numbers/zformat.cxx b/svl/source/numbers/zformat.cxx index ac0c608..09e024e 100644 --- a/svl/source/numbers/zformat.cxx +++ b/svl/source/numbers/zformat.cxx @@ -2815,9 +2815,9 @@ bool SvNumberformat::ImpGetFractionOutput(double fNumber, sal_Int32 k; // Denominator bRes |= ImpNumberFill(sDiv, fNumber, k, j, nIx, NF_SYMBOLTYPE_FRAC); -if ( !bHideFraction ) +if ( !bHideFraction && sDenominatorFormat.getLength() > 0 ) { -while ( sDiv[0] == ' ' ) +while ( sDiv[0] == ' ' ) // left align denominator { sDiv.insert( sDenominatorFormat.getLength(), " " ); sDiv.remove( 0, 1 ); diff --git a/svl/source/numbers/zforscan.cxx b/svl/source/numbers/zforscan.cxx index 0542cf3..5529dcc 100644 --- a/svl/source/numbers/zforscan.cxx +++ b/svl/source/numbers/zforscan.cxx @@ -1079,6 +1079,7 @@ void ImpSvNumberformatScan::Reset() nCntExp = 0; bFrac = false; bBlank = false; +bDenomin = false; nNatNumModifier = 0; } @@ -1666,6 +1667,8 @@ sal_Int32 ImpSvNumberformatScan::FinalScan( OUString& rString ) } else if ( sStrArray[i][0] == ' ' ) nTypeArray[i] = NF_SYMBOLTYPE_FRACBLANK; +else if ( bFrac ) +bDenomin = true; // following elements are no more part of denominator } else if (nTypeArray[i] == NF_KEY_THAI_T) { @@ -1673,7 +1676,7 @@ sal_Int32 ImpSvNumberformatScan::FinalScan( OUString& rString ) sStrArray[i] = sKeyword[nTypeArray[i]]; } else if (sStrArray[i][0] >= '0' && - sStrArray[i][0] <= '9') + sStrArray[i][0] <= '9' && !bDenomin) // denominator was not yet found { OUString sDiv; sal_uInt16 j = i; @@ -1702,10 +1705,14 @@ sal_Int32 ImpSvNumberformatScan::FinalScan( OUString& rString ) { nCntPre++; } +if ( bFrac ) +bDenomin = true; // next content should be treated as outside denominator } } else { +if ( bFrac ) +bDenomin = true;// next content should be treated as outside denominator nTypeArray[i] = NF_SYMBOLTYPE_STRING; } nPos = nPos + sStrArray[i].getLength(); @@ -1741,19 +1748,27 @@ sal_Int32 ImpSvNumberformatScan::FinalScan( OUString& rString ) { return nPos;// Error } -nTypeArray[i] = NF_SYMBOLTYPE_DIGIT; -nPos = nPos + rStr.getLength(); -i++; -nCounter++; -while (i < nAnzStrings && - (sStrArray[i][0] == '#' || -sStrArray[i][0] == '0' || -sStrArray[i][0] == '?')) +
[Libreoffice-commits] core.git: Branch 'libreoffice-5-3' - svl/source
svl/source/numbers/zformat.cxx |4 +-- svl/source/numbers/zforscan.cxx | 43 +--- svl/source/numbers/zforscan.hxx |1 3 files changed, 35 insertions(+), 13 deletions(-) New commits: commit 5be9863007d28ce543b0030ffef4c7d955a8e283 Author: Laurent Balland-Poirier <laurent.balland-poir...@laposte.net> Date: Sun Feb 26 19:40:30 2017 +0100 tdf#106190 fix left alignment of denominator The bug was introduced with left aligment of denominator. Non feasable denominators were not tested and create infinite loop while inserting and removing the same space. This patch detects - if denominator starts just after fraction bar. Otherwise, format is faulty. - if a non digit is detected in the denominator, next part of format is treated as text This patch is changing behavior of some formats: "# ?/foo??" is treated as faulty format while it was considered as valid "# ?/??E?" is treated with 2 digits in denominator and "E?" at the end, while it was considered as faulty Change-Id: I0379a398dff79b6e21a44776c0d4356d066cdeab Reviewed-on: https://gerrit.libreoffice.org/34659 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Eike Rathke <er...@redhat.com> (cherry picked from commit b2738c6f67cb650ac32228f3cd20b9dfe4b41c9c) Reviewed-on: https://gerrit.libreoffice.org/34825 diff --git a/svl/source/numbers/zformat.cxx b/svl/source/numbers/zformat.cxx index ac0c608..09e024e 100644 --- a/svl/source/numbers/zformat.cxx +++ b/svl/source/numbers/zformat.cxx @@ -2815,9 +2815,9 @@ bool SvNumberformat::ImpGetFractionOutput(double fNumber, sal_Int32 k; // Denominator bRes |= ImpNumberFill(sDiv, fNumber, k, j, nIx, NF_SYMBOLTYPE_FRAC); -if ( !bHideFraction ) +if ( !bHideFraction && sDenominatorFormat.getLength() > 0 ) { -while ( sDiv[0] == ' ' ) +while ( sDiv[0] == ' ' ) // left align denominator { sDiv.insert( sDenominatorFormat.getLength(), " " ); sDiv.remove( 0, 1 ); diff --git a/svl/source/numbers/zforscan.cxx b/svl/source/numbers/zforscan.cxx index 0542cf3..5529dcc 100644 --- a/svl/source/numbers/zforscan.cxx +++ b/svl/source/numbers/zforscan.cxx @@ -1079,6 +1079,7 @@ void ImpSvNumberformatScan::Reset() nCntExp = 0; bFrac = false; bBlank = false; +bDenomin = false; nNatNumModifier = 0; } @@ -1666,6 +1667,8 @@ sal_Int32 ImpSvNumberformatScan::FinalScan( OUString& rString ) } else if ( sStrArray[i][0] == ' ' ) nTypeArray[i] = NF_SYMBOLTYPE_FRACBLANK; +else if ( bFrac ) +bDenomin = true; // following elements are no more part of denominator } else if (nTypeArray[i] == NF_KEY_THAI_T) { @@ -1673,7 +1676,7 @@ sal_Int32 ImpSvNumberformatScan::FinalScan( OUString& rString ) sStrArray[i] = sKeyword[nTypeArray[i]]; } else if (sStrArray[i][0] >= '0' && - sStrArray[i][0] <= '9') + sStrArray[i][0] <= '9' && !bDenomin) // denominator was not yet found { OUString sDiv; sal_uInt16 j = i; @@ -1702,10 +1705,14 @@ sal_Int32 ImpSvNumberformatScan::FinalScan( OUString& rString ) { nCntPre++; } +if ( bFrac ) +bDenomin = true; // next content should be treated as outside denominator } } else { +if ( bFrac ) +bDenomin = true;// next content should be treated as outside denominator nTypeArray[i] = NF_SYMBOLTYPE_STRING; } nPos = nPos + sStrArray[i].getLength(); @@ -1741,19 +1748,27 @@ sal_Int32 ImpSvNumberformatScan::FinalScan( OUString& rString ) { return nPos;// Error } -nTypeArray[i] = NF_SYMBOLTYPE_DIGIT; -nPos = nPos + rStr.getLength(); -i++; -nCounter++; -while (i < nAnzStrings && - (sStrArray[i][0] == '#' || -sStrArray[i][0] == '0' || -sStrArray[i][0] == '?')) +if ( !bDenomin ) { nTypeArray[i] = NF_SYMBOLTYPE_DIGIT; -nPos = nPos + sStrArray[i].getLength(); -nCounter++;
[Libreoffice-commits] core.git: sd/source sd/uiconfig
sd/source/ui/dlg/copydlg.cxx| 19 +++ sd/uiconfig/sdraw/ui/copydlg.ui |4 ++-- 2 files changed, 21 insertions(+), 2 deletions(-) New commits: commit 0b133fdb67cc56fba46ec355283144e611e8bf83 Author: Laurent Balland-Poirier <laurent.balland-poir...@laposte.net> Date: Sat Apr 22 01:22:11 2017 +0200 tdf#61561 Increase limitation placement and enlargement Limit placement to +/- page size Limit enlargement to - object size/+ page size Change-Id: I180dc8dfd3ce24e917b9e0893bb640aa9995293b Reviewed-on: https://gerrit.libreoffice.org/36815 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/sd/source/ui/dlg/copydlg.cxx b/sd/source/ui/dlg/copydlg.cxx index 80209f44ddf1..fc39e1b5 100644 --- a/sd/source/ui/dlg/copydlg.cxx +++ b/sd/source/ui/dlg/copydlg.cxx @@ -124,6 +124,25 @@ void CopyDlg::dispose() */ void CopyDlg::Reset() { +// Set Min/Max values +::tools::Rectangle aRect = mpView->GetAllMarkedRect(); +Size aPageSize = mpView->GetSdrPageView()->GetPage()->GetSize(); +SetMetricValue( *m_pMtrFldMoveX, Fraction(100L) / maUIScale, MapUnit::Map100thMM); +double fScaleFactor = m_pMtrFldMoveX->GetValue()/100.0; + +long nPageWidth = aPageSize.Width() * fScaleFactor; +long nPageHeight = aPageSize.Height() * fScaleFactor; +long nRectWidth = aRect.GetWidth() * fScaleFactor; +long nRectHeight = aRect.GetHeight() * fScaleFactor; +m_pMtrFldMoveX->SetMin( -nPageWidth ); +m_pMtrFldMoveX->SetMax( nPageWidth ); +m_pMtrFldMoveY->SetMin( -nPageHeight ); +m_pMtrFldMoveY->SetMax( nPageHeight ); +m_pMtrFldWidth->SetMin( -nRectWidth ); +m_pMtrFldWidth->SetMax( nPageWidth ); +m_pMtrFldHeight->SetMin( -nRectHeight ); +m_pMtrFldHeight->SetMax( nPageHeight ); + const SfxPoolItem* pPoolItem = nullptr; OUString aStr( GetExtraData() ); diff --git a/sd/uiconfig/sdraw/ui/copydlg.ui b/sd/uiconfig/sdraw/ui/copydlg.ui index 87baa25e17ae..8ba01c9f8aa3 100644 --- a/sd/uiconfig/sdraw/ui/copydlg.ui +++ b/sd/uiconfig/sdraw/ui/copydlg.ui @@ -16,8 +16,8 @@ 10 --120 -120 +-100 +100 0.10001 1 ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] help.git: source/text
source/text/schart/00/0004.xhp |2 +- source/text/schart/01/04050100.xhp |4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) New commits: commit f930a0c40fa65c778b9e6b2fa75d7581bb3f82dc Author: Laurent Balland-Poirier <laurent.balland-poir...@laposte.net> Date: Sat Feb 25 15:09:48 2017 +0100 Update menu entry for Insert Trend Line in chart Add emph tag in the same way as other menu commands Change-Id: I968b391485b1cb4fa8083704ca91fd44af087b1f Reviewed-on: https://gerrit.libreoffice.org/34644 Reviewed-by: Olivier Hallot <olivier.hal...@edx.srv.br> Tested-by: Olivier Hallot <olivier.hal...@edx.srv.br> diff --git a/source/text/schart/00/0004.xhp b/source/text/schart/00/0004.xhp index 2f105d1e6..816a88aca 100644 --- a/source/text/schart/00/0004.xhp +++ b/source/text/schart/00/0004.xhp @@ -89,7 +89,7 @@ Choose Insert - X Error Bars or Insert - Y Error Bars (Charts) -Choose Insert - Trend Lines (Charts) +Choose Insert - Trend Line (Charts) Choose Insert - Special Character (Charts) diff --git a/source/text/schart/01/04050100.xhp b/source/text/schart/01/04050100.xhp index 367cf541f..c0037b468 100644 --- a/source/text/schart/01/04050100.xhp +++ b/source/text/schart/01/04050100.xhp @@ -116,10 +116,10 @@ -To insert a trend line for a data series, select the data series in the chart. Choose Insert - Trend Lines, or right-click to open the context menu, and choose Insert - Trend Line. +To insert a trend line for a data series, select the data series in the chart. Choose Insert - Trend Line, or right-click to open the context menu, and choose Insert Trend Line. - + Mean Value Lines are special trend lines that show the mean value. Use Insert - Mean Value Lines to insert mean value lines for data series. ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: helpcontent2
helpcontent2 |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit ad605e2e0606ee2c5c0fb23b84a0f011af62d124 Author: Laurent Balland-Poirier <laurent.balland-poir...@laposte.net> Date: Sat Feb 25 15:09:48 2017 +0100 Updated core Project: help f930a0c40fa65c778b9e6b2fa75d7581bb3f82dc Update menu entry for Insert Trend Line in chart Add emph tag in the same way as other menu commands Change-Id: I968b391485b1cb4fa8083704ca91fd44af087b1f Reviewed-on: https://gerrit.libreoffice.org/34644 Reviewed-by: Olivier Hallot <olivier.hal...@edx.srv.br> Tested-by: Olivier Hallot <olivier.hal...@edx.srv.br> diff --git a/helpcontent2 b/helpcontent2 index 90643687005e..f930a0c40fa6 16 --- a/helpcontent2 +++ b/helpcontent2 @@ -1 +1 @@ -Subproject commit 90643687005e1a21c4067f253cc6adeda0c421e0 +Subproject commit f930a0c40fa65c778b9e6b2fa75d7581bb3f82dc ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: sd/source
sd/source/ui/dlg/copydlg.cxx | 25 + 1 file changed, 25 insertions(+) New commits: commit 25d7103f99c51ccad0ccfc56a4457f0b7db6853e Author: Laurent Balland-Poirier <laurent.balland-poir...@laposte.net> Date: Thu Apr 20 22:38:25 2017 +0200 tdf#104423 Restore saving of Duplicate dlg parameters Saving of parameters in Duplicate dlg was removed by ce82146a6be87b239a0bde0b59fddf8865290b99 Change-Id: Id7aaf0734132e3d2a5bd4f11f3a5a7abeaf64911 Reviewed-on: https://gerrit.libreoffice.org/36755 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Katarina Behrens <katarina.behr...@cib.de> diff --git a/sd/source/ui/dlg/copydlg.cxx b/sd/source/ui/dlg/copydlg.cxx index 6c679cd834bc..23f8b92d51cd 100644 --- a/sd/source/ui/dlg/copydlg.cxx +++ b/sd/source/ui/dlg/copydlg.cxx @@ -80,6 +80,31 @@ CopyDlg::~CopyDlg() void CopyDlg::dispose() { +OUString& rStr = GetExtraData(); + +rStr = OUString::number(m_pNumFldCopies->GetValue()); +rStr += OUString(TOKEN); + +rStr += OUString::number(m_pMtrFldMoveX->GetValue()); +rStr += OUString( TOKEN ); + +rStr += OUString::number(m_pMtrFldMoveY->GetValue()); +rStr += OUString( TOKEN ); + +rStr += OUString::number(m_pMtrFldAngle->GetValue()); +rStr += OUString( TOKEN ); + +rStr += OUString::number(m_pMtrFldWidth->GetValue()); +rStr += OUString( TOKEN ); + +rStr += OUString::number(m_pMtrFldHeight->GetValue()); +rStr += OUString( TOKEN ); + +rStr += OUString::number( m_pLbStartColor->GetSelectEntryColor().GetColor() ); +rStr += OUString( TOKEN ); + +rStr += OUString::number( m_pLbEndColor->GetSelectEntryColor().GetColor() ); + m_pNumFldCopies.clear(); m_pBtnSetViewData.clear(); m_pMtrFldMoveX.clear(); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: extras/source
extras/source/templates/presnt/Alizarin.otp |binary extras/source/templates/presnt/BrightBlue.otp |binary extras/source/templates/presnt/DNA.otp |binary extras/source/templates/presnt/Focus.otp|binary extras/source/templates/presnt/Impress.otp |binary extras/source/templates/presnt/Inspiration.otp |binary extras/source/templates/presnt/LushGreen.otp|binary extras/source/templates/presnt/Metropolis.otp |binary extras/source/templates/presnt/Midnightblue.otp |binary extras/source/templates/presnt/Pencil.otp |binary extras/source/templates/presnt/Sunset.otp |binary extras/source/templates/presnt/Vintage.otp |binary extras/source/templates/presnt/Vivid.otp|binary 13 files changed New commits: commit 5c16d16ed3db32f922b2aeaad49592d2615c7e2c Author: Laurent Balland-Poirier <laurent.balland-poir...@laposte.net> Date: Fri Apr 21 21:22:28 2017 +0200 tdf#107045 Change preview image in templates thumbnail.png was modified in XML code for each Impress template. Localized text was replaced with Lorem Ipsum text Change-Id: I67fbf9b957630a75227d1b595d9bdc4298ef791c Reviewed-on: https://gerrit.libreoffice.org/36805 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Adolfo Jayme Barrientos <fit...@ubuntu.com> diff --git a/extras/source/templates/presnt/Alizarin.otp b/extras/source/templates/presnt/Alizarin.otp index 8a8252d5a0f0..7688482936f1 100644 Binary files a/extras/source/templates/presnt/Alizarin.otp and b/extras/source/templates/presnt/Alizarin.otp differ diff --git a/extras/source/templates/presnt/BrightBlue.otp b/extras/source/templates/presnt/BrightBlue.otp index f9f7a4536407..f1d187d26368 100644 Binary files a/extras/source/templates/presnt/BrightBlue.otp and b/extras/source/templates/presnt/BrightBlue.otp differ diff --git a/extras/source/templates/presnt/DNA.otp b/extras/source/templates/presnt/DNA.otp index 7640e9e1c2a2..212b6ae095e3 100644 Binary files a/extras/source/templates/presnt/DNA.otp and b/extras/source/templates/presnt/DNA.otp differ diff --git a/extras/source/templates/presnt/Focus.otp b/extras/source/templates/presnt/Focus.otp index d99618e841f8..953b6aa04180 100644 Binary files a/extras/source/templates/presnt/Focus.otp and b/extras/source/templates/presnt/Focus.otp differ diff --git a/extras/source/templates/presnt/Impress.otp b/extras/source/templates/presnt/Impress.otp index 9a33dcb7627c..ccd527332673 100644 Binary files a/extras/source/templates/presnt/Impress.otp and b/extras/source/templates/presnt/Impress.otp differ diff --git a/extras/source/templates/presnt/Inspiration.otp b/extras/source/templates/presnt/Inspiration.otp index 18ec2148c61a..9e16fad83519 100644 Binary files a/extras/source/templates/presnt/Inspiration.otp and b/extras/source/templates/presnt/Inspiration.otp differ diff --git a/extras/source/templates/presnt/LushGreen.otp b/extras/source/templates/presnt/LushGreen.otp index e2d6638e97dd..c56786ab4dbb 100644 Binary files a/extras/source/templates/presnt/LushGreen.otp and b/extras/source/templates/presnt/LushGreen.otp differ diff --git a/extras/source/templates/presnt/Metropolis.otp b/extras/source/templates/presnt/Metropolis.otp index f176ad79e9e9..93497a23c925 100644 Binary files a/extras/source/templates/presnt/Metropolis.otp and b/extras/source/templates/presnt/Metropolis.otp differ diff --git a/extras/source/templates/presnt/Midnightblue.otp b/extras/source/templates/presnt/Midnightblue.otp index 962bafa3f6f6..ca47b531002a 100644 Binary files a/extras/source/templates/presnt/Midnightblue.otp and b/extras/source/templates/presnt/Midnightblue.otp differ diff --git a/extras/source/templates/presnt/Pencil.otp b/extras/source/templates/presnt/Pencil.otp index fa12e50deaa5..fd870d0c057b 100644 Binary files a/extras/source/templates/presnt/Pencil.otp and b/extras/source/templates/presnt/Pencil.otp differ diff --git a/extras/source/templates/presnt/Sunset.otp b/extras/source/templates/presnt/Sunset.otp index b3d7b54077b6..381cdda6d8b8 100644 Binary files a/extras/source/templates/presnt/Sunset.otp and b/extras/source/templates/presnt/Sunset.otp differ diff --git a/extras/source/templates/presnt/Vintage.otp b/extras/source/templates/presnt/Vintage.otp index 7dbc4d4c9240..5230fbd3646e 100644 Binary files a/extras/source/templates/presnt/Vintage.otp and b/extras/source/templates/presnt/Vintage.otp differ diff --git a/extras/source/templates/presnt/Vivid.otp b/extras/source/templates/presnt/Vivid.otp index 5241ef42a983..a52c926414d1 100644 Binary files a/extras/source/templates/presnt/Vivid.otp and b/extras/source/templates/presnt/Vivid.otp differ ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-4' - extras/source
extras/source/templates/presnt/Alizarin.otp |binary extras/source/templates/presnt/BrightBlue.otp |binary extras/source/templates/presnt/DNA.otp |binary extras/source/templates/presnt/Focus.otp|binary extras/source/templates/presnt/Impress.otp |binary extras/source/templates/presnt/Inspiration.otp |binary extras/source/templates/presnt/LushGreen.otp|binary extras/source/templates/presnt/Metropolis.otp |binary extras/source/templates/presnt/Midnightblue.otp |binary extras/source/templates/presnt/Pencil.otp |binary extras/source/templates/presnt/Sunset.otp |binary extras/source/templates/presnt/Vintage.otp |binary extras/source/templates/presnt/Vivid.otp|binary 13 files changed New commits: commit 49efc2d00a674e4fa16aa10c19cafbb10e1573ef Author: Laurent Balland-Poirier <laurent.balland-poir...@laposte.net> Date: Fri Apr 21 21:22:28 2017 +0200 tdf#107045 Change preview image in templates thumbnail.png was modified in XML code for each Impress template. Localized text was replaced with Lorem Ipsum text Change-Id: I67fbf9b957630a75227d1b595d9bdc4298ef791c Reviewed-on: https://gerrit.libreoffice.org/36805 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Adolfo Jayme Barrientos <fit...@ubuntu.com> (cherry picked from commit 5c16d16ed3db32f922b2aeaad49592d2615c7e2c) Reviewed-on: https://gerrit.libreoffice.org/38087 Tested-by: Adolfo Jayme Barrientos <fit...@ubuntu.com> diff --git a/extras/source/templates/presnt/Alizarin.otp b/extras/source/templates/presnt/Alizarin.otp index 8a8252d5a0f0..7688482936f1 100644 Binary files a/extras/source/templates/presnt/Alizarin.otp and b/extras/source/templates/presnt/Alizarin.otp differ diff --git a/extras/source/templates/presnt/BrightBlue.otp b/extras/source/templates/presnt/BrightBlue.otp index f9f7a4536407..f1d187d26368 100644 Binary files a/extras/source/templates/presnt/BrightBlue.otp and b/extras/source/templates/presnt/BrightBlue.otp differ diff --git a/extras/source/templates/presnt/DNA.otp b/extras/source/templates/presnt/DNA.otp index 7640e9e1c2a2..212b6ae095e3 100644 Binary files a/extras/source/templates/presnt/DNA.otp and b/extras/source/templates/presnt/DNA.otp differ diff --git a/extras/source/templates/presnt/Focus.otp b/extras/source/templates/presnt/Focus.otp index d99618e841f8..953b6aa04180 100644 Binary files a/extras/source/templates/presnt/Focus.otp and b/extras/source/templates/presnt/Focus.otp differ diff --git a/extras/source/templates/presnt/Impress.otp b/extras/source/templates/presnt/Impress.otp index 9a33dcb7627c..ccd527332673 100644 Binary files a/extras/source/templates/presnt/Impress.otp and b/extras/source/templates/presnt/Impress.otp differ diff --git a/extras/source/templates/presnt/Inspiration.otp b/extras/source/templates/presnt/Inspiration.otp index 18ec2148c61a..9e16fad83519 100644 Binary files a/extras/source/templates/presnt/Inspiration.otp and b/extras/source/templates/presnt/Inspiration.otp differ diff --git a/extras/source/templates/presnt/LushGreen.otp b/extras/source/templates/presnt/LushGreen.otp index e2d6638e97dd..c56786ab4dbb 100644 Binary files a/extras/source/templates/presnt/LushGreen.otp and b/extras/source/templates/presnt/LushGreen.otp differ diff --git a/extras/source/templates/presnt/Metropolis.otp b/extras/source/templates/presnt/Metropolis.otp index f176ad79e9e9..93497a23c925 100644 Binary files a/extras/source/templates/presnt/Metropolis.otp and b/extras/source/templates/presnt/Metropolis.otp differ diff --git a/extras/source/templates/presnt/Midnightblue.otp b/extras/source/templates/presnt/Midnightblue.otp index 962bafa3f6f6..ca47b531002a 100644 Binary files a/extras/source/templates/presnt/Midnightblue.otp and b/extras/source/templates/presnt/Midnightblue.otp differ diff --git a/extras/source/templates/presnt/Pencil.otp b/extras/source/templates/presnt/Pencil.otp index fa12e50deaa5..fd870d0c057b 100644 Binary files a/extras/source/templates/presnt/Pencil.otp and b/extras/source/templates/presnt/Pencil.otp differ diff --git a/extras/source/templates/presnt/Sunset.otp b/extras/source/templates/presnt/Sunset.otp index b3d7b54077b6..381cdda6d8b8 100644 Binary files a/extras/source/templates/presnt/Sunset.otp and b/extras/source/templates/presnt/Sunset.otp differ diff --git a/extras/source/templates/presnt/Vintage.otp b/extras/source/templates/presnt/Vintage.otp index 7dbc4d4c9240..5230fbd3646e 100644 Binary files a/extras/source/templates/presnt/Vintage.otp and b/extras/source/templates/presnt/Vintage.otp differ diff --git a/extras/source/templates/presnt/Vivid.otp b/extras/source/templates/presnt/Vivid.otp index 5241ef42a983..a52c926414d1 100644 Binary files a/extras/source/templates/presnt/Vivid.otp and b/extras/source/templates/presnt/Vivid.otp differ ___ Libreoffice-commits maili
[Libreoffice-commits] help.git: source/text
source/text/sbasic/shared/03030108.xhp | 11 ++- source/text/sbasic/shared/03030201.xhp | 17 + source/text/sbasic/shared/03030202.xhp | 17 + source/text/sbasic/shared/03090302.xhp | 31 +-- source/text/sbasic/shared/03100400.xhp | 10 ++ source/text/sbasic/shared/03100500.xhp | 13 ++--- source/text/sbasic/shared/03100600.xhp | 13 ++--- source/text/sbasic/shared/03100700.xhp |4 +--- source/text/sbasic/shared/03103800.xhp |7 --- source/text/sbasic/shared/03103900.xhp | 20 ++-- source/text/sbasic/shared/03104100.xhp |9 + source/text/sbasic/shared/03104200.xhp | 11 ++- source/text/sbasic/shared/03104300.xhp |7 --- source/text/sbasic/shared/03104400.xhp |7 --- source/text/sbasic/shared/03104600.xhp | 23 --- source/text/sbasic/shared/03120312.xhp | 17 ++--- source/text/sbasic/shared/03120313.xhp | 10 ++ source/text/sbasic/shared/03131500.xhp |7 --- source/text/sbasic/shared/03131700.xhp | 15 --- source/text/sbasic/shared/03131800.xhp | 23 +-- source/text/sbasic/shared/03131900.xhp | 16 +--- source/text/sbasic/shared/03132300.xhp |5 + 22 files changed, 132 insertions(+), 161 deletions(-) New commits: commit 3d5e0e547daaed4c5587d403877a04916cf23eb9 Author: Laurent Balland-Poirier <laurent.balland-poir...@laposte.net> Date: Tue Jan 17 21:15:13 2017 +0100 Basic: beautify Examples with bascode tag Correct many examples to use tag to get colorised text Merge some identical examples in section Remove useless spaces Remove ^M at end of line with Add localize="false" for pure Basic code Add comments from Johnny_M Treat 03101700.xhp in a different commit Change-Id: I94a799ee13829ed9086127aa7d0e722ffe1dd90d Reviewed-on: https://gerrit.libreoffice.org/33240 Reviewed-by: Olivier Hallot <olivier.hal...@edx.srv.br> Tested-by: Olivier Hallot <olivier.hal...@edx.srv.br> diff --git a/source/text/sbasic/shared/03030108.xhp b/source/text/sbasic/shared/03030108.xhp index 3e0a8f884..26313504b 100644 --- a/source/text/sbasic/shared/03030108.xhp +++ b/source/text/sbasic/shared/03030108.xhp @@ -1,6 +1,5 @@ - - + @@ -42,7 +41,7 @@ Syntax: -CDateFromIso(String) +CDateFromIso(String) Return value: Internal date number @@ -52,8 +51,10 @@ Example: -dateval = CDateFromIso("20021231") -dateval = CDateFromIso("2002-12-31") + +dateval = CDateFromIso("20021231") +dateval = CDateFromIso("2002-12-31") + return both 12/31/2002 in the date format of your system diff --git a/source/text/sbasic/shared/03030201.xhp b/source/text/sbasic/shared/03030201.xhp index de076c5f6..f5551ae7b 100644 --- a/source/text/sbasic/shared/03030201.xhp +++ b/source/text/sbasic/shared/03030201.xhp @@ -1,6 +1,6 @@ - + - - + Hour Function [Runtime] @@ -47,9 +46,11 @@ returns the value 12. - Example: - Sub ExampleHour - Print "The current hour is " Hour( Now ) - End Sub + Example: + + Sub ExampleHour + Print "The current hour is " Hour( Now ) + End Sub + - \ No newline at end of file + diff --git a/source/text/sbasic/shared/03030202.xhp b/source/text/sbasic/shared/03030202.xhp index 385e6c476..a03a4205b 100644 --- a/source/text/sbasic/shared/03030202.xhp +++ b/source/text/sbasic/shared/03030202.xhp @@ -1,6 +1,6 @@ - + - - + Minute Function [Runtime] @@ -47,9 +46,11 @@ returns the value 30. - Example: - Sub ExampleMinute - MsgBox "The current minute is " Minute(Now) "." - end sub + Example: + + Sub ExampleMinute + MsgBox "The current minute is " Minute(Now) "." + End Sub + - \ No newline at end of file + diff --git a/source/text/sbasic/shared/03090302.xhp b/source/text/sbasic/shared/03090302.xhp index 7fb24ce86..f01205c39 100644 --- a/source/text/sbasic/shared/03090302.xhp +++ b/source/text/sbasic/shared/03090302.xhp @@ -1,6 +1,5 @@ - - + @@ -37,24 +36,20 @@ Continues program execution within a Sub or Function at the procedure line indicated by a label. Syntax: +see Parameters +Parameters: -see Parameters +Sub/Function +statement block + Label1 +Label2: +statement block +Exit Sub +Label1: +statement block +GoTo Label2 +End Sub/Function -Parameters: -Sub/Function -statement block - Label1 - -Label2: - -statement block -Exit Sub - -Label1: - -statement block -GoTo Label2 -E
[Libreoffice-commits] core.git: helpcontent2
helpcontent2 |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 94a4ad0c916b6299cee8982761251575562bf702 Author: Laurent Balland-Poirier <laurent.balland-poir...@laposte.net> Date: Tue Jan 17 21:15:13 2017 +0100 Updated core Project: help 3d5e0e547daaed4c5587d403877a04916cf23eb9 Basic: beautify Examples with bascode tag Correct many examples to use tag to get colorised text Merge some identical examples in section Remove useless spaces Remove ^M at end of line with Add localize="false" for pure Basic code Add comments from Johnny_M Treat 03101700.xhp in a different commit Change-Id: I94a799ee13829ed9086127aa7d0e722ffe1dd90d Reviewed-on: https://gerrit.libreoffice.org/33240 Reviewed-by: Olivier Hallot <olivier.hal...@edx.srv.br> Tested-by: Olivier Hallot <olivier.hal...@edx.srv.br> diff --git a/helpcontent2 b/helpcontent2 index ee2a29423da1..3d5e0e547daa 16 --- a/helpcontent2 +++ b/helpcontent2 @@ -1 +1 @@ -Subproject commit ee2a29423da11c4f61ce4ca2176383d1a631ec84 +Subproject commit 3d5e0e547daaed4c5587d403877a04916cf23eb9 ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] help.git: Branch 'libreoffice-5-4' - source/text
source/text/sbasic/shared/03101100.xhp | 10 +++--- source/text/sbasic/shared/03101110.xhp | 27 +-- source/text/sbasic/shared/03101120.xhp | 24 +++- source/text/sbasic/shared/03101130.xhp | 24 +++- source/text/sbasic/shared/03101140.xhp | 24 +++- source/text/sbasic/shared/03101300.xhp | 24 +++- source/text/sbasic/shared/03101400.xhp | 24 +++- source/text/sbasic/shared/03101500.xhp | 24 +++- source/text/sbasic/shared/03101600.xhp | 24 +++- source/text/sbasic/shared/03101700.xhp | 27 +-- 10 files changed, 38 insertions(+), 194 deletions(-) New commits: commit 06f78d9927f3d8bd56583fce3181eae19568e3e0 Author: Laurent Balland-Poirier <laurent.balland-poir...@laposte.net> Date: Wed May 17 22:25:57 2017 +0200 Basic: merge identical def and example Defxxx Change-Id: I64abb89958c823d636c402ad4fee1f008742b491 Reviewed-on: https://gerrit.libreoffice.org/37789 Reviewed-by: Olivier Hallot <olivier.hal...@edx.srv.br> Tested-by: Olivier Hallot <olivier.hal...@edx.srv.br> (cherry picked from commit fc04019be5ce20fe8acd95e1cc41ba099dd51cb0) Reviewed-on: https://gerrit.libreoffice.org/37828 diff --git a/source/text/sbasic/shared/03101100.xhp b/source/text/sbasic/shared/03101100.xhp index 4559a5ed8..75d19629b 100644 --- a/source/text/sbasic/shared/03101100.xhp +++ b/source/text/sbasic/shared/03101100.xhp @@ -27,17 +27,16 @@ - DefBool statement - DefBool Statement [Runtime] If no type-declaration character or keyword is specified, the DefBool statement sets the default data type for variables, according to a letter range. + Syntax: Defxxx Characterrange1[, Characterrange2[,...]] @@ -47,8 +46,10 @@ Characterrange: Letters that specify the range of variables that you want to set the default data type for. xxx: Keyword that defines the default variable type: Keyword: Default variable type + DefBool: Boolean + Example: ' Prefix definition for variable types: @@ -59,10 +60,13 @@ DefLng l DefObj o DefVar v + + + Sub ExampleDefBool bOK=TRUE ' bOK is an implicit boolean variable End Sub - \ No newline at end of file + diff --git a/source/text/sbasic/shared/03101110.xhp b/source/text/sbasic/shared/03101110.xhp index 71248ee41..184787d8a 100644 --- a/source/text/sbasic/shared/03101110.xhp +++ b/source/text/sbasic/shared/03101110.xhp @@ -35,34 +35,17 @@ DefCur Statement [Runtime] If no type-declaration character or keyword is specified, the DefCur statement sets the default variable type, according to a letter range. -Syntax: - -Defxxx Characterrange1[, Characterrange2[,...]] - -Parameters: - -Characterrange: Letters that specify the range of variables that you want to set a default data type for. - -xxx: Keyword that defines the default variable type: - -Keyword: Default variable type + + DefCur: Currency -Example: + + -REM Prefix definitions for variable types: -DefBool b -DefDate t -DefDbL d -DefInt i -DefLng l -DefObj o -DefVar v DefCur c Sub ExampleDefCur -cCur=Currency REM cCur is an implicit currency variable +cCur=Currency ' cCur is an implicit currency variable End Sub - diff --git a/source/text/sbasic/shared/03101120.xhp b/source/text/sbasic/shared/03101120.xhp index fcaf086f8..cc1060d71 100644 --- a/source/text/sbasic/shared/03101120.xhp +++ b/source/text/sbasic/shared/03101120.xhp @@ -27,38 +27,20 @@ - DefErr statement - DefErr Statement [Runtime] If no type-declaration character or keyword is specified, the DefErr statement sets the default variable type, according to a letter range. -Syntax: - -Defxxx Characterrange1[, Characterrange2[,...]] - - -Parameters: - Characterrange: Letters that specify the range of variables that you want to set a default data type for. - xxx: Keyword that defines the default variable type: - Keyword: Default variable type + DefErr: Error -Example: + -' Prefix definitions for variable types: -DefBool b -DefDate t -DefDbl d -DefInt i -DefLng l -DefObj o -DefVar v DefErr e Sub ExampleDefErr eErr=Error ' eErr is an implicit error variable @@ -66,4 +48,4 @@ - \ No newline at end of file + diff --git a/source/text/sbasic/shared/03101130.xhp b/source/text/sbasic/shared/03101130.xhp index 15f52373a..3e8991e8a 100644 --- a/source/text/sbasic/shared/03101130.xhp +++ b/source/text/sbasic/shared/03101130.xhp @@ -27,38 +27,20 @@ - DefSng statement - DefSng Statement [Runtime] If no type-declaration character or keyword is specified, the DefSng statement sets the default variable type, according to a letter range. -Syntax: - -Defxxx Characterrange1[, Characterrange2[,...]] - - -Parameters: - Characterrange: Letters that specify the range of variab
[Libreoffice-commits] core.git: Branch 'libreoffice-5-4' - helpcontent2
helpcontent2 |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit df5d6abc284ecb13d68beb285145d367b1a71832 Author: Laurent Balland-Poirier <laurent.balland-poir...@laposte.net> Date: Wed May 17 22:25:57 2017 +0200 Updated core Project: help 06f78d9927f3d8bd56583fce3181eae19568e3e0 Basic: merge identical def and example Defxxx Change-Id: I64abb89958c823d636c402ad4fee1f008742b491 Reviewed-on: https://gerrit.libreoffice.org/37789 Reviewed-by: Olivier Hallot <olivier.hal...@edx.srv.br> Tested-by: Olivier Hallot <olivier.hal...@edx.srv.br> (cherry picked from commit fc04019be5ce20fe8acd95e1cc41ba099dd51cb0) Reviewed-on: https://gerrit.libreoffice.org/37828 diff --git a/helpcontent2 b/helpcontent2 index 3cb6c49b5254..06f78d9927f3 16 --- a/helpcontent2 +++ b/helpcontent2 @@ -1 +1 @@ -Subproject commit 3cb6c49b52541dd5f0c650d79a201a69415d8054 +Subproject commit 06f78d9927f3d8bd56583fce3181eae19568e3e0 ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] help.git: Branch 'libreoffice-5-4' - source/text
source/text/sbasic/shared/03030108.xhp | 11 ++- source/text/sbasic/shared/03030201.xhp | 17 + source/text/sbasic/shared/03030202.xhp | 17 + source/text/sbasic/shared/03090302.xhp | 31 +-- source/text/sbasic/shared/03100400.xhp | 10 ++ source/text/sbasic/shared/03100500.xhp | 13 ++--- source/text/sbasic/shared/03100600.xhp | 13 ++--- source/text/sbasic/shared/03100700.xhp |4 +--- source/text/sbasic/shared/03103800.xhp |7 --- source/text/sbasic/shared/03103900.xhp | 20 ++-- source/text/sbasic/shared/03104100.xhp |9 + source/text/sbasic/shared/03104200.xhp | 11 ++- source/text/sbasic/shared/03104300.xhp |7 --- source/text/sbasic/shared/03104400.xhp |7 --- source/text/sbasic/shared/03104600.xhp | 23 --- source/text/sbasic/shared/03120312.xhp | 17 ++--- source/text/sbasic/shared/03120313.xhp | 10 ++ source/text/sbasic/shared/03131500.xhp |7 --- source/text/sbasic/shared/03131700.xhp | 15 --- source/text/sbasic/shared/03131800.xhp | 23 +-- source/text/sbasic/shared/03131900.xhp | 16 +--- source/text/sbasic/shared/03132300.xhp |5 + 22 files changed, 132 insertions(+), 161 deletions(-) New commits: commit 3cb6c49b52541dd5f0c650d79a201a69415d8054 Author: Laurent Balland-Poirier <laurent.balland-poir...@laposte.net> Date: Tue Jan 17 21:15:13 2017 +0100 Basic: beautify Examples with bascode tag Correct many examples to use tag to get colorised text Merge some identical examples in section Remove useless spaces Remove ^M at end of line with Add localize="false" for pure Basic code Add comments from Johnny_M Treat 03101700.xhp in a different commit Change-Id: I94a799ee13829ed9086127aa7d0e722ffe1dd90d Reviewed-on: https://gerrit.libreoffice.org/33240 Reviewed-by: Olivier Hallot <olivier.hal...@edx.srv.br> Tested-by: Olivier Hallot <olivier.hal...@edx.srv.br> (cherry picked from commit 3d5e0e547daaed4c5587d403877a04916cf23eb9) Reviewed-on: https://gerrit.libreoffice.org/37825 diff --git a/source/text/sbasic/shared/03030108.xhp b/source/text/sbasic/shared/03030108.xhp index 3e0a8f884..26313504b 100644 --- a/source/text/sbasic/shared/03030108.xhp +++ b/source/text/sbasic/shared/03030108.xhp @@ -1,6 +1,5 @@ - - + @@ -42,7 +41,7 @@ Syntax: -CDateFromIso(String) +CDateFromIso(String) Return value: Internal date number @@ -52,8 +51,10 @@ Example: -dateval = CDateFromIso("20021231") -dateval = CDateFromIso("2002-12-31") + +dateval = CDateFromIso("20021231") +dateval = CDateFromIso("2002-12-31") + return both 12/31/2002 in the date format of your system diff --git a/source/text/sbasic/shared/03030201.xhp b/source/text/sbasic/shared/03030201.xhp index de076c5f6..f5551ae7b 100644 --- a/source/text/sbasic/shared/03030201.xhp +++ b/source/text/sbasic/shared/03030201.xhp @@ -1,6 +1,6 @@ - + - - + Hour Function [Runtime] @@ -47,9 +46,11 @@ returns the value 12. - Example: - Sub ExampleHour - Print "The current hour is " Hour( Now ) - End Sub + Example: + + Sub ExampleHour + Print "The current hour is " Hour( Now ) + End Sub + - \ No newline at end of file + diff --git a/source/text/sbasic/shared/03030202.xhp b/source/text/sbasic/shared/03030202.xhp index 385e6c476..a03a4205b 100644 --- a/source/text/sbasic/shared/03030202.xhp +++ b/source/text/sbasic/shared/03030202.xhp @@ -1,6 +1,6 @@ - + - - + Minute Function [Runtime] @@ -47,9 +46,11 @@ returns the value 30. - Example: - Sub ExampleMinute - MsgBox "The current minute is " Minute(Now) "." - end sub + Example: + + Sub ExampleMinute + MsgBox "The current minute is " Minute(Now) "." + End Sub + - \ No newline at end of file + diff --git a/source/text/sbasic/shared/03090302.xhp b/source/text/sbasic/shared/03090302.xhp index 7fb24ce86..f01205c39 100644 --- a/source/text/sbasic/shared/03090302.xhp +++ b/source/text/sbasic/shared/03090302.xhp @@ -1,6 +1,5 @@ - - + @@ -37,24 +36,20 @@ Continues program execution within a Sub or Function at the procedure line indicated by a label. Syntax: +see Parameters +Parameters: -see Parameters +Sub/Function +statement block + Label1 +Label2: +statement block +Exit Sub +Label1: +statement block +GoTo Label2 +End Sub/Function -Parameters: -Sub/
[Libreoffice-commits] core.git: Branch 'libreoffice-5-4' - helpcontent2
helpcontent2 |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 810898cbd255c6ebb8860363974c00c27e82ec83 Author: Laurent Balland-Poirier <laurent.balland-poir...@laposte.net> Date: Tue Jan 17 21:15:13 2017 +0100 Updated core Project: help 3cb6c49b52541dd5f0c650d79a201a69415d8054 Basic: beautify Examples with bascode tag Correct many examples to use tag to get colorised text Merge some identical examples in section Remove useless spaces Remove ^M at end of line with Add localize="false" for pure Basic code Add comments from Johnny_M Treat 03101700.xhp in a different commit Change-Id: I94a799ee13829ed9086127aa7d0e722ffe1dd90d Reviewed-on: https://gerrit.libreoffice.org/33240 Reviewed-by: Olivier Hallot <olivier.hal...@edx.srv.br> Tested-by: Olivier Hallot <olivier.hal...@edx.srv.br> (cherry picked from commit 3d5e0e547daaed4c5587d403877a04916cf23eb9) Reviewed-on: https://gerrit.libreoffice.org/37825 diff --git a/helpcontent2 b/helpcontent2 index 8c185e311871..3cb6c49b5254 16 --- a/helpcontent2 +++ b/helpcontent2 @@ -1 +1 @@ -Subproject commit 8c185e311871e4eae877975dedf06444e547f0ec +Subproject commit 3cb6c49b52541dd5f0c650d79a201a69415d8054 ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: helpcontent2
helpcontent2 |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 96e145476b8ef1f0cb5299c470df2493ae689f60 Author: Laurent Balland-Poirier <laurent.balland-poir...@laposte.net> Date: Mon Jan 30 23:19:12 2017 +0100 Updated core Project: help 1d2c1291f700f729c28a209d2422a8d2f926e347 Basic: add localize=false for some bascode lines Change-Id: I78884c0421ef8ad935ca7214b9116fda29d2797f update: remove duplicate empty line at end of files Reviewed-on: https://gerrit.libreoffice.org/33766 Reviewed-by: Olivier Hallot <olivier.hal...@edx.srv.br> Tested-by: Olivier Hallot <olivier.hal...@edx.srv.br> diff --git a/helpcontent2 b/helpcontent2 index c1b5c626539f..1d2c1291f700 16 --- a/helpcontent2 +++ b/helpcontent2 @@ -1 +1 @@ -Subproject commit c1b5c626539f3893c07c11380c5cfe94bc5f8d36 +Subproject commit 1d2c1291f700f729c28a209d2422a8d2f926e347 ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] help.git: source/text
source/text/sbasic/guide/sample_code.xhp |2 +- source/text/sbasic/shared/03030107.xhp |2 -- source/text/sbasic/shared/03030203.xhp |7 +++ source/text/sbasic/shared/03030302.xhp |7 +++ source/text/sbasic/shared/03030303.xhp |6 ++ source/text/sbasic/shared/03050100.xhp |6 ++ source/text/sbasic/shared/03050200.xhp |2 +- source/text/sbasic/shared/03080201.xhp |6 ++ source/text/sbasic/shared/03090203.xhp |3 +-- source/text/sbasic/shared/03090404.xhp |4 ++-- source/text/sbasic/shared/03090408.xhp |6 ++ source/text/sbasic/shared/03102450.xhp |3 +-- source/text/sbasic/shared/03103200.xhp |6 ++ source/text/sbasic/shared/03103300.xhp |6 ++ source/text/sbasic/shared/03120201.xhp |6 ++ source/text/sbasic/shared/03130100.xhp |2 +- source/text/sbasic/shared/03130700.xhp |6 ++ source/text/sbasic/shared/03131000.xhp |6 ++ source/text/sbasic/shared/03131300.xhp |6 ++ source/text/sbasic/shared/03131400.xhp |6 ++ source/text/sbasic/shared/03132100.xhp |2 +- source/text/sbasic/shared/03132200.xhp |6 ++ 22 files changed, 38 insertions(+), 68 deletions(-) New commits: commit 1d2c1291f700f729c28a209d2422a8d2f926e347 Author: Laurent Balland-Poirier <laurent.balland-poir...@laposte.net> Date: Mon Jan 30 23:19:12 2017 +0100 Basic: add localize=false for some bascode lines Change-Id: I78884c0421ef8ad935ca7214b9116fda29d2797f update: remove duplicate empty line at end of files Reviewed-on: https://gerrit.libreoffice.org/33766 Reviewed-by: Olivier Hallot <olivier.hal...@edx.srv.br> Tested-by: Olivier Hallot <olivier.hal...@edx.srv.br> diff --git a/source/text/sbasic/guide/sample_code.xhp b/source/text/sbasic/guide/sample_code.xhp index a5141068d..334d88cd0 100644 --- a/source/text/sbasic/guide/sample_code.xhp +++ b/source/text/sbasic/guide/sample_code.xhp @@ -94,7 +94,7 @@ MsgBox oCMD1.Dbg_Properties REM execute dialog oDialog1.Execute() -End Sub +End Sub Add an Entry to a ListBox diff --git a/source/text/sbasic/shared/03030107.xhp b/source/text/sbasic/shared/03030107.xhp index 31b5db488..4b50b0f65 100644 --- a/source/text/sbasic/shared/03030107.xhp +++ b/source/text/sbasic/shared/03030107.xhp @@ -27,13 +27,11 @@ - CdateToIso function - CDateToIso Function [Runtime] Returns the date in ISO format without separators (MMDD) from a serial date number that is generated by the DateSerial or the DateValue or the CDateFromIso function. The year part consists of at least four digits, with leading zeros if the absolute value is less than 1000, it can be negative with a leading minus sign if the date passed denotes a year before the common era (BCE) and it can have more than four digits if the absolute value is greater than . The formatted string returned can be in the range "-327680101" to "327671231". diff --git a/source/text/sbasic/shared/03030203.xhp b/source/text/sbasic/shared/03030203.xhp index 07bdde963..162ace2eb 100644 --- a/source/text/sbasic/shared/03030203.xhp +++ b/source/text/sbasic/shared/03030203.xhp @@ -27,20 +27,18 @@ - Now function - Now Function [Runtime] Returns the current system date and time as a Date value. Syntax: -Now +Now Return value: @@ -54,4 +52,5 @@ - \ No newline at end of file + + diff --git a/source/text/sbasic/shared/03030302.xhp b/source/text/sbasic/shared/03030302.xhp index 410d2acff..92f053cac 100644 --- a/source/text/sbasic/shared/03030302.xhp +++ b/source/text/sbasic/shared/03030302.xhp @@ -27,20 +27,18 @@ - Time statement - Time Statement [Runtime] This function returns the current system time as a string in the format "HH:MM:SS". Syntax: -Time +Time Parameters: @@ -54,4 +52,5 @@ - \ No newline at end of file + + diff --git a/source/text/sbasic/shared/03030303.xhp b/source/text/sbasic/shared/03030303.xhp index bf440cf91..e50ce722a 100644 --- a/source/text/sbasic/shared/03030303.xhp +++ b/source/text/sbasic/shared/03030303.xhp @@ -27,13 +27,11 @@ - Timer function - Timer Function [Runtime] Returns a value that specifies the number of seconds that have elapsed since midnight. @@ -41,7 +39,7 @@ Syntax: -Timer +Timer Return value: @@ -62,4 +60,4 @@ - \ No newline at end of file + diff --git a/source/text/sbasic/shared/03050100.xhp b/source/text/sbasic/shared/03050100.xhp index 7ae49da66..19677a7b4 100644 --- a/source/text/sbasic/shared/03050100.xhp +++ b/source/text/sbasic/shared/03050100.xhp @@ -27,20 +27,18 @@ - Erl function - Erl Function [Runtime] Returns the line number where an error occurred during program execution. Syntax: -Erl +Erl Return value: @@ -67,4 +65,4 @@ - \ No newline at end
[Libreoffice-commits] help.git: source/text
source/text/shared/01/05020301.xhp | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) New commits: commit 90643687005e1a21c4067f253cc6adeda0c421e0 Author: Laurent Balland-Poirier <laurent.balland-poir...@laposte.net> Date: Wed Mar 1 14:53:04 2017 +0100 Clarify examples for l10n using space as thousands separator Number Format Code In locale using space as thousands separator, some examples may be not correctly interpreted. This patch adds some text to explain how to solve this. Beautify a little bit some examples. Complete fraction description: any digit symbol (0, # or ?) can be used to described any of the three parts of the fraction. Change-Id: I5bab1da21b33cddfa0a63fbe5e3d53d64ed0103c Reviewed-on: https://gerrit.libreoffice.org/34755 Reviewed-by: Olivier Hallot <olivier.hal...@edx.srv.br> Tested-by: Olivier Hallot <olivier.hal...@edx.srv.br> diff --git a/source/text/shared/01/05020301.xhp b/source/text/shared/01/05020301.xhp index 9c5ba9834..d2db2494a 100644 --- a/source/text/shared/01/05020301.xhp +++ b/source/text/shared/01/05020301.xhp @@ -66,7 +66,7 @@ Decimal Places and Significant Digits Use zero (0), the number sign (#) or the question mark (?) as placeholders in your number format code to represent numbers. The (#) only displays significant digits, while the (0) displays zeroes if there are fewer digits in the number than in the number format. The (?) works as the (#) but adds a space character to keep decimal alignment if there is a hidden non-significant zero. -Use question marks (?) to represent the number of digits to include in the numerator and the denominator of a fraction. Fractions that do not fit the pattern that you define are displayed as floating point numbers. +Use question marks (?), zeroes (0) or number signs (#) to represent the number of digits to include in the numerator and the denominator of a fraction. Fractions that do not fit the pattern that you define are displayed as floating point numbers. If a number contains more digits to the right of the decimal delimiter than there are placeholders in the format, the number is rounded accordingly. If a number contains more digits to the left of the decimal delimiter than there are placeholders in the format, the entire number is displayed. Use the following list as a guide for using placeholders when you create a number format code: @@ -168,7 +168,7 @@ Thousands Separator -Depending on your language setting, you can use a comma, a period or a blank as a thousands separator. You can also use the separator to reduce the size of the number that is displayed by a multiple of 1000 for each separator. +Depending on your language setting, you can use a comma, a period or a blank as a thousands separator. You can also use the separator to reduce the size of the number that is displayed by a multiple of 1000 for each separator. The examples below use comma as thousands separator: @@ -201,7 +201,7 @@ Including Text in Number Format Codes Text and Numbers -To include text in a number format that is applied to a cell containing numbers, place a double quotation mark (") in front of and behind the text, or a backslash (\) before a single character. For example, enter #.# "meters" to display "3.5 meters" or #.# \m to display "3.5 m". +To include text in a number format that is applied to a cell containing numbers, place a double quotation mark (") in front of and behind the text, or a backslash (\) before a single character. For example, enter #.# "meters" to display "3.5 meters" or #.# \m to display "3.5 m". If you use space as thousands separator, you need to insert spaces between quotes in the previous examples: #.#" meters" or #.#\ \m to get the correct result. Text and Text To include text in a number format that is applied to a cell that might contain text, enclose the text by double quotation marks (" "), and then add an at sign (@). For example, enter "Total for "@ to display "Total for December". @@ -271,7 +271,7 @@ To display numbers as percentages, add the percent sign (%) to the number format. Scientific Notation -Scientific notation lets you write very large numbers or very small fractions in a compact form. For example, in scientific notation, 65 is written as 6.5 x 10^5, and 0.65 as 6.5 x 10^-5. Translators: use the decimal delimiter of your language (period or comma) for all number format codes in Calc.In %PRODUCTNAME, these numbers are written as 6.5E+5 and 6.5E-5, respectively. To create a number format that displays numbers using scientific notation, enter a # or 0, and then one of the following codes E-, E+, e- or e+. If sign is omitted after E or e, it won't appear for positive value of exponent. To get engine
[Libreoffice-commits] core.git: helpcontent2
helpcontent2 |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 963c1f40cdc0fa29027755c4dc0998cb8b286c4a Author: Laurent Balland-Poirier <laurent.balland-poir...@laposte.net> Date: Wed Mar 1 14:53:04 2017 +0100 Updated core Project: help 90643687005e1a21c4067f253cc6adeda0c421e0 Clarify examples for l10n using space as thousands separator Number Format Code In locale using space as thousands separator, some examples may be not correctly interpreted. This patch adds some text to explain how to solve this. Beautify a little bit some examples. Complete fraction description: any digit symbol (0, # or ?) can be used to described any of the three parts of the fraction. Change-Id: I5bab1da21b33cddfa0a63fbe5e3d53d64ed0103c Reviewed-on: https://gerrit.libreoffice.org/34755 Reviewed-by: Olivier Hallot <olivier.hal...@edx.srv.br> Tested-by: Olivier Hallot <olivier.hal...@edx.srv.br> diff --git a/helpcontent2 b/helpcontent2 index ab17f13c6d60..90643687005e 16 --- a/helpcontent2 +++ b/helpcontent2 @@ -1 +1 @@ -Subproject commit ab17f13c6d60d2d6ad7ff6ce3734ba81c77f881d +Subproject commit 90643687005e1a21c4067f253cc6adeda0c421e0 ___ 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
sd/source/ui/func/fucopy.cxx|2 +- sd/uiconfig/sdraw/ui/copydlg.ui |1 + 2 files changed, 2 insertions(+), 1 deletion(-) New commits: commit 8b56a5ceed41a1bb0a82af71c90973f50f54e4b8 Author: Laurent Balland-Poirier <laurent.balland-poir...@laposte.net> Date: Sat Apr 22 15:41:16 2017 +0200 tdf#77816 Duplicate dlg: enable fractionnal angle In Duplicate dialog of Draw: Count angle in 100th of degree Change-Id: If1af9a42e7c35d39edbdc3fa624489d7e38b42e1 Reviewed-on: https://gerrit.libreoffice.org/36816 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Katarina Behrens <katarina.behr...@cib.de> diff --git a/sd/source/ui/func/fucopy.cxx b/sd/source/ui/func/fucopy.cxx index 45490d68f8b3..0edd047c0fed 100644 --- a/sd/source/ui/func/fucopy.cxx +++ b/sd/source/ui/func/fucopy.cxx @@ -242,7 +242,7 @@ void FuCopy::DoExecute( SfxRequest& rReq ) mpView->ResizeAllMarked( aRect.TopLeft(), aWidth, aHeight ); if( mpView->IsRotateAllowed() ) -mpView->RotateAllMarked( aRect.Center(), lAngle * 100 ); +mpView->RotateAllMarked( aRect.Center(), lAngle ); if( mpView->IsMoveAllowed() ) mpView->MoveAllMarked( Size( lSizeX, lSizeY ) ); diff --git a/sd/uiconfig/sdraw/ui/copydlg.ui b/sd/uiconfig/sdraw/ui/copydlg.ui index ddadc3fdcd77..07c1a506afda 100644 --- a/sd/uiconfig/sdraw/ui/copydlg.ui +++ b/sd/uiconfig/sdraw/ui/copydlg.ui @@ -273,6 +273,7 @@ True â adjustment2 +2 1 ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] help.git: source/text
source/text/sbasic/shared/03101100.xhp | 10 +++--- source/text/sbasic/shared/03101110.xhp | 27 +-- source/text/sbasic/shared/03101120.xhp | 24 +++- source/text/sbasic/shared/03101130.xhp | 24 +++- source/text/sbasic/shared/03101140.xhp | 24 +++- source/text/sbasic/shared/03101300.xhp | 24 +++- source/text/sbasic/shared/03101400.xhp | 24 +++- source/text/sbasic/shared/03101500.xhp | 24 +++- source/text/sbasic/shared/03101600.xhp | 24 +++- source/text/sbasic/shared/03101700.xhp | 27 +-- 10 files changed, 38 insertions(+), 194 deletions(-) New commits: commit fc04019be5ce20fe8acd95e1cc41ba099dd51cb0 Author: Laurent Balland-Poirier <laurent.balland-poir...@laposte.net> Date: Wed May 17 22:25:57 2017 +0200 Basic: merge identical def and example Defxxx Change-Id: I64abb89958c823d636c402ad4fee1f008742b491 Reviewed-on: https://gerrit.libreoffice.org/37789 Reviewed-by: Olivier Hallot <olivier.hal...@edx.srv.br> Tested-by: Olivier Hallot <olivier.hal...@edx.srv.br> diff --git a/source/text/sbasic/shared/03101100.xhp b/source/text/sbasic/shared/03101100.xhp index 4559a5ed8..75d19629b 100644 --- a/source/text/sbasic/shared/03101100.xhp +++ b/source/text/sbasic/shared/03101100.xhp @@ -27,17 +27,16 @@ - DefBool statement - DefBool Statement [Runtime] If no type-declaration character or keyword is specified, the DefBool statement sets the default data type for variables, according to a letter range. + Syntax: Defxxx Characterrange1[, Characterrange2[,...]] @@ -47,8 +46,10 @@ Characterrange: Letters that specify the range of variables that you want to set the default data type for. xxx: Keyword that defines the default variable type: Keyword: Default variable type + DefBool: Boolean + Example: ' Prefix definition for variable types: @@ -59,10 +60,13 @@ DefLng l DefObj o DefVar v + + + Sub ExampleDefBool bOK=TRUE ' bOK is an implicit boolean variable End Sub - \ No newline at end of file + diff --git a/source/text/sbasic/shared/03101110.xhp b/source/text/sbasic/shared/03101110.xhp index 71248ee41..184787d8a 100644 --- a/source/text/sbasic/shared/03101110.xhp +++ b/source/text/sbasic/shared/03101110.xhp @@ -35,34 +35,17 @@ DefCur Statement [Runtime] If no type-declaration character or keyword is specified, the DefCur statement sets the default variable type, according to a letter range. -Syntax: - -Defxxx Characterrange1[, Characterrange2[,...]] - -Parameters: - -Characterrange: Letters that specify the range of variables that you want to set a default data type for. - -xxx: Keyword that defines the default variable type: - -Keyword: Default variable type + + DefCur: Currency -Example: + + -REM Prefix definitions for variable types: -DefBool b -DefDate t -DefDbL d -DefInt i -DefLng l -DefObj o -DefVar v DefCur c Sub ExampleDefCur -cCur=Currency REM cCur is an implicit currency variable +cCur=Currency ' cCur is an implicit currency variable End Sub - diff --git a/source/text/sbasic/shared/03101120.xhp b/source/text/sbasic/shared/03101120.xhp index fcaf086f8..cc1060d71 100644 --- a/source/text/sbasic/shared/03101120.xhp +++ b/source/text/sbasic/shared/03101120.xhp @@ -27,38 +27,20 @@ - DefErr statement - DefErr Statement [Runtime] If no type-declaration character or keyword is specified, the DefErr statement sets the default variable type, according to a letter range. -Syntax: - -Defxxx Characterrange1[, Characterrange2[,...]] - - -Parameters: - Characterrange: Letters that specify the range of variables that you want to set a default data type for. - xxx: Keyword that defines the default variable type: - Keyword: Default variable type + DefErr: Error -Example: + -' Prefix definitions for variable types: -DefBool b -DefDate t -DefDbl d -DefInt i -DefLng l -DefObj o -DefVar v DefErr e Sub ExampleDefErr eErr=Error ' eErr is an implicit error variable @@ -66,4 +48,4 @@ - \ No newline at end of file + diff --git a/source/text/sbasic/shared/03101130.xhp b/source/text/sbasic/shared/03101130.xhp index 15f52373a..3e8991e8a 100644 --- a/source/text/sbasic/shared/03101130.xhp +++ b/source/text/sbasic/shared/03101130.xhp @@ -27,38 +27,20 @@ - DefSng statement - DefSng Statement [Runtime] If no type-declaration character or keyword is specified, the DefSng statement sets the default variable type, according to a letter range. -Syntax: - -Defxxx Characterrange1[, Characterrange2[,...]] - - -Parameters: - Characterrange: Letters that specify the range of variables that you want to set a default data type for. - xxx: Keyword that defines the default variable type: - Keyword: Def
[Libreoffice-commits] core.git: helpcontent2
helpcontent2 |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit d3cad5aa238f44d2aad93cccbfe4492e7a871669 Author: Laurent Balland-Poirier <laurent.balland-poir...@laposte.net> Date: Wed May 17 22:25:57 2017 +0200 Updated core Project: help fc04019be5ce20fe8acd95e1cc41ba099dd51cb0 Basic: merge identical def and example Defxxx Change-Id: I64abb89958c823d636c402ad4fee1f008742b491 Reviewed-on: https://gerrit.libreoffice.org/37789 Reviewed-by: Olivier Hallot <olivier.hal...@edx.srv.br> Tested-by: Olivier Hallot <olivier.hal...@edx.srv.br> diff --git a/helpcontent2 b/helpcontent2 index 3d5e0e547daa..fc04019be5ce 16 --- a/helpcontent2 +++ b/helpcontent2 @@ -1 +1 @@ -Subproject commit 3d5e0e547daaed4c5587d403877a04916cf23eb9 +Subproject commit fc04019be5ce20fe8acd95e1cc41ba099dd51cb0 ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits