optpage.cxx (c7be74b1) | optpage.cxx (c94a9bc3) |
---|---|
1/************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance --- 1571 unchanged lines hidden (view full) --- 1580 SFX_ITEMSET_ARG (&aSet,pWrtSh,SwWrtShellItem,SID_WRT_SHELL,sal_False); 1581 if (pWrtSh) 1582 SetWrtShell(pWrtSh->GetValue()); 1583} 1584 1585 1586sal_Bool SwShdwCrsrOptionsTabPage::FillItemSet( SfxItemSet& rSet ) 1587{ | 1/************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance --- 1571 unchanged lines hidden (view full) --- 1580 SFX_ITEMSET_ARG (&aSet,pWrtSh,SwWrtShellItem,SID_WRT_SHELL,sal_False); 1581 if (pWrtSh) 1582 SetWrtShell(pWrtSh->GetValue()); 1583} 1584 1585 1586sal_Bool SwShdwCrsrOptionsTabPage::FillItemSet( SfxItemSet& rSet ) 1587{ |
1588 SwShadowCursorItem aOpt; 1589 aOpt.SetOn( aOnOffCB.IsChecked() ); | 1588 SwShadowCursorItem aOpt; 1589 aOpt.SetOn( aOnOffCB.IsChecked() ); |
1590 | 1590 |
1591 sal_uInt8 eMode; 1592 if( aFillIndentRB.IsChecked() ) 1593 eMode= FILL_INDENT; 1594 else if( aFillMarginRB.IsChecked() ) 1595 eMode = FILL_MARGIN; 1596 else if( aFillTabRB.IsChecked() ) 1597 eMode = FILL_TAB; 1598 else 1599 eMode = FILL_SPACE; 1600 aOpt.SetMode( eMode ); | 1591 sal_uInt8 eMode; 1592 if( aFillIndentRB.IsChecked() ) 1593 eMode= FILL_INDENT; 1594 else if( aFillMarginRB.IsChecked() ) 1595 eMode = FILL_MARGIN; 1596 else if( aFillTabRB.IsChecked() ) 1597 eMode = FILL_TAB; 1598 else 1599 eMode = FILL_SPACE; 1600 aOpt.SetMode( eMode ); |
1601 | 1601 |
1602 sal_Bool bRet = sal_False; 1603 const SfxPoolItem* pItem = 0; 1604 if( SFX_ITEM_SET != rSet.GetItemState( FN_PARAM_SHADOWCURSOR, sal_False, &pItem ) 1605 || ((SwShadowCursorItem&)*pItem) != aOpt ) 1606 { 1607 rSet.Put( aOpt ); 1608 bRet = sal_True; 1609 } | 1602 sal_Bool bRet = sal_False; 1603 const SfxPoolItem* pItem = 0; 1604 if( SFX_ITEM_SET != rSet.GetItemState( FN_PARAM_SHADOWCURSOR, sal_False, &pItem ) 1605 || ((SwShadowCursorItem&)*pItem) != aOpt ) 1606 { 1607 rSet.Put( aOpt ); 1608 bRet = sal_True; 1609 } |
1610 | 1610 |
1611 m_pWrtShell->GetDoc()->set( IDocumentSettingAccess::MATH_BASELINE_ALIGNMENT, | 1611 if ( m_pWrtShell ) 1612 { 1613 m_pWrtShell->GetDoc()->set( 1614 IDocumentSettingAccess::MATH_BASELINE_ALIGNMENT, |
1612 m_aMathBaselineAlignmentCB.IsChecked() ); | 1615 m_aMathBaselineAlignmentCB.IsChecked() ); |
1613 bRet |= m_aMathBaselineAlignmentCB.IsChecked() != m_aMathBaselineAlignmentCB.GetSavedValue(); | 1616 bRet |= m_aMathBaselineAlignmentCB.IsChecked() != m_aMathBaselineAlignmentCB.GetSavedValue(); 1617 } |
1614 | 1618 |
1615 if( aCrsrInProtCB.IsChecked() != aCrsrInProtCB.GetSavedValue()) 1616 { 1617 rSet.Put(SfxBoolItem(FN_PARAM_CRSR_IN_PROTECTED, aCrsrInProtCB.IsChecked())); 1618 bRet |= sal_True; 1619 } | 1619 if( aCrsrInProtCB.IsChecked() != aCrsrInProtCB.GetSavedValue()) 1620 { 1621 rSet.Put(SfxBoolItem(FN_PARAM_CRSR_IN_PROTECTED, aCrsrInProtCB.IsChecked())); 1622 bRet |= sal_True; 1623 } |
1620 | 1624 |
1621 const SwDocDisplayItem* pOldAttr = (const SwDocDisplayItem*) 1622 GetOldItem(GetItemSet(), FN_PARAM_DOCDISP); | 1625 const SwDocDisplayItem* pOldAttr = 1626 (const SwDocDisplayItem*)GetOldItem(GetItemSet(), FN_PARAM_DOCDISP); |
1623 | 1627 |
1624 SwDocDisplayItem aDisp; 1625 if(pOldAttr) 1626 aDisp = *pOldAttr; | 1628 SwDocDisplayItem aDisp; 1629 if(pOldAttr) 1630 aDisp = *pOldAttr; |
1627 // 1628 aDisp.bParagraphEnd = aParaCB .IsChecked(); 1629 aDisp.bTab = aTabCB .IsChecked(); 1630 aDisp.bSpace = aSpacesCB .IsChecked(); 1631 aDisp.bNonbreakingSpace = aHSpacesCB .IsChecked(); 1632 aDisp.bSoftHyphen = aSHyphCB .IsChecked(); 1633 aDisp.bFldHiddenText = aFldHiddenCB .IsChecked(); 1634 aDisp.bCharHiddenText = aCharHiddenCB.IsChecked(); 1635 aDisp.bShowHiddenPara = aFldHiddenParaCB .IsChecked(); 1636 aDisp.bManualBreak = aBreakCB .IsChecked(); 1637 1638 bRet |= (!pOldAttr || aDisp != *pOldAttr); | 1631 // 1632 aDisp.bParagraphEnd = aParaCB .IsChecked(); 1633 aDisp.bTab = aTabCB .IsChecked(); 1634 aDisp.bSpace = aSpacesCB .IsChecked(); 1635 aDisp.bNonbreakingSpace = aHSpacesCB .IsChecked(); 1636 aDisp.bSoftHyphen = aSHyphCB .IsChecked(); 1637 aDisp.bFldHiddenText = aFldHiddenCB .IsChecked(); 1638 aDisp.bCharHiddenText = aCharHiddenCB.IsChecked(); 1639 aDisp.bShowHiddenPara = aFldHiddenParaCB .IsChecked(); 1640 aDisp.bManualBreak = aBreakCB .IsChecked(); 1641 1642 bRet |= (!pOldAttr || aDisp != *pOldAttr); |
1639 if(bRet) | 1643 if(bRet) |
1640 bRet = 0 != rSet.Put(aDisp); 1641 1642 return bRet; 1643} 1644 1645void SwShdwCrsrOptionsTabPage::Reset( const SfxItemSet& rSet ) 1646{ | 1644 bRet = 0 != rSet.Put(aDisp); 1645 1646 return bRet; 1647} 1648 1649void SwShdwCrsrOptionsTabPage::Reset( const SfxItemSet& rSet ) 1650{ |
1647 const SfxPoolItem* pItem = 0; | 1651 const SfxPoolItem* pItem = 0; |
1648 1649 SwShadowCursorItem aOpt; | 1652 1653 SwShadowCursorItem aOpt; |
1650 if( SFX_ITEM_SET == rSet.GetItemState( FN_PARAM_SHADOWCURSOR, sal_False, &pItem )) 1651 aOpt = *(SwShadowCursorItem*)pItem; 1652 aOnOffCB.Check( aOpt.IsOn() ); | 1654 if( SFX_ITEM_SET == rSet.GetItemState( FN_PARAM_SHADOWCURSOR, sal_False, &pItem )) 1655 { 1656 aOpt = *(SwShadowCursorItem*)pItem; 1657 } 1658 aOnOffCB.Check( aOpt.IsOn() ); |
1653 | 1659 |
1654 sal_uInt8 eMode = aOpt.GetMode(); 1655 aFillIndentRB.Check( FILL_INDENT == eMode ); 1656 aFillMarginRB.Check( FILL_MARGIN == eMode ); 1657 aFillTabRB.Check( FILL_TAB == eMode ); 1658 aFillSpaceRB.Check( FILL_SPACE == eMode ); | 1660 sal_uInt8 eMode = aOpt.GetMode(); 1661 aFillIndentRB.Check( FILL_INDENT == eMode ); 1662 aFillMarginRB.Check( FILL_MARGIN == eMode ); 1663 aFillTabRB.Check( FILL_TAB == eMode ); 1664 aFillSpaceRB.Check( FILL_SPACE == eMode ); |
1659 | 1665 |
1660 m_aMathBaselineAlignmentCB.Check( m_pWrtShell->GetDoc()->get( IDocumentSettingAccess::MATH_BASELINE_ALIGNMENT ) ); 1661 m_aMathBaselineAlignmentCB.SaveValue(); | 1666 if ( m_pWrtShell ) 1667 { 1668 m_aMathBaselineAlignmentCB.Check( m_pWrtShell->GetDoc()->get( IDocumentSettingAccess::MATH_BASELINE_ALIGNMENT ) ); 1669 m_aMathBaselineAlignmentCB.SaveValue(); 1670 } 1671 else 1672 { 1673 m_aMathBaselineAlignmentCB.Disable(); 1674 } |
1662 | 1675 |
1663 if( SFX_ITEM_SET == rSet.GetItemState( FN_PARAM_CRSR_IN_PROTECTED, sal_False, &pItem )) 1664 aCrsrInProtCB.Check(((const SfxBoolItem*)pItem)->GetValue()); 1665 aCrsrInProtCB.SaveValue(); | 1676 if( SFX_ITEM_SET == rSet.GetItemState( FN_PARAM_CRSR_IN_PROTECTED, sal_False, &pItem )) 1677 { 1678 aCrsrInProtCB.Check(((const SfxBoolItem*)pItem)->GetValue()); 1679 } 1680 aCrsrInProtCB.SaveValue(); |
1666 1667 const SwDocDisplayItem* pDocDisplayAttr = 0; 1668 | 1681 1682 const SwDocDisplayItem* pDocDisplayAttr = 0; 1683 |
1669 rSet.GetItemState( FN_PARAM_DOCDISP, sal_False, 1670 (const SfxPoolItem**)&pDocDisplayAttr ); 1671 if(pDocDisplayAttr) | 1684 rSet.GetItemState( FN_PARAM_DOCDISP, sal_False, (const SfxPoolItem**)&pDocDisplayAttr ); 1685 if(pDocDisplayAttr) |
1672 { 1673 aParaCB .Check (pDocDisplayAttr->bParagraphEnd ); 1674 aTabCB .Check (pDocDisplayAttr->bTab ); 1675 aSpacesCB .Check (pDocDisplayAttr->bSpace ); 1676 aHSpacesCB .Check (pDocDisplayAttr->bNonbreakingSpace ); 1677 aSHyphCB .Check (pDocDisplayAttr->bSoftHyphen ); 1678 aCharHiddenCB.Check (pDocDisplayAttr->bCharHiddenText ); 1679 aFldHiddenCB .Check (pDocDisplayAttr->bFldHiddenText ); --- 934 unchanged lines hidden --- | 1686 { 1687 aParaCB .Check (pDocDisplayAttr->bParagraphEnd ); 1688 aTabCB .Check (pDocDisplayAttr->bTab ); 1689 aSpacesCB .Check (pDocDisplayAttr->bSpace ); 1690 aHSpacesCB .Check (pDocDisplayAttr->bNonbreakingSpace ); 1691 aSHyphCB .Check (pDocDisplayAttr->bSoftHyphen ); 1692 aCharHiddenCB.Check (pDocDisplayAttr->bCharHiddenText ); 1693 aFldHiddenCB .Check (pDocDisplayAttr->bFldHiddenText ); --- 934 unchanged lines hidden --- |