summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--basic/source/classes/eventatt.cxx71
-rw-r--r--connectivity/inc/connectivity/FValue.hxx12
-rw-r--r--connectivity/source/commontools/FValue.cxx154
-rw-r--r--desktop/source/app/app.cxx7
-rw-r--r--desktop/source/deployment/gui/dp_gui_updatedialog.cxx28
-rw-r--r--fpicker/source/aqua/SalAquaPicker.cxx5
-rw-r--r--officecfg/registry/data/org/openoffice/VCL.xcu16
-rw-r--r--shell/source/tools/lngconvex/lngconvex.cxx31
-rw-r--r--svx/source/dialog/hyperdlg.cxx6
9 files changed, 244 insertions, 86 deletions
diff --git a/basic/source/classes/eventatt.cxx b/basic/source/classes/eventatt.cxx
index 7776b57829..b0c8f4b3c3 100644
--- a/basic/source/classes/eventatt.cxx
+++ b/basic/source/classes/eventatt.cxx
@@ -95,53 +95,48 @@ Any sbxToUnoValue( SbxVariable* pVar );
Reference< frame::XModel > getModelFromBasic( SbxObject* pBasic )
{
- Reference< frame::XModel > xModel;
-
- SbxObject* basicChosen = pBasic;
-
- if ( basicChosen == NULL)
+ OSL_PRECOND( pBasic != NULL, "getModelFromBasic: illegal call!" );
+ if ( !pBasic )
+ return NULL;
+
+ // look for the ThisComponent variable, first in the parent (which
+ // might be the document's Basic), then in the parent's parent (which might be
+ // the application Basic)
+ const ::rtl::OUString sThisComponent( RTL_CONSTASCII_USTRINGPARAM( "ThisComponent" ) );
+ SbxVariable* pThisComponent = NULL;
+
+ SbxObject* pLookup = pBasic->GetParent();
+ while ( pLookup && !pThisComponent )
{
- OSL_TRACE("getModelFromBasic() StarBASIC* is NULL" );
- return xModel;
+ pThisComponent = pLookup->Find( sThisComponent, SbxCLASS_OBJECT );
+ pLookup = pLookup->GetParent();
}
- SbxObject* p = pBasic;
- SbxObject* pParent = p->GetParent();
- SbxObject* pParentParent = pParent ? pParent->GetParent() : NULL;
-
- if( pParentParent )
+ if ( !pThisComponent )
{
- basicChosen = pParentParent;
+ OSL_TRACE("Failed to get ThisComponent");
+ // the application Basic, at the latest, should have this variable
+ return NULL;
}
- else if( pParent )
+
+ Any aThisComponent( sbxToUnoValue( pThisComponent ) );
+ Reference< frame::XModel > xModel( aThisComponent, UNO_QUERY );
+ if ( !xModel.is() )
{
- basicChosen = pParent;
+ // it's no XModel. Okay, ThisComponent nowadays is allowed to be a controller.
+ Reference< frame::XController > xController( aThisComponent, UNO_QUERY );
+ if ( xController.is() )
+ xModel = xController->getModel();
}
+ if ( !xModel.is() )
+ return NULL;
- Any aModel;
- SbxVariable *pCompVar = basicChosen->Find( UniString(RTL_CONSTASCII_USTRINGPARAM("ThisComponent")), SbxCLASS_OBJECT );
+#if OSL_DEBUG_LEVEL > 0
+ OSL_TRACE("Have model ThisComponent points to url %s",
+ ::rtl::OUStringToOString( xModel->getURL(),
+ RTL_TEXTENCODING_ASCII_US ).pData->buffer );
+#endif
- if ( pCompVar )
- {
- aModel = sbxToUnoValue( pCompVar );
- if ( sal_False == ( aModel >>= xModel ) ||
- !xModel.is() )
- {
- OSL_TRACE("Failed to extract model from thisComponent ");
- return xModel;
- }
- else
- {
- OSL_TRACE("Have model ThisComponent points to url %s",
- ::rtl::OUStringToOString( xModel->getURL(),
- RTL_TEXTENCODING_ASCII_US ).pData->buffer );
-
- }
- }
- else
- {
- OSL_TRACE("Failed to get ThisComponent");
- }
return xModel;
}
diff --git a/connectivity/inc/connectivity/FValue.hxx b/connectivity/inc/connectivity/FValue.hxx
index 6fdbae4389..8bcfa0eaed 100644
--- a/connectivity/inc/connectivity/FValue.hxx
+++ b/connectivity/inc/connectivity/FValue.hxx
@@ -44,9 +44,15 @@
#include <com/sun/star/util/Time.hpp>
#include <com/sun/star/uno/Sequence.hxx>
#include <com/sun/star/sdbc/XRow.hpp>
+#include <com/sun/star/sdb/XColumn.hpp>
namespace connectivity
{
+ namespace detail
+ {
+ class IValueSource;
+ }
+
class OOO_DLLPUBLIC_DBTOOLS ORowSetValue
{
union
@@ -361,6 +367,12 @@ namespace connectivity
const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRow>& _xRow);
void fill(const ::com::sun::star::uno::Any& _rValue);
+
+ void fill( const sal_Int32 _nType,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XColumn >& _rxColumn );
+
+ private:
+ void impl_fill( const sal_Int32 _nType, sal_Bool _bNullable, const detail::IValueSource& _rValueSource );
};
/// ORowSetValueDecorator decorates a ORowSetValue so the value is "refcounted"
diff --git a/connectivity/source/commontools/FValue.cxx b/connectivity/source/commontools/FValue.cxx
index 37e91d22c8..3068acde8b 100644
--- a/connectivity/source/commontools/FValue.cxx
+++ b/connectivity/source/commontools/FValue.cxx
@@ -40,13 +40,16 @@
#include <rtl/ustrbuf.hxx>
#include <rtl/logfile.hxx>
-using namespace connectivity;
-using namespace dbtools;
+using namespace ::dbtools;
using namespace ::com::sun::star::sdbc;
+using namespace ::com::sun::star::sdb;
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::util;
using namespace ::com::sun::star::io;
+namespace connectivity
+{
+
namespace {
static sal_Bool isStorageCompatible(sal_Int32 _eType1, sal_Int32 _eType2)
{
@@ -1809,6 +1812,107 @@ void ORowSetValue::setSigned(sal_Bool _bMod)
}
}
}
+
+// -----------------------------------------------------------------------------
+namespace detail
+{
+ class SAL_NO_VTABLE IValueSource
+ {
+ public:
+ virtual ::rtl::OUString getString() const = 0;
+ virtual sal_Bool getBoolean() const = 0;
+ virtual sal_Int8 getByte() const = 0;
+ virtual sal_Int16 getShort() const = 0;
+ virtual sal_Int32 getInt() const = 0;
+ virtual sal_Int64 getLong() const = 0;
+ virtual float getFloat() const = 0;
+ virtual double getDouble() const = 0;
+ virtual Date getDate() const = 0;
+ virtual Time getTime() const = 0;
+ virtual DateTime getTimestamp() const = 0;
+ virtual Sequence< sal_Int8 > getBytes() const = 0;
+ virtual Reference< XInputStream > getBinaryStream() const = 0;
+ virtual Reference< XInputStream > getCharacterStream() const = 0;
+ virtual sal_Bool wasNull() const = 0;
+
+ virtual ~IValueSource() { }
+ };
+
+ class RowValue : public IValueSource
+ {
+ public:
+ RowValue( const Reference< XRow >& _xRow, const sal_Int32 _nPos )
+ :m_xRow( _xRow )
+ ,m_nPos( _nPos )
+ {
+ }
+
+ // IValueSource
+ virtual ::rtl::OUString getString() const { return m_xRow->getString( m_nPos ); };
+ virtual sal_Bool getBoolean() const { return m_xRow->getBoolean( m_nPos ); };
+ virtual sal_Int8 getByte() const { return m_xRow->getByte( m_nPos ); };
+ virtual sal_Int16 getShort() const { return m_xRow->getShort( m_nPos ); }
+ virtual sal_Int32 getInt() const { return m_xRow->getInt( m_nPos ); }
+ virtual sal_Int64 getLong() const { return m_xRow->getLong( m_nPos ); }
+ virtual float getFloat() const { return m_xRow->getFloat( m_nPos ); };
+ virtual double getDouble() const { return m_xRow->getDouble( m_nPos ); };
+ virtual Date getDate() const { return m_xRow->getDate( m_nPos ); };
+ virtual Time getTime() const { return m_xRow->getTime( m_nPos ); };
+ virtual DateTime getTimestamp() const { return m_xRow->getTimestamp( m_nPos ); };
+ virtual Sequence< sal_Int8 > getBytes() const { return m_xRow->getBytes( m_nPos ); };
+ virtual Reference< XInputStream > getBinaryStream() const { return m_xRow->getBinaryStream( m_nPos ); };
+ virtual Reference< XInputStream > getCharacterStream() const { return m_xRow->getCharacterStream( m_nPos ); };
+ virtual sal_Bool wasNull() const { return m_xRow->wasNull( ); };
+
+ private:
+ const Reference< XRow > m_xRow;
+ const sal_Int32 m_nPos;
+ };
+
+ class ColumnValue : public IValueSource
+ {
+ public:
+ ColumnValue( const Reference< XColumn >& _rxColumn )
+ :m_xColumn( _rxColumn )
+ {
+ }
+
+ // IValueSource
+ virtual ::rtl::OUString getString() const { return m_xColumn->getString(); };
+ virtual sal_Bool getBoolean() const { return m_xColumn->getBoolean(); };
+ virtual sal_Int8 getByte() const { return m_xColumn->getByte(); };
+ virtual sal_Int16 getShort() const { return m_xColumn->getShort(); }
+ virtual sal_Int32 getInt() const { return m_xColumn->getInt(); }
+ virtual sal_Int64 getLong() const { return m_xColumn->getLong(); }
+ virtual float getFloat() const { return m_xColumn->getFloat(); };
+ virtual double getDouble() const { return m_xColumn->getDouble(); };
+ virtual Date getDate() const { return m_xColumn->getDate(); };
+ virtual Time getTime() const { return m_xColumn->getTime(); };
+ virtual DateTime getTimestamp() const { return m_xColumn->getTimestamp(); };
+ virtual Sequence< sal_Int8 > getBytes() const { return m_xColumn->getBytes(); };
+ virtual Reference< XInputStream > getBinaryStream() const { return m_xColumn->getBinaryStream(); };
+ virtual Reference< XInputStream > getCharacterStream() const { return m_xColumn->getCharacterStream(); };
+ virtual sal_Bool wasNull() const { return m_xColumn->wasNull( ); };
+
+ private:
+ const Reference< XColumn > m_xColumn;
+ };
+}
+
+// -----------------------------------------------------------------------------
+void ORowSetValue::fill( const sal_Int32 _nType, const Reference< XColumn >& _rxColumn )
+{
+ detail::ColumnValue aColumnValue( _rxColumn );
+ impl_fill( _nType, sal_True, aColumnValue );
+}
+
+// -----------------------------------------------------------------------------
+void ORowSetValue::fill( sal_Int32 _nPos, sal_Int32 _nType, sal_Bool _bNullable, const Reference< XRow>& _xRow )
+{
+ detail::RowValue aRowValue( _xRow, _nPos );
+ impl_fill( _nType, _bNullable, aRowValue );
+}
+
// -----------------------------------------------------------------------------
void ORowSetValue::fill(sal_Int32 _nPos,
sal_Int32 _nType,
@@ -1819,10 +1923,8 @@ void ORowSetValue::fill(sal_Int32 _nPos,
}
// -----------------------------------------------------------------------------
-void ORowSetValue::fill(sal_Int32 _nPos,
- sal_Int32 _nType,
- sal_Bool _bNullable,
- const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRow>& _xRow)
+void ORowSetValue::impl_fill( const sal_Int32 _nType, sal_Bool _bNullable, const detail::IValueSource& _rValueSource )
+
{
RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbtools", "Ocke.Janssen@sun.com", "ORowSetValue::fill (2)" );
sal_Bool bReadData = sal_True;
@@ -1833,63 +1935,63 @@ void ORowSetValue::fill(sal_Int32 _nPos,
case DataType::DECIMAL:
case DataType::NUMERIC:
case DataType::LONGVARCHAR:
- (*this) = _xRow->getString(_nPos);
+ (*this) = _rValueSource.getString();
break;
case DataType::BIGINT:
if ( isSigned() )
- (*this) = _xRow->getLong(_nPos);
+ (*this) = _rValueSource.getLong();
else
- (*this) = _xRow->getString(_nPos);
+ (*this) = _rValueSource.getString();
break;
case DataType::FLOAT:
- (*this) = _xRow->getFloat(_nPos);
+ (*this) = _rValueSource.getFloat();
break;
case DataType::DOUBLE:
case DataType::REAL:
- (*this) = _xRow->getDouble(_nPos);
+ (*this) = _rValueSource.getDouble();
break;
case DataType::DATE:
- (*this) = _xRow->getDate(_nPos);
+ (*this) = _rValueSource.getDate();
break;
case DataType::TIME:
- (*this) = _xRow->getTime(_nPos);
+ (*this) = _rValueSource.getTime();
break;
case DataType::TIMESTAMP:
- (*this) = _xRow->getTimestamp(_nPos);
+ (*this) = _rValueSource.getTimestamp();
break;
case DataType::BINARY:
case DataType::VARBINARY:
case DataType::LONGVARBINARY:
- (*this) = _xRow->getBytes(_nPos);
+ (*this) = _rValueSource.getBytes();
break;
case DataType::BIT:
case DataType::BOOLEAN:
- (*this) = _xRow->getBoolean(_nPos);
+ (*this) = _rValueSource.getBoolean();
break;
case DataType::TINYINT:
if ( isSigned() )
- (*this) = _xRow->getByte(_nPos);
+ (*this) = _rValueSource.getByte();
else
- (*this) = _xRow->getShort(_nPos);
+ (*this) = _rValueSource.getShort();
break;
case DataType::SMALLINT:
if ( isSigned() )
- (*this) = _xRow->getShort(_nPos);
+ (*this) = _rValueSource.getShort();
else
- (*this) = _xRow->getInt(_nPos);
+ (*this) = _rValueSource.getInt();
break;
case DataType::INTEGER:
if ( isSigned() )
- (*this) = _xRow->getInt(_nPos);
+ (*this) = _rValueSource.getInt();
else
- (*this) = _xRow->getLong(_nPos);
+ (*this) = _rValueSource.getLong();
break;
case DataType::CLOB:
- (*this) = ::com::sun::star::uno::makeAny(_xRow->getCharacterStream(_nPos));
+ (*this) = ::com::sun::star::uno::makeAny(_rValueSource.getCharacterStream());
setTypeKind(DataType::CLOB);
break;
case DataType::BLOB:
- (*this) = ::com::sun::star::uno::makeAny(_xRow->getBinaryStream(_nPos));
+ (*this) = ::com::sun::star::uno::makeAny(_rValueSource.getBinaryStream());
setTypeKind(DataType::BLOB);
break;
default:
@@ -1897,7 +1999,7 @@ void ORowSetValue::fill(sal_Int32 _nPos,
bReadData = false;
break;
}
- if ( bReadData && _bNullable && _xRow->wasNull() )
+ if ( bReadData && _bNullable && _rValueSource.wasNull() )
setNull();
setTypeKind(_nType);
}
@@ -2043,3 +2145,5 @@ void ORowSetValue::fill(const Any& _rValue)
break;
}
}
+
+} // namespace connectivity
diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx
index 7f937bbd79..aadf6bc625 100644
--- a/desktop/source/app/app.cxx
+++ b/desktop/source/app/app.cxx
@@ -1468,6 +1468,13 @@ void Desktop::Main()
xContainerWindow = xBackingFrame->getContainerWindow();
if (xContainerWindow.is())
{
+ // set the WB_EXT_DOCUMENT style. Normally, this is done by the TaskCreator service when a "_blank"
+ // frame/window is created. Since we do not use the TaskCreator here, we need to mimic its behavior,
+ // otherwise documents loaded into this frame will later on miss functionality depending on the style.
+ Window* pContainerWindow = VCLUnoHelper::GetWindow( xContainerWindow );
+ OSL_ENSURE( pContainerWindow, "Desktop::Main: no implementation access to the frame's container window!" );
+ pContainerWindow->SetExtendedStyle( pContainerWindow->GetExtendedStyle() | WB_EXT_DOCUMENT );
+
SetSplashScreenProgress(75);
Sequence< Any > lArgs(1);
lArgs[0] <<= xContainerWindow;
diff --git a/desktop/source/deployment/gui/dp_gui_updatedialog.cxx b/desktop/source/deployment/gui/dp_gui_updatedialog.cxx
index ea05a7394b..2620a1f29a 100644
--- a/desktop/source/deployment/gui/dp_gui_updatedialog.cxx
+++ b/desktop/source/deployment/gui/dp_gui_updatedialog.cxx
@@ -284,8 +284,8 @@ private:
css::uno::Reference< css::uno::XComponentContext > m_context;
UpdateDialog & m_dialog;
std::vector< dp_gui::TUpdateListEntry > m_vExtensionList;
- css::uno::Reference< css::deployment::XUpdateInformationProvider >
- m_updateInformation;
+ css::uno::Reference< css::deployment::XUpdateInformationProvider > m_updateInformation;
+ css::uno::Reference< css::task::XInteractionHandler > m_xInteractionHdl;
// guarded by Application::GetSolarMutex():
css::uno::Reference< css::task::XAbortChannel > m_abort;
@@ -302,7 +302,21 @@ UpdateDialog::Thread::Thread(
m_updateInformation(
css::deployment::UpdateInformationProvider::create(context)),
m_stop(false)
-{}
+{
+ if( m_context.is() )
+ {
+ css::uno::Reference< css::lang::XMultiComponentFactory > xServiceManager( m_context->getServiceManager() );
+
+ if( xServiceManager.is() )
+ {
+ m_xInteractionHdl = css::uno::Reference< css::task::XInteractionHandler > (
+ xServiceManager->createInstanceWithContext( OUSTR( "com.sun.star.task.InteractionHandler" ), m_context),
+ css::uno::UNO_QUERY );
+ if ( m_xInteractionHdl.is() )
+ m_updateInformation->setInteractionHandler( m_xInteractionHdl );
+ }
+ }
+}
void UpdateDialog::Thread::stop() {
css::uno::Reference< css::task::XAbortChannel > abort;
@@ -327,7 +341,11 @@ UpdateDialog::Thread::Entry::Entry(
version(theVersion)
{}
-UpdateDialog::Thread::~Thread() {}
+UpdateDialog::Thread::~Thread()
+{
+ if ( m_xInteractionHdl.is() )
+ m_updateInformation->setInteractionHandler( css::uno::Reference< css::task::XInteractionHandler > () );
+}
void UpdateDialog::Thread::execute()
{
@@ -1260,7 +1278,7 @@ IMPL_LINK( UpdateDialog, hyperlink_clicked, svt::FixedHyperlink*, pHyperlink )
{
css::uno::Reference< css::system::XSystemShellExecute > xSystemShellExecute(
m_context->getServiceManager()->createInstanceWithContext(
- ::rtl::OUString::createFromAscii( "com.sun.star.system.SystemShellExecute" ),
+ OUSTR( "com.sun.star.system.SystemShellExecute" ),
m_context), css::uno::UNO_QUERY_THROW);
//throws css::lang::IllegalArgumentException, css::system::SystemShellExecuteException
xSystemShellExecute->execute(
diff --git a/fpicker/source/aqua/SalAquaPicker.cxx b/fpicker/source/aqua/SalAquaPicker.cxx
index 8face272e4..c084c71a25 100644
--- a/fpicker/source/aqua/SalAquaPicker.cxx
+++ b/fpicker/source/aqua/SalAquaPicker.cxx
@@ -208,7 +208,10 @@ int SalAquaPicker::run()
}
if (retVal == NSFileHandlingPanelOKButton) {
- implsetDisplayDirectory([[NSURL fileURLWithPath:[m_pDialog directory]] OUStringForInfo:FULLPATH]);
+ NSString* pDir = [m_pDialog directory];
+ if (pDir) {
+ implsetDisplayDirectory([[NSURL fileURLWithPath:pDir] OUStringForInfo:FULLPATH]);
+ }
}
DBG_PRINT_EXIT(CLASS_NAME, __func__, retVal);
diff --git a/officecfg/registry/data/org/openoffice/VCL.xcu b/officecfg/registry/data/org/openoffice/VCL.xcu
index 299debc853..afda854cbb 100644
--- a/officecfg/registry/data/org/openoffice/VCL.xcu
+++ b/officecfg/registry/data/org/openoffice/VCL.xcu
@@ -1648,9 +1648,9 @@
<value>Default,Serif</value>
</prop>
</node>
- <node oor:name="bitstreamveramono" oor:op="replace">
+ <node oor:name="bitstreamverasansmono" oor:op="replace">
<prop oor:name="SubstFonts">
- <value>dejavumono</value>
+ <value>dejavusansmono;couriernew;liberationmono</value>
</prop>
<prop oor:name="SubstFontsHTML"><value>monospace</value></prop>
<prop oor:name="FontWeight"><value>Normal</value></prop>
@@ -2377,7 +2377,7 @@
</node>
<node oor:name="couriernew" oor:op="replace">
<prop oor:name="SubstFonts">
- <value>cumberland;cumberlandamt;liberationmono;nimbusmonol;courier;lucidatypewriter;lucidasanstypewriter;monaco;monospaced;nimbusmono;nimbusmonol</value>
+ <value>cumberland;cumberlandamt;liberationmono;dejavusansmono;nimbusmonol;courier;lucidatypewriter;lucidasanstypewriter;monaco;monospaced;nimbusmono;nimbusmonol</value>
</prop>
<prop oor:name="SubstFontsMS"><value></value></prop>
<prop oor:name="SubstFontsPS"><value>Courier</value></prop>
@@ -2388,7 +2388,7 @@
</node>
<node oor:name="cumberland" oor:op="replace">
<prop oor:name="SubstFonts">
- <value>cumberlandamt;couriernew;liberationmono;nimbusmonol;courier;lucidatypewriter;lucidasanstypewriter;monaco;monospaced;nimbusmono;nimbusmonol</value>
+ <value>cumberlandamt;couriernew;liberationmono;dejavusansmono;nimbusmonol;courier;lucidatypewriter;lucidasanstypewriter;monaco;monospaced;nimbusmono;nimbusmonol</value>
</prop>
<prop oor:name="SubstFontsMS">
<value>Courier New</value>
@@ -2411,7 +2411,7 @@
</node>
<node oor:name="cumberlandamt" oor:op="replace">
<prop oor:name="SubstFonts">
- <value>cumberland;couriernew;liberationmono;nimbusmonol;courier;lucidatypewriter;lucidasanstypewriter;monaco;monospaced;nimbusmono;nimbusmonol</value>
+ <value>cumberland;couriernew;liberationmono;dejavusansmono;nimbusmonol;courier;lucidatypewriter;lucidasanstypewriter;monaco;monospaced;nimbusmono;nimbusmonol</value>
</prop>
<prop oor:name="SubstFontsMS">
<value>Courier New</value>
@@ -2498,9 +2498,9 @@
<value>Default,Serif</value>
</prop>
</node>
- <node oor:name="dejavumono" oor:op="replace">
+ <node oor:name="dejavusansmono" oor:op="replace">
<prop oor:name="SubstFonts">
- <value>bitstreamveramono</value>
+ <value>bitstreamverasansmono;couriernew;liberationmono</value>
</prop>
<prop oor:name="SubstFontsHTML"><value>monospace</value></prop>
<prop oor:name="FontWeight"><value>Normal</value></prop>
@@ -4739,7 +4739,7 @@
</node>
<node oor:name="liberationmono" oor:op="replace">
<prop oor:name="SubstFonts">
- <value>cumberland;cumberlandamt;couriernew;nimbusmonol;courier;lucidatypewriter;lucidasanstypewriter;monaco;monospaced;nimbusmono;nimbusmonol</value>
+ <value>cumberland;cumberlandamt;couriernew;dejavusansmono;nimbusmonol;courier;lucidatypewriter;lucidasanstypewriter;monaco;monospaced;nimbusmono;nimbusmonol</value>
</prop>
<prop oor:name="SubstFontsMS">
<value>Courier New</value>
diff --git a/shell/source/tools/lngconvex/lngconvex.cxx b/shell/source/tools/lngconvex/lngconvex.cxx
index e5fa02155f..927e626a48 100644
--- a/shell/source/tools/lngconvex/lngconvex.cxx
+++ b/shell/source/tools/lngconvex/lngconvex.cxx
@@ -65,6 +65,7 @@
#include <sstream>
#include <iterator>
#include <algorithm>
+#include <string>
namespace /* private */
{
@@ -324,6 +325,8 @@ private:
iso_lang_identifier active_iso_lang_;
};
+typedef std::map< unsigned short , std::string , std::less< unsigned short > > shortmap;
+
//###########################################
void add_group_entries(
Config& aConfig,
@@ -334,21 +337,35 @@ void add_group_entries(
aConfig.SetGroup(GroupName);
size_t key_count = aConfig.GetKeyCount();
+ shortmap map;
for (size_t i = 0; i < key_count; i++)
{
ByteString iso_lang = aConfig.GetKeyName(sal::static_int_cast<USHORT>(i));
ByteString key_value_utf8 = aConfig.ReadKey(sal::static_int_cast<USHORT>(i));
+ iso_lang_identifier myiso_lang( iso_lang );
+ LanguageType ltype = MsLangId::convertIsoNamesToLanguage(myiso_lang.language(), myiso_lang.country());
+ if( ( ltype & 0x0200 ) == 0 && map[ ltype ].empty() )
+ {
+ Substitutor.set_language(iso_lang_identifier(iso_lang));
- Substitutor.set_language(iso_lang_identifier(iso_lang));
-
- key_value_utf8.EraseLeadingAndTrailingChars('\"');
+ key_value_utf8.EraseLeadingAndTrailingChars('\"');
- OUString key_value_utf16 =
- rtl::OStringToOUString(key_value_utf8, RTL_TEXTENCODING_UTF8);
+ OUString key_value_utf16 =
+ rtl::OStringToOUString(key_value_utf8, RTL_TEXTENCODING_UTF8);
- Substitutor.add_substitution(
- GroupName.GetBuffer(), make_winrc_unicode_string(key_value_utf16));
+ Substitutor.add_substitution(
+ GroupName.GetBuffer(), make_winrc_unicode_string(key_value_utf16));
+ map[ static_cast<unsigned short>(ltype) ] = std::string( iso_lang.GetBuffer() );
+ }
+ else
+ {
+ if( !map[ ltype ].empty() )
+ {
+ printf("ERROR: Duplicated ms id %d found for the languages %s and %s !!!! This does not work in microsoft resources\nPlease remove one!\n", ltype , map[ ltype ].c_str() , iso_lang.GetBuffer());
+ exit( -1 );
+ }
+ }
}
}
diff --git a/svx/source/dialog/hyperdlg.cxx b/svx/source/dialog/hyperdlg.cxx
index 3bb5f0b6b1..efbe2e850b 100644
--- a/svx/source/dialog/hyperdlg.cxx
+++ b/svx/source/dialog/hyperdlg.cxx
@@ -78,9 +78,11 @@ SvxHlinkDlgWrapper::SvxHlinkDlgWrapper( Window* _pParent, USHORT nId,
pWindow = mpDlg->GetWindow();
((MyStruct*)pImp)->bVisible = FALSE;
- if ( pInfo->aSize.Width() != 0 && pInfo->aSize.Height() != 0 )
+ Window* pTopWindow = 0;
+ if ( pInfo->aSize.Width() != 0 && pInfo->aSize.Height() != 0 &&
+ (0 != (pTopWindow = SFX_APP()->GetTopWindow())))
{
- Size aParentSize( SFX_APP()->GetTopWindow()->GetSizePixel() );
+ Size aParentSize( pTopWindow->GetSizePixel() );
Size aDlgSize ( GetSizePixel () );
if( aParentSize.Width() < pInfo->aPos.X() )