sc/inc/sc.hrc | 38 ++++++------- sc/source/ui/cctrl/checklistmenu.cxx | 18 ++---- sc/source/ui/cctrl/checklistmenu.src | 14 +--- sc/source/ui/navipi/navipi.cxx | 8 +- sc/source/ui/navipi/navipi.src | 24 ++++---- sc/source/ui/pagedlg/pagedlg.hrc | 5 - sc/source/ui/pagedlg/pagedlg.src | 17 +++-- sc/source/ui/pagedlg/tptable.cxx | 2 sc/source/ui/sidebar/CellAppearancePropertyPanel.cxx | 20 +++--- sc/source/ui/sidebar/CellAppearancePropertyPanel.src | 49 ++++++++++------- sc/source/ui/xmlsource/xmlsourcedlg.cxx | 6 +- uui/source/iahndl-ssl.cxx | 23 +++++-- vcl/headless/svpgdi.cxx | 2 xmlsecurity/source/xmlsec/nss/sanextension_nssimpl.cxx | 46 +++++++-------- xmlsecurity/source/xmlsec/nss/sanextension_nssimpl.hxx | 3 - 15 files changed, 139 insertions(+), 136 deletions(-)
New commits: commit 4e9cfc178c47893229f8030bfe73e2b7c5de92c3 Author: Caolán McNamara <caol...@redhat.com> Date: Thu Jan 19 10:01:25 2017 +0000 Resolves: tdf#105416 blank windows under HiDPI RTL Change-Id: I819f06babd448c37ce2d58297562b640aba1c8c6 diff --git a/vcl/headless/svpgdi.cxx b/vcl/headless/svpgdi.cxx index de5596f..9828147 100644 --- a/vcl/headless/svpgdi.cxx +++ b/vcl/headless/svpgdi.cxx @@ -409,7 +409,7 @@ sal_uInt16 SvpSalGraphics::GetBitCount() const long SvpSalGraphics::GetGraphicsWidth() const { - return m_pSurface ? cairo_image_surface_get_width(m_pSurface) : 0; + return m_pSurface ? cairo_image_surface_get_width(m_pSurface) / m_fScale : 0; } void SvpSalGraphics::ResetClipRegion() commit f0421b64cb66709b09ef836129cdf77ccd60243e Author: Caolán McNamara <caol...@redhat.com> Date: Thu Jan 19 09:38:10 2017 +0000 sc: load BitmapEx resources instead of Image ones Change-Id: If10ae4238a580ab6d19287968aecbf29acbd550e diff --git a/sc/inc/sc.hrc b/sc/inc/sc.hrc index 98053e5..3bd2e75 100644 --- a/sc/inc/sc.hrc +++ b/sc/inc/sc.hrc @@ -994,25 +994,25 @@ #define BMP_START (STR_END) // navigator -#define RID_IMG_DROP_URL (BMP_START + 2) -#define RID_IMG_DROP_LINK (BMP_START + 3) -#define RID_IMG_DROP_COPY (BMP_START + 4) -#define RID_IMG_SELECT_CURRENT (BMP_START + 8) -#define RID_IMG_UNSELECT_CURRENT (BMP_START + 9) - -#define IMG_CELL_BORDER (BMP_START + 10) -#define IMG_LINE_STYLE1 (BMP_START + 11) -#define IMG_LINE_STYLE2 (BMP_START + 12) -#define IMG_LINE_STYLE3 (BMP_START + 13) -#define IMG_LINE_STYLE4 (BMP_START + 14) -#define IMG_LINE_STYLE5 (BMP_START + 15) -#define IMG_LINE_STYLE6 (BMP_START + 16) -#define IMG_LINE_STYLE7 (BMP_START + 17) -#define IMG_LINE_STYLE8 (BMP_START + 18) -#define IMG_LINE_STYLE9 (BMP_START + 19) -#define IMG_ELEMENT_DEFAULT (BMP_START + 20) -#define IMG_ELEMENT_REPEAT (BMP_START + 21) -#define IMG_ELEMENT_ATTRIBUTE (BMP_START + 22) +#define RID_BMP_DROP_URL (BMP_START + 2) +#define RID_BMP_DROP_LINK (BMP_START + 3) +#define RID_BMP_DROP_COPY (BMP_START + 4) +#define RID_BMP_SELECT_CURRENT (BMP_START + 8) +#define RID_BMP_UNSELECT_CURRENT (BMP_START + 9) + +#define RID_BMP_CELL_BORDER (BMP_START + 10) +#define RID_BMP_LINE_STYLE1 (BMP_START + 11) +#define RID_BMP_LINE_STYLE2 (BMP_START + 12) +#define RID_BMP_LINE_STYLE3 (BMP_START + 13) +#define RID_BMP_LINE_STYLE4 (BMP_START + 14) +#define RID_BMP_LINE_STYLE5 (BMP_START + 15) +#define RID_BMP_LINE_STYLE6 (BMP_START + 16) +#define RID_BMP_LINE_STYLE7 (BMP_START + 17) +#define RID_BMP_LINE_STYLE8 (BMP_START + 18) +#define RID_BMP_LINE_STYLE9 (BMP_START + 19) +#define RID_BMP_ELEMENT_DEFAULT (BMP_START + 20) +#define RID_BMP_ELEMENT_REPEAT (BMP_START + 21) +#define RID_BMP_ELEMENT_ATTRIBUTE (BMP_START + 22) #define RID_BMP_LEVEL1 (BMP_START + 23) #define RID_BMP_LEVEL2 (BMP_START + 24) #define RID_BMP_LEVEL3 (BMP_START + 25) diff --git a/sc/source/ui/cctrl/checklistmenu.cxx b/sc/source/ui/cctrl/checklistmenu.cxx index d32ac8b..d997653 100644 --- a/sc/source/ui/cctrl/checklistmenu.cxx +++ b/sc/source/ui/cctrl/checklistmenu.cxx @@ -1096,13 +1096,10 @@ void ScCheckListMenuWindow::packWindow() float fScaleFactor = GetDPIScaleFactor(); - Image aSingleSelect(ScResId(RID_IMG_SELECT_CURRENT)); + BitmapEx aSingleSelectBmp(ScResId(RID_BMP_SELECT_CURRENT)); if (fScaleFactor > 1) - { - BitmapEx aBitmap = aSingleSelect.GetBitmapEx(); - aBitmap.Scale(fScaleFactor, fScaleFactor, BmpScaleFlag::Fast); - aSingleSelect = Image(aBitmap); - } + aSingleSelectBmp.Scale(fScaleFactor, fScaleFactor, BmpScaleFlag::Fast); + Image aSingleSelect(aSingleSelectBmp); getSectionPosSize(aPos, aSize, BTN_SINGLE_SELECT); maBtnSelectSingle->SetPosSizePixel(aPos, aSize); @@ -1111,13 +1108,10 @@ void ScCheckListMenuWindow::packWindow() maBtnSelectSingle->SetClickHdl( LINK(this, ScCheckListMenuWindow, ButtonHdl) ); maBtnSelectSingle->Show(); - Image aSingleUnselect(ScResId(RID_IMG_UNSELECT_CURRENT)); + BitmapEx aSingleUnselectBmp(ScResId(RID_BMP_UNSELECT_CURRENT)); if (fScaleFactor > 1) - { - BitmapEx aBitmap = aSingleUnselect.GetBitmapEx(); - aBitmap.Scale(fScaleFactor, fScaleFactor, BmpScaleFlag::Fast); - aSingleUnselect = Image(aBitmap); - } + aSingleUnselectBmp.Scale(fScaleFactor, fScaleFactor, BmpScaleFlag::Fast); + Image aSingleUnselect(aSingleUnselectBmp); getSectionPosSize(aPos, aSize, BTN_SINGLE_UNSELECT); maBtnUnselectSingle->SetPosSizePixel(aPos, aSize); diff --git a/sc/source/ui/cctrl/checklistmenu.src b/sc/source/ui/cctrl/checklistmenu.src index 59c8eb09..55323c0 100644 --- a/sc/source/ui/cctrl/checklistmenu.src +++ b/sc/source/ui/cctrl/checklistmenu.src @@ -57,20 +57,14 @@ Resource RID_POPUP_FILTER }; }; -Image RID_IMG_SELECT_CURRENT +Bitmap RID_BMP_SELECT_CURRENT { - ImageBitmap = Bitmap - { - File = "popup_select_current.png"; - }; + File = "popup_select_current.png"; }; -Image RID_IMG_UNSELECT_CURRENT +Bitmap RID_BMP_UNSELECT_CURRENT { - ImageBitmap = Bitmap - { - File = "popup_unselect_current.png"; - }; + File = "popup_unselect_current.png"; }; /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/navipi/navipi.cxx b/sc/source/ui/navipi/navipi.cxx index 0d17bbb..6e3be2e 100644 --- a/sc/source/ui/navipi/navipi.cxx +++ b/sc/source/ui/navipi/navipi.cxx @@ -396,16 +396,16 @@ void ScNavigatorDlg::UpdateButtons() switch (nDropMode) { case SC_DROPMODE_URL: - nImageId = RID_IMG_DROP_URL; + nImageId = RID_BMP_DROP_URL; break; case SC_DROPMODE_LINK: - nImageId = RID_IMG_DROP_LINK; + nImageId = RID_BMP_DROP_LINK; break; case SC_DROPMODE_COPY: - nImageId = RID_IMG_DROP_COPY; + nImageId = RID_BMP_DROP_COPY; break; } - aTbxCmd->SetItemImage(nDragModeId, Image(ScResId(nImageId))); + aTbxCmd->SetItemImage(nDragModeId, Image(BitmapEx(ScResId(nImageId)))); } ScNavigatorSettings::ScNavigatorSettings() diff --git a/sc/source/ui/navipi/navipi.src b/sc/source/ui/navipi/navipi.src index 58a9370..6dd01b9 100644 --- a/sc/source/ui/navipi/navipi.src +++ b/sc/source/ui/navipi/navipi.src @@ -59,34 +59,34 @@ Bitmap RID_BMP_CONTENT_DRAWING File = "nc08.png"; }; -Image RID_IMG_DROP_URL +Bitmap RID_BMP_DROP_URL { - ImageBitmap = Bitmap { File = "dropurl.png" ; }; + File = "dropurl.png"; }; -Image RID_IMG_DROP_LINK +Bitmap RID_BMP_DROP_LINK { - ImageBitmap = Bitmap { File = "droplink.png" ; }; + File = "droplink.png"; }; -Image RID_IMG_DROP_COPY +Bitmap RID_BMP_DROP_COPY { - ImageBitmap = Bitmap { File = "dropcopy.png" ; }; + File = "dropcopy.png"; }; -Image IMG_ELEMENT_DEFAULT +Bitmap RID_BMP_ELEMENT_DEFAULT { - ImageBitmap = Bitmap { File = "xml_element.png" ; }; + File = "xml_element.png"; }; -Image IMG_ELEMENT_REPEAT +Bitmap RID_BMP_ELEMENT_REPEAT { - ImageBitmap = Bitmap { File = "xml_element_repeat.png" ; }; + File = "xml_element_repeat.png"; }; -Image IMG_ELEMENT_ATTRIBUTE +Bitmap RID_BMP_ELEMENT_ATTRIBUTE { - ImageBitmap = Bitmap { File = "xml_attribute.png" ; }; + File = "xml_attribute.png"; }; // content description strings are also used in ScLinkTargetsObj diff --git a/sc/source/ui/pagedlg/pagedlg.hrc b/sc/source/ui/pagedlg/pagedlg.hrc index 67fdbe3..6798b8e 100644 --- a/sc/source/ui/pagedlg/pagedlg.hrc +++ b/sc/source/ui/pagedlg/pagedlg.hrc @@ -18,11 +18,10 @@ */ #include "sc.hrc" - // -> RID_SCPAGE_AREAS // TabPage: Tabelle -#define IMG_LEFTRIGHT (SC_DIALOGS_START + 43 + 23) -#define IMG_TOPDOWN (SC_DIALOGS_START + 43 + 24) +#define BMP_LEFTRIGHT (SC_DIALOGS_START + 43 + 23) +#define BMP_TOPDOWN (SC_DIALOGS_START + 43 + 24) /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/pagedlg/pagedlg.src b/sc/source/ui/pagedlg/pagedlg.src index e26d0db..16972ce 100644 --- a/sc/source/ui/pagedlg/pagedlg.src +++ b/sc/source/ui/pagedlg/pagedlg.src @@ -18,13 +18,14 @@ */ #include "pagedlg.hrc" -Image IMG_LEFTRIGHT - { - ImageBitmap = Bitmap { File = "lftrgt.png" ; }; - }; -Image IMG_TOPDOWN - { - ImageBitmap = Bitmap { File = "topdown.png" ; }; - }; +Bitmap BMP_LEFTRIGHT +{ + File = "lftrgt.png"; +}; + +Bitmap BMP_TOPDOWN +{ + File = "topdown.png"; +}; /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/pagedlg/tptable.cxx b/sc/source/ui/pagedlg/tptable.cxx index 1ea9e0f..fb1ad78 100644 --- a/sc/source/ui/pagedlg/tptable.cxx +++ b/sc/source/ui/pagedlg/tptable.cxx @@ -117,7 +117,7 @@ ScTablePage::ScTablePage( vcl::Window* pParent, const SfxItemSet& rCoreAttrs ) : void ScTablePage::ShowImage() { - Image aImg = Image( ScResId( (m_pBtnLeftRight->IsChecked()) ? IMG_LEFTRIGHT : IMG_TOPDOWN ) ); + Image aImg(BitmapEx(ScResId((m_pBtnLeftRight->IsChecked()) ? BMP_LEFTRIGHT : BMP_TOPDOWN))); m_pBmpPageDir->SetImage( aImg ); m_pBmpPageDir->SetOutputSizePixel( aImg.GetSizePixel() ); } diff --git a/sc/source/ui/sidebar/CellAppearancePropertyPanel.cxx b/sc/source/ui/sidebar/CellAppearancePropertyPanel.cxx index de3023d..071bc98 100644 --- a/sc/source/ui/sidebar/CellAppearancePropertyPanel.cxx +++ b/sc/source/ui/sidebar/CellAppearancePropertyPanel.cxx @@ -58,16 +58,16 @@ CellAppearancePropertyPanel::CellAppearancePropertyPanel( maBorderTLBRControl(SID_ATTR_BORDER_DIAG_TLBR, *pBindings, *this), maBorderBLTRControl(SID_ATTR_BORDER_DIAG_BLTR, *pBindings, *this), - maIMGCellBorder(ScResId(IMG_CELL_BORDER)), - maIMGLineStyle1(ScResId(IMG_LINE_STYLE1)), - maIMGLineStyle2(ScResId(IMG_LINE_STYLE2)), - maIMGLineStyle3(ScResId(IMG_LINE_STYLE3)), - maIMGLineStyle4(ScResId(IMG_LINE_STYLE4)), - maIMGLineStyle5(ScResId(IMG_LINE_STYLE5)), - maIMGLineStyle6(ScResId(IMG_LINE_STYLE6)), - maIMGLineStyle7(ScResId(IMG_LINE_STYLE7)), - maIMGLineStyle8(ScResId(IMG_LINE_STYLE8)), - maIMGLineStyle9(ScResId(IMG_LINE_STYLE9)), + maIMGCellBorder(BitmapEx(ScResId(RID_BMP_CELL_BORDER))), + maIMGLineStyle1(BitmapEx(ScResId(RID_BMP_LINE_STYLE1))), + maIMGLineStyle2(BitmapEx(ScResId(RID_BMP_LINE_STYLE2))), + maIMGLineStyle3(BitmapEx(ScResId(RID_BMP_LINE_STYLE3))), + maIMGLineStyle4(BitmapEx(ScResId(RID_BMP_LINE_STYLE4))), + maIMGLineStyle5(BitmapEx(ScResId(RID_BMP_LINE_STYLE5))), + maIMGLineStyle6(BitmapEx(ScResId(RID_BMP_LINE_STYLE6))), + maIMGLineStyle7(BitmapEx(ScResId(RID_BMP_LINE_STYLE7))), + maIMGLineStyle8(BitmapEx(ScResId(RID_BMP_LINE_STYLE8))), + maIMGLineStyle9(BitmapEx(ScResId(RID_BMP_LINE_STYLE9))), mnIn(0), mnOut(0), diff --git a/sc/source/ui/sidebar/CellAppearancePropertyPanel.src b/sc/source/ui/sidebar/CellAppearancePropertyPanel.src index f1be009..bedb801 100644 --- a/sc/source/ui/sidebar/CellAppearancePropertyPanel.src +++ b/sc/source/ui/sidebar/CellAppearancePropertyPanel.src @@ -20,45 +20,54 @@ #include "sc.hrc" #include "helpids.h" -Image IMG_CELL_BORDER +Bitmap RID_BMP_CELL_BORDER { - ImageBitmap = Bitmap{File = "sidebar/CellBorder.png";}; + File = "sidebar/CellBorder.png"; }; -Image IMG_LINE_STYLE1 + +Bitmap RID_BMP_LINE_STYLE1 { - ImageBitmap = Bitmap{File = "sidebar/CellBorderLineStyle_005.png";}; + File = "sidebar/CellBorderLineStyle_005.png"; }; -Image IMG_LINE_STYLE2 + +Bitmap RID_BMP_LINE_STYLE2 { - ImageBitmap = Bitmap{File = "sidebar/CellBorderLineStyle_250.png";}; + File = "sidebar/CellBorderLineStyle_250.png"; }; -Image IMG_LINE_STYLE3 + +Bitmap RID_BMP_LINE_STYLE3 { - ImageBitmap = Bitmap{File = "sidebar/CellBorderLineStyle_400.png";}; + File = "sidebar/CellBorderLineStyle_400.png"; }; -Image IMG_LINE_STYLE4 + +Bitmap RID_BMP_LINE_STYLE4 { - ImageBitmap = Bitmap{File = "sidebar/CellBorderLineStyle_500.png";}; + File = "sidebar/CellBorderLineStyle_500.png"; }; -Image IMG_LINE_STYLE5 + +Bitmap RID_BMP_LINE_STYLE5 { - ImageBitmap = Bitmap{File = "sidebar/CellBorderLineStyle_110.png";}; + File = "sidebar/CellBorderLineStyle_110.png"; }; -Image IMG_LINE_STYLE6 + +Bitmap RID_BMP_LINE_STYLE6 { - ImageBitmap = Bitmap{File = "sidebar/CellBorderLineStyle_260.png";}; + File = "sidebar/CellBorderLineStyle_260.png"; }; -Image IMG_LINE_STYLE7 + +Bitmap RID_BMP_LINE_STYLE7 { - ImageBitmap = Bitmap{File = "sidebar/CellBorderLineStyle_450.png";}; + File = "sidebar/CellBorderLineStyle_450.png"; }; -Image IMG_LINE_STYLE8 + +Bitmap RID_BMP_LINE_STYLE8 { - ImageBitmap = Bitmap{File = "sidebar/CellBorderLineStyle_505.png";}; + File = "sidebar/CellBorderLineStyle_505.png"; }; -Image IMG_LINE_STYLE9 + +Bitmap RID_BMP_LINE_STYLE9 { - ImageBitmap = Bitmap{File = "sidebar/CellBorderLineStyle_750.png";}; + File = "sidebar/CellBorderLineStyle_750.png"; }; // cell border style popup diff --git a/sc/source/ui/xmlsource/xmlsourcedlg.cxx b/sc/source/ui/xmlsource/xmlsourcedlg.cxx index 8b8c4461..d643879 100644 --- a/sc/source/ui/xmlsource/xmlsourcedlg.cxx +++ b/sc/source/ui/xmlsource/xmlsourcedlg.cxx @@ -90,9 +90,9 @@ ScXMLSourceDlg::ScXMLSourceDlg( mpActiveEdit = mpRefEdit; - maXMLParam.maImgElementDefault = Image(ScResId(IMG_ELEMENT_DEFAULT)); - maXMLParam.maImgElementRepeat = Image(ScResId(IMG_ELEMENT_REPEAT)); - maXMLParam.maImgAttribute = Image(ScResId(IMG_ELEMENT_ATTRIBUTE)); + maXMLParam.maImgElementDefault = Image(BitmapEx(ScResId(RID_BMP_ELEMENT_DEFAULT))); + maXMLParam.maImgElementRepeat = Image(BitmapEx(ScResId(RID_BMP_ELEMENT_REPEAT))); + maXMLParam.maImgAttribute = Image(BitmapEx(ScResId(RID_BMP_ELEMENT_ATTRIBUTE))); Link<Button*,void> aBtnHdl = LINK(this, ScXMLSourceDlg, BtnPressedHdl); mpBtnSelectSource->SetClickHdl(aBtnHdl); commit f6572fa96c300be282a410d9e11f0cae7049547f Author: Caolán McNamara <caol...@redhat.com> Date: Thu Jan 19 09:01:27 2017 +0000 tweak to avoid coverity#1371169 Missing move assignment operator Change-Id: I0d29ce18c19c26a7526dad98d77db4670d0c5303 diff --git a/uui/source/iahndl-ssl.cxx b/uui/source/iahndl-ssl.cxx index 20688f7..aa31496 100644 --- a/uui/source/iahndl-ssl.cxx +++ b/uui/source/iahndl-ssl.cxx @@ -28,6 +28,7 @@ #include <com/sun/star/ucb/CertificateValidationRequest.hpp> #include <com/sun/star/uno/Reference.hxx> +#include <comphelper/sequence.hxx> #include <osl/mutex.hxx> #include <com/sun/star/uno/Sequence.hxx> #include <svl/zforlist.hxx> @@ -272,27 +273,33 @@ handleCertificateValidationRequest_( } uno::Sequence< uno::Reference< security::XCertificateExtension > > extensions = rRequest.Certificate->getExtensions(); - uno::Sequence< security::CertAltNameEntry > altNames; - for (sal_Int32 i = 0 ; i < extensions.getLength(); i++){ + uno::Reference< security::XSanExtension > sanExtension; + for (sal_Int32 i = 0 ; i < extensions.getLength(); ++i) + { uno::Reference< security::XCertificateExtension >element = extensions[i]; - OString aId ( reinterpret_cast<const char *>(element->getExtensionId().getConstArray()), element->getExtensionId().getLength()); if (aId.equals(OID_SUBJECT_ALTERNATIVE_NAME)) { - uno::Reference< security::XSanExtension > sanExtension ( element, uno::UNO_QUERY ); - altNames = sanExtension->getAlternativeNames(); + sanExtension = uno::Reference<security::XSanExtension>(element, uno::UNO_QUERY); break; } } + std::vector<security::CertAltNameEntry> altNames; + if (sanExtension.is()) + { + altNames = comphelper::sequenceToContainer<std::vector<security::CertAltNameEntry>>(sanExtension->getAlternativeNames()); + } + OUString certHostName = getContentPart( rRequest.Certificate->getSubjectName() ); - uno::Sequence< OUString > certHostNames(altNames.getLength() + 1); + uno::Sequence< OUString > certHostNames(altNames.size() + 1); certHostNames[0] = certHostName; - for(int n = 0; n < altNames.getLength(); ++n) + for (size_t n = 0; n < altNames.size(); ++n) { - if (altNames[n].Type == security::ExtAltNameType_DNS_NAME){ + if (altNames[n].Type == security::ExtAltNameType_DNS_NAME) + { altNames[n].Value >>= certHostNames[n+1]; } } diff --git a/xmlsecurity/source/xmlsec/nss/sanextension_nssimpl.cxx b/xmlsecurity/source/xmlsec/nss/sanextension_nssimpl.cxx index 5e61463..fc0e05e 100644 --- a/xmlsecurity/source/xmlsec/nss/sanextension_nssimpl.cxx +++ b/xmlsecurity/source/xmlsec/nss/sanextension_nssimpl.cxx @@ -58,9 +58,9 @@ namespace { } //Methods from XSanExtension -css::uno::Sequence< css::security::CertAltNameEntry > SAL_CALL SanExtensionImpl::getAlternativeNames() throw( css::uno::RuntimeException, std::exception ){ - - if (!m_Entries.hasElements()) +css::uno::Sequence< css::security::CertAltNameEntry > SAL_CALL SanExtensionImpl::getAlternativeNames() throw( css::uno::RuntimeException, std::exception ) +{ + if (m_Entries.empty()) { SECItem item; @@ -73,18 +73,18 @@ css::uno::Sequence< css::security::CertAltNameEntry > SAL_CALL SanExtensionImpl: arena = PORT_NewArena(DER_DEFAULT_CHUNKSIZE); if (!arena) - return m_Entries; + return css::uno::Sequence<css::security::CertAltNameEntry>(); nameList = CERT_DecodeAltNameExtension(arena, &item); CERTGeneralName* current = nameList; int size = GetNamesLength(nameList); - std::vector<CertAltNameEntry> arrCertAltNameEntry(size); - for(int i = 0; i < size ; i++){ + m_Entries.resize(size); + for(int i = 0; i < size; ++i){ switch (current->type) { case certOtherName: { - arrCertAltNameEntry[i].Type = ExtAltNameType_OTHER_NAME; + m_Entries[i].Type = ExtAltNameType_OTHER_NAME; css::beans::PropertyValue otherNameProp; otherNameProp.Name = OUString::createFromAscii(CERT_GetOidString(¤t->name.OthName.oid)); @@ -94,64 +94,62 @@ css::uno::Sequence< css::security::CertAltNameEntry > SAL_CALL SanExtensionImpl: otherNameProp.Value <<= otherName; - arrCertAltNameEntry[i].Value <<= otherNameProp; + m_Entries[i].Value <<= otherNameProp; break; } case certRFC822Name: - arrCertAltNameEntry[i].Type = ExtAltNameType_RFC822_NAME; - arrCertAltNameEntry[i].Value <<= OUString(reinterpret_cast<char*>(current->name.other.data), current->name.other.len, RTL_TEXTENCODING_ASCII_US); + m_Entries[i].Type = ExtAltNameType_RFC822_NAME; + m_Entries[i].Value <<= OUString(reinterpret_cast<char*>(current->name.other.data), current->name.other.len, RTL_TEXTENCODING_ASCII_US); break; case certDNSName: - arrCertAltNameEntry[i].Type = ExtAltNameType_DNS_NAME; - arrCertAltNameEntry[i].Value <<= OUString(reinterpret_cast<char*>(current->name.other.data), current->name.other.len, RTL_TEXTENCODING_ASCII_US); + m_Entries[i].Type = ExtAltNameType_DNS_NAME; + m_Entries[i].Value <<= OUString(reinterpret_cast<char*>(current->name.other.data), current->name.other.len, RTL_TEXTENCODING_ASCII_US); break; case certX400Address: { // unsupported - arrCertAltNameEntry[i].Type = ExtAltNameType_X400_ADDRESS; + m_Entries[i].Type = ExtAltNameType_X400_ADDRESS; break; } case certDirectoryName: { // unsupported - arrCertAltNameEntry[i].Type = ExtAltNameType_DIRECTORY_NAME; + m_Entries[i].Type = ExtAltNameType_DIRECTORY_NAME; break; } case certEDIPartyName: { // unsupported - arrCertAltNameEntry[i].Type = ExtAltNameType_EDI_PARTY_NAME; + m_Entries[i].Type = ExtAltNameType_EDI_PARTY_NAME; break; } case certURI: - arrCertAltNameEntry[i].Type = ExtAltNameType_URL; - arrCertAltNameEntry[i].Value <<= OUString(reinterpret_cast<char*>(current->name.other.data), current->name.other.len, RTL_TEXTENCODING_ASCII_US); + m_Entries[i].Type = ExtAltNameType_URL; + m_Entries[i].Value <<= OUString(reinterpret_cast<char*>(current->name.other.data), current->name.other.len, RTL_TEXTENCODING_ASCII_US); break; case certIPAddress: { - arrCertAltNameEntry[i].Type = ExtAltNameType_IP_ADDRESS; + m_Entries[i].Type = ExtAltNameType_IP_ADDRESS; Sequence< sal_Int8 > ipAddress( current->name.other.len ) ; for( unsigned int r = 0; r < current->name.other.len ; r ++ ) ipAddress[r] = *( current->name.other.data + r ) ; - arrCertAltNameEntry[i].Value <<= ipAddress; + m_Entries[i].Value <<= ipAddress; break; } case certRegisterID: - arrCertAltNameEntry[i].Type = ExtAltNameType_REGISTERED_ID; + m_Entries[i].Type = ExtAltNameType_REGISTERED_ID; OString nssOid = OString(CERT_GetOidString(¤t->name.other)); OString unoOid = removeOIDFromString(nssOid); - arrCertAltNameEntry[i].Value <<= OStringToOUString( unoOid, RTL_TEXTENCODING_ASCII_US ); + m_Entries[i].Value <<= OStringToOUString( unoOid, RTL_TEXTENCODING_ASCII_US ); break; } current = CERT_GetNextGeneralName(current); } - m_Entries = ::comphelper::containerToSequence<css::security::CertAltNameEntry>(arrCertAltNameEntry); - PORT_FreeArena(arena, PR_FALSE); } - return m_Entries; + return comphelper::containerToSequence<css::security::CertAltNameEntry>(m_Entries); } OString SanExtensionImpl::removeOIDFromString( const OString &oidString) diff --git a/xmlsecurity/source/xmlsec/nss/sanextension_nssimpl.hxx b/xmlsecurity/source/xmlsec/nss/sanextension_nssimpl.hxx index ca74018..df81eee 100644 --- a/xmlsecurity/source/xmlsec/nss/sanextension_nssimpl.hxx +++ b/xmlsecurity/source/xmlsec/nss/sanextension_nssimpl.hxx @@ -30,13 +30,14 @@ #include <com/sun/star/security/XSanExtension.hpp> #include <com/sun/star/security/CertAltNameEntry.hpp> #include "certificateextension_certextn.hxx" +#include <vector> class SanExtensionImpl : public ::cppu::WeakImplHelper< css::security::XSanExtension > { private: CertificateExtension_CertExtn m_Extn; - css::uno::Sequence< css::security::CertAltNameEntry > m_Entries; + std::vector<css::security::CertAltNameEntry> m_Entries; static OString removeOIDFromString( const OString &oid);
_______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits