Merge pull request 'actualizacion-master-2024-11-28' (#2) from actualizacion-master-2024-11-28 into master
Reviewed-on: #2
This commit is contained in:
commit
6c01e1e1fc
1059 changed files with 17371 additions and 13503 deletions
|
@ -981,10 +981,10 @@ $(eval $(call gb_Helper_register_packages_for_install,ooo,\
|
|||
extras_persona_pink \
|
||||
extras_persona_sand \
|
||||
extras_persona_white \
|
||||
extras_tplpresnt \
|
||||
extras_tplwizdesktop \
|
||||
$(if $(WITH_TEMPLATES),\
|
||||
extras_templates \
|
||||
extras_tplpresnt \
|
||||
extras_tplwizbitmap \
|
||||
extras_tplwizard \
|
||||
) \
|
||||
|
|
|
@ -62,7 +62,6 @@ namespace accessibility
|
|||
|
||||
// XServiceInfo
|
||||
virtual OUString SAL_CALL getImplementationName() override;
|
||||
virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
|
||||
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
|
||||
|
||||
// XAccessible
|
||||
|
|
|
@ -77,7 +77,6 @@ namespace accessibility
|
|||
|
||||
// XServiceInfo
|
||||
virtual OUString SAL_CALL getImplementationName() override;
|
||||
virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
|
||||
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
|
||||
|
||||
// XAccessible
|
||||
|
|
|
@ -67,8 +67,7 @@ public:
|
|||
*/
|
||||
css::uno::Reference< css::accessibility::XAccessible> SAL_CALL
|
||||
getAccessibleChild (sal_Int64 i) override;
|
||||
/** The role is always AccessibleRole::COMBO_BOX.
|
||||
*/
|
||||
|
||||
sal_Int16 SAL_CALL getAccessibleRole() override;
|
||||
|
||||
// XAccessibleAction
|
||||
|
@ -107,7 +106,7 @@ protected:
|
|||
|
||||
/** Returns true when the object is valid.
|
||||
*/
|
||||
virtual bool IsValid() const = 0;
|
||||
bool IsValid() const;
|
||||
|
||||
virtual void ProcessWindowChildEvent (const VclWindowEvent& rVclWindowEvent) override;
|
||||
virtual void ProcessWindowEvent (const VclWindowEvent& rVclWindowEvent) override;
|
||||
|
|
|
@ -39,8 +39,6 @@ public:
|
|||
|
||||
private:
|
||||
virtual ~VCLXAccessibleComboBox() override = default;
|
||||
|
||||
virtual bool IsValid() const override;
|
||||
};
|
||||
|
||||
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
||||
|
|
|
@ -41,7 +41,6 @@ public:
|
|||
private:
|
||||
virtual ~VCLXAccessibleDropDownComboBox() override = default;
|
||||
|
||||
virtual bool IsValid() const override;
|
||||
virtual void ProcessWindowEvent(const VclWindowEvent& rVclWindowEvent) override;
|
||||
};
|
||||
|
||||
|
|
|
@ -40,8 +40,6 @@ public:
|
|||
|
||||
private:
|
||||
virtual ~VCLXAccessibleDropDownListBox() override = default;
|
||||
|
||||
virtual bool IsValid() const override;
|
||||
};
|
||||
|
||||
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
||||
|
|
|
@ -63,6 +63,7 @@ public:
|
|||
// XAccessibleContext
|
||||
virtual sal_Int64 SAL_CALL getAccessibleChildCount( ) override;
|
||||
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleChild( sal_Int64 i ) override;
|
||||
virtual OUString SAL_CALL getAccessibleName() override;
|
||||
virtual sal_Int16 SAL_CALL getAccessibleRole( ) override;
|
||||
|
||||
// XAccessibleAction
|
||||
|
@ -101,6 +102,7 @@ public:
|
|||
virtual sal_Bool SAL_CALL setText( const OUString& sText ) override;
|
||||
|
||||
private:
|
||||
bool isComboBoxChild();
|
||||
bool isEditable();
|
||||
};
|
||||
|
||||
|
|
|
@ -38,8 +38,6 @@ public:
|
|||
|
||||
private:
|
||||
virtual ~VCLXAccessibleListBox() override = default;
|
||||
|
||||
virtual bool IsValid() const override;
|
||||
};
|
||||
|
||||
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
||||
|
|
|
@ -25,7 +25,6 @@
|
|||
#include <com/sun/star/lang/IndexOutOfBoundsException.hpp>
|
||||
#include <comphelper/accessiblecontexthelper.hxx>
|
||||
#include <vcl/toolkit/ivctrl.hxx>
|
||||
#include <cppuhelper/supportsservice.hxx>
|
||||
|
||||
|
||||
namespace accessibility
|
||||
|
@ -130,11 +129,6 @@ namespace accessibility
|
|||
u"com.sun.star.awt.AccessibleIconChoiceControl"_ustr};
|
||||
}
|
||||
|
||||
sal_Bool SAL_CALL AccessibleIconChoiceCtrl::supportsService( const OUString& _rServiceName )
|
||||
{
|
||||
return cppu::supportsService(this, _rServiceName);
|
||||
}
|
||||
|
||||
// XAccessible
|
||||
|
||||
Reference< XAccessibleContext > SAL_CALL AccessibleIconChoiceCtrl::getAccessibleContext( )
|
||||
|
|
|
@ -26,7 +26,6 @@
|
|||
#include <com/sun/star/accessibility/AccessibleStateType.hpp>
|
||||
#include <com/sun/star/lang/IndexOutOfBoundsException.hpp>
|
||||
#include <comphelper/accessiblecontexthelper.hxx>
|
||||
#include <cppuhelper/supportsservice.hxx>
|
||||
|
||||
|
||||
namespace accessibility
|
||||
|
@ -261,11 +260,6 @@ namespace accessibility
|
|||
u"com.sun.star.awt.AccessibleTreeListBox"_ustr};
|
||||
}
|
||||
|
||||
sal_Bool SAL_CALL AccessibleListBox::supportsService( const OUString& _rServiceName )
|
||||
{
|
||||
return cppu::supportsService(this, _rServiceName);
|
||||
}
|
||||
|
||||
// XAccessible
|
||||
|
||||
Reference< XAccessibleContext > SAL_CALL AccessibleListBox::getAccessibleContext( )
|
||||
|
|
|
@ -1043,20 +1043,18 @@ void Document::retrieveRunAttributesImpl(
|
|||
tPropValMap aRunAttrSeq;
|
||||
if ( pColor )
|
||||
{
|
||||
css::beans::PropertyValue aPropVal;
|
||||
aPropVal.Name = "CharColor";
|
||||
aPropVal.Handle = -1;
|
||||
aPropVal.Value = mapFontColor( pColor->GetColor() );
|
||||
aPropVal.State = css::beans::PropertyState_DIRECT_VALUE;
|
||||
css::beans::PropertyValue aPropVal{
|
||||
"CharColor", -1,
|
||||
mapFontColor(pColor->GetColor()),
|
||||
css::beans::PropertyState_DIRECT_VALUE};
|
||||
aRunAttrSeq[ aPropVal.Name ] = aPropVal;
|
||||
}
|
||||
if ( pWeight )
|
||||
{
|
||||
css::beans::PropertyValue aPropVal;
|
||||
aPropVal.Name = "CharWeight";
|
||||
aPropVal.Handle = -1;
|
||||
aPropVal.Value = mapFontWeight( pWeight->getFontWeight() );
|
||||
aPropVal.State = css::beans::PropertyState_DIRECT_VALUE;
|
||||
css::beans::PropertyValue aPropVal{
|
||||
"CharWeight", -1,
|
||||
mapFontWeight(pWeight->getFontWeight()),
|
||||
css::beans::PropertyState_DIRECT_VALUE};
|
||||
aRunAttrSeq[ aPropVal.Name ] = aPropVal;
|
||||
}
|
||||
if ( !RequestedAttributes.hasElements() )
|
||||
|
|
|
@ -54,6 +54,11 @@ VCLXAccessibleBox::VCLXAccessibleBox (VCLXWindow* pVCLWindow, BoxType aType, boo
|
|||
|
||||
VCLXAccessibleBox::~VCLXAccessibleBox() {}
|
||||
|
||||
bool VCLXAccessibleBox::IsValid() const
|
||||
{
|
||||
return GetWindow();
|
||||
}
|
||||
|
||||
void VCLXAccessibleBox::ProcessWindowChildEvent( const VclWindowEvent& rVclWindowEvent )
|
||||
{
|
||||
uno::Any aOldValue, aNewValue;
|
||||
|
@ -308,12 +313,8 @@ Reference<XAccessible> SAL_CALL VCLXAccessibleBox::getAccessibleChild (sal_Int64
|
|||
if (m_aBoxType==COMBOBOX)
|
||||
{
|
||||
VclPtr< ComboBox > pComboBox = GetAs< ComboBox >();
|
||||
if (pComboBox!=nullptr && pComboBox->GetSubEdit()!=nullptr)
|
||||
//Set the edit's acc name the same as parent
|
||||
{
|
||||
pComboBox->GetSubEdit()->SetAccessibleName(getAccessibleName());
|
||||
if (pComboBox && pComboBox->GetSubEdit())
|
||||
m_xText = pComboBox->GetSubEdit()->GetAccessible();
|
||||
}
|
||||
}
|
||||
else if (m_bIsDropDownBox)
|
||||
m_xText = new VCLXAccessibleTextField (GetVCLXWindow(),this);
|
||||
|
|
|
@ -30,12 +30,6 @@ VCLXAccessibleComboBox::VCLXAccessibleComboBox (VCLXWindow* pVCLWindow)
|
|||
{
|
||||
}
|
||||
|
||||
|
||||
bool VCLXAccessibleComboBox::IsValid() const
|
||||
{
|
||||
return GetWindow();
|
||||
}
|
||||
|
||||
// XServiceInfo
|
||||
|
||||
OUString VCLXAccessibleComboBox::getImplementationName()
|
||||
|
|
|
@ -33,12 +33,6 @@ VCLXAccessibleDropDownComboBox::VCLXAccessibleDropDownComboBox (VCLXWindow* pVCL
|
|||
{
|
||||
}
|
||||
|
||||
|
||||
bool VCLXAccessibleDropDownComboBox::IsValid() const
|
||||
{
|
||||
return GetWindow();
|
||||
}
|
||||
|
||||
void VCLXAccessibleDropDownComboBox::ProcessWindowEvent (const VclWindowEvent& rVclWindowEvent)
|
||||
{
|
||||
switch ( rVclWindowEvent.GetId() )
|
||||
|
|
|
@ -30,11 +30,6 @@ VCLXAccessibleDropDownListBox::VCLXAccessibleDropDownListBox (VCLXWindow* pVCLWi
|
|||
{
|
||||
}
|
||||
|
||||
bool VCLXAccessibleDropDownListBox::IsValid() const
|
||||
{
|
||||
return GetWindow();
|
||||
}
|
||||
|
||||
// XServiceInfo
|
||||
OUString VCLXAccessibleDropDownListBox::getImplementationName()
|
||||
{
|
||||
|
|
|
@ -168,15 +168,7 @@ bool VCLXAccessibleEdit::PreferFullTextInTextChangedEvent()
|
|||
// for a combobox subedit, the Orca screen reader announces the new/added text
|
||||
// so always send the whole old and new text and not just
|
||||
// the changed characters, so the whole entry text gets announced
|
||||
Reference<XAccessible> xParent = getAccessibleParent();
|
||||
if (xParent.is())
|
||||
{
|
||||
Reference<XAccessibleContext> xParentContext = xParent->getAccessibleContext();
|
||||
if (xParentContext.is() && xParentContext->getAccessibleRole() == AccessibleRole::COMBO_BOX)
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
return isComboBoxChild();
|
||||
}
|
||||
|
||||
// XServiceInfo
|
||||
|
@ -210,6 +202,16 @@ Reference< XAccessible > VCLXAccessibleEdit::getAccessibleChild( sal_Int64 )
|
|||
throw IndexOutOfBoundsException();
|
||||
}
|
||||
|
||||
OUString VCLXAccessibleEdit::getAccessibleName()
|
||||
{
|
||||
OExternalLockGuard aGuard(this);
|
||||
|
||||
// for combobox edit, return name of the parent
|
||||
if (isComboBoxChild())
|
||||
return getAccessibleParent()->getAccessibleContext()->getAccessibleName();
|
||||
|
||||
return VCLXAccessibleTextComponent::getAccessibleName();
|
||||
}
|
||||
|
||||
sal_Int16 VCLXAccessibleEdit::getAccessibleRole( )
|
||||
{
|
||||
|
@ -616,6 +618,18 @@ sal_Bool VCLXAccessibleEdit::setText( const OUString& sText )
|
|||
return bReturn;
|
||||
}
|
||||
|
||||
bool VCLXAccessibleEdit::isComboBoxChild()
|
||||
{
|
||||
Reference<XAccessible> xParent = getAccessibleParent();
|
||||
if (xParent.is())
|
||||
{
|
||||
Reference<XAccessibleContext> xParentContext = xParent->getAccessibleContext();
|
||||
if (xParentContext.is() && xParentContext->getAccessibleRole() == AccessibleRole::COMBO_BOX)
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool VCLXAccessibleEdit::isEditable()
|
||||
{
|
||||
VclPtr<Edit> pEdit = GetAs<Edit>();
|
||||
|
|
|
@ -29,12 +29,6 @@ VCLXAccessibleListBox::VCLXAccessibleListBox (VCLXWindow* pVCLWindow)
|
|||
{
|
||||
}
|
||||
|
||||
|
||||
bool VCLXAccessibleListBox::IsValid() const
|
||||
{
|
||||
return GetWindow();
|
||||
}
|
||||
|
||||
// XServiceInfo
|
||||
|
||||
OUString VCLXAccessibleListBox::getImplementationName()
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<string name="calc_show">Monstrar</string>
|
||||
<string name="pref_developer_mode">Modo de disveloppator</string>
|
||||
<string name="action_pwd_dialog_cancel">Cancellar</string>
|
||||
<string name="create_file">Crear un nove file</string>
|
||||
<string name="create_file">Crear nove file</string>
|
||||
<string name="calc_hide">Celar</string>
|
||||
<string name="action_UNO_commands">Inviar commando UNO</string>
|
||||
<string name="default_document_name">sin titulo</string>
|
||||
|
@ -16,10 +16,10 @@
|
|||
<string name="slideshow_action_back">Retro</string>
|
||||
<string name="bmp_null">Bmp non valide!</string>
|
||||
<string name="action_paste">Collar</string>
|
||||
<string name="action_pwd_dialog_OK">OK</string>
|
||||
<string name="action_pwd_dialog_OK">De accordo</string>
|
||||
<string name="save_document">SALVEGUARDAR</string>
|
||||
<string name="new_spreadsheet">Nove folio de calculo</string>
|
||||
<string name="select_file_to_open">Selige un file a aperir</string>
|
||||
<string name="select_file_to_open">Selectiona file a aperir</string>
|
||||
<string name="unable_to_export_pdf">Non poteva exportar a PDF</string>
|
||||
<string name="action_save_as">Salveguardar como…</string>
|
||||
<string name="font_color">Color de littera</string>
|
||||
|
@ -29,9 +29,9 @@
|
|||
<string name="file_icon_desc">icone de file</string>
|
||||
<string name="title_recents">Files recente</string>
|
||||
<string name="page">Pagina</string>
|
||||
<string name="calc_insert_before">Inserer</string>
|
||||
<string name="calc_insert_before">Insertar</string>
|
||||
<string name="tabhost_style">Stylo</string>
|
||||
<string name="select_photo_title">Seliger un imagine</string>
|
||||
<string name="select_photo_title">Selectionar imagine</string>
|
||||
<string name="no_save_document">NON</string>
|
||||
<string name="new_textdocument">Nove documento de texto</string>
|
||||
<string name="action_print">Imprimer</string>
|
||||
|
@ -40,52 +40,52 @@
|
|||
<string name="calc_delete">Deler</string>
|
||||
<string name="action_undo">Disfacer</string>
|
||||
<string name="app_vendor">Iste version es fornite per $VENDOR.</string>
|
||||
<string name="action_pwd_dialog_title">Insere le contrasigno</string>
|
||||
<string name="calc_optimal_length_confirm">OK</string>
|
||||
<string name="action_pwd_dialog_title">Inserta contrasigno</string>
|
||||
<string name="calc_optimal_length_confirm">De accordo</string>
|
||||
<string name="action_parts">Partes</string>
|
||||
<string name="pref_category_general">General</string>
|
||||
<string name="action_text_copied">Texto copiate al area de transferentia</string>
|
||||
<string name="action_exportToPDF">Exportar a PDF</string>
|
||||
<string name="action_keyboard">Monstrar le claviero</string>
|
||||
<string name="action_keyboard">Monstrar claviero</string>
|
||||
<string name="about_privacy_policy">Politica de confidentialitate</string>
|
||||
<string name="action_presentation">Presentation de diapositivas</string>
|
||||
<string name="select_photo">Seliger un photo</string>
|
||||
<string name="select_photo">Selectionar photo</string>
|
||||
<string name="action_copy">Copiar</string>
|
||||
<string name="tabhost_insert">Inserer</string>
|
||||
<string name="tabhost_insert">Insertar</string>
|
||||
<string name="action_search">Cerca</string>
|
||||
<string name="no_camera_found">Necun camera trovate</string>
|
||||
<string name="error">Error</string>
|
||||
<string name="app_name_settings">Parametros del visualisator de LibreOffice</string>
|
||||
<string name="name_already_used">Le nomine fornite jam es in uso.</string>
|
||||
<string name="action_save">Salveguardar</string>
|
||||
<string name="alert_ok">OK</string>
|
||||
<string name="alert_ok">De accordo</string>
|
||||
<string name="action_settings">Parametros</string>
|
||||
<string name="app_version">Version: %1$s<br>ID de compilation: <a href=https://hub.libreoffice.org/git-core/%2$s>%2$s</a></string>
|
||||
<string name="about_license">Monstrar le licentia</string>
|
||||
<string name="about_license">Monstrar licentia</string>
|
||||
<string name="title_browser">Tote le files</string>
|
||||
<string name="unable_to_save">Non poteva salveguardar le file</string>
|
||||
<string name="app_name">Visualisator de LibreOffice</string>
|
||||
<string name="action_add_slide">Adder un diapositiva</string>
|
||||
<string name="action_cancel">Cancellar</string>
|
||||
<string name="search_find_next">Trovar le sequente</string>
|
||||
<string name="search_find_previous">Trovar le previe</string>
|
||||
<string name="search_find_next">Trovar sequente</string>
|
||||
<string name="search_find_previous">Trovar precedente</string>
|
||||
<string name="pref_experimental_editing_summary">Activar le modo de edition experimental. Usa lo sub tu proprie risco.</string>
|
||||
<string name="readonly_file">Iste file es solo lectura</string>
|
||||
<string name="about_notice">Monstrar le aviso</string>
|
||||
<string name="readonly_file">Iste file es de sol lectura.</string>
|
||||
<string name="about_notice">Monstrar aviso</string>
|
||||
<string name="alert_cancel">Cancellar</string>
|
||||
<string name="action_back">Previe</string>
|
||||
<string name="select_insert_options">Seliger optiones de insertion:</string>
|
||||
<string name="select_delete_options">Seliger optiones de deletion:</string>
|
||||
<string name="action_rename_worksheet">Renominar le folio de calculo</string>
|
||||
<string name="action_delete_worksheet">Deler le folio</string>
|
||||
<string name="action_delete_slide">Deler le diapositiva</string>
|
||||
<string name="select_insert_options">Selectionar optiones de insertion:</string>
|
||||
<string name="select_delete_options">Selectionar optiones de deletion:</string>
|
||||
<string name="action_rename_worksheet">Renominar folio de calculo</string>
|
||||
<string name="action_delete_worksheet">Deler folio</string>
|
||||
<string name="action_delete_slide">Deler diapositiva</string>
|
||||
<string name="sheet">Folio</string>
|
||||
<string name="slide">Diapositiva</string>
|
||||
<string name="action_rename_slide">Renominar le diapositiva</string>
|
||||
<string name="tabhost_character">Character</string>
|
||||
<string name="tabhost_paragraph">Paragrapho</string>
|
||||
<string name="current_uno_command">Commando UNO actual</string>
|
||||
<string name="insert_table">Inserer un tabella</string>
|
||||
<string name="insert_table">Insertar tabella</string>
|
||||
<string name="UNO_commands_string_hint">Commando UNO</string>
|
||||
<string name="take_photo">Prender un photo</string>
|
||||
<string name="take_photo">Prender photo</string>
|
||||
</resources>
|
|
@ -171,15 +171,16 @@ void MediaWindowImpl::dispose()
|
|||
|
||||
uno::Reference<media::XPlayer> MediaWindowImpl::createPlayer(const OUString& rURL, const OUString& rReferer, const OUString*)
|
||||
{
|
||||
uno::Reference<media::XPlayer> xPlayer;
|
||||
|
||||
if( rURL.isEmpty() )
|
||||
return xPlayer;
|
||||
return nullptr;
|
||||
|
||||
if (SvtSecurityOptions::isUntrustedReferer(rReferer))
|
||||
{
|
||||
return xPlayer;
|
||||
}
|
||||
return nullptr;
|
||||
|
||||
if (INetURLObject(rURL).IsExoticProtocol())
|
||||
return nullptr;
|
||||
|
||||
uno::Reference<media::XPlayer> xPlayer;
|
||||
|
||||
// currently there isn't anything else, throw any mime type to the media players
|
||||
//if (!pMimeType || *pMimeType == AVMEDIA_MIMETYPE_COMMON)
|
||||
|
|
|
@ -238,7 +238,7 @@ OUString ChooseMacro(weld::Window* pParent,
|
|||
SbMethod* pMethod = nullptr;
|
||||
|
||||
MacroChooser aChooser(pParent, xDocFrame);
|
||||
if ( bChooseOnly || !SvtModuleOptions::IsBasicIDE() )
|
||||
if (bChooseOnly || !SvtModuleOptions::IsBasicIDEInstalled())
|
||||
aChooser.SetMode(MacroChooser::ChooseOnly);
|
||||
|
||||
if ( !bChooseOnly && rxLimitToDocument.is() )
|
||||
|
|
|
@ -375,7 +375,7 @@ tools::Long HandleBasicError( StarBASIC const * pBasic )
|
|||
|
||||
tools::Long nRet = 0;
|
||||
Shell* pShell = nullptr;
|
||||
if ( SvtModuleOptions::IsBasicIDE() )
|
||||
if (SvtModuleOptions::IsBasicIDEInstalled())
|
||||
{
|
||||
BasicManager* pBasMgr = FindBasicManager( pBasic );
|
||||
if ( pBasMgr )
|
||||
|
|
|
@ -728,8 +728,7 @@ namespace dxcanvas
|
|||
"CanvasHelper::setupGraphicsState: reference device invalid" );
|
||||
|
||||
// setup view transform first. Clipping e.g. depends on it
|
||||
::basegfx::B2DHomMatrix aTransform;
|
||||
::canvas::tools::getViewStateTransform(aTransform, viewState);
|
||||
::basegfx::B2DHomMatrix aTransform = ::canvas::tools::getViewStateTransform(viewState);
|
||||
|
||||
// add output offset
|
||||
if( !maOutputOffset.equalZero() )
|
||||
|
|
|
@ -70,8 +70,7 @@ namespace canvas
|
|||
|
||||
// rectangular area which is actually covered by the sprite.
|
||||
// coordinates are relative to the sprite origin.
|
||||
::basegfx::B2DRectangle aSpriteRectPixel;
|
||||
::canvas::tools::calcTransformedRectBounds( aSpriteRectPixel,
|
||||
::basegfx::B2DRectangle aSpriteRectPixel = ::canvas::tools::calcTransformedRectBounds(
|
||||
aBounds,
|
||||
maTransform );
|
||||
|
||||
|
@ -413,8 +412,7 @@ namespace canvas
|
|||
|
||||
// transform bounds at origin, as the sprite transformation is
|
||||
// formulated that way
|
||||
::basegfx::B2DRectangle aTransformedBounds;
|
||||
return ::canvas::tools::calcTransformedRectBounds( aTransformedBounds,
|
||||
return ::canvas::tools::calcTransformedRectBounds(
|
||||
rBounds,
|
||||
aTransform );
|
||||
}
|
||||
|
|
|
@ -91,10 +91,10 @@ namespace canvas::tools
|
|||
return viewState;
|
||||
}
|
||||
|
||||
::basegfx::B2DHomMatrix& getViewStateTransform( ::basegfx::B2DHomMatrix& transform,
|
||||
const rendering::ViewState& viewState )
|
||||
::basegfx::B2DHomMatrix getViewStateTransform( const rendering::ViewState& viewState )
|
||||
{
|
||||
return ::basegfx::unotools::homMatrixFromAffineMatrix( transform, viewState.AffineTransform );
|
||||
::basegfx::B2DHomMatrix aTransform;
|
||||
return ::basegfx::unotools::homMatrixFromAffineMatrix( aTransform, viewState.AffineTransform );
|
||||
}
|
||||
|
||||
rendering::ViewState& setViewStateTransform( rendering::ViewState& viewState,
|
||||
|
@ -105,10 +105,10 @@ namespace canvas::tools
|
|||
return viewState;
|
||||
}
|
||||
|
||||
::basegfx::B2DHomMatrix& getRenderStateTransform( ::basegfx::B2DHomMatrix& transform,
|
||||
const rendering::RenderState& renderState )
|
||||
::basegfx::B2DHomMatrix getRenderStateTransform( const rendering::RenderState& renderState )
|
||||
{
|
||||
return ::basegfx::unotools::homMatrixFromAffineMatrix( transform, renderState.AffineTransform );
|
||||
::basegfx::B2DHomMatrix aTransform;
|
||||
return ::basegfx::unotools::homMatrixFromAffineMatrix( aTransform, renderState.AffineTransform );
|
||||
}
|
||||
|
||||
rendering::RenderState& setRenderStateTransform( rendering::RenderState& renderState,
|
||||
|
@ -122,18 +122,14 @@ namespace canvas::tools
|
|||
rendering::RenderState& appendToRenderState( rendering::RenderState& renderState,
|
||||
const ::basegfx::B2DHomMatrix& rTransform )
|
||||
{
|
||||
::basegfx::B2DHomMatrix transform;
|
||||
|
||||
getRenderStateTransform( transform, renderState );
|
||||
::basegfx::B2DHomMatrix transform = getRenderStateTransform( renderState );
|
||||
return setRenderStateTransform( renderState, transform * rTransform );
|
||||
}
|
||||
|
||||
rendering::RenderState& prependToRenderState( rendering::RenderState& renderState,
|
||||
const ::basegfx::B2DHomMatrix& rTransform )
|
||||
{
|
||||
::basegfx::B2DHomMatrix transform;
|
||||
|
||||
getRenderStateTransform( transform, renderState );
|
||||
::basegfx::B2DHomMatrix transform = getRenderStateTransform( renderState );
|
||||
return setRenderStateTransform( renderState, rTransform * transform );
|
||||
}
|
||||
|
||||
|
@ -814,10 +810,10 @@ namespace canvas::tools
|
|||
// rSpriteSize is mapped with its left,top corner to (0,0)
|
||||
// again. This is required to properly render sprite
|
||||
// animations to buffer bitmaps.
|
||||
::basegfx::B2DHomMatrix& calcRectToOriginTransform( ::basegfx::B2DHomMatrix& o_transform,
|
||||
const ::basegfx::B2DRange& i_srcRect,
|
||||
const ::basegfx::B2DHomMatrix& i_transformation )
|
||||
::basegfx::B2DHomMatrix calcRectToOriginTransform( const ::basegfx::B2DRange& i_srcRect,
|
||||
const ::basegfx::B2DHomMatrix& i_transformation )
|
||||
{
|
||||
::basegfx::B2DHomMatrix o_transform;
|
||||
if( i_srcRect.isEmpty() )
|
||||
{
|
||||
o_transform = i_transformation;
|
||||
|
@ -825,9 +821,7 @@ namespace canvas::tools
|
|||
}
|
||||
|
||||
// transform by given transformation
|
||||
::basegfx::B2DRectangle aTransformedRect;
|
||||
|
||||
calcTransformedRectBounds( aTransformedRect,
|
||||
::basegfx::B2DRectangle aTransformedRect = calcTransformedRectBounds(
|
||||
i_srcRect,
|
||||
i_transformation );
|
||||
|
||||
|
@ -841,11 +835,10 @@ namespace canvas::tools
|
|||
return o_transform;
|
||||
}
|
||||
|
||||
::basegfx::B2DRange& calcTransformedRectBounds( ::basegfx::B2DRange& outRect,
|
||||
const ::basegfx::B2DRange& inRect,
|
||||
::basegfx::B2DRange calcTransformedRectBounds( const ::basegfx::B2DRange& inRect,
|
||||
const ::basegfx::B2DHomMatrix& transformation )
|
||||
{
|
||||
outRect.reset();
|
||||
::basegfx::B2DRange outRect;
|
||||
|
||||
if( inRect.isEmpty() )
|
||||
return outRect;
|
||||
|
|
|
@ -795,8 +795,7 @@ namespace vclcanvas
|
|||
// modify output position, to account for the fact
|
||||
// that transformBitmap() always normalizes its output
|
||||
// bitmap into the smallest enclosing box.
|
||||
::basegfx::B2DRectangle aDestRect;
|
||||
::canvas::tools::calcTransformedRectBounds( aDestRect,
|
||||
::basegfx::B2DRectangle aDestRect = ::canvas::tools::calcTransformedRectBounds(
|
||||
::basegfx::B2DRectangle(0,
|
||||
0,
|
||||
aBmpSize.Width(),
|
||||
|
|
|
@ -574,9 +574,8 @@ namespace vclcanvas
|
|||
// extra-verbosity
|
||||
{
|
||||
::basegfx::B2DRectangle aRect(0.0, 0.0, 1.0, 1.0);
|
||||
::basegfx::B2DRectangle aTextureDeviceRect;
|
||||
::basegfx::B2DHomMatrix aTextureTransform;
|
||||
::canvas::tools::calcTransformedRectBounds( aTextureDeviceRect,
|
||||
::basegfx::B2DRectangle aTextureDeviceRect = ::canvas::tools::calcTransformedRectBounds(
|
||||
aRect,
|
||||
aTextureTransform );
|
||||
rOutDev.SetLineColor( COL_RED );
|
||||
|
@ -699,8 +698,7 @@ namespace vclcanvas
|
|||
aTotalTransform *= aTextureTransform;
|
||||
|
||||
const ::basegfx::B2DRectangle aRect(0.0, 0.0, 1.0, 1.0);
|
||||
::basegfx::B2DRectangle aTextureDeviceRect;
|
||||
::canvas::tools::calcTransformedRectBounds( aTextureDeviceRect,
|
||||
::basegfx::B2DRectangle aTextureDeviceRect = ::canvas::tools::calcTransformedRectBounds(
|
||||
aRect,
|
||||
aTotalTransform );
|
||||
|
||||
|
@ -806,8 +804,7 @@ namespace vclcanvas
|
|||
// modify output position, to account for the fact
|
||||
// that transformBitmap() always normalizes its output
|
||||
// bitmap into the smallest enclosing box.
|
||||
::basegfx::B2DRectangle aDestRect;
|
||||
::canvas::tools::calcTransformedRectBounds( aDestRect,
|
||||
::basegfx::B2DRectangle aDestRect = ::canvas::tools::calcTransformedRectBounds(
|
||||
::basegfx::B2DRectangle(0,
|
||||
0,
|
||||
aBmpSize.Width,
|
||||
|
@ -867,8 +864,7 @@ namespace vclcanvas
|
|||
// Finally, the bound rect is transformed back to
|
||||
// device coordinate space, were we determine the
|
||||
// start point from it.
|
||||
::basegfx::B2DRectangle aTextureSpacePolygonRect;
|
||||
::canvas::tools::calcTransformedRectBounds( aTextureSpacePolygonRect,
|
||||
::basegfx::B2DRectangle aTextureSpacePolygonRect = ::canvas::tools::calcTransformedRectBounds(
|
||||
vcl::unotools::b2DRectangleFromRectangle(aPolygonDeviceRect),
|
||||
aInverseTextureTransform );
|
||||
|
||||
|
@ -891,8 +887,7 @@ namespace vclcanvas
|
|||
nY1 + 1.0 );
|
||||
|
||||
// and convert back to device space
|
||||
::basegfx::B2DRectangle aSingleDeviceTextureRect;
|
||||
::canvas::tools::calcTransformedRectBounds( aSingleDeviceTextureRect,
|
||||
::basegfx::B2DRectangle aSingleDeviceTextureRect = ::canvas::tools::calcTransformedRectBounds(
|
||||
aSingleTextureRect,
|
||||
aPureTotalTransform );
|
||||
|
||||
|
|
|
@ -223,13 +223,12 @@ namespace vclcanvas::tools
|
|||
// deleted from the transformation; this can be handled by
|
||||
// an offset when painting the bitmap
|
||||
const Size aBmpSize( rBitmap.GetSizePixel() );
|
||||
::basegfx::B2DRectangle aDestRect;
|
||||
|
||||
// calc effective transformation for bitmap
|
||||
const ::basegfx::B2DRectangle aSrcRect( 0, 0,
|
||||
aBmpSize.Width(),
|
||||
aBmpSize.Height() );
|
||||
::canvas::tools::calcTransformedRectBounds( aDestRect,
|
||||
::basegfx::B2DRectangle aDestRect = ::canvas::tools::calcTransformedRectBounds(
|
||||
aSrcRect,
|
||||
rTransform );
|
||||
|
||||
|
@ -237,8 +236,7 @@ namespace vclcanvas::tools
|
|||
// aligned with (0,0). The method takes the given
|
||||
// rectangle, and calculates a transformation that maps
|
||||
// this rectangle unscaled to the origin.
|
||||
::basegfx::B2DHomMatrix aLocalTransform;
|
||||
::canvas::tools::calcRectToOriginTransform( aLocalTransform,
|
||||
::basegfx::B2DHomMatrix aLocalTransform = ::canvas::tools::calcRectToOriginTransform(
|
||||
aSrcRect,
|
||||
rTransform );
|
||||
|
||||
|
|
|
@ -546,6 +546,28 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testBarOfPieChart)
|
|||
assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:ofPieChart/c:ofPieType[1]", "val", u"bar");
|
||||
}
|
||||
|
||||
CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testPieOfPieSplitPos)
|
||||
{
|
||||
loadFromFile(u"xlsx/pieOfPieChart2.xlsx");
|
||||
save(u"Calc Office Open XML"_ustr);
|
||||
xmlDocUniquePtr pXmlDoc = parseExport(u"xl/charts/chart1.xml"_ustr);
|
||||
CPPUNIT_ASSERT(pXmlDoc);
|
||||
|
||||
assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:ofPieChart");
|
||||
assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:ofPieChart/c:splitPos[1]", "val", u"4");
|
||||
}
|
||||
|
||||
CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testBarOfPieSplitPos)
|
||||
{
|
||||
loadFromFile(u"xlsx/barOfPieChart2.xlsx");
|
||||
save(u"Calc Office Open XML"_ustr);
|
||||
xmlDocUniquePtr pXmlDoc = parseExport(u"xl/charts/chart1.xml"_ustr);
|
||||
CPPUNIT_ASSERT(pXmlDoc);
|
||||
|
||||
assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:ofPieChart");
|
||||
assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:ofPieChart/c:splitPos[1]", "val", u"5");
|
||||
}
|
||||
|
||||
CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testDisplayUnits)
|
||||
{
|
||||
loadFromFile(u"docx/DisplayUnits.docx");
|
||||
|
@ -1133,6 +1155,49 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest, tdf50934_pieOfPie)
|
|||
CPPUNIT_ASSERT_EQUAL(chart2::PieChartSubType_PIE, subPieType);
|
||||
}
|
||||
|
||||
CPPUNIT_TEST_FIXTURE(Chart2ExportTest, tdf161800_barOfPie_split_pos)
|
||||
{
|
||||
loadFromFile(u"ods/tdf161800_barOfPie_split_pos.ods");
|
||||
saveAndReload(u"calc8"_ustr);
|
||||
|
||||
uno::Reference< chart2::XChartDocument > xChartDoc = getChartDocFromSheet( 0 );
|
||||
CPPUNIT_ASSERT(xChartDoc.is());
|
||||
|
||||
Reference< chart2::XChartType > xChartType = getChartTypeFromDoc( xChartDoc, 0 );
|
||||
CPPUNIT_ASSERT(xChartType.is());
|
||||
|
||||
// Verify that it saves and loads with the correct split position
|
||||
Reference< beans::XPropertySet > xPropSet( xChartType, uno::UNO_QUERY_THROW );
|
||||
uno::Any aAny = xPropSet->getPropertyValue(u"SplitPos"_ustr);
|
||||
CPPUNIT_ASSERT(aAny.hasValue());
|
||||
double nSplitPos;
|
||||
aAny >>= nSplitPos;
|
||||
CPPUNIT_ASSERT_EQUAL(4.0, nSplitPos);
|
||||
}
|
||||
|
||||
CPPUNIT_TEST_FIXTURE(Chart2ExportTest, tdf161800_pieOfPie_split_pos)
|
||||
{
|
||||
loadFromFile(u"ods/tdf161800_pieOfPie_split_pos.ods");
|
||||
saveAndReload(u"calc8"_ustr);
|
||||
|
||||
uno::Reference< chart2::XChartDocument > xChartDoc = getChartDocFromSheet( 0 );
|
||||
CPPUNIT_ASSERT(xChartDoc.is());
|
||||
|
||||
Reference< chart2::XChartType > xChartType = getChartTypeFromDoc( xChartDoc, 0 );
|
||||
CPPUNIT_ASSERT(xChartType.is());
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL(u"com.sun.star.chart2.PieChartType"_ustr,
|
||||
xChartType->getChartType());
|
||||
|
||||
// Verify that it saves and loads with the correct split position
|
||||
Reference< beans::XPropertySet > xPropSet( xChartType, uno::UNO_QUERY_THROW );
|
||||
uno::Any aAny = xPropSet->getPropertyValue(u"SplitPos"_ustr);
|
||||
CPPUNIT_ASSERT(aAny.hasValue());
|
||||
double nSplitPos;
|
||||
aAny >>= nSplitPos;
|
||||
CPPUNIT_ASSERT_EQUAL(3.0, nSplitPos);
|
||||
}
|
||||
|
||||
CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testChartCrash)
|
||||
{
|
||||
loadFromFile(u"docx/FDO75975.docx");
|
||||
|
|
BIN
chart2/qa/extras/data/ods/tdf161800_barOfPie_split_pos.ods
Normal file
BIN
chart2/qa/extras/data/ods/tdf161800_barOfPie_split_pos.ods
Normal file
Binary file not shown.
BIN
chart2/qa/extras/data/ods/tdf161800_pieOfPie_split_pos.ods
Normal file
BIN
chart2/qa/extras/data/ods/tdf161800_pieOfPie_split_pos.ods
Normal file
Binary file not shown.
BIN
chart2/qa/extras/data/xlsx/barOfPieChart2.xlsx
Normal file
BIN
chart2/qa/extras/data/xlsx/barOfPieChart2.xlsx
Normal file
Binary file not shown.
BIN
chart2/qa/extras/data/xlsx/pieOfPieChart2.xlsx
Normal file
BIN
chart2/qa/extras/data/xlsx/pieOfPieChart2.xlsx
Normal file
Binary file not shown.
|
@ -104,7 +104,7 @@ enum
|
|||
|
||||
PROP_DIAGRAM_STARTING_ANGLE,
|
||||
PROP_DIAGRAM_OF_PIE_TYPE,
|
||||
PROP_DIAGRAM_COMPOSITE_SIZE,
|
||||
PROP_DIAGRAM_SPLIT_POS,
|
||||
|
||||
PROP_DIAGRAM_RIGHT_ANGLED_AXES,
|
||||
PROP_DIAGRAM_PERSPECTIVE,
|
||||
|
@ -236,8 +236,8 @@ void lcl_AddPropertiesToVector(
|
|||
cppu::UnoType<chart2::PieChartSubType>::get(),
|
||||
beans::PropertyAttribute::BOUND
|
||||
| beans::PropertyAttribute::MAYBEDEFAULT );
|
||||
rOutProperties.emplace_back( "CompositeSize",
|
||||
PROP_DIAGRAM_COMPOSITE_SIZE,
|
||||
rOutProperties.emplace_back( "SplitPos",
|
||||
PROP_DIAGRAM_SPLIT_POS,
|
||||
cppu::UnoType<sal_Int32>::get(),
|
||||
beans::PropertyAttribute::BOUND
|
||||
| beans::PropertyAttribute::MAYBEDEFAULT );
|
||||
|
|
|
@ -305,7 +305,8 @@ rtl::Reference< ChartTypeTemplate > ChartTypeDialogController::getCurrentTemplat
|
|||
}
|
||||
|
||||
void ChartTypeDialogController::commitToModel( const ChartTypeParameter& rParameter
|
||||
, const rtl::Reference<::chart::ChartModel>& xChartModel )
|
||||
, const rtl::Reference<::chart::ChartModel>& xChartModel
|
||||
, const uno::Reference<beans::XPropertySet>& xTemplateProps)
|
||||
{
|
||||
rtl::Reference< ::chart::ChartTypeManager > xTemplateManager = xChartModel->getTypeManager();
|
||||
rtl::Reference< ::chart::ChartTypeTemplate > xTemplate( getCurrentTemplate( rParameter, xTemplateManager ) );
|
||||
|
@ -329,6 +330,20 @@ void ChartTypeDialogController::commitToModel( const ChartTypeParameter& rParame
|
|||
if (xDiagram.is())
|
||||
{
|
||||
xDiagram->setPropertyValue(CHART_UNONAME_SORT_BY_XVALUES, uno::Any(rParameter.bSortByXValues));
|
||||
|
||||
sal_Int32 nSplitPos;
|
||||
try {
|
||||
if (xTemplateProps.is()) {
|
||||
xTemplateProps->getPropertyValue(u"SplitPos"_ustr) >>= nSplitPos;
|
||||
xDiagram->setPropertyValue(u"SplitPos"_ustr, uno::Any(nSplitPos));
|
||||
}
|
||||
}
|
||||
catch( uno::Exception & ex )
|
||||
{
|
||||
//not all templates need to support SplitPos
|
||||
ex.Context.is();//to have debug information without compilation warnings
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
void ChartTypeDialogController::fillSubTypeList( ValueSet& rSubTypeList, const ChartTypeParameter& /*rParameter*/ )
|
||||
|
@ -763,7 +778,7 @@ void OfPieChartDialogController::fillExtraControls(
|
|||
{
|
||||
try
|
||||
{
|
||||
xTemplateProps->getPropertyValue( u"CompositeSize"_ustr ) >>= nCompositeSize;
|
||||
xTemplateProps->getPropertyValue( u"SplitPos"_ustr ) >>= nCompositeSize;
|
||||
}
|
||||
catch( const uno::Exception & )
|
||||
{
|
||||
|
@ -801,7 +816,7 @@ void OfPieChartDialogController::setTemplateProperties( const uno::Reference< be
|
|||
if( xTemplateProps.is())
|
||||
{
|
||||
sal_Int32 nCompositeSize = m_xMF_CompositeSize->get_value();
|
||||
xTemplateProps->setPropertyValue( u"CompositeSize"_ustr , uno::Any(nCompositeSize) );
|
||||
xTemplateProps->setPropertyValue( u"SplitPos"_ustr , uno::Any(nCompositeSize) );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -166,7 +166,8 @@ void ChartTypeTabPage::commitToModel( const ChartTypeParameter& rParameter )
|
|||
return;
|
||||
|
||||
m_aTimerTriggeredControllerLock.startTimer();
|
||||
m_pCurrentMainType->commitToModel( rParameter, m_xChartModel );
|
||||
uno::Reference< beans::XPropertySet > xTemplateProps( static_cast<cppu::OWeakObject*>(getCurrentTemplate().get()), uno::UNO_QUERY );
|
||||
m_pCurrentMainType->commitToModel( rParameter, m_xChartModel, xTemplateProps );
|
||||
}
|
||||
|
||||
void ChartTypeTabPage::stateChanged()
|
||||
|
|
|
@ -20,11 +20,6 @@
|
|||
|
||||
#include <sal/types.h>
|
||||
|
||||
// color to use as foreground for an invalid range
|
||||
#define RANGE_SELECTION_INVALID_RANGE_FOREGROUND_COLOR COL_WHITE
|
||||
// color to use as background for an invalid range
|
||||
#define RANGE_SELECTION_INVALID_RANGE_BACKGROUND_COLOR Color(0xff6563)
|
||||
|
||||
class BuilderPage;
|
||||
|
||||
namespace chart
|
||||
|
|
|
@ -271,8 +271,7 @@ void ChartController::executeDispatch_InsertSpecialCharacter()
|
|||
pOutlinerView->InsertText(aString, true);
|
||||
|
||||
ESelection aSel = pOutlinerView->GetSelection();
|
||||
aSel.nStartPara = aSel.nEndPara;
|
||||
aSel.nStartPos = aSel.nEndPos;
|
||||
aSel.CollapseToEnd();
|
||||
pOutlinerView->SetSelection(aSel);
|
||||
|
||||
// show changes
|
||||
|
|
|
@ -391,7 +391,9 @@ void ChartTypePanel::commitToModel(const ChartTypeParameter& rParameter)
|
|||
return;
|
||||
|
||||
m_aTimerTriggeredControllerLock.startTimer();
|
||||
m_pCurrentMainType->commitToModel(rParameter, m_xChartModel);
|
||||
uno::Reference<beans::XPropertySet> xTemplateProps(
|
||||
static_cast<cppu::OWeakObject*>(getCurrentTemplate().get()), uno::UNO_QUERY);
|
||||
m_pCurrentMainType->commitToModel(rParameter, m_xChartModel, xTemplateProps);
|
||||
}
|
||||
|
||||
void ChartTypePanel::selectMainType()
|
||||
|
|
|
@ -43,7 +43,7 @@ enum
|
|||
PROP_PIECHARTTYPE_USE_RINGS,
|
||||
PROP_PIECHARTTYPE_3DRELATIVEHEIGHT,
|
||||
PROP_PIECHARTTYPE_SUBTYPE, // none, of-bar, of-pie
|
||||
PROP_PIECHARTTYPE_COMPOSITESIZE
|
||||
PROP_PIECHARTTYPE_SPLIT_POS
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -130,8 +130,10 @@ public:
|
|||
virtual void adjustParameterToSubType(ChartTypeParameter& rParameter);
|
||||
virtual void adjustParameterToMainType(ChartTypeParameter& rParameter);
|
||||
OUString getServiceNameForParameter(const ChartTypeParameter& rParameter) const;
|
||||
void commitToModel(const ChartTypeParameter& rParameter,
|
||||
const rtl::Reference<::chart::ChartModel>& xChartModel);
|
||||
void
|
||||
commitToModel(const ChartTypeParameter& rParameter,
|
||||
const rtl::Reference<::chart::ChartModel>& xChartModel,
|
||||
const css::uno::Reference<com::sun::star::beans::XPropertySet>& xTemplateProps);
|
||||
rtl::Reference<::chart::ChartTypeTemplate>
|
||||
getCurrentTemplate(const ChartTypeParameter& rParameter,
|
||||
const rtl::Reference<::chart::ChartTypeManager>& xTemplateManager) const;
|
||||
|
|
|
@ -37,171 +37,171 @@ class SdrAngleItem;
|
|||
// SCHATTR
|
||||
|
||||
// can't this be changed to 0?
|
||||
constexpr sal_uInt16 SCHATTR_START = 1;
|
||||
inline constexpr sal_uInt16 SCHATTR_START = 1;
|
||||
|
||||
constexpr sal_uInt16 SCHATTR_DATADESCR_START (SCHATTR_START);
|
||||
constexpr TypedWhichId<SfxBoolItem> SCHATTR_DATADESCR_SHOW_NUMBER (SCHATTR_DATADESCR_START);
|
||||
constexpr TypedWhichId<SfxBoolItem> SCHATTR_DATADESCR_SHOW_PERCENTAGE (SCHATTR_DATADESCR_START + 1);
|
||||
constexpr TypedWhichId<SfxBoolItem> SCHATTR_DATADESCR_SHOW_CATEGORY (SCHATTR_DATADESCR_START + 2);
|
||||
constexpr TypedWhichId<SfxBoolItem> SCHATTR_DATADESCR_SHOW_SYMBOL (SCHATTR_DATADESCR_START + 3);
|
||||
constexpr TypedWhichId<SfxBoolItem> SCHATTR_DATADESCR_WRAP_TEXT (SCHATTR_DATADESCR_START + 4);
|
||||
constexpr TypedWhichId<SfxStringItem> SCHATTR_DATADESCR_SEPARATOR (SCHATTR_DATADESCR_START + 5);
|
||||
constexpr TypedWhichId<SfxInt32Item> SCHATTR_DATADESCR_PLACEMENT (SCHATTR_DATADESCR_START + 6);
|
||||
constexpr TypedWhichId<SfxIntegerListItem> SCHATTR_DATADESCR_AVAILABLE_PLACEMENTS (SCHATTR_DATADESCR_START + 7);
|
||||
constexpr TypedWhichId<SfxBoolItem> SCHATTR_DATADESCR_NO_PERCENTVALUE (SCHATTR_DATADESCR_START + 8); //percentage values should not be offered
|
||||
constexpr TypedWhichId<SfxBoolItem> SCHATTR_DATADESCR_CUSTOM_LEADER_LINES (SCHATTR_DATADESCR_START + 9);
|
||||
constexpr TypedWhichId<SfxUInt32Item> SCHATTR_PERCENT_NUMBERFORMAT_VALUE (SCHATTR_DATADESCR_START + 10);
|
||||
constexpr TypedWhichId<SfxBoolItem> SCHATTR_PERCENT_NUMBERFORMAT_SOURCE (SCHATTR_DATADESCR_START + 11);
|
||||
constexpr TypedWhichId<SfxBoolItem> SCHATTR_DATADESCR_SHOW_DATA_SERIES_NAME (SCHATTR_DATADESCR_START + 12);
|
||||
constexpr sal_uInt16 SCHATTR_DATADESCR_END (SCHATTR_DATADESCR_SHOW_DATA_SERIES_NAME);
|
||||
inline constexpr sal_uInt16 SCHATTR_DATADESCR_START (SCHATTR_START);
|
||||
inline constexpr TypedWhichId<SfxBoolItem> SCHATTR_DATADESCR_SHOW_NUMBER (SCHATTR_DATADESCR_START);
|
||||
inline constexpr TypedWhichId<SfxBoolItem> SCHATTR_DATADESCR_SHOW_PERCENTAGE (SCHATTR_DATADESCR_START + 1);
|
||||
inline constexpr TypedWhichId<SfxBoolItem> SCHATTR_DATADESCR_SHOW_CATEGORY (SCHATTR_DATADESCR_START + 2);
|
||||
inline constexpr TypedWhichId<SfxBoolItem> SCHATTR_DATADESCR_SHOW_SYMBOL (SCHATTR_DATADESCR_START + 3);
|
||||
inline constexpr TypedWhichId<SfxBoolItem> SCHATTR_DATADESCR_WRAP_TEXT (SCHATTR_DATADESCR_START + 4);
|
||||
inline constexpr TypedWhichId<SfxStringItem> SCHATTR_DATADESCR_SEPARATOR (SCHATTR_DATADESCR_START + 5);
|
||||
inline constexpr TypedWhichId<SfxInt32Item> SCHATTR_DATADESCR_PLACEMENT (SCHATTR_DATADESCR_START + 6);
|
||||
inline constexpr TypedWhichId<SfxIntegerListItem> SCHATTR_DATADESCR_AVAILABLE_PLACEMENTS (SCHATTR_DATADESCR_START + 7);
|
||||
inline constexpr TypedWhichId<SfxBoolItem> SCHATTR_DATADESCR_NO_PERCENTVALUE (SCHATTR_DATADESCR_START + 8); //percentage values should not be offered
|
||||
inline constexpr TypedWhichId<SfxBoolItem> SCHATTR_DATADESCR_CUSTOM_LEADER_LINES (SCHATTR_DATADESCR_START + 9);
|
||||
inline constexpr TypedWhichId<SfxUInt32Item> SCHATTR_PERCENT_NUMBERFORMAT_VALUE (SCHATTR_DATADESCR_START + 10);
|
||||
inline constexpr TypedWhichId<SfxBoolItem> SCHATTR_PERCENT_NUMBERFORMAT_SOURCE (SCHATTR_DATADESCR_START + 11);
|
||||
inline constexpr TypedWhichId<SfxBoolItem> SCHATTR_DATADESCR_SHOW_DATA_SERIES_NAME (SCHATTR_DATADESCR_START + 12);
|
||||
inline constexpr sal_uInt16 SCHATTR_DATADESCR_END (SCHATTR_DATADESCR_SHOW_DATA_SERIES_NAME);
|
||||
|
||||
//legend
|
||||
constexpr sal_uInt16 SCHATTR_LEGEND_START (SCHATTR_DATADESCR_END + 1);
|
||||
constexpr TypedWhichId<SfxInt32Item> SCHATTR_LEGEND_POS (SCHATTR_LEGEND_START);
|
||||
constexpr TypedWhichId<SfxBoolItem> SCHATTR_LEGEND_SHOW (SCHATTR_LEGEND_START + 1);
|
||||
constexpr TypedWhichId<SfxBoolItem> SCHATTR_LEGEND_NO_OVERLAY (SCHATTR_LEGEND_START + 2);
|
||||
constexpr sal_uInt16 SCHATTR_LEGEND_END (SCHATTR_LEGEND_NO_OVERLAY);
|
||||
inline constexpr sal_uInt16 SCHATTR_LEGEND_START (SCHATTR_DATADESCR_END + 1);
|
||||
inline constexpr TypedWhichId<SfxInt32Item> SCHATTR_LEGEND_POS (SCHATTR_LEGEND_START);
|
||||
inline constexpr TypedWhichId<SfxBoolItem> SCHATTR_LEGEND_SHOW (SCHATTR_LEGEND_START + 1);
|
||||
inline constexpr TypedWhichId<SfxBoolItem> SCHATTR_LEGEND_NO_OVERLAY (SCHATTR_LEGEND_START + 2);
|
||||
inline constexpr sal_uInt16 SCHATTR_LEGEND_END (SCHATTR_LEGEND_NO_OVERLAY);
|
||||
|
||||
//text
|
||||
constexpr sal_uInt16 SCHATTR_TEXT_START (SCHATTR_LEGEND_END + 1);
|
||||
constexpr TypedWhichId<SdrAngleItem> SCHATTR_TEXT_DEGREES (SCHATTR_TEXT_START);
|
||||
constexpr TypedWhichId<SfxBoolItem> SCHATTR_TEXT_STACKED (SCHATTR_TEXT_START + 1);
|
||||
constexpr sal_uInt16 SCHATTR_TEXT_END (SCHATTR_TEXT_STACKED);
|
||||
inline constexpr sal_uInt16 SCHATTR_TEXT_START (SCHATTR_LEGEND_END + 1);
|
||||
inline constexpr TypedWhichId<SdrAngleItem> SCHATTR_TEXT_DEGREES (SCHATTR_TEXT_START);
|
||||
inline constexpr TypedWhichId<SfxBoolItem> SCHATTR_TEXT_STACKED (SCHATTR_TEXT_START + 1);
|
||||
inline constexpr sal_uInt16 SCHATTR_TEXT_END (SCHATTR_TEXT_STACKED);
|
||||
|
||||
// statistic
|
||||
constexpr sal_uInt16 SCHATTR_STAT_START (SCHATTR_TEXT_END + 1);
|
||||
constexpr TypedWhichId<SfxBoolItem> SCHATTR_STAT_AVERAGE (SCHATTR_STAT_START);
|
||||
constexpr TypedWhichId<SvxChartKindErrorItem> SCHATTR_STAT_KIND_ERROR (SCHATTR_STAT_START + 1);
|
||||
constexpr TypedWhichId<SvxDoubleItem> SCHATTR_STAT_PERCENT (SCHATTR_STAT_START + 2);
|
||||
constexpr TypedWhichId<SvxDoubleItem> SCHATTR_STAT_BIGERROR (SCHATTR_STAT_START + 3);
|
||||
constexpr TypedWhichId<SvxDoubleItem> SCHATTR_STAT_CONSTPLUS (SCHATTR_STAT_START + 4);
|
||||
constexpr TypedWhichId<SvxDoubleItem> SCHATTR_STAT_CONSTMINUS (SCHATTR_STAT_START + 5);
|
||||
constexpr TypedWhichId<SvxChartIndicateItem> SCHATTR_STAT_INDICATE (SCHATTR_STAT_START + 6);
|
||||
constexpr TypedWhichId<SfxStringItem> SCHATTR_STAT_RANGE_POS (SCHATTR_STAT_START + 7);
|
||||
constexpr TypedWhichId<SfxStringItem> SCHATTR_STAT_RANGE_NEG (SCHATTR_STAT_START + 8);
|
||||
constexpr TypedWhichId<SfxBoolItem> SCHATTR_STAT_ERRORBAR_TYPE (SCHATTR_STAT_START + 9);
|
||||
constexpr sal_uInt16 SCHATTR_STAT_END (SCHATTR_STAT_ERRORBAR_TYPE);
|
||||
inline constexpr sal_uInt16 SCHATTR_STAT_START (SCHATTR_TEXT_END + 1);
|
||||
inline constexpr TypedWhichId<SfxBoolItem> SCHATTR_STAT_AVERAGE (SCHATTR_STAT_START);
|
||||
inline constexpr TypedWhichId<SvxChartKindErrorItem> SCHATTR_STAT_KIND_ERROR (SCHATTR_STAT_START + 1);
|
||||
inline constexpr TypedWhichId<SvxDoubleItem> SCHATTR_STAT_PERCENT (SCHATTR_STAT_START + 2);
|
||||
inline constexpr TypedWhichId<SvxDoubleItem> SCHATTR_STAT_BIGERROR (SCHATTR_STAT_START + 3);
|
||||
inline constexpr TypedWhichId<SvxDoubleItem> SCHATTR_STAT_CONSTPLUS (SCHATTR_STAT_START + 4);
|
||||
inline constexpr TypedWhichId<SvxDoubleItem> SCHATTR_STAT_CONSTMINUS (SCHATTR_STAT_START + 5);
|
||||
inline constexpr TypedWhichId<SvxChartIndicateItem> SCHATTR_STAT_INDICATE (SCHATTR_STAT_START + 6);
|
||||
inline constexpr TypedWhichId<SfxStringItem> SCHATTR_STAT_RANGE_POS (SCHATTR_STAT_START + 7);
|
||||
inline constexpr TypedWhichId<SfxStringItem> SCHATTR_STAT_RANGE_NEG (SCHATTR_STAT_START + 8);
|
||||
inline constexpr TypedWhichId<SfxBoolItem> SCHATTR_STAT_ERRORBAR_TYPE (SCHATTR_STAT_START + 9);
|
||||
inline constexpr sal_uInt16 SCHATTR_STAT_END (SCHATTR_STAT_ERRORBAR_TYPE);
|
||||
|
||||
// these attributes are for replacement of enum eChartStyle
|
||||
|
||||
constexpr sal_uInt16 SCHATTR_STYLE_START (SCHATTR_STAT_END + 1);
|
||||
inline constexpr sal_uInt16 SCHATTR_STYLE_START (SCHATTR_STAT_END + 1);
|
||||
|
||||
// for whole chart
|
||||
constexpr TypedWhichId<SfxBoolItem> SCHATTR_STYLE_DEEP (SCHATTR_STYLE_START );
|
||||
constexpr TypedWhichId<SfxBoolItem> SCHATTR_STYLE_3D (SCHATTR_STYLE_START + 1);
|
||||
constexpr TypedWhichId<SfxBoolItem> SCHATTR_STYLE_VERTICAL (SCHATTR_STYLE_START + 2);
|
||||
inline constexpr TypedWhichId<SfxBoolItem> SCHATTR_STYLE_DEEP (SCHATTR_STYLE_START );
|
||||
inline constexpr TypedWhichId<SfxBoolItem> SCHATTR_STYLE_3D (SCHATTR_STYLE_START + 1);
|
||||
inline constexpr TypedWhichId<SfxBoolItem> SCHATTR_STYLE_VERTICAL (SCHATTR_STYLE_START + 2);
|
||||
|
||||
// also for series
|
||||
constexpr TypedWhichId<SfxInt32Item> SCHATTR_STYLE_BASETYPE (SCHATTR_STYLE_START + 3);// Line,Area,...,Pie
|
||||
constexpr TypedWhichId<SfxBoolItem> SCHATTR_STYLE_LINES (SCHATTR_STYLE_START + 4);// draw line
|
||||
constexpr TypedWhichId<SfxBoolItem> SCHATTR_STYLE_PERCENT (SCHATTR_STYLE_START + 5);
|
||||
constexpr TypedWhichId<SfxBoolItem> SCHATTR_STYLE_STACKED (SCHATTR_STYLE_START + 6);
|
||||
constexpr TypedWhichId<SfxInt32Item> SCHATTR_STYLE_SPLINES (SCHATTR_STYLE_START + 7);
|
||||
inline constexpr TypedWhichId<SfxInt32Item> SCHATTR_STYLE_BASETYPE (SCHATTR_STYLE_START + 3);// Line,Area,...,Pie
|
||||
inline constexpr TypedWhichId<SfxBoolItem> SCHATTR_STYLE_LINES (SCHATTR_STYLE_START + 4);// draw line
|
||||
inline constexpr TypedWhichId<SfxBoolItem> SCHATTR_STYLE_PERCENT (SCHATTR_STYLE_START + 5);
|
||||
inline constexpr TypedWhichId<SfxBoolItem> SCHATTR_STYLE_STACKED (SCHATTR_STYLE_START + 6);
|
||||
inline constexpr TypedWhichId<SfxInt32Item> SCHATTR_STYLE_SPLINES (SCHATTR_STYLE_START + 7);
|
||||
|
||||
// also for data point
|
||||
constexpr TypedWhichId<SfxInt32Item> SCHATTR_STYLE_SYMBOL (SCHATTR_STYLE_START + 8);
|
||||
constexpr TypedWhichId<SfxInt32Item> SCHATTR_STYLE_SHAPE (SCHATTR_STYLE_START + 9);
|
||||
constexpr sal_uInt16 SCHATTR_STYLE_END (SCHATTR_STYLE_SHAPE );
|
||||
inline constexpr TypedWhichId<SfxInt32Item> SCHATTR_STYLE_SYMBOL (SCHATTR_STYLE_START + 8);
|
||||
inline constexpr TypedWhichId<SfxInt32Item> SCHATTR_STYLE_SHAPE (SCHATTR_STYLE_START + 9);
|
||||
inline constexpr sal_uInt16 SCHATTR_STYLE_END (SCHATTR_STYLE_SHAPE );
|
||||
|
||||
constexpr TypedWhichId<SfxInt32Item> SCHATTR_AXIS (SCHATTR_STYLE_END + 1); // see chtmodel.hxx defines CHART_AXIS_PRIMARY_X, etc.
|
||||
inline constexpr TypedWhichId<SfxInt32Item> SCHATTR_AXIS (SCHATTR_STYLE_END + 1); // see chtmodel.hxx defines CHART_AXIS_PRIMARY_X, etc.
|
||||
//Re-mapped:
|
||||
constexpr sal_uInt16 SCHATTR_AXIS_START (SCHATTR_AXIS + 1);
|
||||
inline constexpr sal_uInt16 SCHATTR_AXIS_START (SCHATTR_AXIS + 1);
|
||||
//axis scale
|
||||
constexpr TypedWhichId<SfxInt32Item> SCHATTR_AXISTYPE (SCHATTR_AXIS_START);
|
||||
constexpr TypedWhichId<SfxBoolItem> SCHATTR_AXIS_REVERSE (SCHATTR_AXIS_START + 1);
|
||||
constexpr TypedWhichId<SfxBoolItem> SCHATTR_AXIS_AUTO_MIN (SCHATTR_AXIS_START + 2);
|
||||
constexpr TypedWhichId<SvxDoubleItem> SCHATTR_AXIS_MIN (SCHATTR_AXIS_START + 3);
|
||||
constexpr TypedWhichId<SfxBoolItem> SCHATTR_AXIS_AUTO_MAX (SCHATTR_AXIS_START + 4);
|
||||
constexpr TypedWhichId<SvxDoubleItem> SCHATTR_AXIS_MAX (SCHATTR_AXIS_START + 5);
|
||||
constexpr TypedWhichId<SfxBoolItem> SCHATTR_AXIS_AUTO_STEP_MAIN (SCHATTR_AXIS_START + 6);
|
||||
constexpr TypedWhichId<SvxDoubleItem> SCHATTR_AXIS_STEP_MAIN (SCHATTR_AXIS_START + 7);
|
||||
constexpr TypedWhichId<SfxInt32Item> SCHATTR_AXIS_MAIN_TIME_UNIT (SCHATTR_AXIS_START + 8);
|
||||
constexpr TypedWhichId<SfxBoolItem> SCHATTR_AXIS_AUTO_STEP_HELP (SCHATTR_AXIS_START + 9);
|
||||
constexpr TypedWhichId<SfxInt32Item> SCHATTR_AXIS_STEP_HELP (SCHATTR_AXIS_START + 10);
|
||||
constexpr TypedWhichId<SfxInt32Item> SCHATTR_AXIS_HELP_TIME_UNIT (SCHATTR_AXIS_START + 11);
|
||||
constexpr TypedWhichId<SfxBoolItem> SCHATTR_AXIS_AUTO_TIME_RESOLUTION (SCHATTR_AXIS_START + 12);
|
||||
constexpr TypedWhichId<SfxInt32Item> SCHATTR_AXIS_TIME_RESOLUTION (SCHATTR_AXIS_START + 13);
|
||||
constexpr TypedWhichId<SfxBoolItem> SCHATTR_AXIS_LOGARITHM (SCHATTR_AXIS_START + 14);
|
||||
constexpr TypedWhichId<SfxBoolItem> SCHATTR_AXIS_AUTO_DATEAXIS (SCHATTR_AXIS_START + 15);
|
||||
constexpr TypedWhichId<SfxBoolItem> SCHATTR_AXIS_ALLOW_DATEAXIS (SCHATTR_AXIS_START + 16);
|
||||
constexpr TypedWhichId<SfxBoolItem> SCHATTR_AXIS_AUTO_ORIGIN (SCHATTR_AXIS_START + 17);
|
||||
constexpr TypedWhichId<SvxDoubleItem> SCHATTR_AXIS_ORIGIN (SCHATTR_AXIS_START + 18);
|
||||
inline constexpr TypedWhichId<SfxInt32Item> SCHATTR_AXISTYPE (SCHATTR_AXIS_START);
|
||||
inline constexpr TypedWhichId<SfxBoolItem> SCHATTR_AXIS_REVERSE (SCHATTR_AXIS_START + 1);
|
||||
inline constexpr TypedWhichId<SfxBoolItem> SCHATTR_AXIS_AUTO_MIN (SCHATTR_AXIS_START + 2);
|
||||
inline constexpr TypedWhichId<SvxDoubleItem> SCHATTR_AXIS_MIN (SCHATTR_AXIS_START + 3);
|
||||
inline constexpr TypedWhichId<SfxBoolItem> SCHATTR_AXIS_AUTO_MAX (SCHATTR_AXIS_START + 4);
|
||||
inline constexpr TypedWhichId<SvxDoubleItem> SCHATTR_AXIS_MAX (SCHATTR_AXIS_START + 5);
|
||||
inline constexpr TypedWhichId<SfxBoolItem> SCHATTR_AXIS_AUTO_STEP_MAIN (SCHATTR_AXIS_START + 6);
|
||||
inline constexpr TypedWhichId<SvxDoubleItem> SCHATTR_AXIS_STEP_MAIN (SCHATTR_AXIS_START + 7);
|
||||
inline constexpr TypedWhichId<SfxInt32Item> SCHATTR_AXIS_MAIN_TIME_UNIT (SCHATTR_AXIS_START + 8);
|
||||
inline constexpr TypedWhichId<SfxBoolItem> SCHATTR_AXIS_AUTO_STEP_HELP (SCHATTR_AXIS_START + 9);
|
||||
inline constexpr TypedWhichId<SfxInt32Item> SCHATTR_AXIS_STEP_HELP (SCHATTR_AXIS_START + 10);
|
||||
inline constexpr TypedWhichId<SfxInt32Item> SCHATTR_AXIS_HELP_TIME_UNIT (SCHATTR_AXIS_START + 11);
|
||||
inline constexpr TypedWhichId<SfxBoolItem> SCHATTR_AXIS_AUTO_TIME_RESOLUTION (SCHATTR_AXIS_START + 12);
|
||||
inline constexpr TypedWhichId<SfxInt32Item> SCHATTR_AXIS_TIME_RESOLUTION (SCHATTR_AXIS_START + 13);
|
||||
inline constexpr TypedWhichId<SfxBoolItem> SCHATTR_AXIS_LOGARITHM (SCHATTR_AXIS_START + 14);
|
||||
inline constexpr TypedWhichId<SfxBoolItem> SCHATTR_AXIS_AUTO_DATEAXIS (SCHATTR_AXIS_START + 15);
|
||||
inline constexpr TypedWhichId<SfxBoolItem> SCHATTR_AXIS_ALLOW_DATEAXIS (SCHATTR_AXIS_START + 16);
|
||||
inline constexpr TypedWhichId<SfxBoolItem> SCHATTR_AXIS_AUTO_ORIGIN (SCHATTR_AXIS_START + 17);
|
||||
inline constexpr TypedWhichId<SvxDoubleItem> SCHATTR_AXIS_ORIGIN (SCHATTR_AXIS_START + 18);
|
||||
//axis position
|
||||
constexpr sal_uInt16 SCHATTR_AXIS_POSITION_START (SCHATTR_AXIS_ORIGIN + 1);
|
||||
constexpr TypedWhichId<SfxInt32Item> SCHATTR_AXIS_TICKS (SCHATTR_AXIS_POSITION_START);
|
||||
constexpr TypedWhichId<SfxInt32Item> SCHATTR_AXIS_HELPTICKS (SCHATTR_AXIS_POSITION_START + 1);
|
||||
constexpr TypedWhichId<SfxInt32Item> SCHATTR_AXIS_POSITION (SCHATTR_AXIS_POSITION_START + 2);
|
||||
constexpr TypedWhichId<SvxDoubleItem> SCHATTR_AXIS_POSITION_VALUE (SCHATTR_AXIS_POSITION_START + 3);
|
||||
constexpr TypedWhichId<SfxUInt32Item> SCHATTR_AXIS_CROSSING_MAIN_AXIS_NUMBERFORMAT (SCHATTR_AXIS_POSITION_START + 4);
|
||||
constexpr TypedWhichId<SfxBoolItem> SCHATTR_AXIS_SHIFTED_CATEGORY_POSITION (SCHATTR_AXIS_POSITION_START + 5);
|
||||
constexpr TypedWhichId<SfxInt32Item> SCHATTR_AXIS_LABEL_POSITION (SCHATTR_AXIS_POSITION_START + 6);
|
||||
constexpr TypedWhichId<SfxInt32Item> SCHATTR_AXIS_MARK_POSITION (SCHATTR_AXIS_POSITION_START + 7);
|
||||
inline constexpr sal_uInt16 SCHATTR_AXIS_POSITION_START (SCHATTR_AXIS_ORIGIN + 1);
|
||||
inline constexpr TypedWhichId<SfxInt32Item> SCHATTR_AXIS_TICKS (SCHATTR_AXIS_POSITION_START);
|
||||
inline constexpr TypedWhichId<SfxInt32Item> SCHATTR_AXIS_HELPTICKS (SCHATTR_AXIS_POSITION_START + 1);
|
||||
inline constexpr TypedWhichId<SfxInt32Item> SCHATTR_AXIS_POSITION (SCHATTR_AXIS_POSITION_START + 2);
|
||||
inline constexpr TypedWhichId<SvxDoubleItem> SCHATTR_AXIS_POSITION_VALUE (SCHATTR_AXIS_POSITION_START + 3);
|
||||
inline constexpr TypedWhichId<SfxUInt32Item> SCHATTR_AXIS_CROSSING_MAIN_AXIS_NUMBERFORMAT (SCHATTR_AXIS_POSITION_START + 4);
|
||||
inline constexpr TypedWhichId<SfxBoolItem> SCHATTR_AXIS_SHIFTED_CATEGORY_POSITION (SCHATTR_AXIS_POSITION_START + 5);
|
||||
inline constexpr TypedWhichId<SfxInt32Item> SCHATTR_AXIS_LABEL_POSITION (SCHATTR_AXIS_POSITION_START + 6);
|
||||
inline constexpr TypedWhichId<SfxInt32Item> SCHATTR_AXIS_MARK_POSITION (SCHATTR_AXIS_POSITION_START + 7);
|
||||
//axis label
|
||||
constexpr sal_uInt16 SCHATTR_AXIS_LABEL_START (SCHATTR_AXIS_MARK_POSITION + 1);
|
||||
constexpr TypedWhichId<SfxBoolItem> SCHATTR_AXIS_SHOWDESCR (SCHATTR_AXIS_LABEL_START);
|
||||
constexpr TypedWhichId<SvxChartTextOrderItem> SCHATTR_AXIS_LABEL_ORDER (SCHATTR_AXIS_LABEL_START + 1);
|
||||
constexpr TypedWhichId<SfxBoolItem> SCHATTR_AXIS_LABEL_OVERLAP (SCHATTR_AXIS_LABEL_START + 2);
|
||||
constexpr TypedWhichId<SfxBoolItem> SCHATTR_AXIS_LABEL_BREAK (SCHATTR_AXIS_LABEL_START + 3);
|
||||
constexpr sal_uInt16 SCHATTR_AXIS_LABEL_END (SCHATTR_AXIS_LABEL_BREAK);
|
||||
inline constexpr sal_uInt16 SCHATTR_AXIS_LABEL_START (SCHATTR_AXIS_MARK_POSITION + 1);
|
||||
inline constexpr TypedWhichId<SfxBoolItem> SCHATTR_AXIS_SHOWDESCR (SCHATTR_AXIS_LABEL_START);
|
||||
inline constexpr TypedWhichId<SvxChartTextOrderItem> SCHATTR_AXIS_LABEL_ORDER (SCHATTR_AXIS_LABEL_START + 1);
|
||||
inline constexpr TypedWhichId<SfxBoolItem> SCHATTR_AXIS_LABEL_OVERLAP (SCHATTR_AXIS_LABEL_START + 2);
|
||||
inline constexpr TypedWhichId<SfxBoolItem> SCHATTR_AXIS_LABEL_BREAK (SCHATTR_AXIS_LABEL_START + 3);
|
||||
inline constexpr sal_uInt16 SCHATTR_AXIS_LABEL_END (SCHATTR_AXIS_LABEL_BREAK);
|
||||
|
||||
constexpr sal_uInt16 SCHATTR_AXIS_END (SCHATTR_AXIS_LABEL_END);
|
||||
inline constexpr sal_uInt16 SCHATTR_AXIS_END (SCHATTR_AXIS_LABEL_END);
|
||||
|
||||
constexpr TypedWhichId<SvxBrushItem> SCHATTR_SYMBOL_BRUSH (SCHATTR_AXIS_END + 1);
|
||||
constexpr TypedWhichId<SfxBoolItem> SCHATTR_STOCK_VOLUME (SCHATTR_AXIS_END + 2);
|
||||
constexpr TypedWhichId<SfxBoolItem> SCHATTR_STOCK_UPDOWN (SCHATTR_AXIS_END + 3);
|
||||
constexpr TypedWhichId<SvxSizeItem> SCHATTR_SYMBOL_SIZE (SCHATTR_AXIS_END + 4);
|
||||
constexpr TypedWhichId<SfxBoolItem> SCHATTR_HIDE_DATA_POINT_LEGEND_ENTRY (SCHATTR_AXIS_END + 5);
|
||||
inline constexpr TypedWhichId<SvxBrushItem> SCHATTR_SYMBOL_BRUSH (SCHATTR_AXIS_END + 1);
|
||||
inline constexpr TypedWhichId<SfxBoolItem> SCHATTR_STOCK_VOLUME (SCHATTR_AXIS_END + 2);
|
||||
inline constexpr TypedWhichId<SfxBoolItem> SCHATTR_STOCK_UPDOWN (SCHATTR_AXIS_END + 3);
|
||||
inline constexpr TypedWhichId<SvxSizeItem> SCHATTR_SYMBOL_SIZE (SCHATTR_AXIS_END + 4);
|
||||
inline constexpr TypedWhichId<SfxBoolItem> SCHATTR_HIDE_DATA_POINT_LEGEND_ENTRY (SCHATTR_AXIS_END + 5);
|
||||
|
||||
// non persistent items (binary format)
|
||||
constexpr sal_uInt16 SCHATTR_CHARTTYPE_START (SCHATTR_HIDE_DATA_POINT_LEGEND_ENTRY + 1);
|
||||
inline constexpr sal_uInt16 SCHATTR_CHARTTYPE_START (SCHATTR_HIDE_DATA_POINT_LEGEND_ENTRY + 1);
|
||||
|
||||
// new from New Chart
|
||||
constexpr TypedWhichId<SfxInt32Item> SCHATTR_BAR_OVERLAP (SCHATTR_CHARTTYPE_START );
|
||||
constexpr TypedWhichId<SfxInt32Item> SCHATTR_BAR_GAPWIDTH (SCHATTR_CHARTTYPE_START + 1);
|
||||
constexpr TypedWhichId<SfxBoolItem> SCHATTR_BAR_CONNECT (SCHATTR_CHARTTYPE_START + 2);
|
||||
constexpr TypedWhichId<SfxInt32Item> SCHATTR_NUM_OF_LINES_FOR_BAR (SCHATTR_CHARTTYPE_START + 3);
|
||||
constexpr TypedWhichId<SfxInt32Item> SCHATTR_SPLINE_ORDER (SCHATTR_CHARTTYPE_START + 4);
|
||||
constexpr TypedWhichId<SfxInt32Item> SCHATTR_SPLINE_RESOLUTION (SCHATTR_CHARTTYPE_START + 5);
|
||||
constexpr TypedWhichId<SfxBoolItem> SCHATTR_GROUP_BARS_PER_AXIS (SCHATTR_CHARTTYPE_START + 6);
|
||||
constexpr TypedWhichId<SdrAngleItem> SCHATTR_STARTING_ANGLE (SCHATTR_CHARTTYPE_START + 7);
|
||||
constexpr TypedWhichId<SfxBoolItem> SCHATTR_CLOCKWISE (SCHATTR_CHARTTYPE_START + 8);
|
||||
constexpr TypedWhichId<SfxInt32Item> SCHATTR_MISSING_VALUE_TREATMENT (SCHATTR_CHARTTYPE_START + 9);
|
||||
constexpr TypedWhichId<SfxIntegerListItem> SCHATTR_AVAILABLE_MISSING_VALUE_TREATMENTS (SCHATTR_CHARTTYPE_START + 10);
|
||||
constexpr TypedWhichId<SfxBoolItem> SCHATTR_INCLUDE_HIDDEN_CELLS (SCHATTR_CHARTTYPE_START + 11);
|
||||
constexpr TypedWhichId<SfxBoolItem> SCHATTR_HIDE_LEGEND_ENTRY (SCHATTR_CHARTTYPE_START + 12);
|
||||
inline constexpr TypedWhichId<SfxInt32Item> SCHATTR_BAR_OVERLAP (SCHATTR_CHARTTYPE_START );
|
||||
inline constexpr TypedWhichId<SfxInt32Item> SCHATTR_BAR_GAPWIDTH (SCHATTR_CHARTTYPE_START + 1);
|
||||
inline constexpr TypedWhichId<SfxBoolItem> SCHATTR_BAR_CONNECT (SCHATTR_CHARTTYPE_START + 2);
|
||||
inline constexpr TypedWhichId<SfxInt32Item> SCHATTR_NUM_OF_LINES_FOR_BAR (SCHATTR_CHARTTYPE_START + 3);
|
||||
inline constexpr TypedWhichId<SfxInt32Item> SCHATTR_SPLINE_ORDER (SCHATTR_CHARTTYPE_START + 4);
|
||||
inline constexpr TypedWhichId<SfxInt32Item> SCHATTR_SPLINE_RESOLUTION (SCHATTR_CHARTTYPE_START + 5);
|
||||
inline constexpr TypedWhichId<SfxBoolItem> SCHATTR_GROUP_BARS_PER_AXIS (SCHATTR_CHARTTYPE_START + 6);
|
||||
inline constexpr TypedWhichId<SdrAngleItem> SCHATTR_STARTING_ANGLE (SCHATTR_CHARTTYPE_START + 7);
|
||||
inline constexpr TypedWhichId<SfxBoolItem> SCHATTR_CLOCKWISE (SCHATTR_CHARTTYPE_START + 8);
|
||||
inline constexpr TypedWhichId<SfxInt32Item> SCHATTR_MISSING_VALUE_TREATMENT (SCHATTR_CHARTTYPE_START + 9);
|
||||
inline constexpr TypedWhichId<SfxIntegerListItem> SCHATTR_AVAILABLE_MISSING_VALUE_TREATMENTS (SCHATTR_CHARTTYPE_START + 10);
|
||||
inline constexpr TypedWhichId<SfxBoolItem> SCHATTR_INCLUDE_HIDDEN_CELLS (SCHATTR_CHARTTYPE_START + 11);
|
||||
inline constexpr TypedWhichId<SfxBoolItem> SCHATTR_HIDE_LEGEND_ENTRY (SCHATTR_CHARTTYPE_START + 12);
|
||||
|
||||
constexpr sal_uInt16 SCHATTR_CHARTTYPE_END (SCHATTR_HIDE_LEGEND_ENTRY);
|
||||
inline constexpr sal_uInt16 SCHATTR_CHARTTYPE_END (SCHATTR_HIDE_LEGEND_ENTRY);
|
||||
|
||||
// items for transporting information to dialogs
|
||||
constexpr sal_uInt16 SCHATTR_MISC_START (SCHATTR_CHARTTYPE_END + 1);
|
||||
constexpr TypedWhichId<SfxInt32Item> SCHATTR_AXIS_FOR_ALL_SERIES (SCHATTR_MISC_START);
|
||||
constexpr sal_uInt16 SCHATTR_MISC_END (SCHATTR_AXIS_FOR_ALL_SERIES);
|
||||
inline constexpr sal_uInt16 SCHATTR_MISC_START (SCHATTR_CHARTTYPE_END + 1);
|
||||
inline constexpr TypedWhichId<SfxInt32Item> SCHATTR_AXIS_FOR_ALL_SERIES (SCHATTR_MISC_START);
|
||||
inline constexpr sal_uInt16 SCHATTR_MISC_END (SCHATTR_AXIS_FOR_ALL_SERIES);
|
||||
|
||||
// regression curve
|
||||
constexpr sal_uInt16 SCHATTR_REGRESSION_START (SCHATTR_MISC_END + 1);
|
||||
constexpr TypedWhichId<SvxChartRegressItem> SCHATTR_REGRESSION_TYPE (SCHATTR_REGRESSION_START);
|
||||
constexpr TypedWhichId<SfxBoolItem> SCHATTR_REGRESSION_SHOW_EQUATION (SCHATTR_REGRESSION_START + 1);
|
||||
constexpr TypedWhichId<SfxBoolItem> SCHATTR_REGRESSION_SHOW_COEFF (SCHATTR_REGRESSION_START + 2);
|
||||
constexpr TypedWhichId<SfxInt32Item> SCHATTR_REGRESSION_DEGREE (SCHATTR_REGRESSION_START + 3);
|
||||
constexpr TypedWhichId<SfxInt32Item> SCHATTR_REGRESSION_PERIOD (SCHATTR_REGRESSION_START + 4);
|
||||
constexpr TypedWhichId<SvxDoubleItem> SCHATTR_REGRESSION_EXTRAPOLATE_FORWARD (SCHATTR_REGRESSION_START + 5);
|
||||
constexpr TypedWhichId<SvxDoubleItem> SCHATTR_REGRESSION_EXTRAPOLATE_BACKWARD (SCHATTR_REGRESSION_START + 6);
|
||||
constexpr TypedWhichId<SfxBoolItem> SCHATTR_REGRESSION_SET_INTERCEPT (SCHATTR_REGRESSION_START + 7);
|
||||
constexpr TypedWhichId<SvxDoubleItem> SCHATTR_REGRESSION_INTERCEPT_VALUE (SCHATTR_REGRESSION_START + 8);
|
||||
constexpr TypedWhichId<SfxStringItem> SCHATTR_REGRESSION_CURVE_NAME (SCHATTR_REGRESSION_START + 9);
|
||||
constexpr TypedWhichId<SfxStringItem> SCHATTR_REGRESSION_XNAME (SCHATTR_REGRESSION_START + 10);
|
||||
constexpr TypedWhichId<SfxStringItem> SCHATTR_REGRESSION_YNAME (SCHATTR_REGRESSION_START + 11);
|
||||
constexpr TypedWhichId<SfxInt32Item> SCHATTR_REGRESSION_MOVING_TYPE (SCHATTR_REGRESSION_START + 12);
|
||||
constexpr sal_uInt16 SCHATTR_REGRESSION_END (SCHATTR_REGRESSION_MOVING_TYPE);
|
||||
inline constexpr sal_uInt16 SCHATTR_REGRESSION_START (SCHATTR_MISC_END + 1);
|
||||
inline constexpr TypedWhichId<SvxChartRegressItem> SCHATTR_REGRESSION_TYPE (SCHATTR_REGRESSION_START);
|
||||
inline constexpr TypedWhichId<SfxBoolItem> SCHATTR_REGRESSION_SHOW_EQUATION (SCHATTR_REGRESSION_START + 1);
|
||||
inline constexpr TypedWhichId<SfxBoolItem> SCHATTR_REGRESSION_SHOW_COEFF (SCHATTR_REGRESSION_START + 2);
|
||||
inline constexpr TypedWhichId<SfxInt32Item> SCHATTR_REGRESSION_DEGREE (SCHATTR_REGRESSION_START + 3);
|
||||
inline constexpr TypedWhichId<SfxInt32Item> SCHATTR_REGRESSION_PERIOD (SCHATTR_REGRESSION_START + 4);
|
||||
inline constexpr TypedWhichId<SvxDoubleItem> SCHATTR_REGRESSION_EXTRAPOLATE_FORWARD (SCHATTR_REGRESSION_START + 5);
|
||||
inline constexpr TypedWhichId<SvxDoubleItem> SCHATTR_REGRESSION_EXTRAPOLATE_BACKWARD (SCHATTR_REGRESSION_START + 6);
|
||||
inline constexpr TypedWhichId<SfxBoolItem> SCHATTR_REGRESSION_SET_INTERCEPT (SCHATTR_REGRESSION_START + 7);
|
||||
inline constexpr TypedWhichId<SvxDoubleItem> SCHATTR_REGRESSION_INTERCEPT_VALUE (SCHATTR_REGRESSION_START + 8);
|
||||
inline constexpr TypedWhichId<SfxStringItem> SCHATTR_REGRESSION_CURVE_NAME (SCHATTR_REGRESSION_START + 9);
|
||||
inline constexpr TypedWhichId<SfxStringItem> SCHATTR_REGRESSION_XNAME (SCHATTR_REGRESSION_START + 10);
|
||||
inline constexpr TypedWhichId<SfxStringItem> SCHATTR_REGRESSION_YNAME (SCHATTR_REGRESSION_START + 11);
|
||||
inline constexpr TypedWhichId<SfxInt32Item> SCHATTR_REGRESSION_MOVING_TYPE (SCHATTR_REGRESSION_START + 12);
|
||||
inline constexpr sal_uInt16 SCHATTR_REGRESSION_END (SCHATTR_REGRESSION_MOVING_TYPE);
|
||||
|
||||
constexpr sal_uInt16 SCHATTR_DATA_TABLE_START (SCHATTR_REGRESSION_END + 1);
|
||||
constexpr TypedWhichId<SfxBoolItem> SCHATTR_DATA_TABLE_HORIZONTAL_BORDER (SCHATTR_DATA_TABLE_START + 0);
|
||||
constexpr TypedWhichId<SfxBoolItem> SCHATTR_DATA_TABLE_VERTICAL_BORDER (SCHATTR_DATA_TABLE_START + 1);
|
||||
constexpr TypedWhichId<SfxBoolItem> SCHATTR_DATA_TABLE_OUTLINE (SCHATTR_DATA_TABLE_START + 2);
|
||||
constexpr TypedWhichId<SfxBoolItem> SCHATTR_DATA_TABLE_KEYS (SCHATTR_DATA_TABLE_START + 3);
|
||||
constexpr sal_uInt16 SCHATTR_DATA_TABLE_END (SCHATTR_DATA_TABLE_KEYS);
|
||||
inline constexpr sal_uInt16 SCHATTR_DATA_TABLE_START (SCHATTR_REGRESSION_END + 1);
|
||||
inline constexpr TypedWhichId<SfxBoolItem> SCHATTR_DATA_TABLE_HORIZONTAL_BORDER (SCHATTR_DATA_TABLE_START + 0);
|
||||
inline constexpr TypedWhichId<SfxBoolItem> SCHATTR_DATA_TABLE_VERTICAL_BORDER (SCHATTR_DATA_TABLE_START + 1);
|
||||
inline constexpr TypedWhichId<SfxBoolItem> SCHATTR_DATA_TABLE_OUTLINE (SCHATTR_DATA_TABLE_START + 2);
|
||||
inline constexpr TypedWhichId<SfxBoolItem> SCHATTR_DATA_TABLE_KEYS (SCHATTR_DATA_TABLE_START + 3);
|
||||
inline constexpr sal_uInt16 SCHATTR_DATA_TABLE_END (SCHATTR_DATA_TABLE_KEYS);
|
||||
|
||||
constexpr sal_uInt16 SCHATTR_END (SCHATTR_DATA_TABLE_END);
|
||||
inline constexpr sal_uInt16 SCHATTR_END (SCHATTR_DATA_TABLE_END);
|
||||
|
||||
// values for Items
|
||||
|
||||
|
|
|
@ -98,6 +98,7 @@ enum
|
|||
PROP_DIAGRAM_3DRELATIVEHEIGHT,
|
||||
PROP_DIAGRAM_DATATABLEHBORDER,
|
||||
PROP_DIAGRAM_OF_PIE_TYPE,
|
||||
PROP_DIAGRAM_SPLIT_POS,
|
||||
PROP_DIAGRAM_DATATABLEVBORDER,
|
||||
PROP_DIAGRAM_DATATABLEOUTLINE,
|
||||
PROP_DIAGRAM_EXTERNALDATA
|
||||
|
@ -188,6 +189,10 @@ void lcl_AddPropertiesToVector(
|
|||
PROP_DIAGRAM_OF_PIE_TYPE,
|
||||
cppu::UnoType<chart2::PieChartSubType>::get(),
|
||||
beans::PropertyAttribute::MAYBEVOID );
|
||||
rOutProperties.emplace_back( "SplitPos",
|
||||
PROP_DIAGRAM_SPLIT_POS,
|
||||
cppu::UnoType<sal_Int32>::get(),
|
||||
beans::PropertyAttribute::MAYBEVOID );
|
||||
rOutProperties.emplace_back( "ExternalData",
|
||||
PROP_DIAGRAM_EXTERNALDATA,
|
||||
cppu::UnoType<OUString>::get(),
|
||||
|
@ -209,6 +214,7 @@ const ::chart::tPropertyValueMap& StaticDiagramDefaults()
|
|||
::chart::PropertyHelper::setPropertyValueDefault< sal_Int32 >( aMap, PROP_DIAGRAM_3DRELATIVEHEIGHT, 100 );
|
||||
::chart::PropertyHelper::setPropertyValueDefault< chart2::PieChartSubType >( aMap, PROP_DIAGRAM_OF_PIE_TYPE,
|
||||
chart2::PieChartSubType_NONE);
|
||||
::chart::PropertyHelper::setPropertyValueDefault< sal_Int32 >( aMap, PROP_DIAGRAM_SPLIT_POS, 2 );
|
||||
::chart::SceneProperties::AddDefaultsToMap( aMap );
|
||||
return aMap;
|
||||
}();
|
||||
|
|
|
@ -396,52 +396,52 @@ rtl::Reference< ::chart::ChartTypeTemplate > ChartTypeManager::createTemplate(
|
|||
case TEMPLATE_PIE:
|
||||
xTemplate.set( new PieChartTypeTemplate( m_xContext, aServiceSpecifier,
|
||||
chart2::PieChartOffsetMode_NONE, false,
|
||||
chart2::PieChartSubType_NONE, 2 ));
|
||||
chart2::PieChartSubType_NONE, 3, 2));
|
||||
break;
|
||||
case TEMPLATE_PIEALLEXPLODED:
|
||||
xTemplate.set( new PieChartTypeTemplate( m_xContext, aServiceSpecifier,
|
||||
chart2::PieChartOffsetMode_ALL_EXPLODED, false,
|
||||
chart2::PieChartSubType_NONE, 2 ));
|
||||
chart2::PieChartSubType_NONE, 3, 2 ));
|
||||
break;
|
||||
case TEMPLATE_DONUT:
|
||||
xTemplate.set( new PieChartTypeTemplate( m_xContext, aServiceSpecifier,
|
||||
chart2::PieChartOffsetMode_NONE, true,
|
||||
chart2::PieChartSubType_NONE, 2 ));
|
||||
chart2::PieChartSubType_NONE, 3, 2 ));
|
||||
break;
|
||||
case TEMPLATE_DONUTALLEXPLODED:
|
||||
xTemplate.set( new PieChartTypeTemplate( m_xContext, aServiceSpecifier,
|
||||
chart2::PieChartOffsetMode_ALL_EXPLODED, true,
|
||||
chart2::PieChartSubType_NONE, 2 ));
|
||||
chart2::PieChartSubType_NONE, 3, 2 ));
|
||||
break;
|
||||
case TEMPLATE_BAROFPIE:
|
||||
xTemplate.set( new PieChartTypeTemplate( m_xContext, aServiceSpecifier,
|
||||
chart2::PieChartOffsetMode_NONE, false,
|
||||
chart2::PieChartSubType_BAR, 2 ));
|
||||
chart2::PieChartSubType_BAR, 3, 2 ));
|
||||
break;
|
||||
case TEMPLATE_PIEOFPIE:
|
||||
xTemplate.set( new PieChartTypeTemplate( m_xContext, aServiceSpecifier,
|
||||
chart2::PieChartOffsetMode_NONE, false,
|
||||
chart2::PieChartSubType_PIE, 2 ));
|
||||
chart2::PieChartSubType_PIE, 3, 2 ));
|
||||
break;
|
||||
case TEMPLATE_THREEDPIE:
|
||||
xTemplate.set( new PieChartTypeTemplate( m_xContext, aServiceSpecifier,
|
||||
chart2::PieChartOffsetMode_NONE, false,
|
||||
chart2::PieChartSubType_NONE, 3 ));
|
||||
chart2::PieChartSubType_NONE, 3, 3 ));
|
||||
break;
|
||||
case TEMPLATE_THREEDPIEALLEXPLODED:
|
||||
xTemplate.set( new PieChartTypeTemplate( m_xContext, aServiceSpecifier,
|
||||
chart2::PieChartOffsetMode_ALL_EXPLODED, false,
|
||||
chart2::PieChartSubType_NONE, 3 ));
|
||||
chart2::PieChartSubType_NONE, 3, 3 ));
|
||||
break;
|
||||
case TEMPLATE_THREEDDONUT:
|
||||
xTemplate.set( new PieChartTypeTemplate( m_xContext, aServiceSpecifier,
|
||||
chart2::PieChartOffsetMode_NONE, true,
|
||||
chart2::PieChartSubType_NONE, 3 ));
|
||||
chart2::PieChartSubType_NONE, 3, 3 ));
|
||||
break;
|
||||
case TEMPLATE_THREEDDONUTALLEXPLODED:
|
||||
xTemplate.set( new PieChartTypeTemplate( m_xContext, aServiceSpecifier,
|
||||
chart2::PieChartOffsetMode_ALL_EXPLODED, true,
|
||||
chart2::PieChartSubType_NONE, 3 ));
|
||||
chart2::PieChartSubType_NONE, 3, 3 ));
|
||||
break;
|
||||
|
||||
case TEMPLATE_SCATTERLINESYMBOL:
|
||||
|
|
|
@ -317,13 +317,13 @@ bool ChartTypeTemplate::matchesTemplate2(
|
|||
for( std::size_t nCooSysIdx=0; bResult && (nCooSysIdx < aCooSysSeq.size()); ++nCooSysIdx )
|
||||
{
|
||||
// match dimension
|
||||
bResult = bResult && (aCooSysSeq[nCooSysIdx]->getDimension() == nDimensionToMatch);
|
||||
bResult = aCooSysSeq[nCooSysIdx]->getDimension() == nDimensionToMatch;
|
||||
|
||||
const std::vector< rtl::Reference< ChartType > > & aChartTypeSeq( aCooSysSeq[nCooSysIdx]->getChartTypes2());
|
||||
for( std::size_t nCTIdx=0; bResult && (nCTIdx < aChartTypeSeq.size()); ++nCTIdx )
|
||||
{
|
||||
// match chart type
|
||||
bResult = bResult && aChartTypeSeq[nCTIdx]->getChartType() == aChartTypeToMatch;
|
||||
bResult = aChartTypeSeq[nCTIdx]->getChartType() == aChartTypeToMatch;
|
||||
bool bFound=false;
|
||||
bool bAmbiguous=false;
|
||||
// match stacking mode
|
||||
|
@ -508,7 +508,7 @@ void ChartTypeTemplate::createCoordinateSystems(
|
|||
{
|
||||
bool bOk = true;
|
||||
for( std::size_t i=0; bOk && i<aCoordinateSystems.size(); ++i )
|
||||
bOk = bOk && ( xCooSys->getCoordinateSystemType() == aCoordinateSystems[i]->getCoordinateSystemType() &&
|
||||
bOk = ( xCooSys->getCoordinateSystemType() == aCoordinateSystems[i]->getCoordinateSystemType() &&
|
||||
(xCooSys->getDimension() == aCoordinateSystems[i]->getDimension()) );
|
||||
// coordinate systems are ok
|
||||
if( bOk )
|
||||
|
|
|
@ -47,7 +47,7 @@ namespace
|
|||
::chart::PropertyHelper::setPropertyValueDefault( aOutMap, ::chart::PROP_PIECHARTTYPE_USE_RINGS, false );
|
||||
::chart::PropertyHelper::setPropertyValueDefault< sal_Int32 >( aOutMap, ::chart::PROP_PIECHARTTYPE_3DRELATIVEHEIGHT, 100 );
|
||||
::chart::PropertyHelper::setPropertyValueDefault( aOutMap, ::chart::PROP_PIECHARTTYPE_SUBTYPE, chart2::PieChartSubType_NONE );
|
||||
::chart::PropertyHelper::setPropertyValueDefault< sal_Int32 >( aOutMap, ::chart::PROP_PIECHARTTYPE_COMPOSITESIZE, 2 );
|
||||
::chart::PropertyHelper::setPropertyValueDefault< sal_Int32 >( aOutMap, ::chart::PROP_PIECHARTTYPE_SPLIT_POS, 2 );
|
||||
return aOutMap;
|
||||
}();
|
||||
return aStaticDefaults;
|
||||
|
@ -72,8 +72,8 @@ namespace
|
|||
::chart::PROP_PIECHARTTYPE_SUBTYPE,
|
||||
cppu::UnoType<chart2::PieChartSubType>::get(),
|
||||
beans::PropertyAttribute::MAYBEDEFAULT },
|
||||
{ u"CompositeSize"_ustr,
|
||||
::chart::PROP_PIECHARTTYPE_COMPOSITESIZE,
|
||||
{ u"SplitPos"_ustr,
|
||||
::chart::PROP_PIECHARTTYPE_SPLIT_POS,
|
||||
cppu::UnoType<sal_Int32>::get(),
|
||||
beans::PropertyAttribute::MAYBEVOID }
|
||||
};
|
||||
|
|
|
@ -56,7 +56,7 @@ enum
|
|||
PROP_PIE_TEMPLATE_DIMENSION,
|
||||
PROP_PIE_TEMPLATE_USE_RINGS,
|
||||
PROP_PIE_TEMPLATE_SUB_PIE_TYPE,
|
||||
PROP_PIE_TEMPLATE_COMPOSITE_SIZE
|
||||
PROP_PIE_TEMPLATE_SPLIT_POS
|
||||
};
|
||||
|
||||
::chart::tPropertyValueMap& StaticPieChartTypeTemplateDefaults()
|
||||
|
@ -69,7 +69,8 @@ enum
|
|||
::chart::PropertyHelper::setPropertyValueDefault< sal_Int32 >( aOutMap, PROP_PIE_TEMPLATE_DIMENSION, 2 );
|
||||
::chart::PropertyHelper::setPropertyValueDefault( aOutMap, PROP_PIE_TEMPLATE_USE_RINGS, false );
|
||||
::chart::PropertyHelper::setPropertyValueDefault( aOutMap, PROP_PIE_TEMPLATE_SUB_PIE_TYPE, chart2::PieChartSubType_NONE );
|
||||
::chart::PropertyHelper::setPropertyValueDefault< sal_Int32 >( aOutMap, PROP_PIE_TEMPLATE_COMPOSITE_SIZE, 2 );
|
||||
::chart::PropertyHelper::setPropertyValueDefault< sal_Int32 >(
|
||||
aOutMap, PROP_PIE_TEMPLATE_SPLIT_POS, 2 );
|
||||
return aOutMap;
|
||||
}();
|
||||
return aStaticDefaults;
|
||||
|
@ -106,8 +107,8 @@ enum
|
|||
cppu::UnoType<chart2::PieChartSubType>::get(),
|
||||
beans::PropertyAttribute::BOUND
|
||||
| beans::PropertyAttribute::MAYBEDEFAULT },
|
||||
{ u"CompositeSize"_ustr,
|
||||
PROP_PIE_TEMPLATE_COMPOSITE_SIZE,
|
||||
{ u"SplitPos"_ustr,
|
||||
PROP_PIE_TEMPLATE_SPLIT_POS,
|
||||
cppu::UnoType<sal_Int32>::get(),
|
||||
beans::PropertyAttribute::BOUND
|
||||
| beans::PropertyAttribute::MAYBEDEFAULT }
|
||||
|
@ -140,6 +141,7 @@ PieChartTypeTemplate::PieChartTypeTemplate(
|
|||
chart2::PieChartOffsetMode eMode,
|
||||
bool bRings,
|
||||
chart2::PieChartSubType eSubType,
|
||||
sal_Int32 nCompositeSize,
|
||||
sal_Int32 nDim /* = 2 */ ) :
|
||||
ChartTypeTemplate( xContext, rServiceName )
|
||||
{
|
||||
|
@ -147,7 +149,7 @@ PieChartTypeTemplate::PieChartTypeTemplate(
|
|||
setFastPropertyValue_NoBroadcast( PROP_PIE_TEMPLATE_DIMENSION, uno::Any( nDim ));
|
||||
setFastPropertyValue_NoBroadcast( PROP_PIE_TEMPLATE_USE_RINGS, uno::Any( bRings ));
|
||||
setFastPropertyValue_NoBroadcast( PROP_PIE_TEMPLATE_SUB_PIE_TYPE, uno::Any( eSubType ));
|
||||
setFastPropertyValue_NoBroadcast( PROP_PIE_TEMPLATE_COMPOSITE_SIZE, uno::Any( sal_Int32(2) ));
|
||||
setFastPropertyValue_NoBroadcast( PROP_PIE_TEMPLATE_SPLIT_POS, uno::Any( nCompositeSize ));
|
||||
}
|
||||
|
||||
PieChartTypeTemplate::~PieChartTypeTemplate()
|
||||
|
@ -274,7 +276,8 @@ void PieChartTypeTemplate::createChartTypes(
|
|||
xCT->setFastPropertyValue(
|
||||
PROP_PIECHARTTYPE_SUBTYPE, getFastPropertyValue( PROP_PIE_TEMPLATE_SUB_PIE_TYPE )); // "SubType"
|
||||
xCT->setFastPropertyValue(
|
||||
PROP_PIECHARTTYPE_COMPOSITESIZE, getFastPropertyValue( PROP_PIE_TEMPLATE_COMPOSITE_SIZE )); // "CompositeSize"
|
||||
PROP_PIECHARTTYPE_SPLIT_POS, getFastPropertyValue(
|
||||
PROP_PIE_TEMPLATE_SPLIT_POS )); // "CompositeSize"
|
||||
rCoordSys[0]->setChartTypes( std::vector{xCT} );
|
||||
|
||||
if( !aSeriesSeq.empty() )
|
||||
|
|
|
@ -39,6 +39,7 @@ public:
|
|||
css::chart2::PieChartOffsetMode eMode,
|
||||
bool bRings,
|
||||
css::chart2::PieChartSubType eSubType,
|
||||
sal_Int32 nCompositeSize,
|
||||
sal_Int32 nDim );
|
||||
virtual ~PieChartTypeTemplate() override;
|
||||
|
||||
|
|
|
@ -195,7 +195,7 @@ PieChart::PieChart( const rtl::Reference<ChartType>& xChartTypeModel
|
|||
, m_bUseRings(false)
|
||||
, m_bSizeExcludesLabelsAndExplodedSegments(bExcludingPositioning)
|
||||
, m_eSubType(PieChartSubType_NONE)
|
||||
, m_nCompositeSize(2)
|
||||
, m_nSplitPos(2)
|
||||
, m_fMaxOffset(std::numeric_limits<double>::quiet_NaN())
|
||||
{
|
||||
PlotterBase::m_pPosHelper = &m_aPosHelper;
|
||||
|
@ -230,7 +230,7 @@ PieChart::PieChart( const rtl::Reference<ChartType>& xChartTypeModel
|
|||
}
|
||||
try
|
||||
{
|
||||
xChartTypeModel->getFastPropertyValue(PROP_PIECHARTTYPE_COMPOSITESIZE) >>= m_nCompositeSize; // "CompositeSize"
|
||||
xChartTypeModel->getFastPropertyValue(PROP_PIECHARTTYPE_SPLIT_POS) >>= m_nSplitPos; // "CompositeSize"
|
||||
}
|
||||
catch( const uno::Exception& )
|
||||
{
|
||||
|
@ -1050,7 +1050,7 @@ void PieChart::createShapes()
|
|||
|
||||
PieDataSrcBase *pDataSrc = nullptr;
|
||||
PieDataSrc normalPieSrc;
|
||||
OfPieDataSrc ofPieSrc(m_nCompositeSize);
|
||||
OfPieDataSrc ofPieSrc(m_nSplitPos);
|
||||
|
||||
// Default to regular pie if too few points for of-pie
|
||||
::css::chart2::PieChartSubType eSubType =
|
||||
|
@ -2303,26 +2303,25 @@ uno::Reference< beans::XPropertySet > PieDataSrc::getProps(
|
|||
// class OfPieDataSrc
|
||||
//=======================
|
||||
|
||||
// For now, just implement the default Excel behavior, which is that the
|
||||
// right pie consists of the last three entries in the series. Other
|
||||
// behaviors should be supported later.
|
||||
// Support data splits only of the type "last n entries go in right subchart",
|
||||
// for now.
|
||||
// TODO
|
||||
|
||||
sal_Int32 OfPieDataSrc::getNPoints(const VDataSeries* pSeries,
|
||||
enum SubPieType eType) const
|
||||
{
|
||||
if (eType == SubPieType::LEFT) {
|
||||
return pSeries->getTotalPointCount() - m_nCompositeSize + 1;
|
||||
return pSeries->getTotalPointCount() - m_nSplitPos + 1;
|
||||
} else {
|
||||
assert(eType == SubPieType::RIGHT);
|
||||
return m_nCompositeSize;
|
||||
return m_nSplitPos;
|
||||
}
|
||||
}
|
||||
|
||||
double OfPieDataSrc::getData(const VDataSeries* pSeries, sal_Int32 nPtIdx,
|
||||
enum SubPieType eType) const
|
||||
{
|
||||
const sal_Int32 n = pSeries->getTotalPointCount() - m_nCompositeSize;
|
||||
const sal_Int32 n = pSeries->getTotalPointCount() - m_nSplitPos;
|
||||
if (eType == SubPieType::LEFT) {
|
||||
// nPtIdx should be in [0, n]
|
||||
if (nPtIdx < n) {
|
||||
|
@ -2331,7 +2330,7 @@ double OfPieDataSrc::getData(const VDataSeries* pSeries, sal_Int32 nPtIdx,
|
|||
// composite wedge
|
||||
assert(nPtIdx == n);
|
||||
double total = 0;
|
||||
for (sal_Int32 i = n; i < n + m_nCompositeSize; ++i) {
|
||||
for (sal_Int32 i = n; i < n + m_nSplitPos; ++i) {
|
||||
total += pSeries->getYValue(i);
|
||||
}
|
||||
return total;
|
||||
|
@ -2347,7 +2346,7 @@ uno::Reference< beans::XPropertySet > OfPieDataSrc::getProps(
|
|||
enum SubPieType eType) const
|
||||
{
|
||||
const sal_Int32 nPts = pSeries->getTotalPointCount();
|
||||
const sal_Int32 n = nPts - m_nCompositeSize;
|
||||
const sal_Int32 n = nPts - m_nSplitPos;
|
||||
if (eType == SubPieType::LEFT) {
|
||||
// nPtIdx should be in [0, n]
|
||||
if (nPtIdx < n) {
|
||||
|
|
|
@ -101,8 +101,8 @@ public:
|
|||
class OfPieDataSrc : public PieDataSrcBase
|
||||
{
|
||||
public:
|
||||
OfPieDataSrc(sal_Int32 nCompositeSize):
|
||||
m_nCompositeSize(nCompositeSize)
|
||||
OfPieDataSrc(sal_Int32 nSplitPos):
|
||||
m_nSplitPos(nSplitPos)
|
||||
{}
|
||||
|
||||
// Minimum sensible number of data points
|
||||
|
@ -118,7 +118,7 @@ public:
|
|||
const VDataSeries* pSeries, sal_Int32 nPtIdx,
|
||||
enum SubPieType eType) const;
|
||||
private:
|
||||
sal_Int32 m_nCompositeSize;
|
||||
double m_nSplitPos;
|
||||
};
|
||||
|
||||
//=======================
|
||||
|
@ -276,7 +276,7 @@ private: //member
|
|||
bool m_bSizeExcludesLabelsAndExplodedSegments;
|
||||
::css::chart2::PieChartSubType m_eSubType;
|
||||
// Number of entries in an of-pie composite wedge
|
||||
sal_Int32 m_nCompositeSize;
|
||||
double m_nSplitPos;
|
||||
|
||||
struct PieLabelInfo
|
||||
{
|
||||
|
|
|
@ -154,6 +154,7 @@ void SeriesPlotterContainer::initializeCooSysAndSeriesPlotter(ChartModel& rChart
|
|||
sal_Int32 nStartingAngle = 90;
|
||||
sal_Int32 n3DRelativeHeight = 100;
|
||||
PieChartSubType ePieChartSubType = PieChartSubType_NONE;
|
||||
double nSplitPos = 2;
|
||||
try
|
||||
{
|
||||
xDiagram->getPropertyValue(CHART_UNONAME_SORT_BY_XVALUES) >>= bSortByXValues;
|
||||
|
@ -167,6 +168,8 @@ void SeriesPlotterContainer::initializeCooSysAndSeriesPlotter(ChartModel& rChart
|
|||
xDiagram->getPropertyValue(u"3DRelativeHeight"_ustr) >>= n3DRelativeHeight;
|
||||
}
|
||||
xDiagram->getPropertyValue(u"SubPieType"_ustr) >>= ePieChartSubType;
|
||||
|
||||
xDiagram->getPropertyValue(u"SplitPos"_ustr) >>= nSplitPos;
|
||||
}
|
||||
catch (const uno::Exception&)
|
||||
{
|
||||
|
@ -234,6 +237,9 @@ void SeriesPlotterContainer::initializeCooSysAndSeriesPlotter(ChartModel& rChart
|
|||
uno::Any(ePieChartSubType));
|
||||
// Reset the diagram-level property so it's not persistent.
|
||||
xDiagram->setPropertyValue(u"SubPieType"_ustr, uno::Any(PieChartSubType_NONE));
|
||||
|
||||
xChartType->setFastPropertyValue(PROP_PIECHARTTYPE_SPLIT_POS, uno::Any(nSplitPos));
|
||||
//xDiagram->setPropertyValue(u"SplitPos"_ustr, uno::Any(nSplitPos));
|
||||
}
|
||||
|
||||
if (nT == 0)
|
||||
|
|
|
@ -1098,7 +1098,7 @@ rtl::Reference<Svx3DExtrudeObject>
|
|||
//so we need to translate the object via transformation matrix
|
||||
|
||||
//Matrix for position
|
||||
if (!rPolyPolygon.empty() && !rPolyPolygon[0].empty())
|
||||
if (!rPolyPolygon[0].empty())
|
||||
{
|
||||
basegfx::B3DHomMatrix aM;
|
||||
aM.translate(0, 0, rPolyPolygon[0][0].PositionZ);
|
||||
|
|
|
@ -70,12 +70,15 @@ $(eval $(call gb_Library_add_exception_objects,comphelper,\
|
|||
comphelper/source/container/NamedPropertyValuesContainer \
|
||||
comphelper/source/container/container \
|
||||
comphelper/source/container/containermultiplexer \
|
||||
comphelper/source/container/interfacecontainer2 \
|
||||
comphelper/source/container/interfacecontainer2 \
|
||||
comphelper/source/container/embeddedobjectcontainer \
|
||||
comphelper/source/container/enumerablemap \
|
||||
comphelper/source/container/enumhelper \
|
||||
comphelper/source/container/namecontainer \
|
||||
comphelper/source/crypto/Crypto \
|
||||
$(if $(filter NSS,$(TLS)), comphelper/source/crypto/Crypto_NSS) \
|
||||
$(if $(filter OPENSSL,$(TLS)), comphelper/source/crypto/Crypto_OpenSSL) \
|
||||
$(if $(filter NSS OPENSSL,$(TLS)),,comphelper/source/crypto/Crypto_None) \
|
||||
comphelper/source/eventattachermgr/eventattachermgr \
|
||||
comphelper/source/misc/accessiblecomponenthelper \
|
||||
comphelper/source/misc/accessibleeventnotifier \
|
||||
|
|
|
@ -30,17 +30,9 @@ public:
|
|||
NSS_Shutdown();
|
||||
#endif
|
||||
}
|
||||
|
||||
void testCryptoHash();
|
||||
void testRoundUp();
|
||||
|
||||
CPPUNIT_TEST_SUITE(CryptoTest);
|
||||
CPPUNIT_TEST(testCryptoHash);
|
||||
CPPUNIT_TEST(testRoundUp);
|
||||
CPPUNIT_TEST_SUITE_END();
|
||||
};
|
||||
|
||||
void CryptoTest::testCryptoHash()
|
||||
CPPUNIT_TEST_FIXTURE(CryptoTest, testCryptoHash)
|
||||
{
|
||||
// Check examples from Wikipedia (https://en.wikipedia.org/wiki/HMAC)
|
||||
OString aContentString("The quick brown fox jumps over the lazy dog"_ostr);
|
||||
|
@ -84,7 +76,7 @@ void CryptoTest::testCryptoHash()
|
|||
}
|
||||
}
|
||||
|
||||
void CryptoTest::testRoundUp()
|
||||
CPPUNIT_TEST_FIXTURE(CryptoTest, testRoundUp)
|
||||
{
|
||||
CPPUNIT_ASSERT_EQUAL(16, comphelper::roundUp(16, 16));
|
||||
CPPUNIT_ASSERT_EQUAL(32, comphelper::roundUp(32, 16));
|
||||
|
@ -95,6 +87,102 @@ void CryptoTest::testRoundUp()
|
|||
CPPUNIT_ASSERT_EQUAL(32, comphelper::roundUp(31, 16));
|
||||
}
|
||||
|
||||
CPPUNIT_TEST_SUITE_REGISTRATION(CryptoTest);
|
||||
CPPUNIT_TEST_FIXTURE(CryptoTest, testEncrypt_AES256_CBC)
|
||||
{
|
||||
std::vector<sal_uInt8> key = { 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x10, 0x11,
|
||||
0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x20, 0x21, 0x22,
|
||||
0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x30, 0x31, 0x32 };
|
||||
|
||||
std::vector<sal_uInt8> iv = { 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08,
|
||||
0x09, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16 };
|
||||
|
||||
std::vector<sal_uInt8> original = { 's', 'e', 'c', 'r', 'e', 't', '\0' };
|
||||
|
||||
std::vector<sal_uInt8> encrypted(original.size());
|
||||
|
||||
{
|
||||
sal_uInt32 nWrittenSize = 0;
|
||||
comphelper::Encrypt aEncryptor(key, iv, comphelper::CryptoType::AES_256_CBC);
|
||||
nWrittenSize = aEncryptor.update(encrypted, original);
|
||||
|
||||
// nothing should be written as the size of the input is not a multiple of block size
|
||||
CPPUNIT_ASSERT_EQUAL(sal_uInt32(0), nWrittenSize);
|
||||
}
|
||||
|
||||
{
|
||||
sal_uInt32 nWrittenSize = 0;
|
||||
comphelper::Encrypt aEncryptor(key, iv, comphelper::CryptoType::AES_256_CBC);
|
||||
|
||||
original.resize(16, 0); // apply padding to make it multiple of block size
|
||||
encrypted.resize(16, 0);
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL(std::string("73656372657400000000000000000000"),
|
||||
comphelper::hashToString(original));
|
||||
|
||||
nWrittenSize = aEncryptor.update(encrypted, original);
|
||||
CPPUNIT_ASSERT_EQUAL(sal_uInt32(16), nWrittenSize);
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL(std::string("e75cb91a34377c09c354c24fcef345a6"),
|
||||
comphelper::hashToString(encrypted));
|
||||
|
||||
std::vector<sal_uInt8> decrypted(encrypted.size(), 0);
|
||||
|
||||
comphelper::Decrypt aDecryptor(key, iv, comphelper::CryptoType::AES_256_CBC);
|
||||
nWrittenSize = aDecryptor.update(decrypted, encrypted);
|
||||
CPPUNIT_ASSERT_EQUAL(sal_uInt32(16), nWrittenSize);
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL(std::string("73656372657400000000000000000000"),
|
||||
comphelper::hashToString(decrypted));
|
||||
}
|
||||
}
|
||||
|
||||
CPPUNIT_TEST_FIXTURE(CryptoTest, testEncrypt_AES256_ECB)
|
||||
{
|
||||
std::vector<sal_uInt8> key = { 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x10, 0x11,
|
||||
0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x20, 0x21, 0x22,
|
||||
0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x30, 0x31, 0x32 };
|
||||
|
||||
std::vector<sal_uInt8> iv = { 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08,
|
||||
0x09, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16 };
|
||||
|
||||
std::vector<sal_uInt8> original = { 's', 'e', 'c', 'r', 'e', 't', '\0' };
|
||||
|
||||
std::vector<sal_uInt8> encrypted(original.size());
|
||||
|
||||
{
|
||||
sal_uInt32 nWrittenSize = 0;
|
||||
comphelper::Encrypt aEncryptor(key, iv, comphelper::CryptoType::AES_256_ECB);
|
||||
nWrittenSize = aEncryptor.update(encrypted, original);
|
||||
|
||||
// nothing should be written as the size of the input is not a multiple of block size
|
||||
CPPUNIT_ASSERT_EQUAL(sal_uInt32(0), nWrittenSize);
|
||||
}
|
||||
|
||||
{
|
||||
sal_uInt32 nWrittenSize = 0;
|
||||
comphelper::Encrypt aEncryptor(key, iv, comphelper::CryptoType::AES_256_ECB);
|
||||
|
||||
original.resize(16, 0); // apply padding to make it multiple of block size
|
||||
encrypted.resize(16, 0);
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL(std::string("73656372657400000000000000000000"),
|
||||
comphelper::hashToString(original));
|
||||
|
||||
nWrittenSize = aEncryptor.update(encrypted, original);
|
||||
CPPUNIT_ASSERT_EQUAL(sal_uInt32(16), nWrittenSize);
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL(std::string("abf7abec9a6b58c089e902397c47ac49"),
|
||||
comphelper::hashToString(encrypted));
|
||||
|
||||
std::vector<sal_uInt8> decrypted(encrypted.size(), 0);
|
||||
|
||||
comphelper::Decrypt aDecryptor(key, iv, comphelper::CryptoType::AES_256_ECB);
|
||||
nWrittenSize = aDecryptor.update(decrypted, encrypted);
|
||||
CPPUNIT_ASSERT_EQUAL(sal_uInt32(16), nWrittenSize);
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL(std::string("73656372657400000000000000000000"),
|
||||
comphelper::hashToString(decrypted));
|
||||
}
|
||||
}
|
||||
|
||||
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
||||
|
|
|
@ -5,444 +5,34 @@
|
|||
* 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/.
|
||||
*
|
||||
*/
|
||||
|
||||
#include <comphelper/crypto/Crypto.hxx>
|
||||
#include <com/sun/star/uno/RuntimeException.hpp>
|
||||
#include <sal/types.h>
|
||||
|
||||
#include <config_oox.h>
|
||||
|
||||
#if USE_TLS_OPENSSL
|
||||
#include <openssl/evp.h>
|
||||
#include <openssl/sha.h>
|
||||
#include <openssl/hmac.h>
|
||||
#endif // USE_TLS_OPENSSL
|
||||
|
||||
#if USE_TLS_NSS
|
||||
#include <nss.h>
|
||||
#include <nspr.h>
|
||||
#include <pk11pub.h>
|
||||
#endif // USE_TLS_NSS
|
||||
|
||||
namespace comphelper
|
||||
{
|
||||
#if USE_TLS_OPENSSL
|
||||
|
||||
#if (OPENSSL_VERSION_NUMBER < 0x10100000L)
|
||||
|
||||
static HMAC_CTX* HMAC_CTX_new(void)
|
||||
{
|
||||
HMAC_CTX* pContext = new HMAC_CTX;
|
||||
HMAC_CTX_init(pContext);
|
||||
return pContext;
|
||||
}
|
||||
|
||||
static void HMAC_CTX_free(HMAC_CTX* pContext)
|
||||
{
|
||||
HMAC_CTX_cleanup(pContext);
|
||||
delete pContext;
|
||||
}
|
||||
#endif
|
||||
|
||||
namespace
|
||||
{
|
||||
struct cipher_delete
|
||||
{
|
||||
void operator()(EVP_CIPHER_CTX* p) { EVP_CIPHER_CTX_free(p); }
|
||||
};
|
||||
|
||||
struct hmac_delete
|
||||
{
|
||||
SAL_WNODEPRECATED_DECLARATIONS_PUSH // 'HMAC_CTX_free' is deprecated
|
||||
void
|
||||
operator()(HMAC_CTX* p)
|
||||
{
|
||||
HMAC_CTX_free(p);
|
||||
}
|
||||
SAL_WNODEPRECATED_DECLARATIONS_POP
|
||||
};
|
||||
}
|
||||
|
||||
struct CryptoImpl
|
||||
{
|
||||
std::unique_ptr<EVP_CIPHER_CTX, cipher_delete> mpContext;
|
||||
std::unique_ptr<HMAC_CTX, hmac_delete> mpHmacContext;
|
||||
|
||||
CryptoImpl() = default;
|
||||
|
||||
void setupEncryptContext(std::vector<sal_uInt8>& key, std::vector<sal_uInt8>& iv,
|
||||
CryptoType eType)
|
||||
{
|
||||
mpContext.reset(EVP_CIPHER_CTX_new());
|
||||
EVP_CIPHER_CTX_init(mpContext.get());
|
||||
|
||||
const EVP_CIPHER* cipher = getCipher(eType);
|
||||
if (cipher == nullptr)
|
||||
return;
|
||||
|
||||
if (iv.empty())
|
||||
EVP_EncryptInit_ex(mpContext.get(), cipher, nullptr, key.data(), nullptr);
|
||||
else
|
||||
EVP_EncryptInit_ex(mpContext.get(), cipher, nullptr, key.data(), iv.data());
|
||||
EVP_CIPHER_CTX_set_padding(mpContext.get(), 0);
|
||||
}
|
||||
|
||||
void setupDecryptContext(std::vector<sal_uInt8>& key, std::vector<sal_uInt8>& iv,
|
||||
CryptoType eType)
|
||||
{
|
||||
mpContext.reset(EVP_CIPHER_CTX_new());
|
||||
EVP_CIPHER_CTX_init(mpContext.get());
|
||||
|
||||
const EVP_CIPHER* pCipher = getCipher(eType);
|
||||
if (pCipher == nullptr)
|
||||
return;
|
||||
|
||||
const size_t nMinKeySize = EVP_CIPHER_key_length(pCipher);
|
||||
if (key.size() < nMinKeySize)
|
||||
key.resize(nMinKeySize, 0);
|
||||
|
||||
if (iv.empty())
|
||||
EVP_DecryptInit_ex(mpContext.get(), pCipher, nullptr, key.data(), nullptr);
|
||||
else
|
||||
{
|
||||
const size_t nMinIVSize = EVP_CIPHER_iv_length(pCipher);
|
||||
if (iv.size() < nMinIVSize)
|
||||
iv.resize(nMinIVSize, 0);
|
||||
|
||||
EVP_DecryptInit_ex(mpContext.get(), pCipher, nullptr, key.data(), iv.data());
|
||||
}
|
||||
EVP_CIPHER_CTX_set_padding(mpContext.get(), 0);
|
||||
}
|
||||
|
||||
void setupCryptoHashContext(std::vector<sal_uInt8>& rKey, CryptoHashType eType)
|
||||
{
|
||||
SAL_WNODEPRECATED_DECLARATIONS_PUSH // 'HMAC_CTX_new' is deprecated
|
||||
mpHmacContext.reset(HMAC_CTX_new());
|
||||
SAL_WNODEPRECATED_DECLARATIONS_POP
|
||||
const EVP_MD* aEvpMd = nullptr;
|
||||
switch (eType)
|
||||
{
|
||||
case CryptoHashType::SHA1:
|
||||
aEvpMd = EVP_sha1();
|
||||
break;
|
||||
case CryptoHashType::SHA256:
|
||||
aEvpMd = EVP_sha256();
|
||||
break;
|
||||
case CryptoHashType::SHA384:
|
||||
aEvpMd = EVP_sha384();
|
||||
break;
|
||||
case CryptoHashType::SHA512:
|
||||
aEvpMd = EVP_sha512();
|
||||
break;
|
||||
}
|
||||
SAL_WNODEPRECATED_DECLARATIONS_PUSH // 'HMAC_Init_ex' is deprecated
|
||||
HMAC_Init_ex(mpHmacContext.get(), rKey.data(), rKey.size(), aEvpMd, nullptr);
|
||||
SAL_WNODEPRECATED_DECLARATIONS_POP
|
||||
}
|
||||
|
||||
~CryptoImpl()
|
||||
{
|
||||
if (mpContext)
|
||||
EVP_CIPHER_CTX_cleanup(mpContext.get());
|
||||
}
|
||||
|
||||
static const EVP_CIPHER* getCipher(CryptoType type)
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case CryptoType::AES_128_ECB:
|
||||
return EVP_aes_128_ecb();
|
||||
case CryptoType::AES_128_CBC:
|
||||
return EVP_aes_128_cbc();
|
||||
case CryptoType::AES_256_CBC:
|
||||
return EVP_aes_256_cbc();
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
};
|
||||
|
||||
#elif USE_TLS_NSS
|
||||
|
||||
#define MAX_WRAPPED_KEY_LEN 128
|
||||
|
||||
struct CryptoImpl
|
||||
{
|
||||
PK11SlotInfo* mSlot;
|
||||
PK11Context* mContext;
|
||||
SECItem* mSecParam;
|
||||
PK11SymKey* mSymKey;
|
||||
PK11Context* mWrapKeyContext;
|
||||
PK11SymKey* mWrapKey;
|
||||
|
||||
CryptoImpl()
|
||||
: mSlot(nullptr)
|
||||
, mContext(nullptr)
|
||||
, mSecParam(nullptr)
|
||||
, mSymKey(nullptr)
|
||||
, mWrapKeyContext(nullptr)
|
||||
, mWrapKey(nullptr)
|
||||
{
|
||||
// Initialize NSS, database functions are not needed
|
||||
if (!NSS_IsInitialized())
|
||||
{
|
||||
auto const e = NSS_NoDB_Init(nullptr);
|
||||
if (e != SECSuccess)
|
||||
{
|
||||
PRErrorCode error = PR_GetError();
|
||||
const char* errorText = PR_ErrorToName(error);
|
||||
throw css::uno::RuntimeException(
|
||||
"NSS_NoDB_Init failed with "
|
||||
+ OUString(errorText, strlen(errorText), RTL_TEXTENCODING_UTF8) + " ("
|
||||
+ OUString::number(static_cast<int>(error)) + ")");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
~CryptoImpl()
|
||||
{
|
||||
if (mContext)
|
||||
PK11_DestroyContext(mContext, PR_TRUE);
|
||||
if (mSecParam)
|
||||
SECITEM_FreeItem(mSecParam, PR_TRUE);
|
||||
if (mSymKey)
|
||||
PK11_FreeSymKey(mSymKey);
|
||||
if (mWrapKeyContext)
|
||||
PK11_DestroyContext(mWrapKeyContext, PR_TRUE);
|
||||
if (mWrapKey)
|
||||
PK11_FreeSymKey(mWrapKey);
|
||||
if (mSlot)
|
||||
PK11_FreeSlot(mSlot);
|
||||
}
|
||||
|
||||
PK11SymKey* ImportSymKey(CK_MECHANISM_TYPE mechanism, CK_ATTRIBUTE_TYPE operation, SECItem* key)
|
||||
{
|
||||
mSymKey = PK11_ImportSymKey(mSlot, mechanism, PK11_OriginUnwrap, operation, key, nullptr);
|
||||
if (!mSymKey) //rhbz#1614419 maybe failed due to FIPS, use rhbz#1461450 style workaround
|
||||
{
|
||||
/*
|
||||
* Without FIPS it would be possible to just use
|
||||
* mSymKey = PK11_ImportSymKey( mSlot, mechanism, PK11_OriginUnwrap, CKA_ENCRYPT, &keyItem, nullptr );
|
||||
* with FIPS NSS Level 2 certification has to be "workarounded" (so it becomes Level 1) by using
|
||||
* following method:
|
||||
* 1. Generate wrap key
|
||||
* 2. Encrypt authkey with wrap key
|
||||
* 3. Unwrap encrypted authkey using wrap key
|
||||
*/
|
||||
|
||||
/*
|
||||
* Generate wrapping key
|
||||
*/
|
||||
CK_MECHANISM_TYPE wrap_mechanism = PK11_GetBestWrapMechanism(mSlot);
|
||||
int wrap_key_len = PK11_GetBestKeyLength(mSlot, wrap_mechanism);
|
||||
mWrapKey = PK11_KeyGen(mSlot, wrap_mechanism, nullptr, wrap_key_len, nullptr);
|
||||
if (!mWrapKey)
|
||||
throw css::uno::RuntimeException(u"PK11_KeyGen SymKey failure"_ustr,
|
||||
css::uno::Reference<css::uno::XInterface>());
|
||||
|
||||
/*
|
||||
* Encrypt authkey with wrapping key
|
||||
*/
|
||||
|
||||
/*
|
||||
* Initialization of IV is not needed because PK11_GetBestWrapMechanism should return ECB mode
|
||||
*/
|
||||
SECItem tmp_sec_item = {};
|
||||
mWrapKeyContext
|
||||
= PK11_CreateContextBySymKey(wrap_mechanism, CKA_ENCRYPT, mWrapKey, &tmp_sec_item);
|
||||
if (!mWrapKeyContext)
|
||||
throw css::uno::RuntimeException(u"PK11_CreateContextBySymKey failure"_ustr,
|
||||
css::uno::Reference<css::uno::XInterface>());
|
||||
|
||||
unsigned char wrapped_key_data[MAX_WRAPPED_KEY_LEN];
|
||||
int wrapped_key_len = sizeof(wrapped_key_data);
|
||||
|
||||
if (PK11_CipherOp(mWrapKeyContext, wrapped_key_data, &wrapped_key_len,
|
||||
sizeof(wrapped_key_data), key->data, key->len)
|
||||
!= SECSuccess)
|
||||
{
|
||||
throw css::uno::RuntimeException(u"PK11_CipherOp failure"_ustr,
|
||||
css::uno::Reference<css::uno::XInterface>());
|
||||
}
|
||||
|
||||
if (PK11_Finalize(mWrapKeyContext) != SECSuccess)
|
||||
throw css::uno::RuntimeException(u"PK11_Finalize failure"_ustr,
|
||||
css::uno::Reference<css::uno::XInterface>());
|
||||
|
||||
/*
|
||||
* Finally unwrap sym key
|
||||
*/
|
||||
SECItem wrapped_key = {};
|
||||
wrapped_key.data = wrapped_key_data;
|
||||
wrapped_key.len = wrapped_key_len;
|
||||
|
||||
mSymKey = PK11_UnwrapSymKey(mWrapKey, wrap_mechanism, &tmp_sec_item, &wrapped_key,
|
||||
mechanism, operation, key->len);
|
||||
}
|
||||
return mSymKey;
|
||||
}
|
||||
|
||||
void setupEncryptContext(std::vector<sal_uInt8>& key, std::vector<sal_uInt8>& iv,
|
||||
CryptoType type)
|
||||
{
|
||||
setupCryptoContext(key, iv, type, CKA_ENCRYPT);
|
||||
}
|
||||
|
||||
void setupDecryptContext(std::vector<sal_uInt8>& key, std::vector<sal_uInt8>& iv,
|
||||
CryptoType type)
|
||||
{
|
||||
setupCryptoContext(key, iv, type, CKA_DECRYPT);
|
||||
}
|
||||
|
||||
void setupCryptoContext(std::vector<sal_uInt8>& key, std::vector<sal_uInt8>& iv,
|
||||
CryptoType type, CK_ATTRIBUTE_TYPE operation)
|
||||
{
|
||||
CK_MECHANISM_TYPE mechanism = static_cast<CK_ULONG>(-1);
|
||||
|
||||
SECItem ivItem;
|
||||
ivItem.type = siBuffer;
|
||||
if (iv.empty())
|
||||
ivItem.data = nullptr;
|
||||
else
|
||||
ivItem.data = iv.data();
|
||||
ivItem.len = iv.size();
|
||||
|
||||
SECItem* pIvItem = nullptr;
|
||||
|
||||
switch (type)
|
||||
{
|
||||
case CryptoType::AES_128_ECB:
|
||||
mechanism = CKM_AES_ECB;
|
||||
break;
|
||||
case CryptoType::AES_128_CBC:
|
||||
mechanism = CKM_AES_CBC;
|
||||
pIvItem = &ivItem;
|
||||
break;
|
||||
case CryptoType::AES_256_CBC:
|
||||
mechanism = CKM_AES_CBC;
|
||||
pIvItem = &ivItem;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
mSlot = PK11_GetBestSlot(mechanism, nullptr);
|
||||
|
||||
if (!mSlot)
|
||||
throw css::uno::RuntimeException(u"NSS Slot failure"_ustr,
|
||||
css::uno::Reference<css::uno::XInterface>());
|
||||
|
||||
SECItem keyItem;
|
||||
keyItem.type = siBuffer;
|
||||
keyItem.data = key.data();
|
||||
keyItem.len = key.size();
|
||||
|
||||
mSymKey = ImportSymKey(mechanism, CKA_ENCRYPT, &keyItem);
|
||||
if (!mSymKey)
|
||||
throw css::uno::RuntimeException(u"NSS SymKey failure"_ustr,
|
||||
css::uno::Reference<css::uno::XInterface>());
|
||||
|
||||
mSecParam = PK11_ParamFromIV(mechanism, pIvItem);
|
||||
mContext = PK11_CreateContextBySymKey(mechanism, operation, mSymKey, mSecParam);
|
||||
}
|
||||
|
||||
void setupCryptoHashContext(std::vector<sal_uInt8>& rKey, CryptoHashType eType)
|
||||
{
|
||||
CK_MECHANISM_TYPE aMechanism = static_cast<CK_ULONG>(-1);
|
||||
|
||||
switch (eType)
|
||||
{
|
||||
case CryptoHashType::SHA1:
|
||||
aMechanism = CKM_SHA_1_HMAC;
|
||||
break;
|
||||
case CryptoHashType::SHA256:
|
||||
aMechanism = CKM_SHA256_HMAC;
|
||||
break;
|
||||
case CryptoHashType::SHA384:
|
||||
aMechanism = CKM_SHA384_HMAC;
|
||||
break;
|
||||
case CryptoHashType::SHA512:
|
||||
aMechanism = CKM_SHA512_HMAC;
|
||||
break;
|
||||
}
|
||||
|
||||
mSlot = PK11_GetBestSlot(aMechanism, nullptr);
|
||||
|
||||
if (!mSlot)
|
||||
throw css::uno::RuntimeException(u"NSS Slot failure"_ustr,
|
||||
css::uno::Reference<css::uno::XInterface>());
|
||||
|
||||
SECItem aKeyItem;
|
||||
aKeyItem.data = rKey.data();
|
||||
aKeyItem.len = rKey.size();
|
||||
|
||||
mSymKey = ImportSymKey(aMechanism, CKA_SIGN, &aKeyItem);
|
||||
if (!mSymKey)
|
||||
throw css::uno::RuntimeException(u"NSS SymKey failure"_ustr,
|
||||
css::uno::Reference<css::uno::XInterface>());
|
||||
|
||||
SECItem param;
|
||||
param.data = nullptr;
|
||||
param.len = 0;
|
||||
mContext = PK11_CreateContextBySymKey(aMechanism, CKA_SIGN, mSymKey, ¶m);
|
||||
}
|
||||
};
|
||||
#else
|
||||
struct CryptoImpl
|
||||
{
|
||||
};
|
||||
#endif
|
||||
|
||||
Crypto::Crypto()
|
||||
: mpImpl(std::make_unique<CryptoImpl>())
|
||||
: mpImpl(ICryptoImplementation::createInstance())
|
||||
{
|
||||
}
|
||||
|
||||
Crypto::~Crypto() {}
|
||||
Crypto::~Crypto() = default;
|
||||
|
||||
// DECRYPT
|
||||
|
||||
Decrypt::Decrypt(std::vector<sal_uInt8>& key, std::vector<sal_uInt8>& iv, CryptoType type)
|
||||
{
|
||||
#if USE_TLS_OPENSSL + USE_TLS_NSS == 0
|
||||
(void)key;
|
||||
(void)iv;
|
||||
(void)type;
|
||||
#else
|
||||
mpImpl->setupDecryptContext(key, iv, type);
|
||||
#endif
|
||||
}
|
||||
|
||||
sal_uInt32 Decrypt::update(std::vector<sal_uInt8>& output, std::vector<sal_uInt8>& input,
|
||||
sal_uInt32 inputLength)
|
||||
{
|
||||
int outputLength = 0;
|
||||
|
||||
#if USE_TLS_OPENSSL + USE_TLS_NSS > 0
|
||||
sal_uInt32 actualInputLength
|
||||
= inputLength == 0 || inputLength > input.size() ? input.size() : inputLength;
|
||||
#else
|
||||
(void)output;
|
||||
(void)input;
|
||||
(void)inputLength;
|
||||
#endif
|
||||
|
||||
#if USE_TLS_OPENSSL
|
||||
(void)EVP_DecryptUpdate(mpImpl->mpContext.get(), output.data(), &outputLength, input.data(),
|
||||
actualInputLength);
|
||||
#endif // USE_TLS_OPENSSL
|
||||
|
||||
#if USE_TLS_NSS
|
||||
if (!mpImpl->mContext)
|
||||
return 0;
|
||||
(void)PK11_CipherOp(mpImpl->mContext, output.data(), &outputLength, actualInputLength,
|
||||
input.data(), actualInputLength);
|
||||
#endif // USE_TLS_NSS
|
||||
|
||||
return static_cast<sal_uInt32>(outputLength);
|
||||
return mpImpl->decryptUpdate(output, input, actualInputLength);
|
||||
}
|
||||
|
||||
sal_uInt32 Decrypt::aes128ecb(std::vector<sal_uInt8>& output, std::vector<sal_uInt8>& input,
|
||||
|
@ -459,40 +49,15 @@ sal_uInt32 Decrypt::aes128ecb(std::vector<sal_uInt8>& output, std::vector<sal_uI
|
|||
|
||||
Encrypt::Encrypt(std::vector<sal_uInt8>& key, std::vector<sal_uInt8>& iv, CryptoType type)
|
||||
{
|
||||
#if USE_TLS_OPENSSL + USE_TLS_NSS == 0
|
||||
(void)key;
|
||||
(void)iv;
|
||||
(void)type;
|
||||
#else
|
||||
mpImpl->setupEncryptContext(key, iv, type);
|
||||
#endif
|
||||
}
|
||||
|
||||
sal_uInt32 Encrypt::update(std::vector<sal_uInt8>& output, std::vector<sal_uInt8>& input,
|
||||
sal_uInt32 inputLength)
|
||||
{
|
||||
int outputLength = 0;
|
||||
|
||||
#if USE_TLS_OPENSSL + USE_TLS_NSS > 0
|
||||
sal_uInt32 actualInputLength
|
||||
= inputLength == 0 || inputLength > input.size() ? input.size() : inputLength;
|
||||
#else
|
||||
(void)output;
|
||||
(void)input;
|
||||
(void)inputLength;
|
||||
#endif
|
||||
|
||||
#if USE_TLS_OPENSSL
|
||||
(void)EVP_EncryptUpdate(mpImpl->mpContext.get(), output.data(), &outputLength, input.data(),
|
||||
actualInputLength);
|
||||
#endif // USE_TLS_OPENSSL
|
||||
|
||||
#if USE_TLS_NSS
|
||||
(void)PK11_CipherOp(mpImpl->mContext, output.data(), &outputLength, actualInputLength,
|
||||
input.data(), actualInputLength);
|
||||
#endif // USE_TLS_NSS
|
||||
|
||||
return static_cast<sal_uInt32>(outputLength);
|
||||
return mpImpl->encryptUpdate(output, input, actualInputLength);
|
||||
}
|
||||
|
||||
// CryptoHash - HMAC
|
||||
|
@ -520,52 +85,20 @@ sal_Int32 getSizeForHashType(CryptoHashType eType)
|
|||
CryptoHash::CryptoHash(std::vector<sal_uInt8>& rKey, CryptoHashType eType)
|
||||
: mnHashSize(getSizeForHashType(eType))
|
||||
{
|
||||
#if USE_TLS_OPENSSL + USE_TLS_NSS > 0
|
||||
mpImpl->setupCryptoHashContext(rKey, eType);
|
||||
|
||||
#if USE_TLS_NSS
|
||||
PK11_DigestBegin(mpImpl->mContext);
|
||||
#endif
|
||||
|
||||
#else
|
||||
(void)rKey;
|
||||
#endif
|
||||
}
|
||||
|
||||
bool CryptoHash::update(std::vector<sal_uInt8>& rInput, sal_uInt32 nInputLength)
|
||||
{
|
||||
#if USE_TLS_OPENSSL + USE_TLS_NSS > 0
|
||||
sal_uInt32 nActualInputLength
|
||||
= (nInputLength == 0 || nInputLength > rInput.size()) ? rInput.size() : nInputLength;
|
||||
#else
|
||||
(void)rInput;
|
||||
(void)nInputLength;
|
||||
#endif
|
||||
|
||||
#if USE_TLS_OPENSSL
|
||||
SAL_WNODEPRECATED_DECLARATIONS_PUSH // 'HMAC_Update' is deprecated
|
||||
return HMAC_Update(mpImpl->mpHmacContext.get(), rInput.data(), nActualInputLength)
|
||||
!= 0;
|
||||
SAL_WNODEPRECATED_DECLARATIONS_POP
|
||||
#elif USE_TLS_NSS
|
||||
return PK11_DigestOp(mpImpl->mContext, rInput.data(), nActualInputLength) == SECSuccess;
|
||||
#else
|
||||
return false; // ???
|
||||
#endif
|
||||
return mpImpl->cryptoHashUpdate(rInput, nActualInputLength);
|
||||
}
|
||||
|
||||
std::vector<sal_uInt8> CryptoHash::finalize()
|
||||
{
|
||||
std::vector<sal_uInt8> aHash(mnHashSize, 0);
|
||||
#if USE_TLS_OPENSSL
|
||||
unsigned int nSizeWritten = 0;
|
||||
SAL_WNODEPRECATED_DECLARATIONS_PUSH // 'HMAC_Final' is deprecated
|
||||
(void) HMAC_Final(mpImpl->mpHmacContext.get(), aHash.data(), &nSizeWritten);
|
||||
SAL_WNODEPRECATED_DECLARATIONS_POP
|
||||
#elif USE_TLS_NSS
|
||||
unsigned int nSizeWritten = 0;
|
||||
PK11_DigestFinal(mpImpl->mContext, aHash.data(), &nSizeWritten, aHash.size());
|
||||
#endif
|
||||
mpImpl->cryptoHashFinalize(aHash);
|
||||
return aHash;
|
||||
}
|
||||
|
||||
|
|
295
comphelper/source/crypto/Crypto_NSS.cxx
Normal file
295
comphelper/source/crypto/Crypto_NSS.cxx
Normal file
|
@ -0,0 +1,295 @@
|
|||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||
/*
|
||||
* 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/.
|
||||
*/
|
||||
|
||||
#include <comphelper/crypto/Crypto.hxx>
|
||||
#include <com/sun/star/uno/RuntimeException.hpp>
|
||||
#include <sal/types.h>
|
||||
#include <config_oox.h>
|
||||
|
||||
#include <nss.h>
|
||||
#include <nspr.h>
|
||||
#include <pk11pub.h>
|
||||
|
||||
namespace comphelper
|
||||
{
|
||||
namespace
|
||||
{
|
||||
#define MAX_WRAPPED_KEY_LEN 128
|
||||
|
||||
class CryptoImplementationNSS : public ICryptoImplementation
|
||||
{
|
||||
PK11SlotInfo* mSlot;
|
||||
PK11Context* mContext;
|
||||
SECItem* mSecParam;
|
||||
PK11SymKey* mSymKey;
|
||||
PK11Context* mWrapKeyContext;
|
||||
PK11SymKey* mWrapKey;
|
||||
|
||||
public:
|
||||
CryptoImplementationNSS()
|
||||
: mSlot(nullptr)
|
||||
, mContext(nullptr)
|
||||
, mSecParam(nullptr)
|
||||
, mSymKey(nullptr)
|
||||
, mWrapKeyContext(nullptr)
|
||||
, mWrapKey(nullptr)
|
||||
{
|
||||
// Initialize NSS, database functions are not needed
|
||||
if (!NSS_IsInitialized())
|
||||
{
|
||||
auto const e = NSS_NoDB_Init(nullptr);
|
||||
if (e != SECSuccess)
|
||||
{
|
||||
PRErrorCode error = PR_GetError();
|
||||
const char* errorText = PR_ErrorToName(error);
|
||||
throw css::uno::RuntimeException(
|
||||
"NSS_NoDB_Init failed with "
|
||||
+ OUString(errorText, strlen(errorText), RTL_TEXTENCODING_UTF8) + " ("
|
||||
+ OUString::number(static_cast<int>(error)) + ")");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
virtual ~CryptoImplementationNSS()
|
||||
{
|
||||
if (mContext)
|
||||
PK11_DestroyContext(mContext, PR_TRUE);
|
||||
if (mSecParam)
|
||||
SECITEM_FreeItem(mSecParam, PR_TRUE);
|
||||
if (mSymKey)
|
||||
PK11_FreeSymKey(mSymKey);
|
||||
if (mWrapKeyContext)
|
||||
PK11_DestroyContext(mWrapKeyContext, PR_TRUE);
|
||||
if (mWrapKey)
|
||||
PK11_FreeSymKey(mWrapKey);
|
||||
if (mSlot)
|
||||
PK11_FreeSlot(mSlot);
|
||||
}
|
||||
|
||||
PK11SymKey* ImportSymKey(CK_MECHANISM_TYPE mechanism, CK_ATTRIBUTE_TYPE operation, SECItem* key)
|
||||
{
|
||||
mSymKey = PK11_ImportSymKey(mSlot, mechanism, PK11_OriginUnwrap, operation, key, nullptr);
|
||||
if (!mSymKey) //rhbz#1614419 maybe failed due to FIPS, use rhbz#1461450 style workaround
|
||||
{
|
||||
/*
|
||||
* Without FIPS it would be possible to just use
|
||||
* mSymKey = PK11_ImportSymKey( mSlot, mechanism, PK11_OriginUnwrap, CKA_ENCRYPT, &keyItem, nullptr );
|
||||
* with FIPS NSS Level 2 certification has to be "workarounded" (so it becomes Level 1) by using
|
||||
* following method:
|
||||
* 1. Generate wrap key
|
||||
* 2. Encrypt authkey with wrap key
|
||||
* 3. Unwrap encrypted authkey using wrap key
|
||||
*/
|
||||
|
||||
/*
|
||||
* Generate wrapping key
|
||||
*/
|
||||
CK_MECHANISM_TYPE wrap_mechanism = PK11_GetBestWrapMechanism(mSlot);
|
||||
int wrap_key_len = PK11_GetBestKeyLength(mSlot, wrap_mechanism);
|
||||
mWrapKey = PK11_KeyGen(mSlot, wrap_mechanism, nullptr, wrap_key_len, nullptr);
|
||||
if (!mWrapKey)
|
||||
throw css::uno::RuntimeException(u"PK11_KeyGen SymKey failure"_ustr,
|
||||
css::uno::Reference<css::uno::XInterface>());
|
||||
|
||||
/*
|
||||
* Encrypt authkey with wrapping key
|
||||
*/
|
||||
|
||||
/*
|
||||
* Initialization of IV is not needed because PK11_GetBestWrapMechanism should return ECB mode
|
||||
*/
|
||||
SECItem tmp_sec_item = {};
|
||||
mWrapKeyContext
|
||||
= PK11_CreateContextBySymKey(wrap_mechanism, CKA_ENCRYPT, mWrapKey, &tmp_sec_item);
|
||||
if (!mWrapKeyContext)
|
||||
throw css::uno::RuntimeException(u"PK11_CreateContextBySymKey failure"_ustr,
|
||||
css::uno::Reference<css::uno::XInterface>());
|
||||
|
||||
unsigned char wrapped_key_data[MAX_WRAPPED_KEY_LEN];
|
||||
int wrapped_key_len = sizeof(wrapped_key_data);
|
||||
|
||||
if (PK11_CipherOp(mWrapKeyContext, wrapped_key_data, &wrapped_key_len,
|
||||
sizeof(wrapped_key_data), key->data, key->len)
|
||||
!= SECSuccess)
|
||||
{
|
||||
throw css::uno::RuntimeException(u"PK11_CipherOp failure"_ustr,
|
||||
css::uno::Reference<css::uno::XInterface>());
|
||||
}
|
||||
|
||||
if (PK11_Finalize(mWrapKeyContext) != SECSuccess)
|
||||
throw css::uno::RuntimeException(u"PK11_Finalize failure"_ustr,
|
||||
css::uno::Reference<css::uno::XInterface>());
|
||||
|
||||
/*
|
||||
* Finally unwrap sym key
|
||||
*/
|
||||
SECItem wrapped_key = {};
|
||||
wrapped_key.data = wrapped_key_data;
|
||||
wrapped_key.len = wrapped_key_len;
|
||||
|
||||
mSymKey = PK11_UnwrapSymKey(mWrapKey, wrap_mechanism, &tmp_sec_item, &wrapped_key,
|
||||
mechanism, operation, key->len);
|
||||
}
|
||||
return mSymKey;
|
||||
}
|
||||
|
||||
void setupEncryptContext(std::vector<sal_uInt8>& key, std::vector<sal_uInt8>& iv,
|
||||
CryptoType type) override
|
||||
{
|
||||
setupCryptoContext(key, iv, type, CKA_ENCRYPT);
|
||||
}
|
||||
|
||||
void setupDecryptContext(std::vector<sal_uInt8>& key, std::vector<sal_uInt8>& iv,
|
||||
CryptoType type) override
|
||||
{
|
||||
setupCryptoContext(key, iv, type, CKA_DECRYPT);
|
||||
}
|
||||
|
||||
void setupCryptoContext(std::vector<sal_uInt8>& key, std::vector<sal_uInt8>& iv,
|
||||
CryptoType type, CK_ATTRIBUTE_TYPE operation)
|
||||
{
|
||||
CK_MECHANISM_TYPE mechanism = static_cast<CK_ULONG>(-1);
|
||||
|
||||
SECItem ivItem;
|
||||
ivItem.type = siBuffer;
|
||||
if (iv.empty())
|
||||
ivItem.data = nullptr;
|
||||
else
|
||||
ivItem.data = iv.data();
|
||||
ivItem.len = iv.size();
|
||||
|
||||
SECItem* pIvItem = nullptr;
|
||||
|
||||
switch (type)
|
||||
{
|
||||
case CryptoType::AES_128_ECB:
|
||||
case CryptoType::AES_256_ECB:
|
||||
mechanism = CKM_AES_ECB;
|
||||
break;
|
||||
case CryptoType::AES_128_CBC:
|
||||
mechanism = CKM_AES_CBC;
|
||||
pIvItem = &ivItem;
|
||||
break;
|
||||
case CryptoType::AES_256_CBC:
|
||||
mechanism = CKM_AES_CBC;
|
||||
pIvItem = &ivItem;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
mSlot = PK11_GetBestSlot(mechanism, nullptr);
|
||||
|
||||
if (!mSlot)
|
||||
throw css::uno::RuntimeException(u"NSS Slot failure"_ustr,
|
||||
css::uno::Reference<css::uno::XInterface>());
|
||||
|
||||
SECItem keyItem;
|
||||
keyItem.type = siBuffer;
|
||||
keyItem.data = key.data();
|
||||
keyItem.len = key.size();
|
||||
|
||||
mSymKey = ImportSymKey(mechanism, CKA_ENCRYPT, &keyItem);
|
||||
if (!mSymKey)
|
||||
throw css::uno::RuntimeException(u"NSS SymKey failure"_ustr,
|
||||
css::uno::Reference<css::uno::XInterface>());
|
||||
|
||||
mSecParam = PK11_ParamFromIV(mechanism, pIvItem);
|
||||
mContext = PK11_CreateContextBySymKey(mechanism, operation, mSymKey, mSecParam);
|
||||
}
|
||||
|
||||
void setupCryptoHashContext(std::vector<sal_uInt8>& rKey, CryptoHashType eType) override
|
||||
{
|
||||
CK_MECHANISM_TYPE aMechanism = static_cast<CK_ULONG>(-1);
|
||||
|
||||
switch (eType)
|
||||
{
|
||||
case CryptoHashType::SHA1:
|
||||
aMechanism = CKM_SHA_1_HMAC;
|
||||
break;
|
||||
case CryptoHashType::SHA256:
|
||||
aMechanism = CKM_SHA256_HMAC;
|
||||
break;
|
||||
case CryptoHashType::SHA384:
|
||||
aMechanism = CKM_SHA384_HMAC;
|
||||
break;
|
||||
case CryptoHashType::SHA512:
|
||||
aMechanism = CKM_SHA512_HMAC;
|
||||
break;
|
||||
}
|
||||
|
||||
mSlot = PK11_GetBestSlot(aMechanism, nullptr);
|
||||
|
||||
if (!mSlot)
|
||||
throw css::uno::RuntimeException(u"NSS Slot failure"_ustr,
|
||||
css::uno::Reference<css::uno::XInterface>());
|
||||
|
||||
SECItem aKeyItem;
|
||||
aKeyItem.data = rKey.data();
|
||||
aKeyItem.len = rKey.size();
|
||||
|
||||
mSymKey = ImportSymKey(aMechanism, CKA_SIGN, &aKeyItem);
|
||||
if (!mSymKey)
|
||||
throw css::uno::RuntimeException(u"NSS SymKey failure"_ustr,
|
||||
css::uno::Reference<css::uno::XInterface>());
|
||||
|
||||
SECItem param;
|
||||
param.data = nullptr;
|
||||
param.len = 0;
|
||||
mContext = PK11_CreateContextBySymKey(aMechanism, CKA_SIGN, mSymKey, ¶m);
|
||||
|
||||
// Also call digest to begin
|
||||
PK11_DigestBegin(mContext);
|
||||
}
|
||||
|
||||
sal_uInt32 decryptUpdate(std::vector<sal_uInt8>& output, std::vector<sal_uInt8>& input,
|
||||
sal_uInt32 inputLength) override
|
||||
{
|
||||
if (!mContext)
|
||||
return 0;
|
||||
int outputLength = 0;
|
||||
(void)PK11_CipherOp(mContext, output.data(), &outputLength, inputLength, input.data(),
|
||||
inputLength);
|
||||
return outputLength;
|
||||
}
|
||||
|
||||
sal_uInt32 encryptUpdate(std::vector<sal_uInt8>& output, std::vector<sal_uInt8>& input,
|
||||
sal_uInt32 inputLength) override
|
||||
{
|
||||
if (!mContext)
|
||||
return 0;
|
||||
int outputLength = 0;
|
||||
(void)PK11_CipherOp(mContext, output.data(), &outputLength, inputLength, input.data(),
|
||||
inputLength);
|
||||
return outputLength;
|
||||
}
|
||||
|
||||
bool cryptoHashUpdate(std::vector<sal_uInt8>& rInput, sal_uInt32 nInputLength) override
|
||||
{
|
||||
return PK11_DigestOp(mContext, rInput.data(), nInputLength) == SECSuccess;
|
||||
}
|
||||
|
||||
bool cryptoHashFinalize(std::vector<sal_uInt8>& rHash) override
|
||||
{
|
||||
unsigned int nSizeWritten = 0;
|
||||
PK11_DigestFinal(mContext, rHash.data(), &nSizeWritten, rHash.size());
|
||||
return nSizeWritten == rHash.size();
|
||||
}
|
||||
};
|
||||
|
||||
} // anonymous namespace
|
||||
|
||||
std::shared_ptr<ICryptoImplementation> ICryptoImplementation::createInstance()
|
||||
{
|
||||
return std::shared_ptr<ICryptoImplementation>(new CryptoImplementationNSS);
|
||||
}
|
||||
|
||||
} // namespace comphelper
|
||||
|
||||
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
67
comphelper/source/crypto/Crypto_None.cxx
Normal file
67
comphelper/source/crypto/Crypto_None.cxx
Normal file
|
@ -0,0 +1,67 @@
|
|||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||
/*
|
||||
* 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/.
|
||||
*/
|
||||
|
||||
#include <comphelper/crypto/Crypto.hxx>
|
||||
#include <sal/types.h>
|
||||
#include <config_oox.h>
|
||||
|
||||
namespace comphelper
|
||||
{
|
||||
namespace
|
||||
{
|
||||
class CryptoImplementationNone : public ICryptoImplementation
|
||||
{
|
||||
public:
|
||||
CryptoImplementationNone() = default;
|
||||
|
||||
virtual ~CryptoImplementationNone() {}
|
||||
|
||||
void setupEncryptContext(std::vector<sal_uInt8>& /*key*/, std::vector<sal_uInt8>& /*iv*/,
|
||||
CryptoType /*eType*/) override
|
||||
{
|
||||
}
|
||||
|
||||
void setupDecryptContext(std::vector<sal_uInt8>& /*key*/, std::vector<sal_uInt8>& /*iv*/,
|
||||
CryptoType /*eType*/) override
|
||||
{
|
||||
}
|
||||
|
||||
void setupCryptoHashContext(std::vector<sal_uInt8>& /*rKey*/, CryptoHashType /*eType*/) override
|
||||
{
|
||||
}
|
||||
|
||||
sal_uInt32 decryptUpdate(std::vector<sal_uInt8>& /*output*/, std::vector<sal_uInt8>& /*input*/,
|
||||
sal_uInt32 /*inputLength*/) override
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
sal_uInt32 encryptUpdate(std::vector<sal_uInt8>& /*output*/, std::vector<sal_uInt8>& /*input*/,
|
||||
sal_uInt32 /*inputLength*/) override
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool cryptoHashUpdate(std::vector<sal_uInt8>& /*rInput*/, sal_uInt32 /*nInputLength*/) override
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool cryptoHashFinalize(std::vector<sal_uInt8>& /*rHash*/) override { return false; }
|
||||
};
|
||||
} // anonymous namespace
|
||||
|
||||
std::shared_ptr<ICryptoImplementation> ICryptoImplementation::createInstance()
|
||||
{
|
||||
return std::shared_ptr<ICryptoImplementation>(new CryptoImplementationNone);
|
||||
}
|
||||
|
||||
} // namespace comphelper
|
||||
|
||||
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
208
comphelper/source/crypto/Crypto_OpenSSL.cxx
Normal file
208
comphelper/source/crypto/Crypto_OpenSSL.cxx
Normal file
|
@ -0,0 +1,208 @@
|
|||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||
/*
|
||||
* 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/.
|
||||
*/
|
||||
|
||||
#include <comphelper/crypto/Crypto.hxx>
|
||||
#include <sal/types.h>
|
||||
#include <config_oox.h>
|
||||
|
||||
#include <openssl/evp.h>
|
||||
#include <openssl/sha.h>
|
||||
#include <openssl/hmac.h>
|
||||
|
||||
namespace comphelper
|
||||
{
|
||||
namespace
|
||||
{
|
||||
#if (OPENSSL_VERSION_NUMBER < 0x10100000L)
|
||||
|
||||
static HMAC_CTX* HMAC_CTX_new(void)
|
||||
{
|
||||
HMAC_CTX* pContext = new HMAC_CTX;
|
||||
HMAC_CTX_init(pContext);
|
||||
return pContext;
|
||||
}
|
||||
|
||||
static void HMAC_CTX_free(HMAC_CTX* pContext)
|
||||
{
|
||||
HMAC_CTX_cleanup(pContext);
|
||||
delete pContext;
|
||||
}
|
||||
#endif
|
||||
|
||||
namespace
|
||||
{
|
||||
struct cipher_delete
|
||||
{
|
||||
void operator()(EVP_CIPHER_CTX* p) { EVP_CIPHER_CTX_free(p); }
|
||||
};
|
||||
|
||||
struct hmac_delete
|
||||
{
|
||||
SAL_WNODEPRECATED_DECLARATIONS_PUSH // 'HMAC_CTX_free' is deprecated
|
||||
void
|
||||
operator()(HMAC_CTX* p)
|
||||
{
|
||||
HMAC_CTX_free(p);
|
||||
}
|
||||
SAL_WNODEPRECATED_DECLARATIONS_POP
|
||||
};
|
||||
}
|
||||
|
||||
class CryptoImplementationOpenSSL : public ICryptoImplementation
|
||||
{
|
||||
std::unique_ptr<EVP_CIPHER_CTX, cipher_delete> mpContext;
|
||||
std::unique_ptr<HMAC_CTX, hmac_delete> mpHmacContext;
|
||||
|
||||
public:
|
||||
CryptoImplementationOpenSSL() = default;
|
||||
|
||||
virtual ~CryptoImplementationOpenSSL()
|
||||
{
|
||||
if (mpContext)
|
||||
EVP_CIPHER_CTX_cleanup(mpContext.get());
|
||||
}
|
||||
|
||||
void setupEncryptContext(std::vector<sal_uInt8>& key, std::vector<sal_uInt8>& iv,
|
||||
CryptoType eType) override
|
||||
{
|
||||
mpContext.reset(EVP_CIPHER_CTX_new());
|
||||
EVP_CIPHER_CTX_init(mpContext.get());
|
||||
|
||||
const EVP_CIPHER* cipher = getCipher(eType);
|
||||
if (cipher == nullptr)
|
||||
return;
|
||||
|
||||
if (iv.empty())
|
||||
EVP_EncryptInit_ex(mpContext.get(), cipher, nullptr, key.data(), nullptr);
|
||||
else
|
||||
EVP_EncryptInit_ex(mpContext.get(), cipher, nullptr, key.data(), iv.data());
|
||||
EVP_CIPHER_CTX_set_padding(mpContext.get(), 0);
|
||||
}
|
||||
|
||||
void setupDecryptContext(std::vector<sal_uInt8>& key, std::vector<sal_uInt8>& iv,
|
||||
CryptoType eType) override
|
||||
{
|
||||
mpContext.reset(EVP_CIPHER_CTX_new());
|
||||
EVP_CIPHER_CTX_init(mpContext.get());
|
||||
|
||||
const EVP_CIPHER* pCipher = getCipher(eType);
|
||||
if (pCipher == nullptr)
|
||||
return;
|
||||
|
||||
const size_t nMinKeySize = EVP_CIPHER_key_length(pCipher);
|
||||
if (key.size() < nMinKeySize)
|
||||
key.resize(nMinKeySize, 0);
|
||||
|
||||
if (iv.empty())
|
||||
EVP_DecryptInit_ex(mpContext.get(), pCipher, nullptr, key.data(), nullptr);
|
||||
else
|
||||
{
|
||||
const size_t nMinIVSize = EVP_CIPHER_iv_length(pCipher);
|
||||
if (iv.size() < nMinIVSize)
|
||||
iv.resize(nMinIVSize, 0);
|
||||
|
||||
EVP_DecryptInit_ex(mpContext.get(), pCipher, nullptr, key.data(), iv.data());
|
||||
}
|
||||
EVP_CIPHER_CTX_set_padding(mpContext.get(), 0);
|
||||
}
|
||||
|
||||
void setupCryptoHashContext(std::vector<sal_uInt8>& rKey, CryptoHashType eType) override
|
||||
{
|
||||
SAL_WNODEPRECATED_DECLARATIONS_PUSH // 'HMAC_CTX_new' is deprecated
|
||||
mpHmacContext.reset(HMAC_CTX_new());
|
||||
SAL_WNODEPRECATED_DECLARATIONS_POP
|
||||
const EVP_MD* aEvpMd = nullptr;
|
||||
switch (eType)
|
||||
{
|
||||
case CryptoHashType::SHA1:
|
||||
aEvpMd = EVP_sha1();
|
||||
break;
|
||||
case CryptoHashType::SHA256:
|
||||
aEvpMd = EVP_sha256();
|
||||
break;
|
||||
case CryptoHashType::SHA384:
|
||||
aEvpMd = EVP_sha384();
|
||||
break;
|
||||
case CryptoHashType::SHA512:
|
||||
aEvpMd = EVP_sha512();
|
||||
break;
|
||||
}
|
||||
SAL_WNODEPRECATED_DECLARATIONS_PUSH // 'HMAC_Init_ex' is deprecated
|
||||
HMAC_Init_ex(mpHmacContext.get(), rKey.data(), rKey.size(), aEvpMd, nullptr);
|
||||
SAL_WNODEPRECATED_DECLARATIONS_POP
|
||||
}
|
||||
|
||||
static const EVP_CIPHER* getCipher(CryptoType type)
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case CryptoType::AES_128_ECB:
|
||||
return EVP_aes_128_ecb();
|
||||
case CryptoType::AES_256_ECB:
|
||||
return EVP_aes_256_ecb();
|
||||
case CryptoType::AES_128_CBC:
|
||||
return EVP_aes_128_cbc();
|
||||
case CryptoType::AES_256_CBC:
|
||||
return EVP_aes_256_cbc();
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
sal_uInt32 decryptUpdate(std::vector<sal_uInt8>& output, std::vector<sal_uInt8>& input,
|
||||
sal_uInt32 inputLength) override
|
||||
{
|
||||
if (!mpContext)
|
||||
return 0;
|
||||
int outputLength = 0;
|
||||
(void)EVP_DecryptUpdate(mpContext.get(), output.data(), &outputLength, input.data(),
|
||||
inputLength);
|
||||
return outputLength;
|
||||
}
|
||||
|
||||
sal_uInt32 encryptUpdate(std::vector<sal_uInt8>& output, std::vector<sal_uInt8>& input,
|
||||
sal_uInt32 inputLength) override
|
||||
{
|
||||
if (!mpContext)
|
||||
return 0;
|
||||
int outputLength = 0;
|
||||
(void)EVP_EncryptUpdate(mpContext.get(), output.data(), &outputLength, input.data(),
|
||||
inputLength);
|
||||
return sal_uInt32(outputLength);
|
||||
}
|
||||
|
||||
bool cryptoHashUpdate(std::vector<sal_uInt8>& rInput, sal_uInt32 nInputLength) override
|
||||
{
|
||||
SAL_WNODEPRECATED_DECLARATIONS_PUSH // 'HMAC_Update' is deprecated
|
||||
return HMAC_Update(mpHmacContext.get(), rInput.data(), nInputLength)
|
||||
!= 0;
|
||||
SAL_WNODEPRECATED_DECLARATIONS_POP
|
||||
}
|
||||
|
||||
bool cryptoHashFinalize(std::vector<sal_uInt8>& rHash) override
|
||||
{
|
||||
unsigned int nSizeWritten = 0;
|
||||
SAL_WNODEPRECATED_DECLARATIONS_PUSH // 'HMAC_Final' is deprecated
|
||||
(void) HMAC_Final(mpHmacContext.get(), rHash.data(), &nSizeWritten);
|
||||
SAL_WNODEPRECATED_DECLARATIONS_POP
|
||||
return nSizeWritten == rHash.size();
|
||||
}
|
||||
};
|
||||
|
||||
} // anonymous namespace
|
||||
|
||||
std::shared_ptr<ICryptoImplementation> ICryptoImplementation::createInstance()
|
||||
{
|
||||
return std::shared_ptr<ICryptoImplementation>(new CryptoImplementationOpenSSL);
|
||||
}
|
||||
|
||||
} // namespace comphelper
|
||||
|
||||
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
|
@ -152,8 +152,6 @@ include/svx/autoformathelper.hxx:216
|
|||
_Bool AutoFormatBase::SaveBlockB(SvStream &,unsigned short) const
|
||||
include/svx/dlgctrl.hxx:99
|
||||
Point SvxRectCtl::SetActualRPWithoutInvalidate(enum RectPoint)
|
||||
include/svx/framelink.hxx:159
|
||||
svx::frame::Style & svx::frame::Style::MirrorSelf()
|
||||
include/svx/PaletteManager.hxx:87
|
||||
_Bool PaletteManager::GetLumModOff(unsigned short,unsigned short,short &,short &)
|
||||
include/test/a11y/AccessibilityTools.hxx:119
|
||||
|
|
|
@ -134,6 +134,7 @@ export DCONF_LIBS=@DCONF_LIBS@
|
|||
export DEFAULT_BRAND_IMAGES=@DEFAULT_BRAND_IMAGES@
|
||||
export DICT_SYSTEM_DIR=@DICT_SYSTEM_DIR@
|
||||
export DISABLE_CVE_TESTS=@DISABLE_CVE_TESTS@
|
||||
DISABLE_NAN_TESTS=@DISABLE_NAN_TESTS@
|
||||
export DISABLE_DYNLOADING=@DISABLE_DYNLOADING@
|
||||
export DISABLE_PYTHON=@DISABLE_PYTHON@
|
||||
export DOCDIR=@DOCDIR@
|
||||
|
|
|
@ -529,10 +529,10 @@ Components::Components(
|
|||
sal_uInt32 nStartTime = osl_getGlobalTimer();
|
||||
parseXcsXcuLayer(layer, url);
|
||||
SAL_INFO("configmgr", "parseXcsXcuLayer() took " << (osl_getGlobalTimer() - nStartTime) << " ms");
|
||||
layer += 2; //TODO: overflow
|
||||
layer += 2;
|
||||
} else if (type == "bundledext") {
|
||||
parseXcsXcuIniLayer(layer, url, false);
|
||||
layer += 2; //TODO: overflow
|
||||
layer += 2;
|
||||
} else if (type == "sharedext") {
|
||||
if (sharedExtensionLayer_ != -1) {
|
||||
throw css::uno::RuntimeException(
|
||||
|
@ -540,7 +540,7 @@ Components::Components(
|
|||
}
|
||||
sharedExtensionLayer_ = layer;
|
||||
parseXcsXcuIniLayer(layer, url, true);
|
||||
layer += 2; //TODO: overflow
|
||||
layer += 2;
|
||||
} else if (type == "userext") {
|
||||
if (userExtensionLayer_ != -1) {
|
||||
throw css::uno::RuntimeException(
|
||||
|
@ -548,12 +548,12 @@ Components::Components(
|
|||
}
|
||||
userExtensionLayer_ = layer;
|
||||
parseXcsXcuIniLayer(layer, url, true);
|
||||
layer += 2; //TODO: overflow
|
||||
layer += 2;
|
||||
} else if (type == "res") {
|
||||
sal_uInt32 nStartTime = osl_getGlobalTimer();
|
||||
parseResLayer(layer, url);
|
||||
SAL_INFO("configmgr", "parseResLayer() took " << (osl_getGlobalTimer() - nStartTime) << " ms");
|
||||
++layer; //TODO: overflow
|
||||
++layer;
|
||||
#if ENABLE_DCONF
|
||||
} else if (type == "dconf") {
|
||||
if (url == "!") {
|
||||
|
@ -566,7 +566,7 @@ Components::Components(
|
|||
"CONFIGURATION_LAYERS: unknown \"dconf\" kind \"" + url
|
||||
+ "\"");
|
||||
}
|
||||
++layer; //TODO: overflow
|
||||
++layer;
|
||||
#endif
|
||||
#if defined(_WIN32)
|
||||
} else if (type == "winreg") {
|
||||
|
@ -586,7 +586,7 @@ Components::Components(
|
|||
if (!getenv("SAL_CONFIG_WINREG_RETAIN_TMP"))
|
||||
osl::File::remove(aTempFileURL);
|
||||
}
|
||||
++layer; //TODO: overflow
|
||||
++layer;
|
||||
#endif
|
||||
} else if (type == "user") {
|
||||
bool write;
|
||||
|
@ -625,7 +625,7 @@ Components::Components(
|
|||
}
|
||||
parseModificationLayer(write ? Data::NO_LAYER : layer, url);
|
||||
}
|
||||
++layer; //TODO: overflow
|
||||
++layer;
|
||||
} else {
|
||||
throw css::uno::RuntimeException(
|
||||
"CONFIGURATION_LAYERS: unknown layer type \"" + type + "\"");
|
||||
|
|
31
configure.ac
31
configure.ac
|
@ -9,7 +9,7 @@ dnl in order to create a configure script.
|
|||
# several non-alphanumeric characters, those are split off and used only for the
|
||||
# ABOUTBOXPRODUCTVERSIONSUFFIX in openoffice.lst. Why that is necessary, no idea.
|
||||
|
||||
AC_INIT([LibreOffice],[25.2.0.0.alpha0+],[],[],[http://documentfoundation.org/])
|
||||
AC_INIT([LibreOffice],[25.2.0.0.alpha1+],[],[],[http://documentfoundation.org/])
|
||||
|
||||
dnl libnumbertext needs autoconf 2.68, but that can pick up autoconf268 just fine if it is installed
|
||||
dnl whereas aclocal (as run by autogen.sh) insists on using autoconf and fails hard
|
||||
|
@ -1895,6 +1895,11 @@ libo_FUZZ_ARG_ENABLE(cve-tests,
|
|||
[Prevent CVE tests to be executed]),
|
||||
,)
|
||||
|
||||
libo_FUZZ_ARG_ENABLE(nan-tests,
|
||||
AS_HELP_STRING([--disable-nan-tests],
|
||||
[Prevent NaN payload tests to be executed]),
|
||||
,)
|
||||
|
||||
AC_ARG_ENABLE(build-opensymbol,
|
||||
AS_HELP_STRING([--enable-build-opensymbol],
|
||||
[Do not use the prebuilt opens___.ttf. Build it instead. This needs
|
||||
|
@ -4268,7 +4273,7 @@ map_vs_year_to_version()
|
|||
2022)
|
||||
vsversion=17;;
|
||||
2022preview)
|
||||
vsversion=17.12;;
|
||||
vsversion=17.13;;
|
||||
*)
|
||||
AC_MSG_ERROR([Assertion failure - invalid argument "$1" to map_vs_year_to_version()]);;
|
||||
esac
|
||||
|
@ -4394,7 +4399,7 @@ find_msvc()
|
|||
vcyear=2019
|
||||
vctoolset=v142
|
||||
;;
|
||||
17.0 | 17.12)
|
||||
17.0 | 17.13)
|
||||
vcyear=2022
|
||||
vctoolset=v143
|
||||
;;
|
||||
|
@ -4565,7 +4570,7 @@ if test "$_os" = "WINNT"; then
|
|||
# are always "better", we list them in reverse chronological order.
|
||||
|
||||
case "$vcnumwithdot" in
|
||||
16.0 | 17.0 | 17.12)
|
||||
16.0 | 17.0 | 17.13)
|
||||
WINDOWS_SDK_ACCEPTABLE_VERSIONS="10.0 8.1A 8.1 8.0"
|
||||
;;
|
||||
esac
|
||||
|
@ -7048,7 +7053,7 @@ find_msms()
|
|||
|
||||
msmdir=
|
||||
case "$VCVER" in
|
||||
16.0 | 17.0 | 17.12)
|
||||
16.0 | 17.0 | 17.13)
|
||||
for l in `ls -1 $VC_PRODUCT_DIR/redist/MSVC/`; do
|
||||
my_msm_dir="$VC_PRODUCT_DIR/redist/MSVC/$l/MergeModules/"
|
||||
echo "$as_me:$LINENO: looking for $my_msm_dir${my_msm_file}])" >&5
|
||||
|
@ -7084,7 +7089,7 @@ find_msvc_x64_dlls()
|
|||
|
||||
msvcdllpath="$VC_PRODUCT_DIR/redist/x64/Microsoft.VC${VCVER}.CRT"
|
||||
case "$VCVER" in
|
||||
16.0 | 17.0 | 17.12)
|
||||
16.0 | 17.0 | 17.13)
|
||||
for crtver in 141 142 143; do
|
||||
for l in `ls -1 $VC_PRODUCT_DIR/redist/MSVC/`; do
|
||||
echo "$as_me:$LINENO: testing $VC_PRODUCT_DIR/redist/MSVC/$l/x64/Microsoft.VC$crtver.CRT" >&5
|
||||
|
@ -11538,6 +11543,18 @@ else
|
|||
AC_MSG_RESULT([yes])
|
||||
fi
|
||||
|
||||
dnl ===================================================================
|
||||
dnl Check for disabling nan_tests
|
||||
dnl ===================================================================
|
||||
AC_MSG_CHECKING([whether to execute NaN payload tests])
|
||||
if test "$enable_nan_tests" = "no"; then
|
||||
AC_MSG_RESULT([no])
|
||||
DISABLE_NAN_TESTS=TRUE
|
||||
AC_SUBST(DISABLE_NAN_TESTS)
|
||||
else
|
||||
AC_MSG_RESULT([yes])
|
||||
fi
|
||||
|
||||
dnl ===================================================================
|
||||
dnl Check for system openssl
|
||||
dnl ===================================================================
|
||||
|
@ -12248,7 +12265,7 @@ if test "$test_gtk3" = yes -a "x$enable_gtk3" = "xyes" -o "x$enable_gtk3_kde5" =
|
|||
add_warning 'Non-system cairo combined with gtk3 is known to cause trouble (eg. broken image in the splashscreen). Use --with-system-cairo unless you know what you are doing.'
|
||||
fi
|
||||
: ${with_system_cairo:=yes}
|
||||
PKG_CHECK_MODULES(GTK3, gtk+-3.0 >= 3.20 gtk+-unix-print-3.0 gmodule-no-export-2.0 glib-2.0 >= 2.38 atk >= 2.28.1 cairo)
|
||||
PKG_CHECK_MODULES(GTK3, gtk+-3.0 >= 3.20 gmodule-no-export-2.0 glib-2.0 >= 2.38 atk >= 2.28.1 cairo)
|
||||
GTK3_CFLAGS=$(printf '%s' "$GTK3_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
|
||||
GTK3_CFLAGS="$GTK3_CFLAGS -DGDK_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED"
|
||||
FilterLibs "${GTK3_LIBS}"
|
||||
|
|
|
@ -659,14 +659,6 @@ void OStatement_Base::SetAssignValue(const OUString& aColumnName,
|
|||
{
|
||||
switch (::comphelper::getINT32(xCol->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_TYPE))))
|
||||
{
|
||||
// put criteria depending on the Type as String or double in the variable
|
||||
case DataType::CHAR:
|
||||
case DataType::VARCHAR:
|
||||
case DataType::LONGVARCHAR:
|
||||
*(*m_aAssignValues)[nId] = ORowSetValue(aValue);
|
||||
//Characterset is already converted, since the entire statement was converted
|
||||
break;
|
||||
|
||||
case DataType::BIT:
|
||||
if (aValue.equalsIgnoreAsciiCase("TRUE") || aValue[0] == '1')
|
||||
*(*m_aAssignValues)[nId] = true;
|
||||
|
@ -675,6 +667,10 @@ void OStatement_Base::SetAssignValue(const OUString& aColumnName,
|
|||
else
|
||||
throwFunctionSequenceException(*this);
|
||||
break;
|
||||
case DataType::CHAR:
|
||||
case DataType::VARCHAR:
|
||||
case DataType::LONGVARCHAR:
|
||||
//Characterset is already converted, since the entire statement was converted
|
||||
case DataType::TINYINT:
|
||||
case DataType::SMALLINT:
|
||||
case DataType::INTEGER:
|
||||
|
|
|
@ -47,9 +47,7 @@ namespace cppcanvas::internal
|
|||
SAL_INFO( "cppcanvas.emf", "::cppcanvas::internal::CachedPrimitiveBase: 0x" << std::hex << this );
|
||||
|
||||
const rendering::ViewState aViewState( mpCanvas->getViewState() );
|
||||
::basegfx::B2DHomMatrix aTotalTransform;
|
||||
|
||||
::canvas::tools::getViewStateTransform( aTotalTransform,
|
||||
::basegfx::B2DHomMatrix aTotalTransform = ::canvas::tools::getViewStateTransform(
|
||||
aViewState );
|
||||
aTotalTransform *= rTransformation;
|
||||
|
||||
|
|
|
@ -2980,9 +2980,7 @@ namespace cppcanvas::internal
|
|||
// render subset of actions
|
||||
// ========================
|
||||
|
||||
::basegfx::B2DHomMatrix aMatrix;
|
||||
::canvas::tools::getRenderStateTransform( aMatrix,
|
||||
getRenderState() );
|
||||
::basegfx::B2DHomMatrix aMatrix = ::canvas::tools::getRenderStateTransform( getRenderState() );
|
||||
|
||||
ActionRenderer aRenderer( aMatrix );
|
||||
|
||||
|
@ -3024,8 +3022,7 @@ namespace cppcanvas::internal
|
|||
// query bounds for subset of actions
|
||||
// ==================================
|
||||
|
||||
::basegfx::B2DHomMatrix aMatrix;
|
||||
::canvas::tools::getRenderStateTransform( aMatrix,
|
||||
::basegfx::B2DHomMatrix aMatrix = ::canvas::tools::getRenderStateTransform(
|
||||
getRenderState() );
|
||||
|
||||
AreaQuery aQuery( aMatrix );
|
||||
|
@ -3043,8 +3040,7 @@ namespace cppcanvas::internal
|
|||
{
|
||||
SAL_INFO( "cppcanvas.emf", "::cppcanvas::internal::ImplRenderer::draw()" );
|
||||
|
||||
::basegfx::B2DHomMatrix aMatrix;
|
||||
::canvas::tools::getRenderStateTransform( aMatrix,
|
||||
::basegfx::B2DHomMatrix aMatrix = ::canvas::tools::getRenderStateTransform(
|
||||
getRenderState() );
|
||||
|
||||
try
|
||||
|
|
|
@ -634,9 +634,7 @@ namespace cppcanvas::tools
|
|||
viewState,
|
||||
renderState );
|
||||
|
||||
::basegfx::B2DRange aTransformedBounds;
|
||||
return ::canvas::tools::calcTransformedRectBounds( aTransformedBounds,
|
||||
rBounds,
|
||||
return ::canvas::tools::calcTransformedRectBounds(rBounds,
|
||||
aTransform );
|
||||
}
|
||||
|
||||
|
|
|
@ -176,12 +176,10 @@ namespace cppcanvas::internal
|
|||
|
||||
// determine overall transformation matrix (render, view,
|
||||
// and passed transformation)
|
||||
::basegfx::B2DHomMatrix aTransform;
|
||||
::canvas::tools::getRenderStateTransform( aTransform, maState );
|
||||
::basegfx::B2DHomMatrix aTransform = ::canvas::tools::getRenderStateTransform( maState );
|
||||
aTransform = rTransformation * aTransform;
|
||||
|
||||
::basegfx::B2DHomMatrix aTotalTransform;
|
||||
::canvas::tools::getViewStateTransform( aTotalTransform, mpCanvas->getViewState() );
|
||||
::basegfx::B2DHomMatrix aTotalTransform = ::canvas::tools::getViewStateTransform( mpCanvas->getViewState() );
|
||||
aTotalTransform = aTotalTransform * aTransform;
|
||||
|
||||
// since pure translational changes to the transformation
|
||||
|
|
|
@ -55,9 +55,7 @@ namespace cppcanvas::internal
|
|||
|
||||
::basegfx::B2DHomMatrix ImplCanvas::getTransformation() const
|
||||
{
|
||||
::basegfx::B2DHomMatrix aMatrix;
|
||||
return ::canvas::tools::getViewStateTransform( aMatrix,
|
||||
maViewState );
|
||||
return ::canvas::tools::getViewStateTransform( maViewState );
|
||||
}
|
||||
|
||||
void ImplCanvas::setClip( const ::basegfx::B2DPolyPolygon& rClipPoly )
|
||||
|
|
|
@ -298,7 +298,6 @@
|
|||
#include <drawinglayer/primitive2d/Primitive2DContainer.hxx>
|
||||
#include <drawinglayer/primitive2d/Primitive2DVisitor.hxx>
|
||||
#include <drawinglayer/primitive2d/baseprimitive2d.hxx>
|
||||
#include <editeng/EPosition.hxx>
|
||||
#include <editeng/ESelection.hxx>
|
||||
#include <editeng/editdata.hxx>
|
||||
#include <editeng/editengdllapi.h>
|
||||
|
|
|
@ -26,7 +26,6 @@
|
|||
#define RID_CUISTR_KEY_TEMPLATE_PATH NC_("RID_SVXSTR_KEY_TEMPLATE_PATH", "Templates")
|
||||
#define RID_CUISTR_KEY_GLOSSARY_PATH NC_("RID_SVXSTR_KEY_GLOSSARY_PATH", "AutoText")
|
||||
#define RID_CUISTR_KEY_DICTIONARY_PATH NC_("RID_SVXSTR_KEY_DICTIONARY_PATH", "Dictionaries")
|
||||
#define RID_CUISTR_KEY_HELP_DIR NC_("RID_SVXSTR_KEY_HELP_DIR", "Help")
|
||||
#define RID_CUISTR_KEY_GALLERY_DIR NC_("RID_SVXSTR_KEY_GALLERY_DIR", "Gallery")
|
||||
#define RID_CUISTR_KEY_TEMP_PATH NC_("RID_SVXSTR_KEY_TEMP_PATH", "Temporary files")
|
||||
#define RID_CUISTR_KEY_CLASSIFICATION_PATH NC_("RID_SVXSTR_KEY_CLASSIFICATION_PATH", "Classification")
|
||||
|
|
|
@ -9,6 +9,4 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#define RID_SVXSTR_KEY_BASIC_PATH "BASIC"
|
||||
|
||||
/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */
|
||||
|
|
|
@ -2739,6 +2739,7 @@ SvxIconSelectorDialog::SvxIconSelectorDialog(weld::Window *pWindow,
|
|||
m_xTbSymbol->SetItemWidth(m_nExpectedSize);
|
||||
m_xTbSymbol->SetItemHeight(m_nExpectedSize);
|
||||
m_xTbSymbol->SetExtraSpacing(6);
|
||||
m_xTbSymbol->SetMargin(4);
|
||||
Size aSize(m_xTbSymbol->CalcWindowSizePixel(Size(m_nExpectedSize, m_nExpectedSize), 11, 5));
|
||||
m_xTbSymbol->set_size_request(aSize.Width(), aSize.Height());
|
||||
|
||||
|
|
|
@ -1350,7 +1350,7 @@ bool SentenceEditWindow_Impl::KeyInput(const KeyEvent& rKeyEvt)
|
|||
std::vector<EECharAttrib> aAttribList;
|
||||
m_xEditEngine->GetCharAttribs(0, aAttribList);
|
||||
|
||||
auto nCursor = aCurrentSelection.nStartPos;
|
||||
auto nCursor = aCurrentSelection.start.nIndex;
|
||||
const EECharAttrib* pBackAttr = FindCharAttrib(nCursor, EE_CHAR_BKGCOLOR, aAttribList);
|
||||
const EECharAttrib* pErrorAttr = FindCharAttrib(nCursor, EE_CHAR_GRABBAG, aAttribList);
|
||||
const EECharAttrib* pBackAttrLeft = nullptr;
|
||||
|
@ -1361,21 +1361,21 @@ bool SentenceEditWindow_Impl::KeyInput(const KeyEvent& rKeyEvt)
|
|||
if (bHasRange)
|
||||
{
|
||||
if (pBackAttr &&
|
||||
pBackAttr->nStart == aCurrentSelection.nStartPos &&
|
||||
pBackAttr->nEnd == aCurrentSelection.nEndPos)
|
||||
pBackAttr->nStart == aCurrentSelection.start.nIndex &&
|
||||
pBackAttr->nEnd == aCurrentSelection.end.nIndex)
|
||||
{
|
||||
nSelectionType = FULL;
|
||||
}
|
||||
else if (pErrorAttr &&
|
||||
pErrorAttr->nStart <= aCurrentSelection.nStartPos &&
|
||||
pErrorAttr->nEnd >= aCurrentSelection.nEndPos)
|
||||
pErrorAttr->nStart <= aCurrentSelection.start.nIndex &&
|
||||
pErrorAttr->nEnd >= aCurrentSelection.end.nIndex)
|
||||
{
|
||||
nSelectionType = INSIDE_YES;
|
||||
}
|
||||
else
|
||||
{
|
||||
nSelectionType = bHasField||bHasError ? BRACE : OUTSIDE_NO;
|
||||
while (nCursor < aCurrentSelection.nEndPos)
|
||||
while (nCursor < aCurrentSelection.end.nIndex)
|
||||
{
|
||||
++nCursor;
|
||||
const EECharAttrib* pIntBackAttr = FindCharAttrib(nCursor, EE_CHAR_BKGCOLOR, aAttribList);
|
||||
|
@ -1396,8 +1396,8 @@ bool SentenceEditWindow_Impl::KeyInput(const KeyEvent& rKeyEvt)
|
|||
const EECharAttrib* pCurAttr = pBackAttr ? pBackAttr : pErrorAttr;
|
||||
if (pCurAttr)
|
||||
{
|
||||
nSelectionType = pCurAttr->nStart == aCurrentSelection.nStartPos ?
|
||||
LEFT_NO : pCurAttr->nEnd == aCurrentSelection.nEndPos ? RIGHT_NO : INSIDE_NO;
|
||||
nSelectionType = pCurAttr->nStart == aCurrentSelection.start.nIndex ?
|
||||
LEFT_NO : pCurAttr->nEnd == aCurrentSelection.end.nIndex ? RIGHT_NO : INSIDE_NO;
|
||||
}
|
||||
else
|
||||
nSelectionType = OUTSIDE_NO;
|
||||
|
@ -1747,7 +1747,7 @@ bool SentenceEditWindow_Impl::MarkNextError( bool bIgnoreCurrentError, const css
|
|||
|
||||
void SentenceEditWindow_Impl::MoveErrorMarkTo(sal_Int32 nStart, sal_Int32 nEnd, bool bGrammarError)
|
||||
{
|
||||
ESelection aAll(0, 0, 0, EE_TEXTPOS_ALL);
|
||||
ESelection aAll(m_xEditEngine->NormalizeESelection(ESelection::All()));
|
||||
m_xEditEngine->RemoveAttribs(aAll, false, EE_CHAR_COLOR);
|
||||
m_xEditEngine->RemoveAttribs(aAll, false, EE_CHAR_WEIGHT);
|
||||
m_xEditEngine->RemoveAttribs(aAll, false, EE_CHAR_WEIGHT_CJK);
|
||||
|
@ -1769,7 +1769,7 @@ void SentenceEditWindow_Impl::MoveErrorMarkTo(sal_Int32 nStart, sal_Int32 nEnd,
|
|||
// unless (tdf#133958) the selection already overlaps this range
|
||||
ESelection aCurrentSelection = m_xEditView->GetSelection();
|
||||
aCurrentSelection.Adjust();
|
||||
bool bCurrentSelectionInRange = nStart <= aCurrentSelection.nEndPos && aCurrentSelection.nStartPos <= nEnd;
|
||||
bool bCurrentSelectionInRange = nStart <= aCurrentSelection.end.nIndex && aCurrentSelection.start.nIndex <= nEnd;
|
||||
if (!bCurrentSelectionInRange)
|
||||
{
|
||||
m_xEditView->SetSelection(ESelection(0, nStart));
|
||||
|
@ -2160,7 +2160,7 @@ void SentenceEditWindow_Impl::SetUndoEditMode(bool bSet)
|
|||
pWidget->set_sensitive(false);
|
||||
|
||||
//remove error marks
|
||||
ESelection aAll(0, 0, 0, EE_TEXTPOS_ALL);
|
||||
ESelection aAll(m_xEditEngine->NormalizeESelection(ESelection::All()));
|
||||
m_xEditEngine->RemoveAttribs(aAll, false, EE_CHAR_COLOR);
|
||||
m_xEditEngine->RemoveAttribs(aAll, false, EE_CHAR_WEIGHT);
|
||||
m_xEditEngine->RemoveAttribs(aAll, false, EE_CHAR_WEIGHT_CJK);
|
||||
|
|
|
@ -51,8 +51,7 @@ SvxHyperlinkMailTp::SvxHyperlinkMailTp(weld::Container* pParent, SvxHpLinkDlg* p
|
|||
m_xBtAdrBook->connect_clicked( LINK ( this, SvxHyperlinkMailTp, ClickAdrBookHdl_Impl ) );
|
||||
m_xCbbReceiver->connect_changed( LINK ( this, SvxHyperlinkMailTp, ModifiedReceiverHdl_Impl) );
|
||||
|
||||
if ( !SvtModuleOptions().IsModuleInstalled( SvtModuleOptions::EModule::DATABASE ) ||
|
||||
comphelper::LibreOfficeKit::isActive() )
|
||||
if (!SvtModuleOptions().IsDataBaseInstalled() || comphelper::LibreOfficeKit::isActive())
|
||||
m_xBtAdrBook->hide();
|
||||
}
|
||||
|
||||
|
|
|
@ -24,7 +24,6 @@ inline constexpr OUString HID_OPTIONS_COLORCONFIG_SAVE_SCHEME
|
|||
= u"CUI_HID_OPTIONS_COLORCONFIG_SAVE_SCHEME"_ustr;
|
||||
inline constexpr OUString HID_OFA_FONT_SUBST_CLB = u"CUI_HID_OFA_FONT_SUBST_CLB"_ustr;
|
||||
inline constexpr OUString HID_DBPATH_CTL_PATH = u"CUI_HID_DBPATH_CTL_PATH"_ustr;
|
||||
#define HID_DBPATH_HEADERBAR "CUI_HID_DBPATH_HEADERBAR"
|
||||
inline constexpr OUString HID_OFADLG_TREELISTBOX = u"CUI_HID_OFADLG_TREELISTBOX"_ustr;
|
||||
inline constexpr OUString HID_SVX_CONFIG_TOOLBAR = u"CUI_HID_SVX_CONFIG_TOOLBAR"_ustr;
|
||||
inline constexpr OUString HID_SVX_CONFIG_TOOLBAR_CONTENTS
|
||||
|
|
|
@ -30,10 +30,6 @@
|
|||
|
||||
#include <unordered_map>
|
||||
|
||||
#define OBJTYPE_METHOD 2L
|
||||
#define OBJTYPE_SCRIPTCONTAINER 3L
|
||||
#define OBJTYPE_SFROOT 4L
|
||||
|
||||
typedef std::unordered_map < OUString, OUString > Selection_hash;
|
||||
|
||||
class SFEntry;
|
||||
|
|
|
@ -31,8 +31,8 @@ namespace
|
|||
constexpr std::pair<OUString, std::pair<sfx::AccessibilityIssueID, TranslateId>> options_list[] {
|
||||
{ u"DocumentTitle"_ustr, { sfx::AccessibilityIssueID::DOCUMENT_TITLE, STR_DOCUMENT_TITLE } },
|
||||
{ u"DocumentLanguage"_ustr, { sfx::AccessibilityIssueID::DOCUMENT_LANGUAGE, STR_DOCUMENT_DEFAULT_LANGUAGE } },
|
||||
{ u"DocumentBackground"_ustr, { sfx::AccessibilityIssueID::DOCUMENT_LANGUAGE, STR_AVOID_BACKGROUND_IMAGES } },
|
||||
{ u"DocumentStyleLanguage"_ustr, { sfx::AccessibilityIssueID::DOCUMENT_BACKGROUND, STR_STYLE_NO_LANGUAGE } },
|
||||
{ u"DocumentBackground"_ustr, { sfx::AccessibilityIssueID::DOCUMENT_BACKGROUND, STR_AVOID_BACKGROUND_IMAGES } },
|
||||
{ u"DocumentStyleLanguage"_ustr, { sfx::AccessibilityIssueID::STYLE_LANGUAGE, STR_STYLE_NO_LANGUAGE } },
|
||||
{ u"LinkedGraphic"_ustr, { sfx::AccessibilityIssueID::LINKED_GRAPHIC, STR_LINKED_GRAPHIC } },
|
||||
{ u"NoAltOleObj"_ustr, { sfx::AccessibilityIssueID::NO_ALT_OLE, STR_NO_ALT_OLE } },
|
||||
{ u"NoAltGraphicObj"_ustr, { sfx::AccessibilityIssueID::NO_ALT_GRAPHIC, STR_NO_ALT_GRAPHIC } },
|
||||
|
|
|
@ -108,10 +108,9 @@ const vEntryInfo[] =
|
|||
// The list of these entries (enum ColorConfigEntry) are in colorcfg.hxx.
|
||||
|
||||
{ Group_General, IDS(doccolor), std::u16string_view(u"/DocColor") },
|
||||
{ Group_General, IDS_CB(docboundaries), std::u16string_view(u"/DocBoundaries") },
|
||||
{ Group_General, IDS(docboundaries), std::u16string_view(u"/DocBoundaries") },
|
||||
{ Group_General, IDS(appback), std::u16string_view(u"/AppBackground") },
|
||||
{ Group_General, IDS_CB(objboundaries), std::u16string_view(u"/ObjectBoundaries") },
|
||||
{ Group_General, IDS_CB(tblboundaries), std::u16string_view(u"/TableBoundaries") },
|
||||
{ Group_General, IDS(tblboundaries), std::u16string_view(u"/TableBoundaries") },
|
||||
{ Group_General, IDS(font), std::u16string_view(u"/FontColor") },
|
||||
{ Group_General, IDS_CB(unvisitedlinks), std::u16string_view(u"/Links") },
|
||||
{ Group_General, IDS_CB(visitedlinks), std::u16string_view(u"/LinksVisited") },
|
||||
|
@ -125,7 +124,7 @@ const vEntryInfo[] =
|
|||
{ Group_Writer, IDS_CB(index), std::u16string_view(u"/WriterIdxShadings") },
|
||||
{ Group_Writer, IDS(direct), std::u16string_view(u"/WriterDirectCursor") },
|
||||
{ Group_Writer, IDS(script), std::u16string_view(u"/WriterScriptIndicator") },
|
||||
{ Group_Writer, IDS_CB(section), std::u16string_view(u"/WriterSectionBoundaries") },
|
||||
{ Group_Writer, IDS(section), std::u16string_view(u"/WriterSectionBoundaries") },
|
||||
{ Group_Writer, IDS(hdft), std::u16string_view(u"/WriterHeaderFooterMark") },
|
||||
{ Group_Writer, IDS(pagebreak), std::u16string_view(u"/WriterPageBreaks") },
|
||||
{ Group_Writer, IDS(nonprintchars), std::u16string_view(u"/WriterNonPrintChars") },
|
||||
|
@ -485,7 +484,7 @@ void ColorConfigWindow_Impl::CreateEntries()
|
|||
// get it to align its contents with that of a CheckBox
|
||||
{
|
||||
OUString sSampleText(u"XXXXXX"_ustr);
|
||||
std::unique_ptr<weld::CheckButton> xCheckBox(m_xBuilder->weld_check_button(u"docboundaries"_ustr));
|
||||
std::unique_ptr<weld::CheckButton> xCheckBox(m_xBuilder->weld_check_button(u"unvisitedlinks"_ustr));
|
||||
std::unique_ptr<weld::Label> xFixedText(m_xBuilder->weld_label(u"doccolor"_ustr));
|
||||
OUString sOrigCheck(xCheckBox->get_label());
|
||||
OUString sOrigFixed(xFixedText->get_label());
|
||||
|
@ -677,15 +676,15 @@ bool ColorConfigWindow_Impl::IsGroupVisible (Group eGroup) const
|
|||
{
|
||||
case Group_Writer:
|
||||
case Group_Html:
|
||||
return aModuleOptions.IsModuleInstalled(SvtModuleOptions::EModule::WRITER);
|
||||
return aModuleOptions.IsWriterInstalled();
|
||||
case Group_Calc:
|
||||
return aModuleOptions.IsModuleInstalled(SvtModuleOptions::EModule::CALC);
|
||||
return aModuleOptions.IsCalcInstalled();
|
||||
case Group_Draw:
|
||||
return
|
||||
aModuleOptions.IsModuleInstalled(SvtModuleOptions::EModule::DRAW) ||
|
||||
aModuleOptions.IsModuleInstalled(SvtModuleOptions::EModule::IMPRESS);
|
||||
aModuleOptions.IsDrawInstalled() ||
|
||||
aModuleOptions.IsImpressInstalled();
|
||||
case Group_Sql:
|
||||
return aModuleOptions.IsModuleInstalled(SvtModuleOptions::EModule::DATABASE);
|
||||
return aModuleOptions.IsDataBaseInstalled();
|
||||
default:
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -331,16 +331,16 @@ void OfaMSFilterTabPage2::Reset( const SfxItemSet* )
|
|||
SvtModuleOptions aModuleOpt;
|
||||
|
||||
// int the same sequence as the enums of MSFltrPg2_CheckBoxEntries
|
||||
if ( aModuleOpt.IsModuleInstalled( SvtModuleOptions::EModule::MATH ) )
|
||||
if (aModuleOpt.IsMathInstalled())
|
||||
InsertEntry( sChgToFromMath, MSFltrPg2_CheckBoxEntries::Math );
|
||||
if ( aModuleOpt.IsModuleInstalled( SvtModuleOptions::EModule::WRITER ) )
|
||||
if (aModuleOpt.IsWriterInstalled())
|
||||
InsertEntry( sChgToFromWriter, MSFltrPg2_CheckBoxEntries::Writer );
|
||||
if ( aModuleOpt.IsModuleInstalled( SvtModuleOptions::EModule::CALC ) )
|
||||
if (aModuleOpt.IsCalcInstalled())
|
||||
InsertEntry( sChgToFromCalc, MSFltrPg2_CheckBoxEntries::Calc );
|
||||
if ( aModuleOpt.IsModuleInstalled( SvtModuleOptions::EModule::IMPRESS ) )
|
||||
if (aModuleOpt.IsImpressInstalled())
|
||||
InsertEntry( sChgToFromImpress, MSFltrPg2_CheckBoxEntries::Impress );
|
||||
InsertEntry( sChgToFromSmartArt, MSFltrPg2_CheckBoxEntries::SmartArt, false );
|
||||
if (aModuleOpt.IsModuleInstalled(SvtModuleOptions::EModule::DRAW))
|
||||
if (aModuleOpt.IsDrawInstalled())
|
||||
{
|
||||
InsertEntry(sChgToFromVisio, MSFltrPg2_CheckBoxEntries::Visio, false);
|
||||
InsertEntry(sChgToFromPDF, MSFltrPg2_CheckBoxEntries::PDF, false);
|
||||
|
|
|
@ -1065,17 +1065,7 @@ void OfaViewTabPage::Reset( const SfxItemSet* )
|
|||
m_xUseHardwareAccell->save_state();
|
||||
|
||||
{ // #i95644# AntiAliasing
|
||||
if(SvtOptionsDrawinglayer::IsAAPossibleOnThisSystem())
|
||||
{
|
||||
m_xUseAntiAliase->set_active(SvtOptionsDrawinglayer::IsAntiAliasing());
|
||||
}
|
||||
else
|
||||
{
|
||||
m_xUseAntiAliase->set_active(false);
|
||||
m_xUseAntiAliase->set_sensitive(false);
|
||||
m_xUseAntiAliaseImg->set_visible(true);
|
||||
}
|
||||
|
||||
m_xUseAntiAliase->set_active(SvtOptionsDrawinglayer::IsAntiAliasing());
|
||||
bEnable = !officecfg::Office::Common::Drawinglayer::AntiAliasing::isReadOnly();
|
||||
m_xUseAntiAliase->set_sensitive(bEnable);
|
||||
m_xUseAntiAliaseImg->set_visible(!bEnable);
|
||||
|
|
|
@ -247,7 +247,7 @@ void SvxPathTabPage::Reset( const SfxItemSet* )
|
|||
{
|
||||
// only writer uses autotext
|
||||
if ( static_cast<SvtPathOptions::Paths>(i) == SvtPathOptions::Paths::AutoText
|
||||
&& !SvtModuleOptions().IsModuleInstalled( SvtModuleOptions::EModule::WRITER ) )
|
||||
&& !SvtModuleOptions().IsWriterInstalled())
|
||||
continue;
|
||||
|
||||
TranslateId pId;
|
||||
|
|
|
@ -140,7 +140,7 @@ SvxSaveTabPage::SvxSaveTabPage(weld::Container* pPage, weld::DialogController* p
|
|||
m_xBackupCB->connect_toggled(LINK(this, SvxSaveTabPage, BackupClickHdl_Impl));
|
||||
|
||||
SvtModuleOptions aModuleOpt;
|
||||
if ( !aModuleOpt.IsModuleInstalled( SvtModuleOptions::EModule::MATH ) )
|
||||
if (!aModuleOpt.IsMathInstalled())
|
||||
{
|
||||
m_xSaveAsLB->remove_id(OUString::number(APP_MATH));
|
||||
m_xDocTypeLB->remove_id(OUString::number(APP_MATH));
|
||||
|
@ -151,7 +151,7 @@ SvxSaveTabPage::SvxSaveTabPage(weld::Container* pPage, weld::DialogController* p
|
|||
pImpl->aDefaultReadonlyArr[APP_MATH] = aModuleOpt.IsDefaultFilterReadonly(SvtModuleOptions::EFactory::MATH);
|
||||
}
|
||||
|
||||
if ( !aModuleOpt.IsModuleInstalled( SvtModuleOptions::EModule::DRAW ) )
|
||||
if (!aModuleOpt.IsDrawInstalled())
|
||||
{
|
||||
m_xSaveAsLB->remove_id(OUString::number(APP_DRAW));
|
||||
m_xDocTypeLB->remove_id(OUString::number(APP_DRAW));
|
||||
|
@ -162,7 +162,7 @@ SvxSaveTabPage::SvxSaveTabPage(weld::Container* pPage, weld::DialogController* p
|
|||
pImpl->aDefaultReadonlyArr[APP_DRAW] = aModuleOpt.IsDefaultFilterReadonly(SvtModuleOptions::EFactory::DRAW);
|
||||
}
|
||||
|
||||
if ( !aModuleOpt.IsModuleInstalled( SvtModuleOptions::EModule::IMPRESS ) )
|
||||
if (!aModuleOpt.IsImpressInstalled())
|
||||
{
|
||||
m_xSaveAsLB->remove_id(OUString::number(APP_IMPRESS));
|
||||
m_xDocTypeLB->remove_id(OUString::number(APP_IMPRESS));
|
||||
|
@ -173,7 +173,7 @@ SvxSaveTabPage::SvxSaveTabPage(weld::Container* pPage, weld::DialogController* p
|
|||
pImpl->aDefaultReadonlyArr[APP_IMPRESS] = aModuleOpt.IsDefaultFilterReadonly(SvtModuleOptions::EFactory::IMPRESS);
|
||||
}
|
||||
|
||||
if ( !aModuleOpt.IsModuleInstalled( SvtModuleOptions::EModule::CALC ) )
|
||||
if (!aModuleOpt.IsCalcInstalled())
|
||||
{
|
||||
m_xSaveAsLB->remove_id(OUString::number(APP_CALC));
|
||||
m_xDocTypeLB->remove_id(OUString::number(APP_CALC));
|
||||
|
@ -184,7 +184,7 @@ SvxSaveTabPage::SvxSaveTabPage(weld::Container* pPage, weld::DialogController* p
|
|||
pImpl->aDefaultReadonlyArr[APP_CALC] = aModuleOpt.IsDefaultFilterReadonly(SvtModuleOptions::EFactory::CALC);
|
||||
}
|
||||
|
||||
if ( !aModuleOpt.IsModuleInstalled( SvtModuleOptions::EModule::WRITER ) )
|
||||
if (!aModuleOpt.IsWriterInstalled())
|
||||
{
|
||||
m_xSaveAsLB->remove_id(OUString::number(APP_WRITER));
|
||||
m_xSaveAsLB->remove_id(OUString::number(APP_WRITER_WEB));
|
||||
|
|
|
@ -1712,20 +1712,16 @@ OUString OfaTreeOptionsDialog::getCurrentFactory_Impl( const Reference< XFrame >
|
|||
|
||||
void OfaTreeOptionsDialog::generalOptions(const std::vector<sal_uInt16>& vPageId)
|
||||
{
|
||||
sal_uInt16 nGroup = 0;
|
||||
SvtOptionsDialogOptions aOptionsDlgOpt;
|
||||
sal_uInt16 nPageId = 0;
|
||||
|
||||
if ( !lcl_isOptionHidden( SID_GENERAL_OPTIONS, aOptionsDlgOpt ) )
|
||||
{
|
||||
setGroupName(u"ProductName", CuiResId(SID_GENERAL_OPTIONS_RES[0].first));
|
||||
nGroup = AddGroup(CuiResId(SID_GENERAL_OPTIONS_RES[0].first), nullptr, nullptr, SID_GENERAL_OPTIONS );
|
||||
const sal_uInt16 nEnd = static_cast<sal_uInt16>(std::size(SID_GENERAL_OPTIONS_RES));
|
||||
sal_uInt16 nGroup = AddGroup(CuiResId(SID_GENERAL_OPTIONS_RES[0].first), nullptr, nullptr, SID_GENERAL_OPTIONS );
|
||||
|
||||
for (sal_uInt16 i = 1; i < nEnd; ++i)
|
||||
for (size_t i = 1; i < std::size(SID_GENERAL_OPTIONS_RES); ++i)
|
||||
{
|
||||
OUString sNewTitle = CuiResId(SID_GENERAL_OPTIONS_RES[i].first);
|
||||
nPageId = SID_GENERAL_OPTIONS_RES[i].second;
|
||||
sal_uInt16 nPageId = SID_GENERAL_OPTIONS_RES[i].second;
|
||||
if ( lcl_isOptionHidden( nPageId, aOptionsDlgOpt ) )
|
||||
continue;
|
||||
|
||||
|
@ -1750,17 +1746,14 @@ void OfaTreeOptionsDialog::generalOptions(const std::vector<sal_uInt16>& vPageId
|
|||
|
||||
void OfaTreeOptionsDialog::loadAndSaveOptions(const std::vector<sal_uInt16>& vPageId)
|
||||
{
|
||||
sal_uInt16 nGroup = 0;
|
||||
SvtOptionsDialogOptions aOptionsDlgOpt;
|
||||
sal_uInt16 nPageId = 0;
|
||||
|
||||
if ( !lcl_isOptionHidden( SID_FILTER_DLG, aOptionsDlgOpt ) )
|
||||
{
|
||||
setGroupName( u"LoadSave", CuiResId(SID_FILTER_DLG_RES[0].first) );
|
||||
nGroup = AddGroup( CuiResId(SID_FILTER_DLG_RES[0].first), nullptr, nullptr, SID_FILTER_DLG );
|
||||
sal_uInt16 nGroup = AddGroup( CuiResId(SID_FILTER_DLG_RES[0].first), nullptr, nullptr, SID_FILTER_DLG );
|
||||
for ( size_t i = 1; i < std::size(SID_FILTER_DLG_RES); ++i )
|
||||
{
|
||||
nPageId = static_cast<sal_uInt16>(SID_FILTER_DLG_RES[i].second);
|
||||
sal_uInt16 nPageId = SID_FILTER_DLG_RES[i].second;
|
||||
if ( !lcl_isOptionHidden( nPageId, aOptionsDlgOpt ) )
|
||||
{
|
||||
if (!vPageId.empty())
|
||||
|
@ -1777,18 +1770,14 @@ void OfaTreeOptionsDialog::loadAndSaveOptions(const std::vector<sal_uInt16>& vPa
|
|||
|
||||
void OfaTreeOptionsDialog::languageOptions(const std::vector<sal_uInt16>& vPageId)
|
||||
{
|
||||
sal_uInt16 nGroup = 0;
|
||||
SvtOptionsDialogOptions aOptionsDlgOpt;
|
||||
sal_uInt16 nPageId = 0;
|
||||
|
||||
SvtCTLOptions aCTLLanguageOptions;
|
||||
if ( !lcl_isOptionHidden( SID_LANGUAGE_OPTIONS, aOptionsDlgOpt ) )
|
||||
{
|
||||
setGroupName(u"LanguageSettings", CuiResId(SID_LANGUAGE_OPTIONS_RES[0].first));
|
||||
nGroup = AddGroup(CuiResId(SID_LANGUAGE_OPTIONS_RES[0].first), nullptr, nullptr, SID_LANGUAGE_OPTIONS );
|
||||
sal_uInt16 nGroup = AddGroup(CuiResId(SID_LANGUAGE_OPTIONS_RES[0].first), nullptr, nullptr, SID_LANGUAGE_OPTIONS );
|
||||
for (size_t i = 1; i < std::size(SID_LANGUAGE_OPTIONS_RES); ++i)
|
||||
{
|
||||
nPageId = static_cast<sal_uInt16>(SID_LANGUAGE_OPTIONS_RES[i].second);
|
||||
sal_uInt16 nPageId = SID_LANGUAGE_OPTIONS_RES[i].second;
|
||||
if ( lcl_isOptionHidden( nPageId, aOptionsDlgOpt ) )
|
||||
continue;
|
||||
|
||||
|
@ -1817,33 +1806,28 @@ void OfaTreeOptionsDialog::languageOptions(const std::vector<sal_uInt16>& vPageI
|
|||
|
||||
void OfaTreeOptionsDialog::writerOptions(const std::vector<sal_uInt16>& vPageId)
|
||||
{
|
||||
sal_uInt16 nGroup = 0;
|
||||
SvtOptionsDialogOptions aOptionsDlgOpt;
|
||||
sal_uInt16 nPageId = 0;
|
||||
|
||||
OUString aFactory = getCurrentFactory_Impl( m_xFrame );
|
||||
DBG_ASSERT( GetModuleIdentifier( m_xFrame ) == aFactory, "This should not happen" );
|
||||
|
||||
SvtModuleOptions aModuleOpt;
|
||||
if ( aModuleOpt.IsModuleInstalled( SvtModuleOptions::EModule::WRITER ) )
|
||||
if (SvtModuleOptions().IsWriterInstalled())
|
||||
{
|
||||
// text document
|
||||
OUString aFactory = getCurrentFactory_Impl(m_xFrame);
|
||||
DBG_ASSERT(GetModuleIdentifier(m_xFrame) == aFactory, "This should not happen");
|
||||
if ( aFactory == "com.sun.star.text.TextDocument"
|
||||
|| aFactory == "com.sun.star.text.WebDocument"
|
||||
|| aFactory == "com.sun.star.text.GlobalDocument" )
|
||||
{
|
||||
SfxModule* pSwMod = SfxApplication::GetModule(SfxToolsModule::Writer);
|
||||
SvtOptionsDialogOptions aOptionsDlgOpt;
|
||||
if ( !lcl_isOptionHidden( SID_SW_EDITOPTIONS, aOptionsDlgOpt ) )
|
||||
{
|
||||
if ( aFactory == "com.sun.star.text.WebDocument" )
|
||||
setGroupName( u"WriterWeb", CuiResId(SID_SW_EDITOPTIONS_RES[0].first) );
|
||||
else
|
||||
setGroupName( u"Writer", CuiResId(SID_SW_EDITOPTIONS_RES[0].first) );
|
||||
nGroup = AddGroup(CuiResId(SID_SW_EDITOPTIONS_RES[0].first), pSwMod, pSwMod, SID_SW_EDITOPTIONS );
|
||||
SfxModule* pSwMod = SfxApplication::GetModule(SfxToolsModule::Writer);
|
||||
sal_uInt16 nGroup = AddGroup(CuiResId(SID_SW_EDITOPTIONS_RES[0].first), pSwMod, pSwMod, SID_SW_EDITOPTIONS );
|
||||
SvtCTLOptions aCTLLanguageOptions;
|
||||
for ( size_t i = 1; i < std::size(SID_SW_EDITOPTIONS_RES); ++i )
|
||||
{
|
||||
nPageId = static_cast<sal_uInt16>(SID_SW_EDITOPTIONS_RES[i].second);
|
||||
sal_uInt16 nPageId = SID_SW_EDITOPTIONS_RES[i].second;
|
||||
if ( lcl_isOptionHidden( nPageId, aOptionsDlgOpt ) )
|
||||
continue;
|
||||
if ( ( RID_SW_TP_STD_FONT_CJK != nPageId || SvtCJKOptions::IsCJKFontEnabled() ) &&
|
||||
|
@ -1877,30 +1861,24 @@ void OfaTreeOptionsDialog::writerOptions(const std::vector<sal_uInt16>& vPageId)
|
|||
|
||||
void OfaTreeOptionsDialog::writerWebOptions(const std::vector<sal_uInt16>& vPageId)
|
||||
{
|
||||
sal_uInt16 nGroup = 0;
|
||||
SvtOptionsDialogOptions aOptionsDlgOpt;
|
||||
sal_uInt16 nPageId = 0;
|
||||
|
||||
OUString aFactory = getCurrentFactory_Impl( m_xFrame );
|
||||
DBG_ASSERT( GetModuleIdentifier( m_xFrame ) == aFactory, "This should not happen" );
|
||||
|
||||
SvtModuleOptions aModuleOpt;
|
||||
if ( aModuleOpt.IsModuleInstalled( SvtModuleOptions::EModule::WRITER ) )
|
||||
if (SvtModuleOptions().IsWriterInstalled())
|
||||
{
|
||||
// text document
|
||||
OUString aFactory = getCurrentFactory_Impl(m_xFrame);
|
||||
DBG_ASSERT(GetModuleIdentifier(m_xFrame) == aFactory, "This should not happen");
|
||||
if ( aFactory == "com.sun.star.text.TextDocument"
|
||||
|| aFactory == "com.sun.star.text.WebDocument"
|
||||
|| aFactory == "com.sun.star.text.GlobalDocument" )
|
||||
{
|
||||
SfxModule* pSwMod = SfxApplication::GetModule(SfxToolsModule::Writer);
|
||||
|
||||
// HTML documents
|
||||
SvtOptionsDialogOptions aOptionsDlgOpt;
|
||||
if ( !lcl_isOptionHidden( SID_SW_ONLINEOPTIONS, aOptionsDlgOpt ) )
|
||||
{
|
||||
nGroup = AddGroup(CuiResId(SID_SW_ONLINEOPTIONS_RES[0].first), pSwMod, pSwMod, SID_SW_ONLINEOPTIONS );
|
||||
SfxModule* pSwMod = SfxApplication::GetModule(SfxToolsModule::Writer);
|
||||
sal_uInt16 nGroup = AddGroup(CuiResId(SID_SW_ONLINEOPTIONS_RES[0].first), pSwMod, pSwMod, SID_SW_ONLINEOPTIONS );
|
||||
for( size_t i = 1; i < std::size(SID_SW_ONLINEOPTIONS_RES); ++i )
|
||||
{
|
||||
nPageId = static_cast<sal_uInt16>(SID_SW_ONLINEOPTIONS_RES[i].second);
|
||||
sal_uInt16 nPageId = SID_SW_ONLINEOPTIONS_RES[i].second;
|
||||
if ( !lcl_isOptionHidden( nPageId, aOptionsDlgOpt ) )
|
||||
{
|
||||
if (!vPageId.empty())
|
||||
|
@ -1931,28 +1909,22 @@ void OfaTreeOptionsDialog::writerWebOptions(const std::vector<sal_uInt16>& vPage
|
|||
|
||||
void OfaTreeOptionsDialog::calcOptions(const std::vector<sal_uInt16>& vPageId)
|
||||
{
|
||||
sal_uInt16 nGroup = 0;
|
||||
SvtOptionsDialogOptions aOptionsDlgOpt;
|
||||
sal_uInt16 nPageId = 0;
|
||||
|
||||
OUString aFactory = getCurrentFactory_Impl( m_xFrame );
|
||||
DBG_ASSERT( GetModuleIdentifier( m_xFrame ) == aFactory, "This should not happen" );
|
||||
|
||||
SvtModuleOptions aModuleOpt;
|
||||
// Calc options
|
||||
if ( aModuleOpt.IsModuleInstalled( SvtModuleOptions::EModule::CALC ) )
|
||||
if (SvtModuleOptions().IsCalcInstalled())
|
||||
{
|
||||
OUString aFactory = getCurrentFactory_Impl(m_xFrame);
|
||||
DBG_ASSERT(GetModuleIdentifier(m_xFrame) == aFactory, "This should not happen");
|
||||
if ( aFactory == "com.sun.star.sheet.SpreadsheetDocument" )
|
||||
{
|
||||
SvtOptionsDialogOptions aOptionsDlgOpt;
|
||||
if ( !lcl_isOptionHidden( SID_SC_EDITOPTIONS, aOptionsDlgOpt ) )
|
||||
{
|
||||
SfxModule* pScMod = SfxApplication::GetModule( SfxToolsModule::Calc );
|
||||
setGroupName( u"Calc", CuiResId(SID_SC_EDITOPTIONS_RES[0].first) );
|
||||
nGroup = AddGroup( CuiResId(SID_SC_EDITOPTIONS_RES[0].first), pScMod, pScMod, SID_SC_EDITOPTIONS );
|
||||
const sal_uInt16 nCount = static_cast<sal_uInt16>(std::size(SID_SC_EDITOPTIONS_RES));
|
||||
for ( sal_uInt16 i = 1; i < nCount; ++i )
|
||||
sal_uInt16 nGroup = AddGroup( CuiResId(SID_SC_EDITOPTIONS_RES[0].first), pScMod, pScMod, SID_SC_EDITOPTIONS );
|
||||
for (size_t i = 1; i < std::size(SID_SC_EDITOPTIONS_RES); ++i)
|
||||
{
|
||||
nPageId = static_cast<sal_uInt16>(SID_SC_EDITOPTIONS_RES[i].second);
|
||||
sal_uInt16 nPageId = SID_SC_EDITOPTIONS_RES[i].second;
|
||||
if ( lcl_isOptionHidden( nPageId, aOptionsDlgOpt ) )
|
||||
continue;
|
||||
|
||||
|
@ -1971,28 +1943,22 @@ void OfaTreeOptionsDialog::calcOptions(const std::vector<sal_uInt16>& vPageId)
|
|||
|
||||
void OfaTreeOptionsDialog::impressOptions(const std::vector<sal_uInt16>& vPageId)
|
||||
{
|
||||
sal_uInt16 nGroup = 0;
|
||||
SvtOptionsDialogOptions aOptionsDlgOpt;
|
||||
sal_uInt16 nPageId = 0;
|
||||
|
||||
OUString aFactory = getCurrentFactory_Impl( m_xFrame );
|
||||
DBG_ASSERT( GetModuleIdentifier( m_xFrame ) == aFactory, "This should not happen" );
|
||||
SvtModuleOptions aModuleOpt;
|
||||
|
||||
// Impress options
|
||||
SfxModule* pSdMod = SfxApplication::GetModule( SfxToolsModule::Draw );
|
||||
if ( aModuleOpt.IsModuleInstalled( SvtModuleOptions::EModule::IMPRESS ) )
|
||||
if (SvtModuleOptions().IsImpressInstalled())
|
||||
{
|
||||
OUString aFactory = getCurrentFactory_Impl(m_xFrame);
|
||||
DBG_ASSERT(GetModuleIdentifier(m_xFrame) == aFactory, "This should not happen");
|
||||
if ( aFactory == "com.sun.star.presentation.PresentationDocument" )
|
||||
{
|
||||
SvtOptionsDialogOptions aOptionsDlgOpt;
|
||||
if ( !lcl_isOptionHidden( SID_SD_EDITOPTIONS, aOptionsDlgOpt ) )
|
||||
{
|
||||
SfxModule* pSdMod = SfxApplication::GetModule(SfxToolsModule::Draw);
|
||||
setGroupName( u"Impress", CuiResId(SID_SD_EDITOPTIONS_RES[0].first) );
|
||||
nGroup = AddGroup( CuiResId(SID_SD_EDITOPTIONS_RES[0].first), pSdMod, pSdMod, SID_SD_EDITOPTIONS );
|
||||
const sal_uInt16 nCount = static_cast<sal_uInt16>(std::size(SID_SD_EDITOPTIONS_RES));
|
||||
for ( sal_uInt16 i = 1; i < nCount; ++i )
|
||||
sal_uInt16 nGroup = AddGroup( CuiResId(SID_SD_EDITOPTIONS_RES[0].first), pSdMod, pSdMod, SID_SD_EDITOPTIONS );
|
||||
for (size_t i = 1; i < std::size(SID_SD_EDITOPTIONS_RES); ++i)
|
||||
{
|
||||
nPageId = static_cast<sal_uInt16>(SID_SD_EDITOPTIONS_RES[i].second);
|
||||
sal_uInt16 nPageId = SID_SD_EDITOPTIONS_RES[i].second;
|
||||
if ( lcl_isOptionHidden( nPageId, aOptionsDlgOpt ) )
|
||||
continue;
|
||||
|
||||
|
@ -2011,28 +1977,22 @@ void OfaTreeOptionsDialog::impressOptions(const std::vector<sal_uInt16>& vPageId
|
|||
|
||||
void OfaTreeOptionsDialog::drawOptions(const std::vector<sal_uInt16>& vPageId)
|
||||
{
|
||||
sal_uInt16 nGroup = 0;
|
||||
SvtOptionsDialogOptions aOptionsDlgOpt;
|
||||
sal_uInt16 nPageId = 0;
|
||||
|
||||
OUString aFactory = getCurrentFactory_Impl( m_xFrame );
|
||||
DBG_ASSERT( GetModuleIdentifier( m_xFrame ) == aFactory, "This should not happen" );
|
||||
SvtModuleOptions aModuleOpt;
|
||||
|
||||
// Draw options
|
||||
SfxModule* pSdMod = SfxApplication::GetModule(SfxToolsModule::Draw);
|
||||
if ( aModuleOpt.IsModuleInstalled( SvtModuleOptions::EModule::DRAW ) )
|
||||
if (SvtModuleOptions().IsDrawInstalled())
|
||||
{
|
||||
OUString aFactory = getCurrentFactory_Impl(m_xFrame);
|
||||
DBG_ASSERT(GetModuleIdentifier(m_xFrame) == aFactory, "This should not happen");
|
||||
if ( aFactory == "com.sun.star.drawing.DrawingDocument" )
|
||||
{
|
||||
SvtOptionsDialogOptions aOptionsDlgOpt;
|
||||
if ( !lcl_isOptionHidden( SID_SD_GRAPHIC_OPTIONS, aOptionsDlgOpt ) )
|
||||
{
|
||||
SfxModule* pSdMod = SfxApplication::GetModule(SfxToolsModule::Draw);
|
||||
setGroupName( u"Draw", CuiResId(SID_SD_GRAPHIC_OPTIONS_RES[0].first) );
|
||||
nGroup = AddGroup( CuiResId(SID_SD_GRAPHIC_OPTIONS_RES[0].first), pSdMod, pSdMod, SID_SD_GRAPHIC_OPTIONS );
|
||||
const sal_uInt16 nCount = static_cast<sal_uInt16>(std::size(SID_SD_GRAPHIC_OPTIONS_RES));
|
||||
for ( sal_uInt16 i = 1; i < nCount; ++i )
|
||||
sal_uInt16 nGroup = AddGroup( CuiResId(SID_SD_GRAPHIC_OPTIONS_RES[0].first), pSdMod, pSdMod, SID_SD_GRAPHIC_OPTIONS );
|
||||
for (size_t i = 1; i < std::size(SID_SD_GRAPHIC_OPTIONS_RES); ++i)
|
||||
{
|
||||
nPageId = static_cast<sal_uInt16>(SID_SD_GRAPHIC_OPTIONS_RES[i].second);
|
||||
sal_uInt16 nPageId = SID_SD_GRAPHIC_OPTIONS_RES[i].second;
|
||||
if ( lcl_isOptionHidden( nPageId, aOptionsDlgOpt ) )
|
||||
continue;
|
||||
|
||||
|
@ -2052,27 +2012,22 @@ void OfaTreeOptionsDialog::drawOptions(const std::vector<sal_uInt16>& vPageId)
|
|||
|
||||
void OfaTreeOptionsDialog::mathOptions(const std::vector<sal_uInt16>& vPageId)
|
||||
{
|
||||
sal_uInt16 nGroup = 0;
|
||||
SvtOptionsDialogOptions aOptionsDlgOpt;
|
||||
sal_uInt16 nPageId = 0;
|
||||
|
||||
OUString aFactory = getCurrentFactory_Impl( m_xFrame );
|
||||
DBG_ASSERT( GetModuleIdentifier( m_xFrame ) == aFactory, "This should not happen" );
|
||||
SvtModuleOptions aModuleOpt;
|
||||
|
||||
// Math options
|
||||
if ( aModuleOpt.IsModuleInstalled( SvtModuleOptions::EModule::MATH ) )
|
||||
if (SvtModuleOptions().IsMathInstalled())
|
||||
{
|
||||
OUString aFactory = getCurrentFactory_Impl(m_xFrame);
|
||||
DBG_ASSERT(GetModuleIdentifier(m_xFrame) == aFactory, "This should not happen");
|
||||
if ( aFactory == "com.sun.star.formula.FormulaProperties" )
|
||||
{
|
||||
SvtOptionsDialogOptions aOptionsDlgOpt;
|
||||
if ( !lcl_isOptionHidden( SID_SM_EDITOPTIONS, aOptionsDlgOpt ) )
|
||||
{
|
||||
SfxModule* pSmMod = SfxApplication::GetModule(SfxToolsModule::Math);
|
||||
setGroupName( u"Math", CuiResId(SID_SM_EDITOPTIONS_RES[0].first) );
|
||||
nGroup = AddGroup(CuiResId(SID_SM_EDITOPTIONS_RES[0].first), pSmMod, pSmMod, SID_SM_EDITOPTIONS );
|
||||
sal_uInt16 nGroup = AddGroup(CuiResId(SID_SM_EDITOPTIONS_RES[0].first), pSmMod, pSmMod, SID_SM_EDITOPTIONS );
|
||||
for ( size_t i = 1; i < std::size(SID_SM_EDITOPTIONS_RES); ++i )
|
||||
{
|
||||
nPageId = static_cast<sal_uInt16>(SID_SM_EDITOPTIONS_RES[i].second);
|
||||
sal_uInt16 nPageId = SID_SM_EDITOPTIONS_RES[i].second;
|
||||
if ( !lcl_isOptionHidden( nPageId, aOptionsDlgOpt ) )
|
||||
{
|
||||
if (!vPageId.empty())
|
||||
|
@ -2092,24 +2047,21 @@ void OfaTreeOptionsDialog::mathOptions(const std::vector<sal_uInt16>& vPageId)
|
|||
|
||||
void OfaTreeOptionsDialog::databaseOptions(const std::vector<sal_uInt16>& vPageId)
|
||||
{
|
||||
sal_uInt16 nGroup = 0;
|
||||
SvtOptionsDialogOptions aOptionsDlgOpt;
|
||||
sal_uInt16 nPageId = 0;
|
||||
|
||||
SvtModuleOptions aModuleOpt;
|
||||
|
||||
// Database - needed only if there is an application which integrates with databases
|
||||
if ( !lcl_isOptionHidden( SID_SB_STARBASEOPTIONS, aOptionsDlgOpt ) &&
|
||||
( aModuleOpt.IsModuleInstalled( SvtModuleOptions::EModule::DATABASE )
|
||||
|| aModuleOpt.IsModuleInstalled( SvtModuleOptions::EModule::WRITER )
|
||||
|| aModuleOpt.IsModuleInstalled( SvtModuleOptions::EModule::CALC )
|
||||
( aModuleOpt.IsDataBaseInstalled()
|
||||
|| aModuleOpt.IsWriterInstalled()
|
||||
|| aModuleOpt.IsCalcInstalled()
|
||||
) )
|
||||
{
|
||||
setGroupName( u"Base", CuiResId(SID_SB_STARBASEOPTIONS_RES[0].first) );
|
||||
nGroup = AddGroup( CuiResId(SID_SB_STARBASEOPTIONS_RES[0].first), nullptr, nullptr, SID_SB_STARBASEOPTIONS );
|
||||
sal_uInt16 nGroup = AddGroup( CuiResId(SID_SB_STARBASEOPTIONS_RES[0].first), nullptr, nullptr, SID_SB_STARBASEOPTIONS );
|
||||
for ( size_t i = 1; i < std::size(SID_SB_STARBASEOPTIONS_RES); ++i )
|
||||
{
|
||||
nPageId = static_cast<sal_uInt16>(SID_SB_STARBASEOPTIONS_RES[i].second);
|
||||
sal_uInt16 nPageId = SID_SB_STARBASEOPTIONS_RES[i].second;
|
||||
if ( !lcl_isOptionHidden( nPageId, aOptionsDlgOpt ) )
|
||||
{
|
||||
if (!vPageId.empty())
|
||||
|
@ -2126,17 +2078,15 @@ void OfaTreeOptionsDialog::databaseOptions(const std::vector<sal_uInt16>& vPageI
|
|||
|
||||
void OfaTreeOptionsDialog::chartOptions(const std::vector<sal_uInt16>& vPageId)
|
||||
{
|
||||
sal_uInt16 nGroup = 0;
|
||||
SvtOptionsDialogOptions aOptionsDlgOpt;
|
||||
sal_uInt16 nPageId = 0;
|
||||
|
||||
if ( !lcl_isOptionHidden( SID_SCH_EDITOPTIONS, aOptionsDlgOpt ) )
|
||||
{
|
||||
setGroupName( u"Charts", CuiResId(SID_SCH_EDITOPTIONS_RES[0].first) );
|
||||
nGroup = AddGroup( CuiResId(SID_SCH_EDITOPTIONS_RES[0].first), nullptr, nullptr, SID_SCH_EDITOPTIONS );
|
||||
sal_uInt16 nGroup = AddGroup( CuiResId(SID_SCH_EDITOPTIONS_RES[0].first), nullptr, nullptr, SID_SCH_EDITOPTIONS );
|
||||
for ( size_t i = 1; i < std::size(SID_SCH_EDITOPTIONS_RES); ++i )
|
||||
{
|
||||
nPageId = static_cast<sal_uInt16>(SID_SCH_EDITOPTIONS_RES[i].second);
|
||||
sal_uInt16 nPageId = SID_SCH_EDITOPTIONS_RES[i].second;
|
||||
if ( !lcl_isOptionHidden( nPageId, aOptionsDlgOpt ) )
|
||||
{
|
||||
if (!vPageId.empty())
|
||||
|
@ -2153,19 +2103,17 @@ void OfaTreeOptionsDialog::chartOptions(const std::vector<sal_uInt16>& vPageId)
|
|||
|
||||
void OfaTreeOptionsDialog::internetOptions(const std::vector<sal_uInt16>& vPageId)
|
||||
{
|
||||
sal_uInt16 nGroup = 0;
|
||||
SvtOptionsDialogOptions aOptionsDlgOpt;
|
||||
sal_uInt16 nPageId = 0;
|
||||
|
||||
if ( lcl_isOptionHidden( SID_INET_DLG, aOptionsDlgOpt ) )
|
||||
return;
|
||||
|
||||
setGroupName(u"Internet", CuiResId(SID_INET_DLG_RES[0].first));
|
||||
nGroup = AddGroup(CuiResId(SID_INET_DLG_RES[0].first), nullptr, nullptr, SID_INET_DLG );
|
||||
sal_uInt16 nGroup = AddGroup(CuiResId(SID_INET_DLG_RES[0].first), nullptr, nullptr, SID_INET_DLG );
|
||||
|
||||
for ( size_t i = 1; i < std::size(SID_INET_DLG_RES); ++i )
|
||||
{
|
||||
nPageId = static_cast<sal_uInt16>(SID_INET_DLG_RES[i].second);
|
||||
sal_uInt16 nPageId = SID_INET_DLG_RES[i].second;
|
||||
if ( lcl_isOptionHidden( nPageId, aOptionsDlgOpt ) )
|
||||
continue;
|
||||
#if defined(_WIN32)
|
||||
|
|
|
@ -392,6 +392,7 @@ SvxSlantTabPage::SvxSlantTabPage(weld::Container* pPage, weld::DialogController*
|
|||
m_aControlX[i] = m_xBuilder->weld_metric_spin_button("controlx" + OUString::number(i+1), FieldUnit::CM);
|
||||
m_aControlGroupY[i] = m_xBuilder->weld_widget("controlgroupy" + OUString::number(i+1));
|
||||
m_aControlY[i] = m_xBuilder->weld_metric_spin_button("controly" + OUString::number(i+1), FieldUnit::CM);
|
||||
m_aControlGroups[i]->set_sensitive(false);
|
||||
}
|
||||
|
||||
// this page needs ExchangeSupport
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
<property name="label-xalign">0</property>
|
||||
<property name="shadow-type">none</property>
|
||||
<child>
|
||||
<!-- n-columns=2 n-rows=11 -->
|
||||
<!-- n-columns=2 n-rows=10 -->
|
||||
<object class="GtkGrid" id="gdGeneral">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
|
@ -61,14 +61,12 @@
|
|||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkCheckButton" id="docboundaries">
|
||||
<object class="GtkLabel" id="docboundaries">
|
||||
<property name="label" translatable="yes" context="colorconfigwin|docboundaries">Text boundaries</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">True</property>
|
||||
<property name="receives-default">False</property>
|
||||
<property name="halign">start</property>
|
||||
<property name="valign">center</property>
|
||||
<property name="draw-indicator">True</property>
|
||||
<accessibility>
|
||||
<relation type="label-for" target="docboundaries_lb"/>
|
||||
</accessibility>
|
||||
|
@ -138,65 +136,19 @@
|
|||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkCheckButton" id="objboundaries">
|
||||
<property name="label" translatable="yes" context="colorconfigwin|objboundaries">Object boundaries</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">True</property>
|
||||
<property name="receives-default">False</property>
|
||||
<property name="halign">start</property>
|
||||
<property name="valign">center</property>
|
||||
<property name="draw-indicator">True</property>
|
||||
<accessibility>
|
||||
<relation type="label-for" target="objboundaries_lb"/>
|
||||
</accessibility>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left-attach">0</property>
|
||||
<property name="top-attach">3</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkMenuButton" id="objboundaries_lb">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">True</property>
|
||||
<property name="receives-default">False</property>
|
||||
<property name="halign">end</property>
|
||||
<property name="xalign">0</property>
|
||||
<property name="draw-indicator">True</property>
|
||||
<property name="label" translatable="no"></property>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<accessibility>
|
||||
<relation type="labelled-by" target="objboundaries"/>
|
||||
</accessibility>
|
||||
<child internal-child="accessible">
|
||||
<object class="AtkObject" id="objboundaries_lb-atkobject">
|
||||
<property name="AtkObject::accessible-name" translatable="yes" context="colorconfigwin|objboundaries_lb">Object boundaries color</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left-attach">1</property>
|
||||
<property name="top-attach">3</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkCheckButton" id="tblboundaries">
|
||||
<object class="GtkLabel" id="tblboundaries">
|
||||
<property name="label" translatable="yes" context="colorconfigwin|tblboundaries">Table boundaries</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">True</property>
|
||||
<property name="receives-default">False</property>
|
||||
<property name="halign">start</property>
|
||||
<property name="valign">center</property>
|
||||
<property name="draw-indicator">True</property>
|
||||
<accessibility>
|
||||
<relation type="label-for" target="tblboundaries_lb"/>
|
||||
</accessibility>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left-attach">0</property>
|
||||
<property name="top-attach">4</property>
|
||||
<property name="top-attach">3</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
|
@ -222,7 +174,7 @@
|
|||
</object>
|
||||
<packing>
|
||||
<property name="left-attach">1</property>
|
||||
<property name="top-attach">4</property>
|
||||
<property name="top-attach">3</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
|
@ -237,7 +189,7 @@
|
|||
</object>
|
||||
<packing>
|
||||
<property name="left-attach">0</property>
|
||||
<property name="top-attach">5</property>
|
||||
<property name="top-attach">4</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
|
@ -255,7 +207,7 @@
|
|||
</object>
|
||||
<packing>
|
||||
<property name="left-attach">1</property>
|
||||
<property name="top-attach">5</property>
|
||||
<property name="top-attach">4</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
|
@ -273,7 +225,7 @@
|
|||
</object>
|
||||
<packing>
|
||||
<property name="left-attach">0</property>
|
||||
<property name="top-attach">6</property>
|
||||
<property name="top-attach">5</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
|
@ -299,7 +251,7 @@
|
|||
</object>
|
||||
<packing>
|
||||
<property name="left-attach">1</property>
|
||||
<property name="top-attach">6</property>
|
||||
<property name="top-attach">5</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
|
@ -317,7 +269,7 @@
|
|||
</object>
|
||||
<packing>
|
||||
<property name="left-attach">0</property>
|
||||
<property name="top-attach">7</property>
|
||||
<property name="top-attach">6</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
|
@ -343,7 +295,7 @@
|
|||
</object>
|
||||
<packing>
|
||||
<property name="left-attach">1</property>
|
||||
<property name="top-attach">7</property>
|
||||
<property name="top-attach">6</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
|
@ -358,7 +310,7 @@
|
|||
</object>
|
||||
<packing>
|
||||
<property name="left-attach">0</property>
|
||||
<property name="top-attach">8</property>
|
||||
<property name="top-attach">7</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
|
@ -376,7 +328,7 @@
|
|||
</object>
|
||||
<packing>
|
||||
<property name="left-attach">1</property>
|
||||
<property name="top-attach">8</property>
|
||||
<property name="top-attach">7</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
|
@ -391,7 +343,7 @@
|
|||
</object>
|
||||
<packing>
|
||||
<property name="left-attach">0</property>
|
||||
<property name="top-attach">9</property>
|
||||
<property name="top-attach">8</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
|
@ -409,7 +361,7 @@
|
|||
</object>
|
||||
<packing>
|
||||
<property name="left-attach">1</property>
|
||||
<property name="top-attach">9</property>
|
||||
<property name="top-attach">8</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
|
@ -427,7 +379,7 @@
|
|||
</object>
|
||||
<packing>
|
||||
<property name="left-attach">0</property>
|
||||
<property name="top-attach">10</property>
|
||||
<property name="top-attach">9</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
|
@ -453,7 +405,7 @@
|
|||
</object>
|
||||
<packing>
|
||||
<property name="left-attach">1</property>
|
||||
<property name="top-attach">10</property>
|
||||
<property name="top-attach">9</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
|
@ -646,14 +598,12 @@
|
|||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkCheckButton" id="section">
|
||||
<object class="GtkLabel" id="section">
|
||||
<property name="label" translatable="yes" context="colorconfigwin|section">Section boundaries</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">True</property>
|
||||
<property name="receives-default">False</property>
|
||||
<property name="halign">start</property>
|
||||
<property name="valign">center</property>
|
||||
<property name="draw-indicator">True</property>
|
||||
<accessibility>
|
||||
<relation type="label-for" target="section_lb"/>
|
||||
</accessibility>
|
||||
|
|
|
@ -119,10 +119,6 @@
|
|||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="events">GDK_BUTTON_MOTION_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_STRUCTURE_MASK</property>
|
||||
<property name="margin-start">3</property>
|
||||
<property name="margin-end">3</property>
|
||||
<property name="margin_top">3</property>
|
||||
<property name="margin_bottom">3</property>
|
||||
<property name="hexpand">True</property>
|
||||
<property name="vexpand">True</property>
|
||||
</object>
|
||||
|
|
|
@ -234,10 +234,8 @@
|
|||
<property name="can-focus">False</property>
|
||||
<property name="label" translatable="yes" context="possizetabpage|FT_WIDTH">Wi_dth:</property>
|
||||
<property name="use-underline">True</property>
|
||||
<property name="mnemonic-widget">MTR_FLD_WIDTH</property>
|
||||
<property name="xalign">0</property>
|
||||
<accessibility>
|
||||
<relation type="label-for" target="MTR_FLD_WIDTH"/>
|
||||
</accessibility>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left-attach">0</property>
|
||||
|
@ -329,9 +327,6 @@
|
|||
<property name="truncate-multiline">True</property>
|
||||
<property name="adjustment">adjustmentSIZE</property>
|
||||
<property name="digits">2</property>
|
||||
<accessibility>
|
||||
<relation type="labelled-by" target="FT_WIDTH"/>
|
||||
</accessibility>
|
||||
<child internal-child="accessible">
|
||||
<object class="AtkObject" id="MTR_FLD_WIDTH-atkobject">
|
||||
<property name="AtkObject::accessible-description" translatable="yes" context="possizetabpage|extended_tip|MTR_FLD_WIDTH">Enter a width for the selected object.</property>
|
||||
|
@ -352,9 +347,6 @@
|
|||
<property name="truncate-multiline">True</property>
|
||||
<property name="adjustment">adjustmentSIZE1</property>
|
||||
<property name="digits">2</property>
|
||||
<accessibility>
|
||||
<relation type="labelled-by" target="FT_HEIGHT"/>
|
||||
</accessibility>
|
||||
<child internal-child="accessible">
|
||||
<object class="AtkObject" id="MTR_FLD_HEIGHT-atkobject">
|
||||
<property name="AtkObject::accessible-description" translatable="yes" context="possizetabpage|extended_tip|MTR_FLD_HEIGHT">Enter a height for the selected object.</property>
|
||||
|
@ -372,10 +364,8 @@
|
|||
<property name="can-focus">False</property>
|
||||
<property name="label" translatable="yes" context="possizetabpage|FT_HEIGHT">H_eight:</property>
|
||||
<property name="use-underline">True</property>
|
||||
<property name="mnemonic-widget">MTR_FLD_HEIGHT</property>
|
||||
<property name="xalign">0</property>
|
||||
<accessibility>
|
||||
<relation type="label-for" target="MTR_FLD_HEIGHT"/>
|
||||
</accessibility>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left-attach">0</property>
|
||||
|
|
|
@ -598,11 +598,10 @@ FeatureState OApplicationController::GetState(sal_uInt16 _nId) const
|
|||
case SID_NEWDOC:
|
||||
case SID_APP_NEW_FORM:
|
||||
case ID_DOCUMENT_CREATE_REPWIZ:
|
||||
aReturn.bEnabled = !isDataSourceReadOnly() && SvtModuleOptions().IsModuleInstalled(SvtModuleOptions::EModule::WRITER);
|
||||
aReturn.bEnabled = !isDataSourceReadOnly() && SvtModuleOptions().IsWriterInstalled();
|
||||
break;
|
||||
case SID_APP_NEW_REPORT:
|
||||
aReturn.bEnabled = !isDataSourceReadOnly()
|
||||
&& SvtModuleOptions().IsModuleInstalled(SvtModuleOptions::EModule::WRITER);
|
||||
aReturn.bEnabled = !isDataSourceReadOnly() && SvtModuleOptions().IsWriterInstalled();
|
||||
if ( aReturn.bEnabled )
|
||||
{
|
||||
Reference< XContentEnumerationAccess > xEnumAccess(m_xContext->getServiceManager(), UNO_QUERY);
|
||||
|
@ -670,7 +669,7 @@ FeatureState OApplicationController::GetState(sal_uInt16 _nId) const
|
|||
case SID_REPORT_CREATE_REPWIZ_PRE_SEL:
|
||||
case SID_APP_NEW_REPORT_PRE_SEL:
|
||||
aReturn.bEnabled = !isDataSourceReadOnly()
|
||||
&& SvtModuleOptions().IsModuleInstalled(SvtModuleOptions::EModule::WRITER)
|
||||
&& SvtModuleOptions().IsWriterInstalled()
|
||||
&& getContainer()->isALeafSelected();
|
||||
if ( aReturn.bEnabled )
|
||||
{
|
||||
|
|
|
@ -103,28 +103,18 @@ void ODocumentInfoPreview::fill(
|
|||
}
|
||||
}
|
||||
|
||||
m_xEditView->SetSelection(ESelection(0, 0, 0, 0));
|
||||
}
|
||||
|
||||
namespace
|
||||
{
|
||||
ESelection InsertAtEnd(const EditEngine& rEditEngine)
|
||||
{
|
||||
const sal_uInt32 nPara = rEditEngine.GetParagraphCount() -1;
|
||||
sal_Int32 nLastLen = rEditEngine.GetText(nPara).getLength();
|
||||
return ESelection(nPara, nLastLen, nPara, nLastLen);
|
||||
}
|
||||
m_xEditView->SetSelection(ESelection(0, 0));
|
||||
}
|
||||
|
||||
void ODocumentInfoPreview::insertEntry(
|
||||
std::u16string_view title, OUString const & value)
|
||||
{
|
||||
if (!m_xEditEngine->GetText().isEmpty()) {
|
||||
m_xEditEngine->QuickInsertText(u"\n\n"_ustr, InsertAtEnd(*m_xEditEngine));
|
||||
if (m_xEditEngine->HasText()) {
|
||||
m_xEditEngine->QuickInsertText(u"\n\n"_ustr, ESelection::AtEnd());
|
||||
}
|
||||
|
||||
OUString caption(OUString::Concat(title) + ":\n");
|
||||
m_xEditEngine->QuickInsertText(caption, InsertAtEnd(*m_xEditEngine));
|
||||
m_xEditEngine->QuickInsertText(caption, ESelection::AtEnd());
|
||||
|
||||
SfxItemSet aSet(m_xEditEngine->GetEmptyItemSet());
|
||||
aSet.Put(SvxWeightItem(WEIGHT_BOLD, EE_CHAR_WEIGHT));
|
||||
|
@ -133,7 +123,7 @@ void ODocumentInfoPreview::insertEntry(
|
|||
int nCaptionPara = m_xEditEngine->GetParagraphCount() - 2;
|
||||
m_xEditEngine->QuickSetAttribs(aSet, ESelection(nCaptionPara, 0, nCaptionPara, caption.getLength() - 1));
|
||||
|
||||
m_xEditEngine->QuickInsertText(value, InsertAtEnd(*m_xEditEngine));
|
||||
m_xEditEngine->QuickInsertText(value, ESelection::AtEnd());
|
||||
}
|
||||
|
||||
void ODocumentInfoPreview::insertNonempty(tools::Long id, OUString const & value)
|
||||
|
|
|
@ -203,7 +203,7 @@ void SQLEditView::UpdateData()
|
|||
{
|
||||
OUString aLine( rEditEngine.GetText( nLine ) );
|
||||
|
||||
ESelection aAllLine(nLine, 0, nLine, EE_TEXTPOS_ALL);
|
||||
ESelection aAllLine(nLine, 0, nLine, EE_TEXTPOS_MAX);
|
||||
rEditEngine.RemoveAttribs(aAllLine, false, EE_CHAR_COLOR);
|
||||
rEditEngine.RemoveAttribs(aAllLine, false, EE_CHAR_WEIGHT);
|
||||
rEditEngine.RemoveAttribs(aAllLine, false, EE_CHAR_WEIGHT_CJK);
|
||||
|
@ -234,8 +234,8 @@ void SQLEditView::UpdateData()
|
|||
void SQLEditView::DoBracketHilight(sal_uInt16 nKey)
|
||||
{
|
||||
ESelection aCurrentPos = m_xEditView->GetSelection();
|
||||
sal_Int32 nStartPos = aCurrentPos.nStartPos;
|
||||
const sal_uInt32 nStartPara = aCurrentPos.nStartPara;
|
||||
sal_Int32 nStartPos = aCurrentPos.start.nIndex;
|
||||
const sal_uInt32 nStartPara = aCurrentPos.start.nPara;
|
||||
sal_uInt16 nCount = 0;
|
||||
int nChar = -1;
|
||||
|
||||
|
@ -294,7 +294,7 @@ void SQLEditView::DoBracketHilight(sal_uInt16 nKey)
|
|||
aSet.Put(SvxWeightItem(WEIGHT_ULTRABOLD, EE_CHAR_WEIGHT_CTL));
|
||||
|
||||
m_xEditEngine->QuickSetAttribs(aSet, ESelection(nPara, i, nPara, i + 1));
|
||||
m_xEditEngine->QuickSetAttribs(aSet, ESelection(nStartPara, nStartPos, nStartPara, nStartPos));
|
||||
m_xEditEngine->QuickSetAttribs(aSet, ESelection(nStartPara, nStartPos));
|
||||
return;
|
||||
}
|
||||
else
|
||||
|
@ -415,11 +415,9 @@ bool SQLEditView::Command(const CommandEvent& rCEvt)
|
|||
pEditView->DeleteSelected();
|
||||
else if (sCommand == "selectall")
|
||||
{
|
||||
sal_Int32 nPar = m_xEditEngine->GetParagraphCount();
|
||||
if (nPar)
|
||||
if (m_xEditEngine->GetParagraphCount())
|
||||
{
|
||||
sal_Int32 nLen = m_xEditEngine->GetTextLen(nPar - 1);
|
||||
pEditView->SetSelection(ESelection(0, 0, nPar - 1, nLen));
|
||||
pEditView->SetSelection(ESelection::All());
|
||||
}
|
||||
}
|
||||
else if (sCommand == "specialchar")
|
||||
|
|
|
@ -507,7 +507,7 @@ void OSQLMessageBox::impl_addDetailsButton()
|
|||
if ( bMoreDetailsAvailable )
|
||||
{
|
||||
m_xDialog->add_button(GetStandardText(StandardButtonType::More), RET_MORE);
|
||||
m_xMoreButton.reset(m_xDialog->weld_widget_for_response(RET_MORE));
|
||||
m_xMoreButton = m_xDialog->weld_button_for_response(RET_MORE);
|
||||
m_xMoreButton->connect_clicked(LINK(this, OSQLMessageBox, ButtonClickHdl));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3677,9 +3677,10 @@ void DesktopLOKTest::testABI()
|
|||
CPPUNIT_ASSERT_EQUAL(documentClassOffset(75), offsetof(struct _LibreOfficeKitDocumentClass, createSlideRenderer));
|
||||
CPPUNIT_ASSERT_EQUAL(documentClassOffset(76), offsetof(struct _LibreOfficeKitDocumentClass, postSlideshowCleanup));
|
||||
CPPUNIT_ASSERT_EQUAL(documentClassOffset(77), offsetof(struct _LibreOfficeKitDocumentClass, renderNextSlideLayer));
|
||||
CPPUNIT_ASSERT_EQUAL(documentClassOffset(78), offsetof(struct _LibreOfficeKitDocumentClass, setViewOption));
|
||||
|
||||
// As above
|
||||
CPPUNIT_ASSERT_EQUAL(documentClassOffset(78), sizeof(struct _LibreOfficeKitDocumentClass));
|
||||
CPPUNIT_ASSERT_EQUAL(documentClassOffset(79), sizeof(struct _LibreOfficeKitDocumentClass));
|
||||
}
|
||||
|
||||
CPPUNIT_TEST_SUITE_REGISTRATION(DesktopLOKTest);
|
||||
|
|
|
@ -2177,13 +2177,13 @@ void Desktop::OpenClients()
|
|||
SvtModuleOptions aOpt;
|
||||
|
||||
// Support command line parameters to start a module (as preselection)
|
||||
if ( rArgs.IsWriter() && aOpt.IsModuleInstalled( SvtModuleOptions::EModule::WRITER ) )
|
||||
if (rArgs.IsWriter() && aOpt.IsWriterInstalled())
|
||||
aRequest.aModule = aOpt.GetFactoryName( SvtModuleOptions::EFactory::WRITER );
|
||||
else if ( rArgs.IsCalc() && aOpt.IsModuleInstalled( SvtModuleOptions::EModule::CALC ) )
|
||||
else if (rArgs.IsCalc() && aOpt.IsCalcInstalled())
|
||||
aRequest.aModule = aOpt.GetFactoryName( SvtModuleOptions::EFactory::CALC );
|
||||
else if ( rArgs.IsImpress() && aOpt.IsModuleInstalled( SvtModuleOptions::EModule::IMPRESS ) )
|
||||
else if (rArgs.IsImpress() && aOpt.IsImpressInstalled())
|
||||
aRequest.aModule= aOpt.GetFactoryName( SvtModuleOptions::EFactory::IMPRESS );
|
||||
else if ( rArgs.IsDraw() && aOpt.IsModuleInstalled( SvtModuleOptions::EModule::DRAW ) )
|
||||
else if (rArgs.IsDraw() && aOpt.IsDrawInstalled())
|
||||
aRequest.aModule= aOpt.GetFactoryName( SvtModuleOptions::EFactory::DRAW );
|
||||
}
|
||||
|
||||
|
@ -2230,21 +2230,21 @@ void Desktop::OpenDefault()
|
|||
if ( rArgs.HasModuleParam() )
|
||||
{
|
||||
// Support new command line parameters to start a module
|
||||
if ( rArgs.IsWriter() && aOpt.IsModuleInstalled( SvtModuleOptions::EModule::WRITER ) )
|
||||
if (rArgs.IsWriter() && aOpt.IsWriterInstalled())
|
||||
aName = aOpt.GetFactoryEmptyDocumentURL( SvtModuleOptions::EFactory::WRITER );
|
||||
else if ( rArgs.IsCalc() && aOpt.IsModuleInstalled( SvtModuleOptions::EModule::CALC ) )
|
||||
else if (rArgs.IsCalc() && aOpt.IsCalcInstalled())
|
||||
aName = aOpt.GetFactoryEmptyDocumentURL( SvtModuleOptions::EFactory::CALC );
|
||||
else if ( rArgs.IsImpress() && aOpt.IsModuleInstalled( SvtModuleOptions::EModule::IMPRESS ) )
|
||||
else if (rArgs.IsImpress() && aOpt.IsImpressInstalled())
|
||||
aName = aOpt.GetFactoryEmptyDocumentURL( SvtModuleOptions::EFactory::IMPRESS );
|
||||
else if ( rArgs.IsBase() && aOpt.IsModuleInstalled( SvtModuleOptions::EModule::DATABASE ) )
|
||||
else if (rArgs.IsBase() && aOpt.IsDataBaseInstalled())
|
||||
aName = aOpt.GetFactoryEmptyDocumentURL( SvtModuleOptions::EFactory::DATABASE );
|
||||
else if ( rArgs.IsDraw() && aOpt.IsModuleInstalled( SvtModuleOptions::EModule::DRAW ) )
|
||||
else if (rArgs.IsDraw() && aOpt.IsDrawInstalled())
|
||||
aName = aOpt.GetFactoryEmptyDocumentURL( SvtModuleOptions::EFactory::DRAW );
|
||||
else if ( rArgs.IsMath() && aOpt.IsModuleInstalled( SvtModuleOptions::EModule::MATH ) )
|
||||
else if (rArgs.IsMath() && aOpt.IsMathInstalled())
|
||||
aName = aOpt.GetFactoryEmptyDocumentURL( SvtModuleOptions::EFactory::MATH );
|
||||
else if ( rArgs.IsGlobal() && aOpt.IsModuleInstalled( SvtModuleOptions::EModule::WRITER ) )
|
||||
else if (rArgs.IsGlobal() && aOpt.IsModuleInstalled(SvtModuleOptions::EModule::GLOBAL))
|
||||
aName = aOpt.GetFactoryEmptyDocumentURL( SvtModuleOptions::EFactory::WRITERGLOBAL );
|
||||
else if ( rArgs.IsWeb() && aOpt.IsModuleInstalled( SvtModuleOptions::EModule::WRITER ) )
|
||||
else if (rArgs.IsWeb() && aOpt.IsModuleInstalled(SvtModuleOptions::EModule::WEB))
|
||||
aName = aOpt.GetFactoryEmptyDocumentURL( SvtModuleOptions::EFactory::WRITERWEB );
|
||||
}
|
||||
|
||||
|
@ -2257,15 +2257,15 @@ void Desktop::OpenDefault()
|
|||
}
|
||||
|
||||
// Old way to create a default document
|
||||
if ( aOpt.IsModuleInstalled( SvtModuleOptions::EModule::WRITER ) )
|
||||
if (aOpt.IsWriterInstalled())
|
||||
aName = aOpt.GetFactoryEmptyDocumentURL( SvtModuleOptions::EFactory::WRITER );
|
||||
else if ( aOpt.IsModuleInstalled( SvtModuleOptions::EModule::CALC ) )
|
||||
else if (aOpt.IsCalcInstalled())
|
||||
aName = aOpt.GetFactoryEmptyDocumentURL( SvtModuleOptions::EFactory::CALC );
|
||||
else if ( aOpt.IsModuleInstalled( SvtModuleOptions::EModule::IMPRESS ) )
|
||||
else if (aOpt.IsImpressInstalled())
|
||||
aName = aOpt.GetFactoryEmptyDocumentURL( SvtModuleOptions::EFactory::IMPRESS );
|
||||
else if ( aOpt.IsModuleInstalled( SvtModuleOptions::EModule::DATABASE ) )
|
||||
else if (aOpt.IsDataBaseInstalled())
|
||||
aName = aOpt.GetFactoryEmptyDocumentURL( SvtModuleOptions::EFactory::DATABASE );
|
||||
else if ( aOpt.IsModuleInstalled( SvtModuleOptions::EModule::DRAW ) )
|
||||
else if (aOpt.IsDrawInstalled())
|
||||
aName = aOpt.GetFactoryEmptyDocumentURL( SvtModuleOptions::EFactory::DRAW );
|
||||
else
|
||||
return;
|
||||
|
|
|
@ -1089,13 +1089,13 @@ bool IpcThread::process(OString const & arguments, bool * waitProcessed) {
|
|||
SvtModuleOptions aOpt;
|
||||
|
||||
// Support command line parameters to start a module (as preselection)
|
||||
if ( aCmdLineArgs->IsWriter() && aOpt.IsModuleInstalled( SvtModuleOptions::EModule::WRITER ) )
|
||||
if (aCmdLineArgs->IsWriter() && aOpt.IsWriterInstalled())
|
||||
pRequest->aModule = aOpt.GetFactoryName( SvtModuleOptions::EFactory::WRITER );
|
||||
else if ( aCmdLineArgs->IsCalc() && aOpt.IsModuleInstalled( SvtModuleOptions::EModule::CALC ) )
|
||||
else if (aCmdLineArgs->IsCalc() && aOpt.IsCalcInstalled())
|
||||
pRequest->aModule = aOpt.GetFactoryName( SvtModuleOptions::EFactory::CALC );
|
||||
else if ( aCmdLineArgs->IsImpress() && aOpt.IsModuleInstalled( SvtModuleOptions::EModule::IMPRESS ) )
|
||||
else if (aCmdLineArgs->IsImpress() && aOpt.IsImpressInstalled())
|
||||
pRequest->aModule= aOpt.GetFactoryName( SvtModuleOptions::EFactory::IMPRESS );
|
||||
else if ( aCmdLineArgs->IsDraw() && aOpt.IsModuleInstalled( SvtModuleOptions::EModule::DRAW ) )
|
||||
else if (aCmdLineArgs->IsDraw() && aOpt.IsDrawInstalled())
|
||||
pRequest->aModule= aOpt.GetFactoryName( SvtModuleOptions::EFactory::DRAW );
|
||||
}
|
||||
|
||||
|
|
|
@ -433,6 +433,7 @@ void ExtensionBox_Impl::DrawRow(vcl::RenderContext& rRenderContext, const tools:
|
|||
auto aTextHeight = rRenderContext.GetTextHeight();
|
||||
|
||||
// Get max title width
|
||||
// coverity[ tainted_data_return : FALSE ] version 2023.12.2
|
||||
auto nMaxTitleWidth = rRect.GetWidth() - ICON_OFFSET;
|
||||
nMaxTitleWidth -= (2 * SMALL_ICON_SIZE) + (4 * SPACE_BETWEEN);
|
||||
rRenderContext.SetFont(aStdFont);
|
||||
|
|
|
@ -106,6 +106,8 @@
|
|||
#include <com/sun/star/lang/XComponent.hpp>
|
||||
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
|
||||
#include <com/sun/star/style/XStyleFamiliesSupplier.hpp>
|
||||
#include <com/sun/star/util/thePathSettings.hpp>
|
||||
#include <com/sun/star/util/PathSubstitution.hpp>
|
||||
#include <com/sun/star/util/URLTransformer.hpp>
|
||||
#include <com/sun/star/util/XFlushable.hpp>
|
||||
#include <com/sun/star/configuration/theDefaultProvider.hpp>
|
||||
|
@ -1337,6 +1339,8 @@ static void doc_postSlideshowCleanup(LibreOfficeKitDocument* pThis);
|
|||
static bool doc_renderNextSlideLayer(
|
||||
LibreOfficeKitDocument* pThis, unsigned char* pBuffer, bool* bIsBitmapLayer, char** pJsonMsg);
|
||||
|
||||
static void doc_setViewOption(LibreOfficeKitDocument* pDoc, const char* pOption, const char* pValue);
|
||||
|
||||
} // extern "C"
|
||||
|
||||
namespace {
|
||||
|
@ -1357,6 +1361,10 @@ rtl::Reference<LOKClipboard> forceSetClipboardForCurrentView(LibreOfficeKitDocum
|
|||
{
|
||||
ITiledRenderable* pDoc = getTiledRenderable(pThis);
|
||||
rtl::Reference<LOKClipboard> xClip(LOKClipboardFactory::getClipboardForCurView());
|
||||
if (!pDoc)
|
||||
{
|
||||
return xClip;
|
||||
}
|
||||
|
||||
SAL_INFO("lok", "Set to clipboard for view " << xClip.get());
|
||||
// FIXME: using a hammer here - should not be necessary if all tests used createView.
|
||||
|
@ -1538,6 +1546,7 @@ LibLODocument_Impl::LibLODocument_Impl(uno::Reference <css::lang::XComponent> xC
|
|||
m_pDocumentClass->createSlideRenderer = doc_createSlideRenderer;
|
||||
m_pDocumentClass->postSlideshowCleanup = doc_postSlideshowCleanup;
|
||||
m_pDocumentClass->renderNextSlideLayer = doc_renderNextSlideLayer;
|
||||
m_pDocumentClass->setViewOption = doc_setViewOption;
|
||||
|
||||
gDocumentClass = m_pDocumentClass;
|
||||
}
|
||||
|
@ -4327,6 +4336,7 @@ static void doc_setPartMode(LibreOfficeKitDocument* pThis,
|
|||
// TODO: we could be clever and e.g. set to 0 when we change to/from
|
||||
// embedded object mode, and not when changing between slide/notes/combined
|
||||
// modes?
|
||||
// TODO: Also now see ViewShellBase::setEditMode for a similar case
|
||||
if ( nCurrentPart < pDoc->getParts() )
|
||||
{
|
||||
pDoc->setPart( nCurrentPart );
|
||||
|
@ -5274,9 +5284,9 @@ static void lo_setOption(LibreOfficeKit* /*pThis*/, const char *pOption, const c
|
|||
|
||||
SolarMutexGuard aGuard;
|
||||
OutputDevice *pDevice = Application::GetDefaultDevice();
|
||||
OutputDevice::ImplClearAllFontData(false);
|
||||
OutputDevice::ImplClearAllFontData(true);
|
||||
pDevice->AddTempDevFont(sMagicFileName, u""_ustr);
|
||||
OutputDevice::ImplRefreshAllFontData(false);
|
||||
OutputDevice::ImplRefreshAllFontData(true);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
@ -5776,6 +5786,11 @@ static bool doc_renderNextSlideLayer(
|
|||
return bDone;
|
||||
}
|
||||
|
||||
static void doc_setViewOption(LibreOfficeKitDocument* /*pDoc*/, const char* /*pOption*/, const char* /*pValue*/)
|
||||
{
|
||||
// placeholder for now
|
||||
}
|
||||
|
||||
static bool getFromTransferable(
|
||||
const css::uno::Reference<css::datatransfer::XTransferable> &xTransferable,
|
||||
const OString &aInMimeType, OString &aRet);
|
||||
|
@ -7953,10 +7968,6 @@ static void preloadData()
|
|||
static SvtSysLocaleOptions aSvtSysLocaleOptions;
|
||||
static SvtUserOptions aSvtUserOptions;
|
||||
//static SvtViewOptions aSvtViewOptions;
|
||||
static MouseSettings aMouseSettings;
|
||||
static StyleSettings aStyleSettings;
|
||||
static MiscSettings aMiscSettings;
|
||||
static HelpSettings aHelpSettings;
|
||||
static AllSettings aAllSettings;
|
||||
#if defined __GNUC__ || defined __clang__
|
||||
#pragma GCC diagnostic pop
|
||||
|
@ -7981,6 +7992,9 @@ static void preloadData()
|
|||
|
||||
// Set user profile's path back to the original one
|
||||
rtl::Bootstrap::set(u"UserInstallation"_ustr, sUserPath);
|
||||
|
||||
// Note that unotools::Bootstrap has initialized from the temp UserInstallation at this point
|
||||
// see Bootstrap::reloadData for when it gets resynced
|
||||
}
|
||||
|
||||
namespace {
|
||||
|
@ -8172,29 +8186,6 @@ static int lo_initialize(LibreOfficeKit* pThis, const char* pAppPath, const char
|
|||
if (eStage != PRE_INIT)
|
||||
comphelper::LibreOfficeKit::setStatusIndicatorCallback(lo_status_indicator_callback, pLib);
|
||||
|
||||
if (pUserProfileUrl && eStage != PRE_INIT)
|
||||
{
|
||||
OUString url(
|
||||
pUserProfileUrl, strlen(pUserProfileUrl), RTL_TEXTENCODING_UTF8);
|
||||
OUString path;
|
||||
if (url.startsWithIgnoreAsciiCase("vnd.sun.star.pathname:", &path))
|
||||
{
|
||||
OUString url2;
|
||||
osl::FileBase::RC e = osl::FileBase::getFileURLFromSystemPath(
|
||||
path, url2);
|
||||
if (e == osl::FileBase::E_None)
|
||||
url = url2;
|
||||
else
|
||||
SAL_WARN("lok", "resolving <" << url << "> failed with " << +e);
|
||||
}
|
||||
rtl::Bootstrap::set(u"UserInstallation"_ustr, url);
|
||||
if (eStage == SECOND_INIT)
|
||||
{
|
||||
comphelper::rng::reseed();
|
||||
utl::Bootstrap::reloadData();
|
||||
}
|
||||
}
|
||||
|
||||
OUString aAppPath;
|
||||
if (pAppPath)
|
||||
{
|
||||
|
@ -8226,6 +8217,48 @@ static int lo_initialize(LibreOfficeKit* pThis, const char* pAppPath, const char
|
|||
if (osl::FileBase::getFileURLFromSystemPath(aAppPath, aAppURL) != osl::FileBase::E_None)
|
||||
return 0;
|
||||
|
||||
if (pUserProfileUrl && eStage != PRE_INIT)
|
||||
{
|
||||
OUString url(
|
||||
pUserProfileUrl, strlen(pUserProfileUrl), RTL_TEXTENCODING_UTF8);
|
||||
OUString path;
|
||||
if (url.startsWithIgnoreAsciiCase("vnd.sun.star.pathname:", &path))
|
||||
{
|
||||
OUString url2;
|
||||
osl::FileBase::RC e = osl::FileBase::getFileURLFromSystemPath(
|
||||
path, url2);
|
||||
if (e == osl::FileBase::E_None)
|
||||
url = url2;
|
||||
else
|
||||
SAL_WARN("lok", "resolving <" << url << "> failed with " << +e);
|
||||
}
|
||||
|
||||
rtl::Bootstrap::set(u"UserInstallation"_ustr, url);
|
||||
rtl::Bootstrap::set(u"BRAND_BASE_DIR"_ustr, aAppURL + "/..");
|
||||
if (eStage == SECOND_INIT)
|
||||
{
|
||||
comphelper::rng::reseed();
|
||||
|
||||
utl::Bootstrap::reloadData();
|
||||
|
||||
// Now that bootstrap User/Shared installation paths have been (re)set to the final
|
||||
// location, reinitialize the PathSubstitution rules and PathSettings so that
|
||||
// $(userurl)/$(instdir) path variables will be expanded using these newly set
|
||||
// paths and not the paths detected during preinit which used unorthodox throwaway
|
||||
// temp locations
|
||||
|
||||
// First reinitialize the PathSubstitution rules
|
||||
uno::Reference<css::util::XStringSubstitution> xPathSubst(util::PathSubstitution::create(xContext));
|
||||
uno::Reference<lang::XInitialization> xReInitSubstitution(xPathSubst, uno::UNO_QUERY_THROW);
|
||||
xReInitSubstitution->initialize({});
|
||||
|
||||
// PathSettings depend on PathSubstitution rules
|
||||
uno::Reference<css::util::XPathSettings> xPathSettings = util::thePathSettings::get(xContext);
|
||||
uno::Reference<lang::XInitialization> xReInitSettings(xPathSettings, uno::UNO_QUERY_THROW);
|
||||
xReInitSettings->initialize({});
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef IOS
|
||||
// A LibreOffice-using iOS app should have the ICU data file in the app bundle. Initialize ICU
|
||||
// to use that.
|
||||
|
|
|
@ -516,6 +516,7 @@ static ProgressStatus read_percent(ChildInfo const *info, int *pPercent)
|
|||
memmove(pBuffer, pNext, nNotProcessed);
|
||||
|
||||
/* read data */
|
||||
// coverity[ tainted_data_return : FALSE ] version 2023.12.2
|
||||
ssize_t nThisRead = read(child_info_get_status_fd(info),
|
||||
pBuffer + nNotProcessed, BUFFER_LEN - nNotProcessed);
|
||||
|
||||
|
|
|
@ -25,6 +25,7 @@
|
|||
--without-system-frozen
|
||||
--without-system-glm
|
||||
--without-system-gpgmepp
|
||||
--without-system-java-websocket
|
||||
--without-system-jfreereport
|
||||
--without-system-libabw
|
||||
--without-system-libatomic_ops
|
||||
|
|
28
download.lst
28
download.lst
|
@ -48,8 +48,8 @@ CAIRO_TARBALL := cairo-1.17.$(CAIRO_VERSION_MICRO).tar.xz
|
|||
# three static lines
|
||||
# so that git cherry-pick
|
||||
# will not run into conflicts
|
||||
CDR_SHA256SUM := 5666249d613466b9aa1e987ea4109c04365866e9277d80f6cd9663e86b8ecdd4
|
||||
CDR_TARBALL := libcdr-0.1.7.tar.xz
|
||||
CDR_SHA256SUM := ced677c8300b29c91d3004bb1dddf0b99761bf5544991c26c2ee8f427e87193c
|
||||
CDR_TARBALL := libcdr-0.1.8.tar.xz
|
||||
# three static lines
|
||||
# so that git cherry-pick
|
||||
# will not run into conflicts
|
||||
|
@ -108,8 +108,8 @@ EPUBGEN_TARBALL := libepubgen-0.1.1.tar.xz
|
|||
# three static lines
|
||||
# so that git cherry-pick
|
||||
# will not run into conflicts
|
||||
ETONYEK_SHA256SUM := b430435a6e8487888b761dc848b7981626eb814884963ffe25eb26a139301e9a
|
||||
ETONYEK_VERSION_MICRO := 10
|
||||
ETONYEK_SHA256SUM := b9fa82fbeb8cb7a701101060e4f3e1e4ef7c38f574b2859d3ecbe43604c21f83
|
||||
ETONYEK_VERSION_MICRO := 12
|
||||
ETONYEK_TARBALL := libetonyek-0.1.$(ETONYEK_VERSION_MICRO).tar.xz
|
||||
# three static lines
|
||||
# so that git cherry-pick
|
||||
|
@ -170,13 +170,13 @@ FONT_NOTO_KUFI_ARABIC_TARBALL := NotoKufiArabic-v2.109.zip
|
|||
# three static lines
|
||||
# so that git cherry-pick
|
||||
# will not run into conflicts
|
||||
FONT_NOTO_SANS_SHA256SUM := 1dffbaf31a0a699ee2c57dfb60c1a628010425301dd076cfb485adbe017352c1
|
||||
FONT_NOTO_SANS_TARBALL := NotoSans-v2.014.zip
|
||||
FONT_NOTO_SANS_SHA256SUM := 0c34df072a3fa7efbb7cbf34950e1f971a4447cffe365d3a359e2d4089b958f5
|
||||
FONT_NOTO_SANS_TARBALL := NotoSans-v2.015.zip
|
||||
# three static lines
|
||||
# so that git cherry-pick
|
||||
# will not run into conflicts
|
||||
FONT_NOTO_SERIF_SHA256SUM := 6abce0a80df4ef6d5a944d60c81099364481d6a7015b0721d87bc4c16acc1fd3
|
||||
FONT_NOTO_SERIF_TARBALL := NotoSerif-v2.014.zip
|
||||
FONT_NOTO_SERIF_SHA256SUM := 0e9a43c8a4b94ac76f55069ed1d7385bbcaf6b99527a94deb5619e032b7e76c1
|
||||
FONT_NOTO_SERIF_TARBALL := NotoSerif-v2.015.zip
|
||||
# three static lines
|
||||
# so that git cherry-pick
|
||||
# will not run into conflicts
|
||||
|
@ -397,8 +397,8 @@ LIBJPEG_TURBO_TARBALL := libjpeg-turbo-2.1.5.1.tar.gz
|
|||
# three static lines
|
||||
# so that git cherry-pick
|
||||
# will not run into conflicts
|
||||
LANGTAGREG_SHA256SUM := 75bc394dd83ddfd62b172a462db1b66bdb5950f40823ed63b8c7db6b71e37e75
|
||||
LANGTAGREG_TARBALL := language-subtag-registry-2024-06-14.tar.bz2
|
||||
LANGTAGREG_SHA256SUM := 121f27bd1fabac9a74fb042cf68396b6df74cdf5d1ccc30f4c9b78584cc13864
|
||||
LANGTAGREG_TARBALL := language-subtag-registry-2024-11-19.tar.bz2
|
||||
# three static lines
|
||||
# so that git cherry-pick
|
||||
# will not run into conflicts
|
||||
|
@ -541,8 +541,8 @@ ONLINEUPDATE_TARBALL := onlineupdate-c003be8b9727672e7d30972983b375f4c200233f-2.
|
|||
# three static lines
|
||||
# so that git cherry-pick
|
||||
# will not run into conflicts
|
||||
OPENLDAP_SHA256SUM := 48969323e94e3be3b03c6a132942dcba7ef8d545f2ad35401709019f696c3c4e
|
||||
OPENLDAP_TARBALL := openldap-2.6.8.tgz
|
||||
OPENLDAP_SHA256SUM := 2cb7dc73e9c8340dff0d99357fbaa578abf30cc6619f0521972c555681e6b2ff
|
||||
OPENLDAP_TARBALL := openldap-2.6.9.tgz
|
||||
# three static lines
|
||||
# so that git cherry-pick
|
||||
# will not run into conflicts
|
||||
|
@ -588,8 +588,8 @@ POPPLER_DATA_TARBALL := poppler-data-0.4.12.tar.gz
|
|||
# three static lines
|
||||
# so that git cherry-pick
|
||||
# will not run into conflicts
|
||||
POSTGRESQL_SHA256SUM := 84727fbccdbd1efe01d8de64bc1b33095db773ad2457cefcedc2d8258ebc09d6
|
||||
POSTGRESQL_TARBALL := postgresql-14.14.tar.bz2
|
||||
POSTGRESQL_SHA256SUM := 02e891e314b4e9ee24cbd78028dab7c73f9c1ba3e30835bcbef71fe220401fc5
|
||||
POSTGRESQL_TARBALL := postgresql-14.15.tar.bz2
|
||||
# three static lines
|
||||
# so that git cherry-pick
|
||||
# will not run into conflicts
|
||||
|
|
|
@ -48,12 +48,6 @@ constexpr OUStringLiteral g_PropertyName_UseAntiAliasing = u"UseAntiAliasing";
|
|||
constexpr OUStringLiteral g_PropertyName_PixelSnapHairline = u"PixelSnapHairline";
|
||||
}
|
||||
|
||||
namespace
|
||||
{
|
||||
bool bForwardsAreInitialized(false);
|
||||
bool bForwardPixelSnapHairline(true);
|
||||
}
|
||||
|
||||
class ImpViewInformation2D
|
||||
{
|
||||
private:
|
||||
|
@ -123,8 +117,13 @@ public:
|
|||
, mbEditViewActive(false)
|
||||
, mbReducedDisplayQuality(false)
|
||||
, mbUseAntiAliasing(ViewInformation2D::getGlobalAntiAliasing())
|
||||
, mbPixelSnapHairline(mbUseAntiAliasing && bForwardPixelSnapHairline)
|
||||
{
|
||||
if (comphelper::IsFuzzing())
|
||||
mbPixelSnapHairline = false;
|
||||
else
|
||||
mbPixelSnapHairline
|
||||
= mbUseAntiAliasing
|
||||
&& officecfg::Office::Common::Drawinglayer::SnapHorVerLinesToDiscrete::get();
|
||||
}
|
||||
|
||||
const basegfx::B2DHomMatrix& getObjectTransformation() const { return maObjectTransformation; }
|
||||
|
@ -250,18 +249,11 @@ ViewInformation2D::ImplType& theGlobalDefault()
|
|||
ViewInformation2D::ViewInformation2D()
|
||||
: mpViewInformation2D(theGlobalDefault())
|
||||
{
|
||||
if (!bForwardsAreInitialized)
|
||||
{
|
||||
bForwardsAreInitialized = true;
|
||||
if (!comphelper::IsFuzzing())
|
||||
{
|
||||
bForwardPixelSnapHairline
|
||||
= officecfg::Office::Common::Drawinglayer::SnapHorVerLinesToDiscrete::get();
|
||||
}
|
||||
}
|
||||
|
||||
setUseAntiAliasing(ViewInformation2D::getGlobalAntiAliasing());
|
||||
setPixelSnapHairline(bForwardPixelSnapHairline);
|
||||
if (!comphelper::IsFuzzing())
|
||||
setPixelSnapHairline(
|
||||
getUseAntiAliasing()
|
||||
&& officecfg::Office::Common::Drawinglayer::SnapHorVerLinesToDiscrete::get());
|
||||
}
|
||||
|
||||
ViewInformation2D::ViewInformation2D(const ViewInformation2D&) = default;
|
||||
|
@ -427,11 +419,6 @@ void ViewInformation2D::setGlobalAntiAliasing(bool bAntiAliasing, bool bTemporar
|
|||
}
|
||||
bool ViewInformation2D::getGlobalAntiAliasing() { return globalAntiAliasing(); }
|
||||
|
||||
void ViewInformation2D::forwardPixelSnapHairline(bool bPixelSnapHairline)
|
||||
{
|
||||
bForwardPixelSnapHairline = bPixelSnapHairline;
|
||||
}
|
||||
|
||||
ViewInformation2D
|
||||
createViewInformation2D(const css::uno::Sequence<css::beans::PropertyValue>& rViewParameters)
|
||||
{
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue