[Libreoffice-commits] core.git: cui/source cui/uiconfig extras/source include/svx svx/source
cui/source/dialogs/cuigaldlg.cxx | 232 ++--- cui/source/inc/cuigaldlg.hxx | 42 ++-- cui/uiconfig/ui/galleryfilespage.ui| 88 +++-- extras/source/glade/libreoffice-catalog.xml.in |3 include/svx/galctrl.hxx| 21 ++ svx/source/gallery2/galctrl.cxx| 86 + 6 files changed, 288 insertions(+), 184 deletions(-) New commits: commit 62623f7604df0437316c101803098760f4fe4651 Author: Caolán McNamara AuthorDate: Wed Nov 28 16:52:14 2018 + Commit: Caolán McNamara CommitDate: Thu Nov 29 09:52:26 2018 +0100 weld GalleryFilesPage Change-Id: I5fa399144fb12bb19c3b88bf99f99dad6a64e052 Reviewed-on: https://gerrit.libreoffice.org/64188 Tested-by: Jenkins Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara diff --git a/cui/source/dialogs/cuigaldlg.cxx b/cui/source/dialogs/cuigaldlg.cxx index aacb1f37ff89..f2eeb836e15c 100644 --- a/cui/source/dialogs/cuigaldlg.cxx +++ b/cui/source/dialogs/cuigaldlg.cxx @@ -73,31 +73,29 @@ SearchThread::SearchThread( SearchProgress* pProgress, { } - SearchThread::~SearchThread() { } - void SearchThread::execute() { -const OUString aFileType( mpBrowser->m_pCbbFileType->GetText() ); +const OUString aFileType(mpBrowser->m_xCbbFileType->get_active_text()); -if( !aFileType.isEmpty() ) +if (!aFileType.isEmpty()) { -const sal_Int32 nFileNumber = mpBrowser->m_pCbbFileType->GetEntryPos( aFileType ); +const int nFileNumber = mpBrowser->m_xCbbFileType->find_text(aFileType); sal_Int32 nBeginFormat, nEndFormat; std::vector< OUString > aFormats; -if( !nFileNumber || ( nFileNumber >= mpBrowser->m_pCbbFileType->GetEntryCount() ) ) +if( !nFileNumber || nFileNumber == -1) { nBeginFormat = 1; -nEndFormat = mpBrowser->m_pCbbFileType->GetEntryCount() - 1; +nEndFormat = mpBrowser->m_xCbbFileType->get_count() - 1; } else nBeginFormat = nEndFormat = nFileNumber; -for( sal_Int32 i = nBeginFormat; i <= nEndFormat; ++i ) +for (sal_Int32 i = nBeginFormat; i <= nEndFormat; ++i) aFormats.push_back( mpBrowser->aFilterEntryList[ i ]->aFilterName.toAsciiLowerCase() ); ImplSearch( maStartURL, aFormats, mpBrowser->bSearchRecursive ); @@ -171,9 +169,9 @@ void SearchThread::ImplSearch( const INetURLObject& rStartURL, mpBrowser->aFoundList.push_back( aFoundURL.GetMainURL( INetURLObject::DecodeMechanism::NONE ) ); -mpBrowser->m_pLbxFound->InsertEntry( -GetReducedString( aFoundURL, 50 ), - static_cast(mpBrowser->aFoundList.size()) - 1 ); +mpBrowser->m_xLbxFound->insert_text( +mpBrowser->aFoundList.size() - 1, +GetReducedString(aFoundURL, 50)); } } } @@ -279,16 +277,24 @@ void TakeThread::execute() GalleryTheme* pThm = mpBrowser->GetXChgData()->pTheme; std::unique_ptr pStatusProgress; +std::vector aSelectedRows; + { SolarMutexGuard aGuard; pStatusProgress.reset(new GalleryProgress); -nEntries = mpBrowser->bTakeAll ? mpBrowser->m_pLbxFound->GetEntryCount() : mpBrowser->m_pLbxFound->GetSelectedEntryCount(); +if (mpBrowser->bTakeAll) +nEntries = mpBrowser->m_xLbxFound->n_children(); +else +{ +aSelectedRows = mpBrowser->m_xLbxFound->get_selected_rows(); +nEntries = aSelectedRows.size(); +} pThm->LockBroadcaster(); } for( sal_Int32 i = 0; i < nEntries && schedule(); ++i ) { -const sal_Int32 nPos = mpBrowser->bTakeAll ? i : mpBrowser->m_pLbxFound->GetSelectedEntryPos( i ); +const sal_Int32 nPos = mpBrowser->bTakeAll ? i : aSelectedRows[i]; const INetURLObject aURL( mpBrowser->aFoundList[ nPos ]); mrTakenList.push_back( static_cast(nPos) ); @@ -359,8 +365,8 @@ IMPL_LINK_NOARG(TakeProgress, CleanUpHdl, void*, void) sal_uInt32 i, nCount; GetParent()->EnterWait(); -pBrowser->m_pLbxFound->SetUpdateMode( false ); -pBrowser->m_pLbxFound->SetNoSelection(); +pBrowser->m_xLbxFound->select(-1); +pBrowser->m_xLbxFound->freeze(); // mark all taken positions in aRemoveEntries for( i = 0, nCount = maTakenList.size(); i < nCount; ++i ) @@ -382,17 +388,17 @@ IMPL_LINK_NOARG(TakeProgress, CleanUpHdl, void*, void) // refill list box for( i = 0, nCount = aRemoveEntries.size(); i < nCount; ++i ) if( !aRemoveEntries[ i ] ) -aRemainingVector.push_back(
[Libreoffice-commits] core.git: cui/source cui/uiconfig extras/source include/svx svx/source
cui/source/inc/connect.hxx | 43 +-- cui/source/tabpages/connect.cxx| 321 +++-- cui/uiconfig/ui/connectortabpage.ui| 146 +++ extras/source/glade/libreoffice-catalog.xml.in |3 include/svx/connctrl.hxx | 17 - svx/source/dialog/connctrl.cxx | 61 +--- 6 files changed, 293 insertions(+), 298 deletions(-) New commits: commit 3120c9722f5c7553c78d638c3fd1f976f76bc9e9 Author: Caolán McNamara AuthorDate: Fri Sep 28 10:30:11 2018 +0100 Commit: Caolán McNamara CommitDate: Fri Sep 28 16:57:00 2018 +0200 weld SvxConnectionPage Change-Id: I155f0c037f0d1879cec4d0b511d60a276466b1bb Reviewed-on: https://gerrit.libreoffice.org/61077 Tested-by: Jenkins Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara diff --git a/cui/source/inc/connect.hxx b/cui/source/inc/connect.hxx index 5c034d2104af..a7e499743275 100644 --- a/cui/source/inc/connect.hxx +++ b/cui/source/inc/connect.hxx @@ -21,10 +21,8 @@ #include #include -#include -#include -#include -#include +#include +#include #include class SdrView; @@ -34,36 +32,33 @@ class SvxConnectionPage : public SfxTabPage { private: static const sal_uInt16 pRanges[]; -VclPtr m_pLbType; - -VclPtr m_pFtLine1; -VclPtr m_pMtrFldLine1; -VclPtr m_pFtLine2; -VclPtr m_pMtrFldLine2; -VclPtr m_pFtLine3; -VclPtr m_pMtrFldLine3; - -VclPtr m_pMtrFldHorz1; -VclPtr m_pMtrFldVert1; -VclPtr m_pMtrFldHorz2; -VclPtr m_pMtrFldVert2; - -VclPtr m_pCtlPreview; - const SfxItemSet& rOutAttrs; SfxItemSet aAttrSet; const SdrView* pView; MapUnit eUnit; +SvxXConnectionPreview m_aCtlPreview; +std::unique_ptr m_xLbType; +std::unique_ptr m_xFtLine1; +std::unique_ptr m_xMtrFldLine1; +std::unique_ptr m_xFtLine2; +std::unique_ptr m_xMtrFldLine2; +std::unique_ptr m_xFtLine3; +std::unique_ptr m_xMtrFldLine3; +std::unique_ptr m_xMtrFldHorz1; +std::unique_ptr m_xMtrFldVert1; +std::unique_ptr m_xMtrFldHorz2; +std::unique_ptr m_xMtrFldVert2; +std::unique_ptr m_xCtlPreview; + voidFillTypeLB(); -DECL_LINK( ChangeAttrEditHdl_Impl, Edit&, void ); -DECL_LINK( ChangeAttrListBoxHdl_Impl, ListBox&, void ); -void ChangeAttrHdl_Impl(void const *); +DECL_LINK(ChangeAttrEditHdl_Impl, weld::MetricSpinButton&, void); +DECL_LINK(ChangeAttrListBoxHdl_Impl, weld::ComboBox&, void); public: -SvxConnectionPage( vcl::Window* pWindow, const SfxItemSet& rInAttrs ); +SvxConnectionPage(TabPageParent pWindow, const SfxItemSet& rInAttrs); virtual ~SvxConnectionPage() override; virtual void dispose() override; diff --git a/cui/source/tabpages/connect.cxx b/cui/source/tabpages/connect.cxx index 2820e383434c..cffd7806beeb 100644 --- a/cui/source/tabpages/connect.cxx +++ b/cui/source/tabpages/connect.cxx @@ -68,29 +68,24 @@ SvxConnectionDialog::SvxConnectionDialog( vcl::Window* pParent, const SfxItemSet |* \/ -SvxConnectionPage::SvxConnectionPage( vcl::Window* pWindow, const SfxItemSet& rInAttrs ) -: SfxTabPage(pWindow ,"ConnectorTabPage" ,"cui/ui/connectortabpage.ui" -,) +SvxConnectionPage::SvxConnectionPage(TabPageParent pWindow, const SfxItemSet& rInAttrs) +: SfxTabPage(pWindow, "cui/ui/connectortabpage.ui", "ConnectorTabPage", ) , rOutAttrs(rInAttrs) , aAttrSet(*rInAttrs.GetPool()) , pView(nullptr) +, m_xLbType(m_xBuilder->weld_combo_box("LB_TYPE")) +, m_xFtLine1(m_xBuilder->weld_label("FT_LINE_1")) +, m_xMtrFldLine1(m_xBuilder->weld_metric_spin_button("MTR_FLD_LINE_1", FUNIT_CM)) +, m_xFtLine2(m_xBuilder->weld_label("FT_LINE_2")) +, m_xMtrFldLine2(m_xBuilder->weld_metric_spin_button("MTR_FLD_LINE_2", FUNIT_CM)) +, m_xFtLine3(m_xBuilder->weld_label("FT_LINE_3")) +, m_xMtrFldLine3(m_xBuilder->weld_metric_spin_button("MTR_FLD_LINE_3", FUNIT_CM)) +, m_xMtrFldHorz1(m_xBuilder->weld_metric_spin_button("MTR_FLD_HORZ_1", FUNIT_MM)) +, m_xMtrFldVert1(m_xBuilder->weld_metric_spin_button("MTR_FLD_VERT_1", FUNIT_MM)) +, m_xMtrFldHorz2(m_xBuilder->weld_metric_spin_button("MTR_FLD_HORZ_2", FUNIT_MM)) +, m_xMtrFldVert2(m_xBuilder->weld_metric_spin_button("MTR_FLD_VERT_2", FUNIT_MM)) +, m_xCtlPreview(new weld::CustomWeld(*m_xBuilder, "CTL_PREVIEW", m_aCtlPreview)) { -get(m_pLbType,"LB_TYPE"); - -get(m_pFtLine1,"FT_LINE_1"); -get(m_pMtrFldLine1,"MTR_FLD_LINE_1"); -get(m_pFtLine2,"FT_LINE_2"); -get(m_pMtrFldLine2,"MTR_FLD_LINE_2"); -get(m_pFtLine3,"FT_LINE_3"); -get(m_pMtrFldLine3,"MTR_FLD_LINE_3"); - -get(m_pMtrFldHorz1,"MTR_FLD_HORZ_1"); -
[Libreoffice-commits] core.git: cui/source cui/uiconfig extras/source include/svx svx/source
cui/source/dialogs/cuigrfflt.cxx | 163 - cui/source/factory/dlgfact.cxx | 15 +- cui/source/factory/dlgfact.hxx | 16 ++ cui/source/inc/cuigrfflt.hxx | 83 +++- cui/uiconfig/ui/embossdialog.ui| 51 ++- extras/source/glade/libreoffice-catalog.xml.in |3 include/svx/svxdlg.hxx |2 svx/source/dialog/grfflt.cxx |2 8 files changed, 281 insertions(+), 54 deletions(-) New commits: commit 3a87fb18241e803f7ebffedfc59648782f560f4e Author: Caolán McNamara AuthorDate: Mon Sep 17 16:53:23 2018 +0100 Commit: Caolán McNamara CommitDate: Wed Sep 19 15:51:43 2018 +0200 weld GraphicFilterEmboss Change-Id: Ic3c816ddd7d5df9c5ced14600fffd6ca59f0096e Reviewed-on: https://gerrit.libreoffice.org/60594 Tested-by: Jenkins Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara diff --git a/cui/source/dialogs/cuigrfflt.cxx b/cui/source/dialogs/cuigrfflt.cxx index e9f84d1789ef..f8f2b76bc4a5 100644 --- a/cui/source/dialogs/cuigrfflt.cxx +++ b/cui/source/dialogs/cuigrfflt.cxx @@ -79,7 +79,6 @@ void GraphicPreviewWindow::SetPreview(const Graphic& rGraphic) Invalidate(); } - void GraphicPreviewWindow::ScaleImageToFit() { if (!mpOrigGraphic) @@ -125,13 +124,105 @@ void GraphicPreviewWindow::ScaleImageToFit() maModifyHdl.Call(nullptr); } - void GraphicPreviewWindow::Resize() { Control::Resize(); ScaleImageToFit(); } +CuiGraphicPreviewWindow::CuiGraphicPreviewWindow() +: mpOrigGraphic(nullptr) +, mfScaleX(0.0) +, mfScaleY(0.0) +{ +} + +void CuiGraphicPreviewWindow::SetDrawingArea(weld::DrawingArea* pDrawingArea) +{ +CustomWidgetController::SetDrawingArea(pDrawingArea); +OutputDevice = pDrawingArea->get_ref_device(); +maOutputSizePixel = rDevice.LogicToPixel(Size(81, 73), MapMode(MapUnit::MapAppFont)); +pDrawingArea->set_size_request(maOutputSizePixel.Width(), maOutputSizePixel.Height()); +} + +void CuiGraphicPreviewWindow::Paint(vcl::RenderContext& rRenderContext, const ::tools::Rectangle&) +{ + rRenderContext.SetBackground(Wallpaper(Application::GetSettings().GetStyleSettings().GetDialogColor())); +rRenderContext.Erase(); + +const Size aOutputSize(GetOutputSizePixel()); + +if (maPreview.IsAnimated()) +{ +const Size aGraphicSize(rRenderContext.LogicToPixel(maPreview.GetPrefSize(), maPreview.GetPrefMapMode())); +const Point aGraphicPosition((aOutputSize.Width() - aGraphicSize.Width() ) >> 1, + (aOutputSize.Height() - aGraphicSize.Height() ) >> 1); +maPreview.StartAnimation(, aGraphicPosition, aGraphicSize); +} +else +{ +const Size aGraphicSize(maPreview.GetSizePixel()); +const Point aGraphicPosition((aOutputSize.Width() - aGraphicSize.Width()) >> 1, + (aOutputSize.Height() - aGraphicSize.Height()) >> 1); +maPreview.Draw(, aGraphicPosition, aGraphicSize); +} +} + +void CuiGraphicPreviewWindow::SetPreview(const Graphic& rGraphic) +{ +maPreview = rGraphic; +Invalidate(); +} + +void CuiGraphicPreviewWindow::ScaleImageToFit() +{ +if (!mpOrigGraphic) +return; + +maScaledOrig = *mpOrigGraphic; + +const Size aPreviewSize(GetOutputSizePixel()); +Size aGrfSize(maOrigGraphicSizePixel); + +if( mpOrigGraphic->GetType() == GraphicType::Bitmap && +aPreviewSize.Width() && aPreviewSize.Height() && +aGrfSize.Width() && aGrfSize.Height() ) +{ +const double fGrfWH = static_cast(aGrfSize.Width()) / aGrfSize.Height(); +const double fPreWH = static_cast(aPreviewSize.Width()) / aPreviewSize.Height(); + +if( fGrfWH < fPreWH ) +{ +aGrfSize.setWidth( static_cast( aPreviewSize.Height() * fGrfWH ) ); +aGrfSize.setHeight( aPreviewSize.Height() ); +} +else +{ +aGrfSize.setWidth( aPreviewSize.Width() ); +aGrfSize.setHeight( static_cast( aPreviewSize.Width() / fGrfWH ) ); +} + +mfScaleX = static_cast(aGrfSize.Width()) / maOrigGraphicSizePixel.Width(); +mfScaleY = static_cast(aGrfSize.Height()) / maOrigGraphicSizePixel.Height(); + +if( !mpOrigGraphic->IsAnimated() ) +{ +BitmapEx aBmpEx( mpOrigGraphic->GetBitmapEx() ); + +if( aBmpEx.Scale( aGrfSize ) ) +maScaledOrig = aBmpEx; +} +} + +maModifyHdl.Call(nullptr); +} + +void CuiGraphicPreviewWindow::Resize() +{ +maOutputSizePixel = GetOutputSizePixel(); +ScaleImageToFit(); +} + GraphicFilterDialog::GraphicFilterDialog(vcl::Window* pParent, const OUString& rID, const OUString& rUIXMLDescription, const Graphic& rGraphic) @@ -180,6 +271,36 @@ IMPL_LINK_NOARG(GraphicFilterDialog, ImplModifyHdl,