fpicker/source/office/iodlgimp.hxx | 2 +- include/vcl/builder.hxx | 3 +++ vcl/source/window/builder.cxx | 7 ++++++- 3 files changed, 10 insertions(+), 2 deletions(-)
New commits: commit 5a83b31acab390785505b84895359fa9fbc25ed9 Author: Caolán McNamara <caol...@redhat.com> Date: Wed Jul 2 11:43:45 2014 +0100 expose a way to drop ownership of a window from builder tree Change-Id: I6f6bff32271ed1d6c328ba211a6b1249fda039dd diff --git a/include/vcl/builder.hxx b/include/vcl/builder.hxx index 3f4841e..baa77d3 100644 --- a/include/vcl/builder.hxx +++ b/include/vcl/builder.hxx @@ -297,6 +297,9 @@ public: OString get_by_window(const ::Window *pWindow) const; void delete_by_window(const ::Window *pWindow); + //release ownership of pWindow, i.e. don't delete it + void drop_ownership(const ::Window *pWindow); + //apply the properties of rProps to pWindow static void set_properties(::Window *pWindow, const stringmap &rProps); diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx index 98055fc..e336a05 100644 --- a/vcl/source/window/builder.cxx +++ b/vcl/source/window/builder.cxx @@ -2998,12 +2998,17 @@ void VclBuilder::delete_by_name(const OString& sID) void VclBuilder::delete_by_window(const Window *pWindow) { + drop_ownership(pWindow); + delete pWindow; +} + +void VclBuilder::drop_ownership(const Window *pWindow) +{ for (std::vector<WinAndId>::iterator aI = m_aChildren.begin(), aEnd = m_aChildren.end(); aI != aEnd; ++aI) { if (aI->m_pWindow == pWindow) { - delete aI->m_pWindow; m_aChildren.erase(aI); break; } commit 5983675eccd9517915d8f5558c25f47c952edb24 Author: Caolán McNamara <caol...@redhat.com> Date: Wed Jul 2 11:09:22 2014 +0100 fix crash when m_aType is '*' Change-Id: If2c4ca98814a58b785cd2670eac1e522e70464fd diff --git a/fpicker/source/office/iodlgimp.hxx b/fpicker/source/office/iodlgimp.hxx index 9b5d5e2..9461af9 100644 --- a/fpicker/source/office/iodlgimp.hxx +++ b/fpicker/source/office/iodlgimp.hxx @@ -57,7 +57,7 @@ public: const OUString& GetName() const { return m_aName; } const OUString& GetType() const { return m_aType; } - const OUString GetExtension() const { return m_aType.copy( 2 ); } + const OUString GetExtension() const { return m_aType.getLength() > 2 ? m_aType.copy( 2 ) : OUString(); } bool isGroupSeparator() const { return m_aType.isEmpty(); } };
_______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits