~ubuntu-branches/ubuntu/precise/okular/precise-proposed

« back to all changes in this revision

Viewing changes to part.cpp

  • Committer: Package Import Robot
  • Author(s): Jonathan Riddell
  • Date: 2012-01-04 13:14:56 UTC
  • mto: This revision was merged to the branch mainline in revision 14.
  • Revision ID: package-import@ubuntu.com-20120104131456-yxgfg1lcu59kdq4k
Tags: upstream-4.7.97
ImportĀ upstreamĀ versionĀ 4.7.97

Show diffs side-by-side

added added

removed removed

Lines of Context:
1213
1213
    }
1214
1214
 
1215
1215
    // if the 'OpenTOC' flag is set, open the TOC
1216
 
    if ( m_document->metaData( "OpenTOC" ).toBool() && m_sidebar->isItemEnabled( 0 ) )
 
1216
    if ( m_document->metaData( "OpenTOC" ).toBool() && m_sidebar->isItemEnabled( 0 ) && !m_sidebar->isCollapsed() )
1217
1217
    {
1218
1218
        const bool sidebarVisible = m_sidebar->isSidebarVisible();
1219
1219
        m_sidebar->setCurrentIndex( 0 );
1449
1449
        // store the current toolbox pane
1450
1450
        m_dirtyToolboxIndex = m_sidebar->currentIndex();
1451
1451
        m_wasSidebarVisible = m_sidebar->isSidebarVisible();
 
1452
        m_wasSidebarCollapsed = m_sidebar->isCollapsed();
1452
1453
 
1453
1454
        // store if presentation view was open
1454
1455
        m_wasPresentationOpen = ((PresentationWidget*)m_presentationWidget != 0);
1469
1470
        m_document->setViewport( m_viewportDirty );
1470
1471
        m_viewportDirty.pageNumber = -1;
1471
1472
        m_document->setRotation( m_dirtyPageRotation );
1472
 
        if ( m_sidebar->currentIndex() != m_dirtyToolboxIndex && m_sidebar->isItemEnabled( m_dirtyToolboxIndex ) )
 
1473
        if ( m_sidebar->currentIndex() != m_dirtyToolboxIndex && m_sidebar->isItemEnabled( m_dirtyToolboxIndex )
 
1474
            && !m_sidebar->isCollapsed() )
1473
1475
        {
1474
1476
            m_sidebar->setCurrentIndex( m_dirtyToolboxIndex );
1475
1477
        }
1477
1479
        {
1478
1480
            m_sidebar->setSidebarVisibility( m_wasSidebarVisible );
1479
1481
        }
 
1482
        if ( m_sidebar->isCollapsed() != m_wasSidebarCollapsed )
 
1483
        {
 
1484
            m_sidebar->setCollapsed( m_wasSidebarCollapsed );
 
1485
        }
1480
1486
        if (m_wasPresentationOpen) slotShowPresentation();
1481
1487
        emit enablePrintAction(true && m_document->printingSupport() != Okular::Document::NoPrinting);
1482
1488
    }