[Libreoffice-commits] .: Branch 'libreoffice-3-5' - 3 commits - connectivity/source solenv/gbuild sw/source
Michael Stahl
mst at kemper.freedesktop.org
Sat Jan 14 12:32:28 PST 2012
connectivity/source/drivers/dbase/dindexnode.cxx | 21 ++++++++++-----
solenv/gbuild/UnoApiTarget.mk | 32 +++++++++++++++++------
sw/source/ui/uno/unotxdoc.cxx | 3 ++
3 files changed, 42 insertions(+), 14 deletions(-)
New commits:
commit 5a25394f397634d1f11df28171727a578354e56c
Author: Michael Stahl <mstahl at redhat.com>
Date: Sat Jan 14 21:01:10 2012 +0100
gbuild: UnoApiTarget: fix dependencies
This should fix the bug, probably introduced with the per-directory
performance enhancements, that after a change to an IDL file 2 builds
are required to rebuild everything.
(cherry picked from commit 26450b3136979db86577591ef380040972d111fc)
diff --git a/solenv/gbuild/UnoApiTarget.mk b/solenv/gbuild/UnoApiTarget.mk
index e5415df..e557577 100644
--- a/solenv/gbuild/UnoApiTarget.mk
+++ b/solenv/gbuild/UnoApiTarget.mk
@@ -76,8 +76,10 @@ endef
# for interfaces, exceptions, structs, enums, constant groups
define gb_UnoApiTarget_add_idlfile
-$(call gb_UnoApiTarget_get_target,$(1)) : $(call gb_UnoApiPartTarget_get_target,$(2)/$(3).urd)
-$(call gb_UnoApiPartTarget_get_target,$(2)/$(3).urd) : $(call gb_UnoApiPartTarget_get_target,$(2)/idl.done)
+$(call gb_UnoApiTarget_get_target,$(1)) : \
+ $(call gb_UnoApiPartTarget_get_target,$(2)/idl.done)
+$(call gb_UnoApiPartTarget_get_target,$(2)/idl.done) : \
+ $(call gb_UnoApiPartTarget_get_target,$(2)/$(3).urd)
gb_UnoApiTarget_HPPFILES_$(1) += $(2)/$(3).hdl
gb_UnoApiTarget_HPPFILES_$(1) += $(2)/$(3).hpp
gb_UnoApiTarget_IDLFILES_$(1) += $(2)/$(3).idl
@@ -97,8 +99,10 @@ endef
# for old-style services and modules
define gb_UnoApiTarget_add_idlfile_noheader
-$(call gb_UnoApiTarget_get_target,$(1)) : $(call gb_UnoApiPartTarget_get_target,$(2)/$(3).urd)
-$(call gb_UnoApiPartTarget_get_target,$(2)/$(3).urd) : $(call gb_UnoApiPartTarget_get_target,$(2)/idl_noheader.done)
+$(call gb_UnoApiTarget_get_target,$(1)) : \
+ $(call gb_UnoApiPartTarget_get_target,$(2)/idl_noheader.done)
+$(call gb_UnoApiPartTarget_get_target,$(2)/idl_noheader.done) : \
+ $(call gb_UnoApiPartTarget_get_target,$(2)/$(3).urd)
gb_UnoApiTarget_IDLFILES_$(1) += $(2)/$(3).idl
endef
@@ -113,8 +117,10 @@ endef
# for new-style services
define gb_UnoApiTarget_add_idlfile_nohdl
-$(call gb_UnoApiTarget_get_target,$(1)) : $(call gb_UnoApiPartTarget_get_target,$(2)/$(3).urd)
-$(call gb_UnoApiPartTarget_get_target,$(2)/$(3).urd) : $(call gb_UnoApiPartTarget_get_target,$(2)/idl_nohdl.done)
+$(call gb_UnoApiTarget_get_target,$(1)) : \
+ $(call gb_UnoApiPartTarget_get_target,$(2)/idl_nohdl.done)
+$(call gb_UnoApiPartTarget_get_target,$(2)/idl_nohdl.done) : \
+ $(call gb_UnoApiPartTarget_get_target,$(2)/$(3).urd)
gb_UnoApiTarget_HPPFILES_$(1) += $(2)/$(3).hpp
gb_UnoApiTarget_IDLFILES_$(1) += $(2)/$(3).idl
@@ -170,11 +176,23 @@ $(call gb_UnoApiTarget_get_clean_target,%) :
-rm -rf $(call gb_UnoApiTarget_get_header_target,$*)\
$(call gb_UnoApiPartTarget_get_target,$*)
+# The .urd files are actually created by the gb_UnoApiPartTarget__command,
+# invoked for the per-directory .done files.
+# The reason why .urd files are tracked is so new files that are added are
+# picked up and cause a rebuild, even if older than the .done file (also, as a
+# convenience for users who delete them from the workdir by hand; this dummy
+# rule plus the dependency from the .done target to the .urd file plus the
+# sort/patsubst call in gb_UnoApiPartTarget__command cause command to be
+# invoked with the .idl file corresponding to the .urd in that case.
+$(call gb_UnoApiPartTarget_get_target,%.urd) :
+ @true
+
define gb_UnoApiPartTarget__command
$$(call gb_Output_announce,$(2),$(true),IDL,2)
mkdir -p $(call gb_UnoApiPartTarget_get_target,$(2)) && \
RESPONSEFILE=$$(call var2file,$$(shell $(gb_MKTEMP)),500,\
- $$(call gb_Helper_convert_native,$$(INCLUDE) $$(DEFS) -O $(call gb_UnoApiPartTarget_get_target,$(2)) -verbose -C $$?)) && \
+ $$(call gb_Helper_convert_native,$$(INCLUDE) $$(DEFS) -O $(call gb_UnoApiPartTarget_get_target,$(2)) -verbose -C \
+ $$(sort $$(patsubst $$(call gb_UnoApiPartTarget_get_target,%.urd),$(SRCDIR)/%.idl,$$?)))) && \
$(gb_UnoApiTarget_IDLCCOMMAND) @$$$${RESPONSEFILE} > /dev/null && \
rm -f $$$${RESPONSEFILE} && \
touch $$@
commit 4c4ea76c78ceb0003d7049e1c6eb81c6999eba44
Author: Michael Stahl <mstahl at redhat.com>
Date: Sat Jan 14 20:59:35 2012 +0100
connectivity: dbase: global variable cleanup
(cherry picked from commit 88cceffc271e747be830675d62d24b6749a417f5)
diff --git a/connectivity/source/drivers/dbase/dindexnode.cxx b/connectivity/source/drivers/dbase/dindexnode.cxx
index 0b67e1d..f4e5277 100644
--- a/connectivity/source/drivers/dbase/dindexnode.cxx
+++ b/connectivity/source/drivers/dbase/dindexnode.cxx
@@ -34,6 +34,7 @@
#include "diagnose_ex.h"
#include <algorithm>
+#include <boost/scoped_array.hpp>
using namespace connectivity;
@@ -683,8 +684,6 @@ void ONDXNode::Read(SvStream &rStream, ODbaseIndex& rIndex)
rStream >> aChild;
}
-char aData[128];
-
//------------------------------------------------------------------
void ONDXNode::Write(SvStream &rStream, const ONDXPage& rPage) const
{
@@ -696,24 +695,32 @@ void ONDXNode::Write(SvStream &rStream, const ONDXPage& rPage) const
if (rIndex.getHeader().db_keytype) // double
{
+ if (sizeof(double) != rIndex.getHeader().db_keylen)
+ {
+ OSL_TRACE("this key length cannot possibly be right?");
+ }
if (aKey.getValue().isNull())
{
- memset(aData,0,rIndex.getHeader().db_keylen);
- rStream.Write((sal_uInt8*)aData,rIndex.getHeader().db_keylen);
+ sal_uInt8 buf[sizeof(double)];
+ memset(&buf[0], 0, sizeof(double));
+ rStream.Write(&buf[0], sizeof(double));
}
else
rStream << (double) aKey.getValue();
}
else
{
- memset(aData,0x20,rIndex.getHeader().db_keylen);
+ sal_uInt16 const nLen(rIndex.getHeader().db_keylen);
+ ::boost::scoped_array<sal_uInt8> pBuf(new sal_uInt8[nLen]);
+ memset(&pBuf[0], 0x20, nLen);
if (!aKey.getValue().isNull())
{
::rtl::OUString sValue = aKey.getValue();
rtl::OString aText(rtl::OUStringToOString(sValue, rIndex.m_pTable->getConnection()->getTextEncoding()));
- strncpy(aData, aText.getStr(), std::min<size_t>(rIndex.getHeader().db_keylen, aText.getLength()));
+ strncpy(reinterpret_cast<char *>(&pBuf[0]), aText.getStr(),
+ std::min<size_t>(nLen, aText.getLength()));
}
- rStream.Write((sal_uInt8*)aData,rIndex.getHeader().db_keylen);
+ rStream.Write(&pBuf[0], nLen);
}
rStream << aChild;
}
commit 1ee02e390548267aa6eb5fdb06ea247c60a327d0
Author: Michael Stahl <mstahl at redhat.com>
Date: Fri Jan 13 23:54:07 2012 +0100
SwXTextDocument: add some SolarMutexGuards
(cherry picked from commit ff2df7b7b61b557db6540ec7d3b38189677ac7f3)
diff --git a/sw/source/ui/uno/unotxdoc.cxx b/sw/source/ui/uno/unotxdoc.cxx
index 120cb6d..8711d4e 100644
--- a/sw/source/ui/uno/unotxdoc.cxx
+++ b/sw/source/ui/uno/unotxdoc.cxx
@@ -569,6 +569,7 @@ void SwXTextDocument::dispose(void) throw( RuntimeException )
void SwXTextDocument::close( sal_Bool bDeliverOwnership ) throw( util::CloseVetoException, RuntimeException )
{
+ SolarMutexGuard aGuard;
if(IsValid() && m_pHiddenViewFrame)
lcl_DisposeView( m_pHiddenViewFrame, pDocShell);
SfxBaseModel::close(bDeliverOwnership);
@@ -3023,6 +3024,7 @@ void SAL_CALL SwXTextDocument::render(
Reference<XNameContainer> SAL_CALL SwXTextDocument::getXForms()
throw( RuntimeException )
{
+ SolarMutexGuard aGuard;
if ( !pDocShell )
throw DisposedException( ::rtl::OUString(), static_cast< XTextDocument* >( this ) );
SwDoc* pDoc = pDocShell->GetDoc();
@@ -3032,6 +3034,7 @@ Reference<XNameContainer> SAL_CALL SwXTextDocument::getXForms()
uno::Reference< text::XFlatParagraphIterator > SAL_CALL SwXTextDocument::getFlatParagraphIterator(::sal_Int32 nTextMarkupType, sal_Bool bAutomatic)
throw ( uno::RuntimeException )
{
+ SolarMutexGuard aGuard;
return new SwXFlatParagraphIterator( *pDocShell->GetDoc(), nTextMarkupType, bAutomatic );
}
More information about the Libreoffice-commits
mailing list