mirror of
				https://github.com/JakubMelka/PDF4QT.git
				synced 2025-06-05 21:59:17 +02:00 
			
		
		
		
	Issue #139: Changing page layout reset the current page
This commit is contained in:
		@@ -1328,7 +1328,24 @@ void PDFDrawWidgetProxy::setPageLayout(PageLayout pageLayout)
 | 
			
		||||
{
 | 
			
		||||
    if (getPageLayout() != pageLayout)
 | 
			
		||||
    {
 | 
			
		||||
        std::optional<PDFInteger> pageIndex;
 | 
			
		||||
 | 
			
		||||
        if (m_widget)
 | 
			
		||||
        {
 | 
			
		||||
            std::vector<PDFInteger> currentPages = m_widget->getDrawWidget()->getCurrentPages();
 | 
			
		||||
            if (!currentPages.empty())
 | 
			
		||||
            {
 | 
			
		||||
                pageIndex = currentPages.front();
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        m_controller->setPageLayout(pageLayout);
 | 
			
		||||
 | 
			
		||||
        if (pageIndex.has_value())
 | 
			
		||||
        {
 | 
			
		||||
            goToPage(*pageIndex);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        Q_EMIT pageLayoutChanged();
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -1,4 +1,5 @@
 | 
			
		||||
CURRENT:
 | 
			
		||||
 - Issue #139: Changing page layout reset the current page
 | 
			
		||||
 - Issue #137: Redaction - Cannot convert '#000000' to color value
 | 
			
		||||
 - Issue #134: Add search bar for actions
 | 
			
		||||
 - Issue #133: Rectangle selector when choosing the page of the PDF 
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user