locale.cxx (7d472e45) locale.cxx (49b34792)
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

--- 458 unchanged lines hidden (view full) ---

467}
468
469//-----------------------------------------------
470::rtl::OUString Locale::toISO() const
471{
472 ::rtl::OUStringBuffer sISO(64);
473
474 sISO.append(m_sLanguage);
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

--- 458 unchanged lines hidden (view full) ---

467}
468
469//-----------------------------------------------
470::rtl::OUString Locale::toISO() const
471{
472 ::rtl::OUStringBuffer sISO(64);
473
474 sISO.append(m_sLanguage);
475 if (m_sCountry.getLength())
475 if ( !m_sCountry.isEmpty() )
476 {
477 sISO.append(SEPERATOR_LC);
478 sISO.append(m_sCountry);
479
476 {
477 sISO.append(SEPERATOR_LC);
478 sISO.append(m_sCountry);
479
480 if (m_sVariant.getLength())
480 if ( !m_sVariant.isEmpty() )
481 {
482 sISO.append(SEPERATOR_CV);
483 sISO.append(m_sVariant);
484 }
485 }
486
487 return sISO.makeStringAndClear();
488}

--- 141 unchanged lines hidden (view full) ---

630 if (aLocale.equals(EN()))
631 {
632 aLocale = X_DEFAULT();
633 return sal_True;
634 }
635
636 // d) remove country from incoming locale
637 // e.g. "de-DE" => "de" or "en-US" => "en"!
481 {
482 sISO.append(SEPERATOR_CV);
483 sISO.append(m_sVariant);
484 }
485 }
486
487 return sISO.makeStringAndClear();
488}

--- 141 unchanged lines hidden (view full) ---

630 if (aLocale.equals(EN()))
631 {
632 aLocale = X_DEFAULT();
633 return sal_True;
634 }
635
636 // d) remove country from incoming locale
637 // e.g. "de-DE" => "de" or "en-US" => "en"!
638 if (aLocale.getCountry().getLength())
638 if ( !aLocale.getCountry().isEmpty())
639 {
640 aLocale.setCountry(::rtl::OUString());
641 return sal_True;
642 }
643
644 // e) "en-US" possible?
645 if (!aLocale.equals(EN_US()))
646 {

--- 33 unchanged lines hidden ---
639 {
640 aLocale.setCountry(::rtl::OUString());
641 return sal_True;
642 }
643
644 // e) "en-US" possible?
645 if (!aLocale.equals(EN_US()))
646 {

--- 33 unchanged lines hidden ---