[Libreoffice-commits] core.git: Branch 'distro/collabora/lov-5.2' - 10 commits - framework/source package/source sc/source svl/source sw/source vcl/source vcl/unx xmloff/source
anwilli5
anwilli5 at ncsu.edu
Wed Aug 10 10:04:28 UTC 2016
framework/source/accelerators/acceleratorconfiguration.cxx | 9 +++-
framework/source/accelerators/presethandler.cxx | 24 ++-----------
framework/source/inc/accelerators/presethandler.hxx | 3 +
framework/source/services/autorecovery.cxx | 13 +++++++
package/source/manifest/ManifestDefines.hxx | 4 +-
package/source/manifest/ManifestExport.cxx | 4 +-
package/source/manifest/ManifestImport.cxx | 3 +
package/source/manifest/ManifestImport.hxx | 1
sc/source/core/data/column4.cxx | 14 +++++++
sc/source/core/tool/interpr4.cxx | 15 ++++++--
svl/source/numbers/numfmuno.cxx | 2 -
sw/source/ui/misc/bookmark.cxx | 12 +++---
sw/source/uibase/inc/bookmark.hxx | 1
vcl/source/control/edit.cxx | 5 ++
vcl/source/edit/vclmedit.cxx | 7 ---
vcl/source/window/window2.cxx | 2 -
vcl/unx/generic/gdi/x11cairotextrender.cxx | 23 ++++--------
xmloff/source/forms/propertyimport.cxx | 11 +++++
18 files changed, 94 insertions(+), 59 deletions(-)
New commits:
commit 9e47646c34905a0ac41c12763eb90cfa01ca88a4
Author: anwilli5 <anwilli5 at ncsu.edu>
Date: Sun Jun 5 23:06:05 2016 -0400
tdf#96607 'Save as' doesn't update global auto-recovery state
The auto-recovery service maintains a list of structures (one for each open
document) containing information needed to carry out the auto-save
functionality. One such piece of information is the location of the backup
file, stored in a struct member named 'OldTempURL'. At every auto-save
interval, this list is iterated through and a function (implts_saveOneDoc)
is called during each iteration to save the current state of the associated
document.
The algorithm works as follows:
1. A new backup file URL is chosen so as not to conflict with any already
existing backup files in the backup directory. This URL is based on the
file name and incorporates a number (starting at 0) that is incremented
until a name is chosen that doesn't conflict.
2. The document is saved to this new backup file URL
3. The previous backup file (indicated by its structure's 'OldTempURL') is
deleted
4. The new backup file URL is stored (in its structure's 'OldTempURL') for the
next time the file needs to be saved.
Assuming you start with a new Writer doc and then make some changes, when it is
time to auto-save, the backup file name 'untitled_0.odt' (excluding path) will
be selected, the latest state of the open file will be written to that backup
file, and the full URL for the backup file will be saved into the struct
'OldTempURL' member.
The next time changes are made and an auto-save occurs, this algorithm will
result in the name 'untitled_1.odt' being selected, the file contents saved
into this new file, 'untitled_0.odt' being deleted, and the full URL for the
new backup file being saved in 'OldTempURL'.
The third time through results in 'untitled_0.odt' being selected (since this
file doesn't exist on disk), and subsequent iterations of auto-saving cause
the backup file name to alternate between the two aforementioned.
The problem occurs during a 'Save as' operation. When this happens, the backup
file is deleted (which is fine - it was just saved, and the next auto-save will
back it up) but 'OldTempURL' is not properly reset (see below for more info.)
During the next auto-save, 'untitled_0.odt' will be selected for the new backup
file name (since no file exists by this name), and one of two things will
happen (based on how many auto-saves have occurred):
1. 'OldTempURL' points to 'untitled_1.odt', and the algorithm above continues
to work correctly (at least in that it continues to backup file contents.)
2. 'OldTempURL' points to 'untitled_0.odt', the name chosen for the new backup
file. In this case, the document contents will be saved to this file
(step 2) but then the file will be deleted (step 3). 'OldTempURL' will
maintain this URL from then on out, causing this case to be hit for all
future auto-save intervals.
So, 50% of the time (30 minutes out of every hour) auto-save will stop backing
up file contents on a 'Save as'.
The function that handles the 'Save as' case (implts_markDocumentAsSaved)
clears 'OldTempURL' and sets other relavent struct members for a local variable
copy of the global struct, but doesn't copy them back. :( These changes are
effectively lost when the function returns.
There are several other cases where this appears to be happening as well, but
more work is needed to determine whether this is actually the case:
- implts_prepareSessionShutdown
- implts_saveDocs, handling the 'dangerousDocs' and in a few other places
- implts_openDocs
- implts_resetHandleStates
Also, there is some JUnitTest code for auto-save, but it is currently disabled
(and fails to run successfully.) It'd be great to get these working again, or
to just write python equivalents. Implementing this would like take me a while,
though, so for now I just tested manually to ensure that this fixes the issue.
When I have some more time I'd like to work more on this, but I wanted to send
this patch in for now to address bug #96607.
This may also address bug #99890, since some of the struct members that don't
make it into the global state relate to the file name. I haven't explicitly
tested this case, though.
Change-Id: Ic702d6f78e60c7cf828a1564ccca118dd45d152b
Reviewed-on: https://gerrit.libreoffice.org/25948
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: jan iversen <jani at documentfoundation.org>
Reviewed-on: https://gerrit.libreoffice.org/27919
Tested-by: jan iversen <jani at documentfoundation.org>
Reviewed-by: Aron Budea <baron at caesar.elte.hu>
Reviewed-by: Michael Stahl <mstahl at redhat.com>
diff --git a/framework/source/services/autorecovery.cxx b/framework/source/services/autorecovery.cxx
index 0a1655b..cf97b6d 100644
--- a/framework/source/services/autorecovery.cxx
+++ b/framework/source/services/autorecovery.cxx
@@ -2667,11 +2667,22 @@ void AutoRecovery::implts_markDocumentAsSaved(const css::uno::Reference< css::fr
return;
aInfo = *pIt;
+ /* Since the document has been saved, update its entry in the document
+ * cache. We essentially reset the state of the document from an
+ * autorecovery perspective, updating things like the filename (which
+ * would change in the case of a 'Save as' operation) and the associated
+ * backup file URL. */
+
aInfo.DocumentState = AutoRecovery::E_UNKNOWN;
// TODO replace getLocation() with getURL() ... it's a workaround currently only!
css::uno::Reference< css::frame::XStorable > xDoc(aInfo.Document, css::uno::UNO_QUERY);
aInfo.OrgURL = xDoc->getLocation();
+ /* Save off the backup file URLs and then clear them. NOTE - it is
+ * important that we clear them - otherwise, we could enter a state
+ * where pIt->OldTempURL == pIt->NewTempURL and our backup algorithm
+ * in implts_saveOneDoc will write to that URL and then delete the file
+ * at that URL (bug #96607) */
sRemoveURL1 = aInfo.OldTempURL;
sRemoveURL2 = aInfo.NewTempURL;
aInfo.OldTempURL.clear();
@@ -2692,6 +2703,8 @@ void AutoRecovery::implts_markDocumentAsSaved(const css::uno::Reference< css::fr
aInfo.UsedForSaving = false;
+ *pIt = aInfo;
+
} /* SAFE */
implts_flushConfigItem(aInfo);
commit a3911b8294cd1f9565280f378780f4f01ace97bb
Author: Eike Rathke <erack at redhat.com>
Date: Tue Aug 9 12:36:58 2016 +0200
do not resolve system locale when queried, rhbz#1364406 related
When loading older documents that calculated a number format on the fly an
inherited but default format of a type could had been applied using the fixed
resolved locale instead of the default system locale, which then was stored
upon save and remained sticky. This because a format the formula depends on
already was applied using the resolved system locale.
http://bugs.documentfoundation.org/attachment.cgi?id=78559 of tdf#63267
exhibits the behavior on the hidden sheet 'Festwerte' when unprotected and
inspecting number formats in column A under Datum.
Change-Id: If23908f259458e988c5164cc5e268bfc9a6a6bcd
(cherry picked from commit 0d386267458b881f15e555186b52f7e2517ceca1)
Reviewed-on: https://gerrit.libreoffice.org/28004
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
Tested-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/svl/source/numbers/numfmuno.cxx b/svl/source/numbers/numfmuno.cxx
index 0f87d68..e349d81 100644
--- a/svl/source/numbers/numfmuno.cxx
+++ b/svl/source/numbers/numfmuno.cxx
@@ -723,7 +723,7 @@ uno::Any SAL_CALL SvNumberFormatObj::getPropertyValue( const OUString& aProperty
}
else if (aPropertyName == PROPERTYNAME_LOCALE)
{
- lang::Locale aLocale( LanguageTag( pFormat->GetLanguage()).getLocale());
+ lang::Locale aLocale( LanguageTag( pFormat->GetLanguage()).getLocale( false));
aRet <<= aLocale;
}
else if (aPropertyName == PROPERTYNAME_TYPE)
commit f992e33beb117198a70d51a7a5ac7fa1a775b19d
Author: Eike Rathke <erack at redhat.com>
Date: Fri Aug 5 21:01:49 2016 +0200
Resolves: rhbz#1364406 inherit the actual format index also for date and time
So summing [HH]:MM cells or calculating with dates uses the same format
in the result, not just the default format of a type.
This also fixes the apparently broken state stored by 4.4 (and earlier,
later?) where no type information was stored with the formula cell,
which may be just due to the old behavior of not applying the actual
format but determining it on the fly instead.
Change-Id: I14d0a7d07185bf5c77e0d7f6989a4a1d1a468d27
(cherry picked from commit f2e3de4dfcf10f9a59f8fc3f051c620fd50ef3c2)
Reviewed-on: https://gerrit.libreoffice.org/27916
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
Tested-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/sc/source/core/tool/interpr4.cxx b/sc/source/core/tool/interpr4.cxx
index 8997c8f..e4b3e5e 100644
--- a/sc/source/core/tool/interpr4.cxx
+++ b/sc/source/core/tool/interpr4.cxx
@@ -4149,9 +4149,18 @@ StackVar ScInterpreter::Interpret()
if ( nFuncFmtType != css::util::NumberFormat::UNDEFINED )
{
nRetTypeExpr = nFuncFmtType;
- // inherit the format index only for currency formats
- nRetIndexExpr = ( nFuncFmtType == css::util::NumberFormat::CURRENCY ?
- nFuncFmtIndex : 0 );
+ // Inherit the format index for currency, date or time formats.
+ switch (nFuncFmtType)
+ {
+ case css::util::NumberFormat::CURRENCY:
+ case css::util::NumberFormat::DATE:
+ case css::util::NumberFormat::TIME:
+ case css::util::NumberFormat::DATETIME:
+ nRetIndexExpr = nFuncFmtIndex;
+ break;
+ default:
+ nRetIndexExpr = 0;
+ }
}
}
commit cd8609d61fdd92e14359e9c710ac0a1c0a1e1189
Author: Eike Rathke <erack at redhat.com>
Date: Tue Aug 2 19:55:08 2016 +0200
Resolves: tdf#100582 SetMatColsRows() when constructing matrix ScFormulaCell
... from an ScFormulaCellGroup token array, because ScFormulaResult that holds
the matrix dimensions is not cloned in that case as we don't clone from an
ScFormulaCell.
Change-Id: I13ab1b29db71ae1618580de995fe12ec423d4dc7
(cherry picked from commit c82a81bbda104ef08dd9e18725a09475b2d65183)
Reviewed-on: https://gerrit.libreoffice.org/27808
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
Tested-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/sc/source/core/data/column4.cxx b/sc/source/core/data/column4.cxx
index 6e8e4da..b524c59 100644
--- a/sc/source/core/data/column4.cxx
+++ b/sc/source/core/data/column4.cxx
@@ -483,6 +483,16 @@ void ScColumn::CloneFormulaCell(
sc::CellStoreType::iterator itPos = maCells.begin();
sc::CellTextAttrStoreType::iterator itAttrPos = maCellTextAttrs.begin();
+ SCCOL nMatrixCols = 0;
+ SCROW nMatrixRows = 0;
+ sal_uInt8 nMatrixFlag = rSrc.GetMatrixFlag();
+ if (nMatrixFlag == MM_FORMULA)
+ {
+ rSrc.GetMatColsRows( nMatrixCols, nMatrixRows);
+ SAL_WARN_IF( nMatrixCols != 1 || nMatrixRows != 1, "sc.core",
+ "ScColumn::CloneFormulaCell - cloning array/matrix with not exactly one column or row as single cell");
+ }
+
std::vector<ScFormulaCell*> aFormulas;
std::vector<sc::RowSpan>::const_iterator itSpan = rRanges.begin(), itSpanEnd = rRanges.end();
for (; itSpan != itSpanEnd; ++itSpan)
@@ -514,7 +524,9 @@ void ScColumn::CloneFormulaCell(
xGroup->compileCode(*pDocument, aPos, pDocument->GetGrammar());
for (size_t i = 0; i < nLen; ++i, aPos.IncRow())
{
- ScFormulaCell* pCell = new ScFormulaCell(pDocument, aPos, xGroup, pDocument->GetGrammar(), rSrc.GetMatrixFlag());
+ ScFormulaCell* pCell = new ScFormulaCell(pDocument, aPos, xGroup, pDocument->GetGrammar(), nMatrixFlag);
+ if (nMatrixFlag == MM_FORMULA)
+ pCell->SetMatColsRows( nMatrixCols, nMatrixRows);
if (i == 0)
{
xGroup->mpTopCell = pCell;
commit c30d94fc319110fe6e903bb97a4e80255eff2c56
Author: Michael Stahl <mstahl at redhat.com>
Date: Mon Aug 8 15:03:54 2016 +0200
OFFICE-3708: package: recognize correct SHA256 URL
ODF 1.2 uses an incorrect URL to refer to SHA256, add support for the
correct W3C URL on import but continue to export the incorrect URL for
now.
Change-Id: I3135bcf989070d20f85f14702db07595f304e706
(cherry picked from commit 1015d35f2362953f415804476037d4f162eb49b5)
Reviewed-on: https://gerrit.libreoffice.org/27988
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Miklos Vajna <vmiklos at collabora.co.uk>
diff --git a/package/source/manifest/ManifestDefines.hxx b/package/source/manifest/ManifestDefines.hxx
index 3db4a0b..968aed6 100644
--- a/package/source/manifest/ManifestDefines.hxx
+++ b/package/source/manifest/ManifestDefines.hxx
@@ -52,7 +52,9 @@
#define ATTRIBUTE_SALT "manifest:salt"
#define ATTRIBUTE_ITERATION_COUNT "manifest:iteration-count"
-#define SHA256_URL "http://www.w3.org/2000/09/xmldsig#sha256"
+/// OFFICE-3708: wrong URL cited in ODF 1.2 and used since OOo 3.4 beta
+#define SHA256_URL_ODF12 "http://www.w3.org/2000/09/xmldsig#sha256"
+#define SHA256_URL "http://www.w3.org/2001/04/xmlenc#sha256"
#define SHA1_NAME "SHA1"
#define SHA1_URL "http://www.w3.org/2000/09/xmldsig#sha1"
diff --git a/package/source/manifest/ManifestExport.cxx b/package/source/manifest/ManifestExport.cxx
index 2c12b5f..ebb87f6 100644
--- a/package/source/manifest/ManifestExport.cxx
+++ b/package/source/manifest/ManifestExport.cxx
@@ -81,6 +81,7 @@ ManifestExport::ManifestExport( uno::Reference< xml::sax::XDocumentHandler > xHa
const OUString sWhiteSpace ( " " );
+ const OUString sSHA256_URL_ODF12 ( SHA256_URL_ODF12 );
const OUString sSHA256_URL ( SHA256_URL );
const OUString sSHA1_Name ( SHA1_NAME );
@@ -350,7 +351,8 @@ ManifestExport::ManifestExport( uno::Reference< xml::sax::XDocumentHandler > xHa
*pStartKeyAlg >>= nStartKeyAlgID;
if ( nStartKeyAlgID == xml::crypto::DigestID::SHA256 )
{
- sStartKeyAlg = sSHA256_URL;
+ sStartKeyAlg = sSHA256_URL_ODF12; // TODO use sSHA256_URL
+ (void) sSHA256_URL;
aBuffer.append( (sal_Int32)32 );
sStartKeySize = aBuffer.makeStringAndClear();
}
diff --git a/package/source/manifest/ManifestImport.cxx b/package/source/manifest/ManifestImport.cxx
index 69d5a33..1b171bc 100644
--- a/package/source/manifest/ManifestImport.cxx
+++ b/package/source/manifest/ManifestImport.cxx
@@ -70,6 +70,7 @@ ManifestImport::ManifestImport( vector < Sequence < PropertyValue > > & rNewManV
, sStartKeyAlgProperty ( "StartKeyAlgorithm" )
, sDigestAlgProperty ( "DigestAlgorithm" )
+ , sSHA256_URL_ODF12 ( SHA256_URL_ODF12 )
, sSHA256_URL ( SHA256_URL )
, sSHA1_Name ( SHA1_NAME )
, sSHA1_URL ( SHA1_URL )
@@ -228,7 +229,7 @@ void ManifestImport::doStartKeyAlg(StringHashMap &rConvertedAttribs)
throw( uno::RuntimeException )
{
OUString aString = rConvertedAttribs[sStartKeyAlgNameAttribute];
- if ( aString.equals( sSHA256_URL ) ) {
+ if (aString.equals(sSHA256_URL) || aString.equals(sSHA256_URL_ODF12)) {
aSequence[PKG_MNFST_STARTALG].Name = sStartKeyAlgProperty;
aSequence[PKG_MNFST_STARTALG].Value <<= xml::crypto::DigestID::SHA256;
} else if ( aString.equals( sSHA1_Name ) || aString.equals( sSHA1_URL ) ) {
diff --git a/package/source/manifest/ManifestImport.hxx b/package/source/manifest/ManifestImport.hxx
index 1948496..4e25499 100644
--- a/package/source/manifest/ManifestImport.hxx
+++ b/package/source/manifest/ManifestImport.hxx
@@ -93,6 +93,7 @@ protected:
const OUString sStartKeyAlgProperty;
const OUString sDigestAlgProperty;
+ const OUString sSHA256_URL_ODF12;
const OUString sSHA256_URL;
const OUString sSHA1_Name;
const OUString sSHA1_URL;
commit 8d70c510c5cfbc4eef063f1df250bbef6fd03716
Author: Caolán McNamara <caolanm at redhat.com>
Date: Thu Aug 4 17:23:30 2016 +0100
Resolves: tdf#101213 drop use of CAIRO_OPERATOR_DIFFERENCE
for tdf#99446 and rhbz#1283420 there is a hackaround which ended up in 5.1.5,
which is not in 5.1.4, for corrupt glyphs under X. I can still reproduce the
problem if I drop the CAIRO_OPERATOR_DIFFERENCE usage here with master and
gtk2.
This alternative hackaround to force a read of the underlying surface works
just as well (help->license information is the reproducer) but reportedly
solves the performance regression.
(cherry picked from commit 705d7597480b2307d7e4929ce9386d80ce2a0f16)
Change-Id: Ie3c5b07409537a1734226b4ce034620351297e25
Reviewed-on: https://gerrit.libreoffice.org/27983
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Miklos Vajna <vmiklos at collabora.co.uk>
diff --git a/vcl/unx/generic/gdi/x11cairotextrender.cxx b/vcl/unx/generic/gdi/x11cairotextrender.cxx
index cf8bc99..f25ed1f 100644
--- a/vcl/unx/generic/gdi/x11cairotextrender.cxx
+++ b/vcl/unx/generic/gdi/x11cairotextrender.cxx
@@ -38,10 +38,6 @@ struct _XRegion
BOX extents;
};
-#if CAIRO_VERSION < CAIRO_VERSION_ENCODE(1, 10, 0)
-# define CAIRO_OPERATOR_DIFFERENCE (static_cast<cairo_operator_t>(23))
-#endif
-
X11CairoTextRender::X11CairoTextRender(X11SalGraphics& rParent)
: mrParent(rParent)
{
@@ -56,17 +52,16 @@ cairo_t* X11CairoTextRender::getCairoContext()
{
cairo_t *cr = mrParent.getCairoContext();
- //rhbz#1283420 bodge to draw and undraw something which has the side effect
- //of making the mysterious xrender related problem go away
- if (cairo_version() >= CAIRO_VERSION_ENCODE(1, 10, 0))
+ //rhbz#1283420 bodge to force a read from the underlying surface which has
+ //the side effect of making the mysterious xrender related problem go away
{
- cairo_save(cr);
- cairo_set_source_rgb(cr, 1.0, 1.0, 1.0);
- cairo_set_operator(cr, CAIRO_OPERATOR_DIFFERENCE);
- cairo_rectangle(cr, 0, 0, 1, 1);
- cairo_fill_preserve(cr);
- cairo_fill(cr);
- cairo_restore(cr);
+ cairo_surface_t *target = cairo_get_target(cr);
+ cairo_surface_t *throw_away = cairo_surface_create_similar(target, cairo_surface_get_content(target), 1, 1);
+ cairo_t *force_read_cr = cairo_create(throw_away);
+ cairo_set_source_surface(force_read_cr, target, 0, 0);
+ cairo_paint(force_read_cr);
+ cairo_destroy(force_read_cr);
+ cairo_surface_destroy(throw_away);
}
return cr;
commit bb62677f6a1638e825fe44e90842cc5c33fe7b21
Author: Caolán McNamara <caolanm at redhat.com>
Date: Mon Aug 8 15:37:10 2016 +0100
Resolves: tdf#101359 getBookmarksCount includes more than aTableBookmarks
aTableBookmarks is just "BOOKMARK"s while getBookmarksCount() includes two
extra types. So cache the result of getBookmarksCount when filling
aTableBookmarks to compare if the count from the time of filling
aTableBookmarks is unchanged.
Change-Id: I69fedab613f23e4e2b30498e4620a370d92272e0
(cherry picked from commit cdb708291b59ac89b43c24154f0edc77f237eadd)
Reviewed-on: https://gerrit.libreoffice.org/27992
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Miklos Vajna <vmiklos at collabora.co.uk>
diff --git a/sw/source/ui/misc/bookmark.cxx b/sw/source/ui/misc/bookmark.cxx
index 1ab72f8..6798738 100644
--- a/sw/source/ui/misc/bookmark.cxx
+++ b/sw/source/ui/misc/bookmark.cxx
@@ -246,7 +246,7 @@ bool SwInsertBookmarkDlg::ValidateBookmarks()
bool SwInsertBookmarkDlg::HaveBookmarksChanged()
{
IDocumentMarkAccess* const pMarkAccess = rSh.getIDocumentMarkAccess();
- if (pMarkAccess->getBookmarksCount() != static_cast<sal_Int32>(aTableBookmarks.size()))
+ if (pMarkAccess->getBookmarksCount() != m_nLastBookmarksCount)
return true;
IDocumentMarkAccess::const_iterator_t ppBookmark = pMarkAccess->getBookmarksBegin();
@@ -277,16 +277,18 @@ void SwInsertBookmarkDlg::PopulateTable()
aTableBookmarks.push_back(std::make_pair(ppBookmark->get(), ppBookmark->get()->GetName()));
}
}
+ m_nLastBookmarksCount = pMarkAccess->getBookmarksCount();
}
void SwInsertBookmarkDlg::Apply()
{
}
-SwInsertBookmarkDlg::SwInsertBookmarkDlg(vcl::Window* pParent, SwWrtShell& rS, SfxRequest& rRequest) :
- SvxStandardDialog(pParent, "InsertBookmarkDialog", "modules/swriter/ui/insertbookmark.ui"),
- rSh(rS),
- rReq(rRequest)
+SwInsertBookmarkDlg::SwInsertBookmarkDlg(vcl::Window* pParent, SwWrtShell& rS, SfxRequest& rRequest)
+ : SvxStandardDialog(pParent, "InsertBookmarkDialog", "modules/swriter/ui/insertbookmark.ui")
+ , rSh(rS)
+ , rReq(rRequest)
+ , m_nLastBookmarksCount(0)
{
get(m_pBookmarksContainer, "bookmarks");
get(m_pEditBox, "name");
diff --git a/sw/source/uibase/inc/bookmark.hxx b/sw/source/uibase/inc/bookmark.hxx
index 0754f69..472cedb 100644
--- a/sw/source/uibase/inc/bookmark.hxx
+++ b/sw/source/uibase/inc/bookmark.hxx
@@ -61,6 +61,7 @@ class SwInsertBookmarkDlg: public SvxStandardDialog
SwWrtShell& rSh;
SfxRequest& rReq;
std::vector<std::pair<sw::mark::IMark*, OUString>> aTableBookmarks;
+ sal_Int32 m_nLastBookmarksCount;
DECL_LINK_TYPED(ModifyHdl, Edit&, void);
DECL_LINK_TYPED(InsertHdl, Button*, void);
commit e07b0828278389cd612453d107ce532f6eaa4ae5
Author: Michael Stahl <mstahl at redhat.com>
Date: Tue Jul 19 14:50:18 2016 +0200
xmloff: forms import: convert relative xlink:href to absolute
There is currently only one place in the forms directory that converts
relative hyperlinks to absolute on import, in
OURLReferenceImport::handleAttribute(), but there are other elements
that have xlink:href attribute as well, such as form:form.
The export of form:form xlink:href does convert absolute to relative,
in exportTargetLocationAttribute(), but if the model URL is actually
already relative it will be converted to absolute instead, oddly enough.
This leads to different absolute href attributes, depending on the
directory where the file is exported, as can be observed with e.g.
ooo95698-1.odt and fdo40634-2.odt.
Let's apply a big hammer and make all "href" attributes absolute on
import.
Change-Id: I39d05707f3a8a899c7bbde8d9c0e2bc006c39e12
(cherry picked from commit c49b87ac140f3f2c79c8211f38cd86118022bdce)
Reviewed-on: https://gerrit.libreoffice.org/27901
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Miklos Vajna <vmiklos at collabora.co.uk>
diff --git a/xmloff/source/forms/propertyimport.cxx b/xmloff/source/forms/propertyimport.cxx
index fa92c1c..33ac8ac 100644
--- a/xmloff/source/forms/propertyimport.cxx
+++ b/xmloff/source/forms/propertyimport.cxx
@@ -323,7 +323,16 @@ bool OPropertyImport::handleAttribute(sal_uInt16 /*_nNamespaceKey*/, const OUStr
aNewValue.Name = pProperty->sPropertyName;
// convert the value string into the target type
- aNewValue.Value = PropertyConversion::convertString(pProperty->aPropertyType, _rValue, pProperty->pEnumMap, pProperty->bInverseSemantics);
+ if (token::IsXMLToken(_rLocalName, token::XML_HREF))
+ {
+ aNewValue.Value <<= m_rContext.getGlobalContext().GetAbsoluteReference(_rValue);
+ }
+ else
+ {
+ aNewValue.Value = PropertyConversion::convertString(
+ pProperty->aPropertyType, _rValue, pProperty->pEnumMap,
+ pProperty->bInverseSemantics);
+ }
implPushBackPropertyValue( aNewValue );
return true;
}
commit d9a2076674f22fdf7ade10f488ca64b22ebad2bb
Author: Michael Stahl <mstahl at redhat.com>
Date: Fri Jul 29 22:58:21 2016 +0200
framework: stop adding silly empty accelerator/current.xml files
... to ODF packages. Somehow this is even skipped sometimes, but it's
much easier to just turn off the silliness than find out why.
Change-Id: Iff509dfd8325fd517e6434bcb56edbd06a3c27f1
(cherry picked from commit d76e3abe130007086099c62c5b425aaef82dc944)
Reviewed-on: https://gerrit.libreoffice.org/27900
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Miklos Vajna <vmiklos at collabora.co.uk>
diff --git a/framework/source/accelerators/acceleratorconfiguration.cxx b/framework/source/accelerators/acceleratorconfiguration.cxx
index ae62a7a..3e27f5c 100644
--- a/framework/source/accelerators/acceleratorconfiguration.cxx
+++ b/framework/source/accelerators/acceleratorconfiguration.cxx
@@ -232,7 +232,8 @@ void SAL_CALL XMLBasedAcceleratorConfiguration::reload()
css::uno::Reference< css::io::XStream > xStreamNoLang;
{
SolarMutexGuard g;
- xStream = m_aPresetHandler.openTarget(TARGET_CURRENT); // open or create!
+ xStream = m_aPresetHandler.openTarget(TARGET_CURRENT,
+ css::embed::ElementModes::READ);
try
{
xStreamNoLang = m_aPresetHandler.openPreset(PRESET_DEFAULT);
@@ -273,7 +274,8 @@ void SAL_CALL XMLBasedAcceleratorConfiguration::store()
css::uno::Reference< css::io::XStream > xStream;
{
SolarMutexGuard g;
- xStream = m_aPresetHandler.openTarget(TARGET_CURRENT); // open or create!
+ xStream = m_aPresetHandler.openTarget(TARGET_CURRENT,
+ css::embed::ElementModes::READWRITE); // open or create!
}
css::uno::Reference< css::io::XOutputStream > xOut;
@@ -329,7 +331,8 @@ sal_Bool SAL_CALL XMLBasedAcceleratorConfiguration::isReadOnly()
css::uno::Reference< css::io::XStream > xStream;
{
SolarMutexGuard g;
- xStream = m_aPresetHandler.openTarget(TARGET_CURRENT); // open or create!
+ xStream = m_aPresetHandler.openTarget(TARGET_CURRENT,
+ css::embed::ElementModes::READWRITE); // open or create!
}
css::uno::Reference< css::io::XOutputStream > xOut;
diff --git a/framework/source/accelerators/presethandler.cxx b/framework/source/accelerators/presethandler.cxx
index 1845677..628cfa2 100644
--- a/framework/source/accelerators/presethandler.cxx
+++ b/framework/source/accelerators/presethandler.cxx
@@ -586,7 +586,8 @@ css::uno::Reference< css::io::XStream > PresetHandler::openPreset(const OUString
return xStream;
}
-css::uno::Reference< css::io::XStream > PresetHandler::openTarget(const OUString& sTarget)
+css::uno::Reference< css::io::XStream > PresetHandler::openTarget(
+ const OUString& sTarget, sal_Int32 const nMode)
{
css::uno::Reference< css::embed::XStorage > xFolder;
{
@@ -598,26 +599,9 @@ css::uno::Reference< css::io::XStream > PresetHandler::openTarget(const OUString
if (!xFolder.is())
return css::uno::Reference< css::io::XStream >();
- OUString sFile(sTarget);
- sFile += ".xml";
+ OUString const sFile(sTarget + ".xml");
- // try it in read/write mode first and ignore errors.
- css::uno::Reference< css::io::XStream > xStream;
- try
- {
- xStream = xFolder->openStreamElement(sFile, css::embed::ElementModes::READWRITE);
- return xStream;
- }
- catch(const css::uno::RuntimeException&)
- { throw; }
- catch(const css::uno::Exception&)
- { xStream.clear(); }
-
- // try it readonly if it failed before.
- // inform user about errors (use original exceptions!)
- xStream = xFolder->openStreamElement(sFile, css::embed::ElementModes::READ);
-
- return xStream;
+ return xFolder->openStreamElement(sFile, nMode);
}
void PresetHandler::commitUserChanges()
diff --git a/framework/source/inc/accelerators/presethandler.hxx b/framework/source/inc/accelerators/presethandler.hxx
index 3451ef7..be781c2 100644
--- a/framework/source/inc/accelerators/presethandler.hxx
+++ b/framework/source/inc/accelerators/presethandler.hxx
@@ -297,7 +297,8 @@ class PresetHandler
@return The opened target stream ... or NULL if the target does not exists
or couldnt be created as new one.
*/
- css::uno::Reference< css::io::XStream > openTarget(const OUString& sTarget);
+ css::uno::Reference< css::io::XStream > openTarget(
+ const OUString& sTarget, sal_Int32 nMode);
/** @short do anything which is necessary to flush all changes
back to disk.
commit e1ce7af64eee1140b1746e39ce18e3e6397b4347
Author: Caolán McNamara <caolanm at redhat.com>
Date: Thu Aug 4 12:12:40 2016 +0100
Resolves: tdf#97120 printing controls uses wrong font and font sizes
regression apparently since
commit 825b3df7f1d987021ec4a08ff8e7ed78e5772c97
Date: Thu Oct 22 19:03:01 2015 +0200
tdf#94138 fix printing of edit form fields
revert the GetDrawPixelFont part of that so the font is pulled
from the control and not the device its printed to, this makes
tdf#97120 and tdf#97120 work properly again
then revert
commit 6c41727484a04ab89005ffb052937dae5d7dc223
Date: Tue Dec 1 17:44:23 2015 +0100
tdf#94138 Use correct fonts for multiline edit when printing
because that replicates the original GetDrawPixelFont behaviour
so its not needed after the other revert.
Then, to solve the original tdf#94138, in the edit StateChanged handler call
ApplySettings(*this); like FixedText::StateChanged does to merge in the
controlfont setting to the underlying OutputDevice of the control, which
presumably is what is then retrieved from GetDrawPixelFont
Change-Id: I992a0e2011ffce7748d39f7f2bc49fbf6b8eaa79
(cherry picked from commit 5a5db03acc605a02c76c0f2977079b3dcf48de22)
Reviewed-on: https://gerrit.libreoffice.org/27879
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Miklos Vajna <vmiklos at collabora.co.uk>
diff --git a/vcl/source/control/edit.cxx b/vcl/source/control/edit.cxx
index aab72e8..33032c3 100644
--- a/vcl/source/control/edit.cxx
+++ b/vcl/source/control/edit.cxx
@@ -2268,6 +2268,7 @@ void Edit::StateChanged( StateChangedType nType )
{
if (!mpSubEdit)
{
+ ApplySettings(*this);
ImplShowCursor();
Invalidate();
}
@@ -2276,6 +2277,7 @@ void Edit::StateChanged( StateChangedType nType )
{
if (!mpSubEdit)
{
+ ApplySettings(*this);
ImplShowCursor();
Invalidate();
}
@@ -2284,6 +2286,7 @@ void Edit::StateChanged( StateChangedType nType )
{
if (!mpSubEdit)
{
+ ApplySettings(*this);
Invalidate();
}
}
@@ -2291,6 +2294,7 @@ void Edit::StateChanged( StateChangedType nType )
{
if (!mpSubEdit)
{
+ ApplySettings(*this);
Invalidate();
}
}
@@ -2307,6 +2311,7 @@ void Edit::DataChanged( const DataChangedEvent& rDCEvt )
{
if ( !mpSubEdit )
{
+ ApplySettings(*this);
ImplShowCursor();
Invalidate();
}
diff --git a/vcl/source/edit/vclmedit.cxx b/vcl/source/edit/vclmedit.cxx
index 7f25066..cd1adb6 100644
--- a/vcl/source/edit/vclmedit.cxx
+++ b/vcl/source/edit/vclmedit.cxx
@@ -1365,12 +1365,7 @@ void VclMultiLineEdit::Draw( OutputDevice* pDev, const Point& rPos, const Size&
Point aPos = pDev->LogicToPixel( rPos );
Size aSize = pDev->LogicToPixel( rSize );
- vcl::Font aFont = pImpVclMEdit->GetTextWindow()->GetPointFont(*this);
- Size aFontSize = aFont.GetFontSize();
- MapMode aPtMapMode(MAP_POINT);
- aFontSize = pDev->LogicToPixel(aFontSize, aPtMapMode);
- aFont.SetFontSize(aFontSize);
-
+ vcl::Font aFont = pImpVclMEdit->GetTextWindow()->GetDrawPixelFont(pDev);
aFont.SetTransparent( true );
OutDevType eOutDevType = pDev->GetOutDevType();
diff --git a/vcl/source/window/window2.cxx b/vcl/source/window/window2.cxx
index cd67ca6..3cd36e24 100644
--- a/vcl/source/window/window2.cxx
+++ b/vcl/source/window/window2.cxx
@@ -654,7 +654,7 @@ Size Window::CalcOutputSize( const Size& rWinSz ) const
vcl::Font Window::GetDrawPixelFont(OutputDevice* pDev) const
{
- vcl::Font aFont = GetPointFont(*pDev);
+ vcl::Font aFont = GetPointFont(*const_cast<Window*>(this));
Size aFontSize = aFont.GetFontSize();
MapMode aPtMapMode(MAP_POINT);
aFontSize = pDev->LogicToPixel( aFontSize, aPtMapMode );
More information about the Libreoffice-commits
mailing list